Skip to content

Commit 1340b1f

Browse files
Fix Dymola warnings for array parameters in controller record
1 parent 3db438c commit 1340b1f

16 files changed

Lines changed: 246 additions & 211 deletions

File tree

Lines changed: 86 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,113 @@
11
simulateModel("Buildings.Templates.Plants.Boilers.HotWater.Validation.BoilerPlant",
2-
method="cvode",
3-
tolerance=1e-6,
4-
startTime=0.0,
5-
stopTime=86400.0,
6-
resultFile="BoilerPlant");
2+
method="cvode",
3+
tolerance=1e-6,
4+
startTime=0.0,
5+
stopTime=86400.0,
6+
resultFile="BoilerPlant");
77
createPlot(
8-
id=1,
9-
position={5, 5, 300, 500},
10-
y={"pla.ctl.ctlLooPri.staSetCon.capReq1.y", "pla.cap_nominal"},
11-
autoscale=true,
12-
grid=true,
13-
timeUnit="h"
8+
id=1,
9+
position={5, 5, 300, 500},
10+
y={"pla.ctl.ctlLooPri.staSetCon.capReq1.y", "pla.cap_nominal"},
11+
autoscale=true,
12+
grid=true,
13+
timeUnit="h"
1414
);
1515
createPlot(
16-
id=1,
17-
subPlot=2,
18-
y={"pla.bus.TOut", "pla.ctl.dat.TOutLck"},
19-
autoscale=true,
20-
grid=true,
21-
timeUnit="h"
16+
id=1,
17+
subPlot=2,
18+
y={"pla.bus.TOut", "pla.ctl.dat.TOutLck"},
19+
autoscale=true,
20+
grid=true,
21+
timeUnit="h"
2222
);
2323
createPlot(
24-
id=2,
25-
position={310, 5, 300, 500},
26-
y={"pla.ctl.reqPlaHeaWat.y", "pla.ctl.ctlLooPri.yPla"},
27-
autoscale=true,
28-
grid=true,
29-
timeUnit="h"
24+
id=2,
25+
position={310, 5, 300, 500},
26+
y={"pla.ctl.reqPlaHeaWat.y", "pla.ctl.ctlLooPri.yPla"},
27+
autoscale=true,
28+
grid=true,
29+
timeUnit="h"
3030
);
3131
createPlot(
32-
id=2,
33-
subPlot=2,
34-
y={"pla.ctl.ctlLooPri.staSetCon.ySta"},
35-
autoscale=true,
36-
grid=true,
37-
timeUnit="h"
32+
id=2,
33+
subPlot=2,
34+
y={"pla.ctl.ctlLooPri.staSetCon.ySta"},
35+
autoscale=true,
36+
grid=true,
37+
timeUnit="h"
3838
);
3939
createPlot(
40-
id=3,
41-
position={615, 5, 300, 500},
42-
subPlot=1,
43-
y={"pla.bus.boiCon[1].y1", "pla.bus.boiCon[2].y1"},
44-
autoscale=true,
45-
grid=true,
46-
timeUnit="h"
40+
id=3,
41+
position={615, 5, 300, 500},
42+
subPlot=1,
43+
y={"pla.bus.boiCon[1].y1", "pla.bus.boiCon[2].y1"},
44+
autoscale=true,
45+
grid=true,
46+
timeUnit="h"
4747
);
4848
createPlot(
49-
id=3,
50-
subPlot=2,
51-
y={"pla.bus.valBoiConIso[1].y1", "pla.bus.valBoiConIso[2].y1"},
52-
autoscale=true,
53-
grid=true,
54-
timeUnit="h"
49+
id=3,
50+
subPlot=2,
51+
y={"pla.bus.valBoiConIso[1].y1", "pla.bus.valBoiConIso[2].y1"},
52+
autoscale=true,
53+
grid=true,
54+
timeUnit="h"
5555
);
5656
createPlot(
57-
id=4,
58-
position={920, 5, 300, 600},
59-
subPlot=1,
60-
y={"pla.bus.pumHeaWatPriCon.y1[1]", "pla.bus.pumHeaWatPriCon.y1[2]"},
61-
autoscale=true,
62-
grid=true,
63-
timeUnit="h"
57+
id=4,
58+
position={920, 5, 300, 600},
59+
subPlot=1,
60+
y={"pla.bus.pumHeaWatPriCon.y1[1]", "pla.bus.pumHeaWatPriCon.y1[2]"},
61+
autoscale=true,
62+
grid=true,
63+
timeUnit="h"
6464
);
6565
createPlot(
66-
id=4,
67-
subPlot=2,
68-
y={"pla.bus.pumHeaWatPriCon.y"},
69-
autoscale=true,
70-
grid=true,
71-
timeUnit="h"
66+
id=4,
67+
subPlot=2,
68+
y={"pla.bus.pumHeaWatPriCon.y"},
69+
autoscale=true,
70+
grid=true,
71+
timeUnit="h"
7272
);
7373
createPlot(
74-
id=5,
75-
position={1225, 5, 300, 600},
76-
subPlot=1,
77-
y={"pla.ctl.reqResHeaWat.y"},
78-
autoscale=true,
79-
grid=true,
80-
timeUnit="h"
74+
id=5,
75+
position={1225, 5, 300, 600},
76+
subPlot=1,
77+
y={"pla.ctl.reqResHeaWat.y"},
78+
autoscale=true,
79+
grid=true,
80+
timeUnit="h"
8181
);
8282
createPlot(
83-
id=5,
84-
subPlot=2,
85-
y={"pla.bus.dpHeaWatRem[1]", "datAll.pla.ctl.dpHeaWatRemSet_max[1]"},
86-
autoscale=true,
87-
grid=true,
88-
timeUnit="h"
83+
id=5,
84+
subPlot=2,
85+
y={"pla.bus.dpHeaWatRem[1]", "datAll.pla.ctl.dpHeaWatRemSet_max[1]"},
86+
autoscale=true,
87+
grid=true,
88+
timeUnit="h"
8989
);
9090
createPlot(
91-
id=6,
92-
position={40, 40, 300, 600},
93-
y={"pla.bus.looCon.VHeaWatPri_flow", "datAll.pla.ctl.VHeaWatPriCon_flow_nominal"},
94-
autoscale=true,
95-
grid=true,
96-
timeUnit="h"
91+
id=6,
92+
position={40, 40, 300, 600},
93+
y={"pla.bus.looCon.VHeaWatPri_flow", "datAll.pla.ctl.VHeaWatPriCon_flow_nominal"},
94+
autoscale=true,
95+
grid=true,
96+
timeUnit="h"
9797
);
9898
createPlot(
99-
id=6,
100-
subPlot=2,
101-
y={"pla.bus.boiCon[1].y_actual", "pla.bus.boiCon[2].y_actual"},
102-
autoscale=true,
103-
grid=true,
104-
timeUnit="h"
99+
id=6,
100+
subPlot=2,
101+
y={"pla.bus.boiCon[1].y_actual", "pla.bus.boiCon[2].y_actual"},
102+
autoscale=true,
103+
grid=true,
104+
timeUnit="h"
105105
);
106106
createPlot(
107-
id=7,
108-
y={"pla.bus.boiCon[1].THeaWatSupSet", "pla.bus.boiCon[2].THeaWatSupSet", "pla.bus.looCon.THeaWatPriSup", "pla.bus.looCon.THeaWatPlaRet"},
109-
autoscale=true,
110-
grid=true,
111-
timeUnit="h"
107+
id=7,
108+
position={350, 40, 500, 400},
109+
y={"pla.bus.boiCon[1].THeaWatSupSet", "pla.bus.boiCon[2].THeaWatSupSet", "pla.bus.looCon.THeaWatPriSup", "pla.bus.looCon.THeaWatPlaRet"},
110+
autoscale=true,
111+
grid=true,
112+
timeUnit="h"
112113
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
simulateModel("Buildings.Templates.Plants.Boilers.HotWater.Validation.BoilerPlantOpenLoop",
2+
method="cvode",
3+
tolerance=1e-6,
4+
startTime=0.0,
5+
stopTime=2200.0,
6+
resultFile="BoilerPlantOpenLoop");
7+
createPlot(id=1,
8+
position={5, 5, 400, 600},
9+
y={"THeaWatRet.T", "pla.bus.looNon.THeaWatPlaRet", "pla.bus.looNon.THeaWatPriSup", "pla.bus.boiNon[1].THeaWatSupSet", "pla.boiNon.boiPol[1].boi.T"},
10+
autoscale=true,
11+
grid=true);
12+
createPlot(id=1,
13+
y={"pla.bus.boiNon[1].y1"},
14+
subPlot=2,
15+
autoscale=true,
16+
grid=true);
17+
createPlot(id=1,
18+
y={"pla.bus.boiNon[1].y_actual"},
19+
subPlot=3,
20+
autoscale=true,
21+
grid=true);
22+
createPlot(id=2,
23+
position={415, 5, 400, 300},
24+
y={"pla.bus.looNon.VHeaWatPri_flow", "VHeaWat_flow.V_flow"},
25+
autoscale=true,
26+
grid=true);

Buildings/Templates/Components/Validation/BoilerHotWater.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ model BoilerHotWater "Test model for the hot water boiler model"
1919
dpHeaWat_nominal(displayUnit="Pa") = 5000,
2020
THeaWatSup_nominal=333.15)
2121
"Design and operating parameters for the boiler model using a polynomial"
22-
annotation (Placement(transformation(extent={{60,20},{80,40}})));
22+
annotation (Placement(transformation(extent={{40,40},{60,60}})));
2323

2424
Buildings.Templates.Components.Boilers.HotWaterTable boiTab(
2525
redeclare final package Medium = Medium,
@@ -57,7 +57,7 @@ model BoilerHotWater "Test model for the hot water boiler model"
5757
timeScale=3600,
5858
period=3600) "Boiler Enable signal"
5959
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));
60-
Buildings.Templates.HeatingPlants.HotWater.Interfaces.Bus bus
60+
Buildings.Templates.Components.Interfaces.Bus bus
6161
"Boiler control bus"
6262
annotation (
6363
Placement(transformation(extent={{-20,20},{20,60}}), iconTransformation(
@@ -79,7 +79,7 @@ model BoilerHotWater "Test model for the hot water boiler model"
7979
final m_flow_nominal=datBoiTab.mHeaWat_flow_nominal)
8080
"HW supply temperature"
8181
annotation (Placement(transformation(extent={{30,-90},{50,-70}})));
82-
HeatingPlants.HotWater.Interfaces.Bus bus1
82+
Buildings.Templates.Components.Interfaces.Bus bus1
8383
"Boiler control bus"
8484
annotation (
8585
Placement(transformation(extent={{-20,-60},{20,-20}}),

Buildings/Templates/Components/Validation/BoilerHotWaterRecord.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ model BoilerHotWaterRecord
1414
dpHeaWat_nominal(displayUnit="Pa") = 5000,
1515
THeaWatSup_nominal=333.15)
1616
"Design and operating parameters for the boiler model using a lookup table"
17-
annotation (Placement(transformation(extent={{60,80},{80,100}})));
17+
annotation (Placement(transformation(extent={{10,70},{30,90}})));
1818

1919
parameter Buildings.Templates.Components.Data.BoilerHotWater datBoiTabRed(
2020
final typMod=Buildings.Templates.Components.Types.BoilerHotWaterModel.Table,
@@ -25,7 +25,7 @@ model BoilerHotWaterRecord
2525
dpHeaWat_nominal(displayUnit="Pa") = 5000,
2626
THeaWatSup_nominal=333.15)
2727
"Design and operating parameters for the boiler model using a lookup table with redeclaration"
28-
annotation (Placement(transformation(extent={{60,50},{80,70}})));
28+
annotation (Placement(transformation(extent={{68,70},{88,90}})));
2929

3030
parameter Buildings.Templates.Components.Data.BoilerHotWater datBoiTabLoc(
3131
final typMod=Buildings.Templates.Components.Types.BoilerHotWaterModel.Table,
@@ -36,7 +36,7 @@ model BoilerHotWaterRecord
3636
dpHeaWat_nominal(displayUnit="Pa") = 5000,
3737
THeaWatSup_nominal=333.15)
3838
"Design and operating parameters for the boiler model using a local assignment of the efficiency curve "
39-
annotation (Placement(transformation(extent={{60,50},{80,70}})));
39+
annotation (Placement(transformation(extent={{40,70},{60,90}})));
4040

4141
annotation (
4242
experiment(
@@ -64,7 +64,7 @@ HW flow rate and capacity persist when redeclaring the performance record
6464
<code>datBoiTabRed.per</code>,
6565
</li>
6666
<li>
67-
how to completely overwrite the original bindings to the design conditions
67+
how to completely overwrite the original bindings with the design conditions
6868
when assigning an instance of a compatible record to <code>datBoiTab.per</code>.
6969
Note that Dymola (as of version 2023.x) does not support a direct binding
7070
with a record function and requires a local instance of the record as illustrated

Buildings/Templates/Data/Defaults.mo

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ package Defaults
8989
"HHW system gauge pressure at design conditions";
9090
constant Modelica.Units.SI.PressureDifference dpHeaWatBoi=5E3
9191
"Boiler HW pressure drop";
92-
constant Modelica.Units.SI.Temperature THeaWatSup=80 + 273.15
93-
"HW supply temperature";
94-
constant Modelica.Units.SI.Temperature THeaWatConSup=65 + 273.15
95-
"HW supply temperature for condensing boilers";
96-
constant Modelica.Units.SI.Temperature THeaWatRet=55 + 273.15
97-
"HW return temperature";
9892
constant Modelica.Units.SI.Temperature TOutHeaWatLck=21 + 273.15
9993
"Outdoor air lockout temperature above which the HW system is prevented from operating";
10094
constant Modelica.Units.SI.PressureDifference dpHeaWatSet_min=5 * 6894

Buildings/Templates/Plants/Boilers/HotWater/BoilerPlant.mo

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ model BoilerPlant "Boiler plant"
55
final typCtl=ctl.typ,
66
final nAirHan=ctl.nAirHan,
77
final nEquZon=ctl.nEquZon,
8-
cfg(
8+
final cfg(
99
final have_senDpHeaWatRemWir=ctl.have_senDpHeaWatRemWir,
1010
final nSenDpHeaWatRem=ctl.nSenDpHeaWatRem,
1111
final have_senVHeaWatSec=ctl.have_senVHeaWatSec));
@@ -67,7 +67,7 @@ model BoilerPlant "Boiler plant"
6767
Buildings.Templates.Components.Pumps.Multiple pumHeaWatPriCon(
6868
redeclare final package Medium = Medium,
6969
final nPum=nPumHeaWatPriCon,
70-
final have_var=have_varPumHeaWatPriCon,
70+
final have_var=have_pumHeaWatPriVarCon,
7171
final have_varCom=true,
7272
final dat=dat.pumHeaWatPriCon,
7373
final energyDynamics=energyDynamics,
@@ -155,7 +155,7 @@ model BoilerPlant "Boiler plant"
155155
redeclare final package Medium = Medium,
156156
final m_flow_nominal=mHeaWat_flow_nominal,
157157
final allowFlowReversal=true,
158-
final have_sen=have_varPumHeaWatPriCon
158+
final have_sen=have_pumHeaWatPriVarCon
159159
and typPumHeaWatSec<>Buildings.Templates.Plants.Boilers.HotWater.Types.PumpsSecondary.None
160160
and ctl.typMeaCtlHeaWatPri==Buildings.Templates.Plants.Boilers.HotWater.Types.PrimaryOverflowMeasurement.FlowDecoupler,
161161
final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter,
@@ -263,7 +263,7 @@ model BoilerPlant "Boiler plant"
263263
Buildings.Templates.Components.Pumps.Multiple pumHeaWatPriNon(
264264
redeclare final package Medium = Medium,
265265
final nPum=nPumHeaWatPriNon,
266-
final have_var=have_varPumHeaWatPriNon,
266+
final have_var=have_pumHeaWatPriVarNon,
267267
final have_varCom=true,
268268
final dat=dat.pumHeaWatPriNon,
269269
final energyDynamics=energyDynamics,
@@ -350,7 +350,7 @@ model BoilerPlant "Boiler plant"
350350
redeclare final package Medium = Medium,
351351
final m_flow_nominal=mHeaWat_flow_nominal,
352352
final allowFlowReversal=true,
353-
final have_sen=have_varPumHeaWatPriNon
353+
final have_sen=have_pumHeaWatPriVarNon
354354
and typPumHeaWatSec<>Buildings.Templates.Plants.Boilers.HotWater.Types.PumpsSecondary.None
355355
and ctl.typMeaCtlHeaWatPri==Buildings.Templates.Plants.Boilers.HotWater.Types.PrimaryOverflowMeasurement.FlowDecoupler,
356356
final typ=Buildings.Templates.Components.Types.SensorVolumeFlowRate.FlowMeter,

Buildings/Templates/Plants/Boilers/HotWater/Components/Controls/Guideline36.mo

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ block Guideline36 "Guideline 36 controller"
1717
"True: Headered primary hot water pumps;
1818
False: Dedicated primary hot water pumps";
1919

20-
final parameter Boolean have_varPriPum = cfg.have_varPumHeaWatPriCon or cfg.have_varPumHeaWatPriNon
20+
final parameter Boolean have_varPriPum = cfg.have_pumHeaWatPriVarCon or cfg.have_pumHeaWatPriVarNon
2121
"True: Variable-speed primary pumps;
2222
False: Fixed-speed primary pumps";
2323

@@ -220,6 +220,10 @@ block Guideline36 "Guideline 36 controller"
220220
Buildings.Controls.OBC.CDL.Reals.MultiMax FIXME_max(nin=nSenDpHeaWatRem)
221221
"There should be one setpoint value for each remote sensor"
222222
annotation (Placement(transformation(extent={{-60,50},{-40,70}})));
223+
Buildings.Controls.OBC.CDL.Logical.Pre uBoi_pre[nBoi]
224+
"Break algebraic loop at initialization" annotation (Placement(
225+
transformation(extent={{-60,-30},{-40,-10}}), iconTransformation(extent
226+
={{-240,220},{-200,260}})));
223227
initial equation
224228
assert(nAirHan + nEquZon > 0,
225229
"In "+ getInstanceName() + ": "+
@@ -315,8 +319,6 @@ equation
315319
points={{12,-10.5},{32,-10.5},{32,78},{48,78}}, color={255,0,255}));
316320
connect(ctlLooPri.yMaxSecPumSpe, ctlPumHeaWatSec.uMaxSecPumSpeCon)
317321
annotation (Line(points={{12,-7.1},{34,-7.1},{34,62},{48,62}}, color={0,0,127}));
318-
connect(FIXME_uBoi.y, ctlLooPri.uBoi) annotation (Line(points={{-78,-20},{-20,
319-
-20},{-20,-20.7},{-12,-20.7}}, color={255,0,255}));
320322
connect(busBoiCon.y_actual, FIXME_uBoi.u) annotation (Line(
321323
points={{-240,160},{-120,160},{-120,-20},{-102,-20}},
322324
color={255,204,51},
@@ -331,6 +333,10 @@ equation
331333
annotation (Line(points={{-78,60},{-62,60}}, color={0,0,127}));
332334
connect(FIXME_max.y, ctlPumHeaWatSec.dpHotWatSet) annotation (Line(points={{-38,
333335
60},{28,60},{28,66},{48,66}}, color={0,0,127}));
336+
connect(FIXME_uBoi.y, uBoi_pre.u)
337+
annotation (Line(points={{-78,-20},{-62,-20}}, color={255,0,255}));
338+
connect(uBoi_pre.y, ctlLooPri.uBoi) annotation (Line(points={{-38,-20},{-20,
339+
-20},{-20,-20.7},{-12,-20.7}}, color={255,0,255}));
334340
annotation (Documentation(info="<html>
335341
<h4>Description</h4>
336342
FIXME cfg.have_boiCon and cfg.have_boiNon mutually exclusive

0 commit comments

Comments
 (0)