Skip to content

Commit

Permalink
Merge pull request #275 from RWTH-EBC/issue262_storageExamples
Browse files Browse the repository at this point in the history
Issue262 correction of the model paths in Fluid.Storage.Examples.StorageBoiler…

Okay, I accept this as an intermediate solution until we replace these models with internal ones or that from Annex60. If we keep them, we need to revise the solution for `bouyancy`. It currently sets values for medium properties that are overwritten by media definitions upper-level models. This is not a sufficient solution if we decide to keep them.
  • Loading branch information
mlauster authored Sep 26, 2016
2 parents fb95d3b + d69184e commit 42f3ced
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 78 deletions.
10 changes: 5 additions & 5 deletions AixLib/Fluid/Storage/BaseClasses/Bouyancy.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ model Bouyancy
parameter Real kappa = 0.4;
Modelica.SIunits.TemperatureDifference dT;
Modelica.SIunits.ThermalConductivity lambda_eff;
parameter Modelica.SIunits.Acceleration g = baseParameters.g;
Modelica.SIunits.SpecificHeatCapacity cp = baseParameters.cp_Water;
Modelica.SIunits.ThermalConductivity lambda = baseParameters.lambda_Water;
Modelica.SIunits.Density rho = baseParameters.rho_Water;
parameter Modelica.SIunits.Acceleration g = Modelica.Constants.g_n;
Modelica.SIunits.SpecificHeatCapacity cp = 4180;
Modelica.SIunits.ThermalConductivity lambda = 0.598;
Modelica.SIunits.Density rho = 1000;
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_a annotation(Placement(transformation(extent = {{-16, 86}, {4, 106}})));
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_b port_b annotation(Placement(transformation(extent = {{-16, -104}, {4, -84}})));
equation
Expand All @@ -21,7 +21,7 @@ equation
end if;
port_a.Q_flow = lambda_eff * A / dx * dT;
port_a.Q_flow + port_b.Q_flow = 0;
annotation( Documentation(info = "<html>
annotation (Documentation(info = "<html>
<h4><span style=\"color:#008000\">Overview</span></h4>
<p>Bouyancy model for the heat transfer between the layers in a buffer storage.</p>
</html>", revisions = "<html>
Expand Down
86 changes: 53 additions & 33 deletions AixLib/Fluid/Storage/Examples/StorageBoiler.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ model StorageBoiler
Modelica.Media.Water.ConstantPropertyLiquidWater
constrainedby Modelica.Media.Interfaces.PartialMedium;

AixLib.HVAC.Storage.Storage storage(
AixLib.Fluid.Storage.Storage storage(
n=10,
V_HE=0.05,
kappa=0.4,
Expand All @@ -21,57 +21,77 @@ model StorageBoiler
h=2,
k_HE=1500,
redeclare package Medium = Medium)
annotation (Placement(transformation(extent={{-56,14},{-36,34}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T = 283.15) annotation(Placement(transformation(extent = {{-94, 14}, {-74, 34}})));
Pumps.Pump pump(redeclare package Medium = Medium, m_flow_small=1e-4)
annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin = {-32, 62})));
HeatGeneration.Boiler boiler(Q_flow_max = 50000, boilerEfficiencyB = AixLib.DataBase.Boiler.BoilerCondensing(),
annotation (Placement(transformation(extent={{-18,12},{2,32}})));
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature(T = 283.15) annotation(Placement(transformation(extent={{-56,12},
{-36,32}})));
AixLib.Fluid.Movers.Pump
pump(redeclare package Medium = Medium, m_flow_small=1e-4)
annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 270, origin={6,60})));
AixLib.Fluid.HeatExchangers.Boiler
boiler(Q_flow_max = 50000, boilerEfficiencyB = AixLib.DataBase.Boiler.BoilerCondensing(),
redeclare package Medium = Medium,
m_flow_nominal=0.01) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {-16, 76})));
m_flow_nominal=0.01) annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin={22,74})));
AixLib.Fluid.Sources.FixedBoundary
boundary_p(nPorts=1, redeclare package Medium = Medium)
annotation(Placement(transformation(extent = {{-86, 70}, {-66, 90}})));
Modelica.Blocks.Sources.BooleanExpression booleanExpression annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {6, 60})));
Modelica.Blocks.Sources.Constant const(k = 273.15 + 80) annotation(Placement(transformation(extent = {{-3, -3}, {3, 3}}, rotation = 180, origin = {13, 69})));
Pipes.StaticPipe pipe(D = 0.05, l = 5,
annotation(Placement(transformation(extent={{-48,68},
{-28,88}})));
Modelica.Blocks.Sources.BooleanExpression booleanExpression annotation(Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin={46,48})));
Modelica.Blocks.Sources.Constant const(k = 273.15 + 80) annotation(Placement(transformation(extent = {{-3, -3}, {3, 3}}, rotation = 180, origin={51,67})));
AixLib.Fluid.FixedResistances.Pipe
pipe(D = 0.05, l = 5,
redeclare package Medium = Medium,
m_flow_small=1e-4) annotation(Placement(transformation(extent = {{-26, -10}, {-6, 10}})));
HydraulicResistances.HydraulicResistance hydraulicResistance(zeta = 1000,
m_flow_small=1e-4) annotation(Placement(transformation(extent={{12,-12},
{32,8}})));
AixLib.Fluid.FixedResistances.HydraulicResistance
hydraulicResistance(zeta = 1000,
redeclare package Medium = Medium,
m_flow_small=1e-4) annotation(Placement(transformation(extent = {{8, -10}, {28, 10}})));
m_flow_small=1e-4) annotation(Placement(transformation(extent={{46,-12},
{66,8}})));
AixLib.Fluid.Sources.Boundary_ph
boundary_ph1(use_p_in = true, h = 0.8e5,
nPorts=1,
redeclare package Medium = Medium) annotation(Placement(transformation(extent = {{-104, -20}, {-84, 0}})));
redeclare package Medium = Medium) annotation(Placement(transformation(extent={{-66,-22},
{-46,-2}})));
Modelica.Blocks.Sources.Ramp ramp(duration = 1000, height = 0.00001e5,
offset=101325) annotation(Placement(transformation(extent = {{-136, -14}, {-116, 6}})));
offset=101325) annotation(Placement(transformation(extent={{-96,-14},
{-76,6}})));
AixLib.Fluid.Sources.FixedBoundary
boundary_ph2(nPorts=1, redeclare package Medium = Medium)
annotation(Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 180, origin = {-72, 46})));
Pipes.StaticPipe pipe1(D = 0.05, l = 5,
annotation(Placement(transformation(extent = {{10, -10}, {-10, 10}}, rotation = 180, origin={-34,44})));
AixLib.Fluid.FixedResistances.Pipe
pipe1(D = 0.05, l = 5,
redeclare package Medium = Medium,
m_flow_small=1e-4) annotation(Placement(transformation(extent = {{-66, -20}, {-46, 0}})));
m_flow_small=1e-4) annotation(Placement(transformation(extent={{-28,-22},
{-8,-2}})));
equation
connect(fixedTemperature.port, storage.heatPort) annotation(Line(points = {{-74, 24}, {-54, 24}}, color = {191, 0, 0}));
connect(pump.port_a, boiler.port_b) annotation(Line(points = {{-32, 72}, {-32, 76}, {-26, 76}}, color = {0, 127, 255}));
connect(booleanExpression.y, pump.IsNight) annotation(Line(points = {{-5, 60}, {-14, 60}, {-14, 62}, {-21.8, 62}}, color = {255, 0, 255}));
connect(const.y, boiler.T_set) annotation(Line(points = {{9.7, 69}, {-5.2, 69}}, color = {0, 0, 127}));
connect(pipe.port_b, hydraulicResistance.port_a) annotation(Line(points = {{-6, 0}, {8, 0}}, color = {0, 127, 255}));
connect(hydraulicResistance.port_b, boiler.port_a) annotation(Line(points = {{28, 0}, {52, 0}, {52, 76}, {-6, 76}}, color = {0, 127, 255}));
connect(pump.port_b, storage.port_a_heatGenerator) annotation(Line(points = {{-32, 52}, {-32, 32.8}, {-37.6, 32.8}}, color = {0, 127, 255}));
connect(pipe.port_a, storage.port_b_heatGenerator) annotation(Line(points = {{-26, 0}, {-32, 0}, {-32, 16}, {-37.6, 16}}, color = {0, 127, 255}));
connect(ramp.y, boundary_ph1.p_in) annotation(Line(points={{-115,-4},{-106,-2}}, color = {0, 0, 127}));
connect(pipe1.port_b, storage.port_a_consumer) annotation(Line(points = {{-46, -10}, {-46, 14}}, color = {0, 127, 255}));
connect(fixedTemperature.port, storage.heatPort) annotation(Line(points={{-36,22},
{-16,22}}, color = {191, 0, 0}));
connect(pump.port_a, boiler.port_b) annotation(Line(points={{6,70},{6,74},{12,
74}}, color = {0, 127, 255}));
connect(booleanExpression.y, pump.IsNight) annotation(Line(points={{35,48},{
24,48},{24,60},{16.2,60}}, color = {255, 0, 255}));
connect(const.y, boiler.T_set) annotation(Line(points={{47.7,67},{32.8,67}}, color = {0, 0, 127}));
connect(pipe.port_b, hydraulicResistance.port_a) annotation(Line(points={{32,-2},
{46,-2}}, color = {0, 127, 255}));
connect(hydraulicResistance.port_b, boiler.port_a) annotation(Line(points={{66,-2},
{90,-2},{90,74},{32,74}}, color = {0, 127, 255}));
connect(pump.port_b, storage.port_a_heatGenerator) annotation(Line(points={{6,50},{
6,30.8},{0.4,30.8}}, color = {0, 127, 255}));
connect(pipe.port_a, storage.port_b_heatGenerator) annotation(Line(points={{12,-2},
{6,-2},{6,14},{0.4,14}}, color = {0, 127, 255}));
connect(ramp.y, boundary_ph1.p_in) annotation(Line(points={{-75,-4},{-68,-4}}, color = {0, 0, 127}));
connect(pipe1.port_b, storage.port_a_consumer) annotation(Line(points={{-8,-12},
{-8,12}}, color = {0, 127, 255}));
connect(boundary_ph1.ports[1], pipe1.port_a) annotation (Line(
points={{-84,-10},{-66,-10}},
points={{-46,-12},{-28,-12}},
color={0,127,255}));
connect(storage.port_b_consumer, boundary_ph2.ports[1]) annotation (Line(
points={{-46,34},{-46,46},{-62,46}},
points={{-8,32},{-8,44},{-24,44}},
color={0,127,255}));
connect(boundary_p.ports[1], pump.port_a) annotation (Line(
points={{-66,80},{-32,80},{-32,72}},
points={{-28,78},{6,78},{6,70}},
color={0,127,255}));
annotation( experiment(StopTime = 86400, Interval = 60),Documentation(info = "<html>
annotation (experiment(StopTime = 86400, Interval = 60),Documentation(info = "<html>
<h4><font color=\"#008000\">Overview</font></h4>
<p>This is a simple example of a storage and a boiler.</p>
</html>", revisions="<html>
Expand Down
Loading

0 comments on commit 42f3ced

Please sign in to comment.