Skip to content

Commit dc3844d

Browse files
committed
* final Version of GeothermalHeatPumpSystem as Controlled System Model, #55
1 parent 540088c commit dc3844d

File tree

3 files changed

+32
-33
lines changed

3 files changed

+32
-33
lines changed

pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpBase.mo

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ partial model GeothermalHeatPumpBase
114114
extent={{-6,-7},{6,7}},
115115
rotation=90,
116116
origin={-18,-78})));
117-
AixLib.Fluid.Sources.Boundary_pT geothField_sink1(redeclare package Medium =
118-
Water, nPorts=1) "One of two sinks representing geothermal field"
119-
annotation (Placement(transformation(extent={{5,-5},{-5,5}},
117+
AixLib.Fluid.Sources.Boundary_pT geothField(redeclare package Medium = Water,
118+
nPorts=1) "Boundary of the geothermal field Volume" annotation (Placement(
119+
transformation(
120+
extent={{5,-5},{-5,5}},
120121
rotation=-90,
121122
origin={-139,-29})));
122123
AixLib.Fluid.FixedResistances.PressureDrop resistanceHeatConsumerFlow(
@@ -352,8 +353,8 @@ equation
352353
points={{100,-106},{106,-106},{106,-56}}, color={0,127,255}));
353354
connect(supplyTemSensor.port_b, pumpGeothermalSource.port_a)
354355
annotation (Line(points={{-108,-54},{-96,-54}}, color={0,127,255}));
355-
connect(geothField_sink1.ports[1], vol.ports[1])
356-
annotation (Line(points={{-139,-24},{-139,-16}}, color={0,127,255}));
356+
connect(geothField.ports[1], vol.ports[1]) annotation (Line(points={{-139,-24},
357+
{-139,-20},{-139,-16},{-139,-16}}, color={0,127,255}));
357358
connect(vol.ports[2], supplyTemSensor.port_a) annotation (Line(points={{-137,
358359
-16},{-130,-16},{-130,-54},{-122,-54}}, color={0,127,255}));
359360
connect(thermalConductor.port_b, vol.heatPort)
@@ -362,8 +363,8 @@ equation
362363
annotation (Line(points={{-146,-52},{-146,-46}}, color={191,0,0}));
363364
connect(vol.ports[3], returnTemSensor.port_b) annotation (Line(points={{-135,
364365
-16},{-150,-16},{-150,14},{-114,14},{-114,18}}, color={0,127,255}));
365-
connect(vol.ports[4], heatPumpTab.port_b_sink) annotation (Line(points={{-133,
366-
-16},{10,-16},{10,14.9},{-5.8,14.9}}, color={0,127,255}));
366+
connect(heatPumpTab.port_b_sink, vol.ports[4]) annotation (Line(points={{-5.8,
367+
14.9},{10,14.9},{10,-16},{-133,-16}}, color={0,127,255}));
367368
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-160,
368369
-120},{160,80}})), Icon(coordinateSystem(
369370
preserveAspectRatio=false, extent={{-160,-120},{160,80}})),

pyDMPC/ModelicaModels/ModelicaModels/BaseClasses/GeothermalHeatPumpControlledBase.mo

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ partial model GeothermalHeatPumpControlledBase
6060
rotation=90,
6161
origin={-60.5,-109})));
6262
inner Modelica.Fluid.System system
63-
annotation (Placement(transformation(extent={{120,60},{140,80}})));
63+
annotation (Placement(transformation(extent={{180,60},{200,80}})));
6464
Modelica.Blocks.Interfaces.RealOutput returnTemperature(
6565
final quantity="ThermodynamicTemperature",
6666
final unit="K",
@@ -150,7 +150,7 @@ partial model GeothermalHeatPumpControlledBase
150150
computeWetBulbTemperature=false,
151151
filNam=Modelica.Utilities.Files.loadResource("modelica://ModelicaModels/Subsystems/Geo/BaseClasses/TEASER_BuildingSets/DEU_BW_Mannheim_107290_TRY2010_12_Jahr_BBSR.mos"))
152152
"Weather data reader"
153-
annotation (Placement(transformation(extent={{188,32},{168,52}})));
153+
annotation (Placement(transformation(extent={{200,30},{180,50}})));
154154
Modelica.Blocks.Sources.CombiTimeTable tableAHU(
155155
tableOnFile=true,
156156
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
@@ -159,7 +159,7 @@ partial model GeothermalHeatPumpControlledBase
159159
fileName=Modelica.Utilities.Files.loadResource(
160160
"modelica://ModelicaModels/Subsystems/Geo/BaseClasses/TEASER_BuildingSets/AHU_TEASER.mat"))
161161
"Boundary conditions for air handling unit"
162-
annotation (Placement(transformation(extent={{188,2},{172,18}})));
162+
annotation (Placement(transformation(extent={{200,0},{180,20}})));
163163
Modelica.Blocks.Sources.CombiTimeTable tableTSet(
164164
tableOnFile=true,
165165
tableName="Tset",
@@ -168,7 +168,7 @@ partial model GeothermalHeatPumpControlledBase
168168
"modelica://ModelicaModels/Subsystems/Geo/BaseClasses/TEASER_BuildingSets/Tset_TEASER.mat"),
169169
columns=2:7)
170170
"Set points for heater"
171-
annotation (Placement(transformation(extent={{188,-46},{172,-30}})));
171+
annotation (Placement(transformation(extent={{200,-60},{180,-40}})));
172172
Modelica.Blocks.Sources.CombiTimeTable tableInternalGains(
173173
tableOnFile=true,
174174
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic,
@@ -177,10 +177,10 @@ partial model GeothermalHeatPumpControlledBase
177177
"modelica://ModelicaModels/Subsystems/Geo/BaseClasses/TEASER_BuildingSets/InternalGains_TEASER.mat"),
178178
columns=2:19)
179179
"Profiles for internal gains"
180-
annotation (Placement(transformation(extent={{188,-68},{172,-52}})));
180+
annotation (Placement(transformation(extent={{200,-90},{180,-70}})));
181181
Modelica.Blocks.Sources.Constant const[6](each k=0)
182182
"Set point for cooler"
183-
annotation (Placement(transformation(extent={{188,-22},{172,-6}})));
183+
annotation (Placement(transformation(extent={{200,-30},{180,-10}})));
184184
Modelica.Blocks.Math.Gain negate(k=-1)
185185
annotation (Placement(transformation(extent={{110,-2},{102,6}})));
186186
Modelica.Blocks.Math.Gain negate1(k=-1) annotation (Placement(transformation(
@@ -218,19 +218,17 @@ equation
218218
connect(supplyTemSensor.T, supplyTemperature) annotation (Line(points={{-115,-62.8},
219219
{-115,-67.4},{-116,-67.4},{-116,-120}}, color={0,0,127}));
220220
connect(weaDat.weaBus,multizone. weaBus) annotation (Line(
221-
points={{168,42},{166,42},{166,14},{162,14}},
221+
points={{180,40},{166,40},{166,14},{162,14}},
222222
color={255,204,51},
223223
thickness=0.5));
224224
connect(tableInternalGains.y,multizone. intGains)
225-
annotation (Line(points={{171.2,-60},{148,-60},{148,-1}},
226-
color={0,0,127}));
225+
annotation (Line(points={{179,-80},{148,-80},{148,-1}},color={0,0,127}));
227226
connect(tableAHU.y,multizone. AHU)
228-
annotation (Line(points={{171.2,10},{163,10}}, color={0,0,127}));
229-
connect(tableTSet.y,multizone. TSetHeat) annotation (Line(points={{171.2,-38},
230-
{159.2,-38},{159.2,-1}},
231-
color={0,0,127}));
232-
connect(const.y,multizone. TSetCool) annotation (Line(points={{171.2,-14},{
233-
162,-14},{162,-2},{161.4,-2},{161.4,-1}}, color={0,0,127}));
227+
annotation (Line(points={{179,10},{163,10}}, color={0,0,127}));
228+
connect(tableTSet.y,multizone. TSetHeat) annotation (Line(points={{179,-50},{
229+
159.2,-50},{159.2,-1}},color={0,0,127}));
230+
connect(const.y,multizone. TSetCool) annotation (Line(points={{179,-20},{162,
231+
-20},{162,-2},{161.4,-2},{161.4,-1}}, color={0,0,127}));
234232
connect(negate1.u,sum1. y) annotation (Line(points={{116,-13.2},{124,-13.2},{124,
235233
-16.4},{132,-16.4}}, color={0,0,127}));
236234
connect(negate.u,sum2. y)
@@ -257,6 +255,6 @@ First implementation.
257255
</li>
258256
</ul>
259257
</html>"),
260-
Diagram(coordinateSystem(extent={{-160,-120},{140,80}})),
261-
Icon(coordinateSystem(extent={{-160,-120},{140,80}})));
258+
Diagram(coordinateSystem(extent={{-160,-120},{200,80}})),
259+
Icon(coordinateSystem(extent={{-160,-120},{200,80}})));
262260
end GeothermalHeatPumpControlledBase;

pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/GeothermalHeatPumpSystem.mo

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ model GeothermalHeatPumpSystem
33
"Example of a geothermal heat pump systemreplaceable package Water = AixLib.Media.Water;"
44
extends Modelica.Icons.Example;
55
extends ModelicaModels.BaseClasses.GeothermalHeatPumpControlledBase(
6+
geothField(T=285.15),
67
redeclare
78
AixLib.Fluid.Examples.GeothermalHeatPump.Components.BoilerStandAlone
89
PeakLoadDevice(redeclare package Medium = Water),
@@ -14,7 +15,6 @@ model GeothermalHeatPumpSystem
1415
pumpCondenser(T_start=285.15),
1516
pumpEvaporator(T_start=285.15),
1617
pumpColdConsumer(T_start=285.15),
17-
geothField_sink1(T=285.15),
1818
integrator(k=3600),
1919
integrator1(k=3600),
2020
multizone(zoneParam={
@@ -61,7 +61,7 @@ model GeothermalHeatPumpSystem
6161
annotation (Placement(transformation(extent={{-78,62},{-58,82}})));
6262
Modelica.Blocks.Interfaces.RealInput T_set_storage
6363
"Connector of Real input signal 2"
64-
annotation (Placement(transformation(extent={{-108,58},{-88,78}})));
64+
annotation (Placement(transformation(extent={{-102,62},{-90,74}})));
6565
equation
6666
connect(resistanceColdConsumerFlow.port_b,coldConsumerFlow. ports[1])
6767
annotation (Line(points={{80,-20},{88,-20}}, color={0,127,255}));
@@ -93,8 +93,8 @@ equation
9393
annotation (Line(points={{-139,74},{-122,74},{-122,-26},{-100,-26}}, color=
9494
{0,0,127}));
9595
connect(valveHeatSink.y, geothermalFieldControllerHeat.valveOpening1)
96-
annotation (Line(points={{-30,-45.6},{-30,-45.6},{-30,-32},{-30,-21.2},{-83.04,
97-
-21.2}}, color={0,0,127}));
96+
annotation (Line(points={{-30,-45.6},{-30,-21.2},{-83.04,-21.2}},
97+
color={0,0,127}));
9898
connect(geothermalFieldControllerHeat.valveOpening2, valveHeatStorage.y)
9999
annotation (Line(points={{-83.04,-30.8},{-56,-30.8},{-56,-63},{-26.4,-63}},
100100
color={0,0,127}));
@@ -111,10 +111,10 @@ equation
111111
string="%second",
112112
index=1,
113113
extent={{6,3},{6,3}}));
114-
connect(getTStorageUpper.y, hPControllerOnOff.T_meas) annotation (Line(points
115-
={{-139,74},{-108.5,74},{-108.5,76},{-78,76}}, color={0,0,127}));
114+
connect(getTStorageUpper.y, hPControllerOnOff.T_meas) annotation (Line(points=
115+
{{-139,74},{-108.5,74},{-108.5,76},{-78,76}}, color={0,0,127}));
116116
connect(T_set_storage, hPControllerOnOff.T_set)
117-
annotation (Line(points={{-98,68},{-78,68}}, color={0,0,127}));
117+
annotation (Line(points={{-96,68},{-78,68}}, color={0,0,127}));
118118
annotation (experiment(StopTime=86400, Interval=10), Documentation(revisions="<html>
119119
<ul>
120120
<li>
@@ -139,6 +139,6 @@ from the geothermal field to the heat storage
139139
<p>In the flow line of the heating circuit a boiler is connected as a peak load device.
140140
Consumers are modeled as sinks are sources with a constant temperature.</p>
141141
</html>"),
142-
Diagram(coordinateSystem(extent={{-160,-120},{140,80}})),
143-
Icon(coordinateSystem(extent={{-160,-120},{140,80}})));
142+
Diagram(coordinateSystem(extent={{-160,-120},{200,80}})),
143+
Icon(coordinateSystem(extent={{-160,-120},{200,80}})));
144144
end GeothermalHeatPumpSystem;

0 commit comments

Comments
 (0)