Skip to content

Commit 9097876

Browse files
committed
Further update the test hall models, #79
1 parent ae1e4b3 commit 9097876

File tree

23 files changed

+557
-259
lines changed

23 files changed

+557
-259
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
within ModelicaModels.ControlledSystems;
2-
model ControlledSystemBoundaries
3-
"Version of controlled system with boundary conditions"
2+
model AHU "Version of air handling unit with boundary conditions"
43
extends ModelicaModels.BaseClasses.ControlledSystemBaseClass(volumeFlow(
54
tableOnFile=false, table=[0,0.31,0.29]), freshAirSource(nPorts=2));
65
Modelica.Blocks.Sources.Sine outdoorTemperature(
@@ -154,4 +153,4 @@ equation
154153
Evaluate=false,
155154
OutputCPUtime=false,
156155
OutputFlatModelica=false));
157-
end ControlledSystemBoundaries;
156+
end AHU;

pyDMPC/ModelicaModels/ModelicaModels/ControlledSystems/TestHall.mo

Lines changed: 150 additions & 110 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ControlledSystemBoundaries
1+
AHU
22
TestHall

pyDMPC/ModelicaModels/ModelicaModels/SubsystemModels/DetailedModels/Geo/Building.mo

Lines changed: 0 additions & 18 deletions
This file was deleted.

pyDMPC/ModelicaModels/ModelicaModels/SubsystemModels/DetailedModels/Geo/Field.mo

Lines changed: 0 additions & 53 deletions
This file was deleted.

pyDMPC/ModelicaModels/ModelicaModels/SubsystemModels/DetailedModels/Geo/GeoCommunicationBaseClass.mo

Lines changed: 0 additions & 47 deletions
This file was deleted.

pyDMPC/ModelicaModels/ModelicaModels/SubsystemModels/DetailedModels/Geo/package.order

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
within ModelicaModels.SubsystemModels.TestHall;
2+
model HallLong
3+
"Version of the hall model for long prediction horizons"
4+
5+
extends ModelicaModels.Subsystems.TestHall.BaseClasses.HallConnected;
6+
7+
Modelica.Blocks.Sources.CombiTimeTable weather(
8+
tableOnFile=true,
9+
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint,
10+
columns={2},
11+
tableName="InputTable",
12+
fileName="weather.mat",
13+
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments)
14+
"Table with weather forecast" annotation (Placement(transformation(
15+
extent={{-10,-10},{10,10}},
16+
rotation=0,
17+
origin={-10,50})));
18+
Modelica.Blocks.Sources.CombiTimeTable decisionVariables(
19+
tableOnFile=true,
20+
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint,
21+
tableName="tab1",
22+
smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments,
23+
columns={2},
24+
fileName="decisionVariables.mat")
25+
"Table with decision variables" annotation (Placement(
26+
transformation(
27+
extent={{-10,-10},{10,10}},
28+
rotation=0,
29+
origin={30,50})));
30+
Modelica.Blocks.Sources.Constant AirVolumeFlow(k=8000)
31+
"Air volume flow rate, could be an initial value"
32+
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
33+
Modelica.Blocks.Math.Gain V2m(k=1.2/3600) "Volume to mass flow"
34+
annotation (Placement(transformation(extent={{-62,84},{-50,96}})));
35+
Modelica.Blocks.Sources.Constant Tnormal(k=273 + 22)
36+
"Average Temperature of supply air or forecast"
37+
annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
38+
Modelica.Blocks.Sources.RealExpression realExpression(y=35 -
39+
decisionVariables.y[1])
40+
annotation (Placement(transformation(extent={{-66,-44},{-10,-26}})));
41+
Modelica.Blocks.Interfaces.RealOutput hallTemperature
42+
"Absolute temperature as output signal"
43+
annotation (Placement(transformation(extent={{90,50},{110,70}})));
44+
equation
45+
connect(AirVolumeFlow.y,V2m. u) annotation (Line(points={{-79,90},{-63.2,90}},
46+
color={0,0,127}));
47+
connect(realExpression.y, hallBaseClass.CCA_SEN_T__WS_SUP__AI_U_C)
48+
annotation (Line(points={{-7.2,-35},{0,-35},{0,-14},{20,-14}}, color={0,0,
49+
127}));
50+
connect(V2m.y, fluidSource.dotm) annotation (Line(points={{-49.4,90},{-40,90},
51+
{-40,3.34},{-18.2,3.34}}, color={0,0,127}));
52+
connect(Tnormal.y, fluidSource.T_fluid) annotation (Line(points={{-79,50},{
53+
-60,50},{-60,-2.78},{-18.2,-2.78}}, color={0,0,127}));
54+
connect(weather.y[1], hallBaseClass.AIR_AHU_SEN_T_AIR_ODA__AI_U__C)
55+
annotation (Line(points={{1,50},{8,50},{8,10},{20,10}}, color={0,0,127}));
56+
connect(hallBaseClass.hallTemperature, hallTemperature) annotation (Line(
57+
points={{60,14},{80,14},{80,60},{100,60}}, color={0,0,127}));
58+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
59+
coordinateSystem(preserveAspectRatio=false)));
60+
end HallLong;
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
within ModelicaModels.SubsystemModels.TestHall;
2+
model HallShort "Version of the hall model for short prediction horizons"
3+
4+
extends ModelicaModels.Subsystems.TestHall.BaseClasses.HallConnected;
5+
6+
Modelica.Blocks.Sources.CombiTimeTable weather(
7+
tableOnFile=true,
8+
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint,
9+
columns={2},
10+
tableName="InputTable",
11+
fileName="weather.mat",
12+
smoothness=Modelica.Blocks.Types.Smoothness.LinearSegments)
13+
"Table with weather forecast" annotation (Placement(transformation(
14+
extent={{-10,-10},{10,10}},
15+
rotation=0,
16+
origin={-10,50})));
17+
Modelica.Blocks.Sources.CombiTimeTable decisionVariables(
18+
tableOnFile=true,
19+
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint,
20+
tableName="tab1",
21+
smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments,
22+
columns={2},
23+
fileName="decisionVariables.mat")
24+
"Table with decision variables" annotation (Placement(
25+
transformation(
26+
extent={{-10,-10},{10,10}},
27+
rotation=0,
28+
origin={30,50})));
29+
Modelica.Blocks.Sources.Constant AirVolumeFlow(k=8000)
30+
"Air volume flow rate, could be an initial value"
31+
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
32+
Modelica.Blocks.Math.Gain V2m(k=1.2/3600) "Volume to mass flow"
33+
annotation (Placement(transformation(extent={{-62,84},{-50,96}})));
34+
Modelica.Blocks.Interfaces.RealOutput hallTemperature
35+
"Absolute temperature as output signal"
36+
annotation (Placement(transformation(extent={{90,50},{110,70}})));
37+
Modelica.Blocks.Sources.CombiTimeTable variation(
38+
tableOnFile=true,
39+
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint,
40+
tableName="tab1",
41+
columns=2:3,
42+
fileName="variation.mat") "Table with control input"
43+
annotation (
44+
Placement(transformation(
45+
extent={{-10,-10},{10,10}},
46+
rotation=0,
47+
origin={-90,48})));
48+
Modelica.Thermal.HeatTransfer.Celsius.ToKelvin hallTemperature1
49+
annotation (Placement(transformation(extent={{-70,42},{-58,54}})));
50+
Modelica.Blocks.Sources.Constant currentWaterTemperature(k=22)
51+
"Can be an iniitial value"
52+
annotation (Placement(transformation(extent={{-40,-40},{-20,-20}})));
53+
equation
54+
connect(AirVolumeFlow.y,V2m. u) annotation (Line(points={{-79,90},{-63.2,90}},
55+
color={0,0,127}));
56+
connect(V2m.y, fluidSource.dotm) annotation (Line(points={{-49.4,90},{-40,90},
57+
{-40,3.34},{-18.2,3.34}}, color={0,0,127}));
58+
connect(weather.y[1], hallBaseClass.AIR_AHU_SEN_T_AIR_ODA__AI_U__C)
59+
annotation (Line(points={{1,50},{8,50},{8,10},{20,10}}, color={0,0,127}));
60+
connect(hallBaseClass.hallTemperature, hallTemperature) annotation (Line(
61+
points={{60,14},{80,14},{80,60},{100,60}}, color={0,0,127}));
62+
connect(currentWaterTemperature.y, hallBaseClass.CCA_SEN_T__WS_SUP__AI_U_C)
63+
annotation (Line(points={{-19,-30},{0,-30},{0,-14},{20,-14}}, color={0,0,
64+
127}));
65+
connect(fluidSource.T_fluid, hallTemperature1.Kelvin) annotation (Line(points=
66+
{{-18.2,-2.78},{-46,-2.78},{-46,48},{-57.4,48}}, color={0,0,127}));
67+
connect(variation.y[1], hallTemperature1.Celsius)
68+
annotation (Line(points={{-79,48},{-71.2,48}}, color={0,0,127}));
69+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
70+
coordinateSystem(preserveAspectRatio=false)));
71+
end HallShort;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
within ModelicaModels.SubsystemModels;
2+
package TestHall "Models for the test hall case study"
3+
end TestHall;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
HallLong
2+
HallShort
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BaseClasses
22
DetailedModels
3+
TestHall

pyDMPC/ModelicaModels/ModelicaModels/Subsystems/TestHall/BaseClasses/HallBaseClass.mo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ model HallBaseClass "Simplified model of hall 1"
55
"Nominal mass flow rate"
66
annotation(Dialog(group = "Nominal condition"));
77

8-
parameter AixLib.FastHVAC.Media.BaseClasses.MediumSimple medium = AixLib.FastHVAC.Media.WaterSimple();
8+
parameter AixLib.FastHVAC.Media.BaseClasses.MediumSimple medium = ModelicaModels.Subsystems.TestHall.BaseClasses.SimpleAir();
99

1010
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature outdoorAir
1111
annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
@@ -62,6 +62,9 @@ model HallBaseClass "Simplified model of hall 1"
6262
CInt={10^8},
6363
T_start=295.15)
6464
annotation (Placement(transformation(extent={{60,20},{80,42}})));
65+
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort
66+
"Heat transfer into the working fluid"
67+
annotation (Placement(transformation(extent={{-10,88},{10,108}})));
6568
equation
6669
connect(waterTemperature.Kelvin,supplyWater. T) annotation (Line(points={{-67.4,
6770
-70},{-62,-70}}, color={0,0,127}));
@@ -92,6 +95,8 @@ equation
9295
{4,-70},{4,20},{20,20},{20,9.4}}, color={191,0,0}));
9396
connect(workingFluid.heatPort, intWalRC.port_a)
9497
annotation (Line(points={{20,9.4},{20,30},{60,30}}, color={191,0,0}));
98+
connect(workingFluid.heatPort, heatPort) annotation (Line(points={{20,9.4},{20,
99+
80},{0,80},{0,98}}, color={191,0,0}));
95100
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-140,-100},
96101
{100,100}})), Diagram(
97102
coordinateSystem(preserveAspectRatio=false, extent={{-140,-100},{100,100}})),

pyDMPC/ModelicaModels/ModelicaModels/Subsystems/TestHall/BaseClasses/HallCalibrationBaseClass.mo

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
within ModelicaModels.Subsystems.TestHall.BaseClasses;
22
model HallCalibrationBaseClass
33

4-
parameter AixLib.FastHVAC.Media.BaseClasses.MediumSimple medium=AixLib.FastHVAC.Media.WaterSimple();
4+
extends ModelicaModels.Subsystems.TestHall.BaseClasses.HallConnected;
55

66
Modelica.Blocks.Math.Feedback feedback1
77
annotation (Placement(transformation(extent={{16,-40},{36,-60}})));
@@ -12,34 +12,23 @@ model HallCalibrationBaseClass
1212
extent={{-6,-6},{6,6}},
1313
rotation=90,
1414
origin={-48,-24})));
15-
AixLib.FastHVAC.Components.Pumps.FluidSource
16-
fluidSource(medium = medium)
17-
annotation (Placement(transformation(extent={{-42,10},{-24,-8}})));
1815
Modelica.Blocks.Math.Gain gain(k=1.2/3600)
1916
annotation (Placement(transformation(extent={{-54,8},{-46,16}})));
20-
HallBaseClass hall
21-
annotation (Placement(transformation(extent={{-12,-14},{16,14}})));
22-
AixLib.FastHVAC.Components.Sinks.Vessel vessel
23-
annotation (Placement(transformation(extent={{48,-10},{68,10}})));
2417
Modelica.Blocks.Math.Product product
2518
annotation (Placement(transformation(extent={{46,-60},{66,-40}})));
2619
equation
27-
connect(fluidSource.enthalpyPort_b, hall.enthalpyPort_a)
28-
annotation (Line(points={{-24,0.1},{-24,0},{-12,0}}, color={176,0,0}));
29-
connect(hall.enthalpyPort_b, vessel.enthalpyPort_a)
30-
annotation (Line(points={{16,0},{51,0}}, color={176,0,0}));
31-
connect(hall.hallTemperature, feedback1.u2)
32-
annotation (Line(points={{16,9.8},{26,9.8},{26,-42}}, color={0,0,127}));
3320
connect(integrator.u, product.y)
3421
annotation (Line(points={{78,-50},{67,-50}}, color={0,0,127}));
3522
connect(feedback1.y, product.u1) annotation (Line(points={{35,-50},{38,-50},{
3623
38,-44},{44,-44}}, color={0,0,127}));
3724
connect(feedback1.y, product.u2) annotation (Line(points={{35,-50},{38,-50},{
3825
38,-56},{44,-56}}, color={0,0,127}));
26+
connect(gain.y, fluidSource.dotm) annotation (Line(points={{-45.6,12},{-26,12},
27+
{-26,3.34},{-18.2,3.34}}, color={0,0,127}));
3928
connect(toKelvin.Kelvin, fluidSource.T_fluid) annotation (Line(points={{-48,
40-
-17.4},{-48,-2.78},{-40.2,-2.78}}, color={0,0,127}));
41-
connect(gain.y, fluidSource.dotm) annotation (Line(points={{-45.6,12},{-44,12},
42-
{-44,3.34},{-40.2,3.34}}, color={0,0,127}));
29+
-17.4},{-48,-2.78},{-18.2,-2.78}}, color={0,0,127}));
30+
connect(hallBaseClass.hallTemperature, feedback1.u2) annotation (Line(points=
31+
{{60,14},{72,14},{72,-30},{26,-30},{26,-42}}, color={0,0,127}));
4332
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
4433
coordinateSystem(preserveAspectRatio=false)),
4534
experiment(StopTime=5184000, Interval=3600));
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
within ModelicaModels.Subsystems.TestHall.BaseClasses;
2+
model HallConnected "A model of the hall with fluid source and sink"
3+
4+
parameter AixLib.FastHVAC.Media.BaseClasses.MediumSimple medium=ModelicaModels.Subsystems.TestHall.BaseClasses.SimpleAir();
5+
6+
HallBaseClass hallBaseClass(medium=medium)
7+
annotation (Placement(transformation(extent={{20,-20},{60,20}})));
8+
AixLib.FastHVAC.Components.Pumps.FluidSource
9+
fluidSource(medium=medium)
10+
annotation (Placement(transformation(extent={{-20,10},{-2,-8}})));
11+
AixLib.FastHVAC.Components.Sinks.Vessel vessel
12+
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
13+
equation
14+
connect(fluidSource.enthalpyPort_b, hallBaseClass.enthalpyPort_a) annotation (
15+
Line(points={{-2,0.1},{14,0.1},{14,0},{20,0}}, color={176,0,0}));
16+
connect(hallBaseClass.enthalpyPort_b, vessel.enthalpyPort_a)
17+
annotation (Line(points={{60,0},{83,0}}, color={176,0,0}));
18+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
19+
coordinateSystem(preserveAspectRatio=false)));
20+
end HallConnected;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
HallBaseClass
22
HallCalibrationBaseClass
33
SimpleAir
4+
HallConnected

0 commit comments

Comments
 (0)