Skip to content

Commit

Permalink
Add new features to the AWHP plant template (#3847)
Browse files Browse the repository at this point in the history
* Checkout component from issue1374_template_CHW_final

* Refactor chiller component w/ ElectricReformulatedEIR

* Add HRC controls, refactor with LoadAverage block

- In AirToWater validation model: fix wrong assignment of
  VChiWat_flow_nominal and use actual setpoint for supply temperature.

* Integrate HRC component into template

* Add HP failsafe staging conditions

* Add pump failsafe staging condition

- Add Edge block to trigger pump stage change command and remove
  minimum runtime in pump stage index block. This is needed because
  efficiency and failsafe conditions lead to different stage runtimes.
  If the pump availability is taken into account in the future, then
  the timers need to be reset when a lag pump become available so that
  the stage change command is triggered again (see the rationale in
  StageChangeCommand where an "if" condition is still used for this
  reason).

* Add primary-only configuration

* Add local ∆p reset block


---------

Co-authored-by: JayHuLBL <[email protected]>
  • Loading branch information
AntoineGautier and JayHuLBL authored Jul 6, 2024
1 parent 2cf523e commit c39e4c0
Show file tree
Hide file tree
Showing 249 changed files with 12,538 additions and 4,961 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ env:
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-templates-optimica"
- TEST_ARG="make test-templates-dymola"

before_install:
Expand Down Expand Up @@ -180,7 +179,7 @@ script:
- |
TRAVIS_WAIT=90
if [[ "$TEST_ARG" == *test-templates* ]]; then
TRAVIS_WAIT=180
TRAVIS_WAIT=120
fi
(cd Buildings/Resources/Scripts/travis && travis_wait $TRAVIS_WAIT $TEST_ARG)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,20 @@ model Controller "Validation controller model"
final period=3600)
"Freeze protection reset"
annotation (Placement(transformation(extent={{-240,-170},{-220,-150}})));
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
final trueHoldDuration=1)
"Break loop"
annotation (Placement(transformation(extent={{220,30},{240,50}})));

Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(
final realTrue=1,
final realFalse=0)
"Convert to real"
annotation (Placement(transformation(extent={{190,70},{170,90}})));
Buildings.Fluid.BaseClasses.ActuatorFilter fil(
final f=5/(2*Modelica.Constants.pi*10),
initType=Modelica.Blocks.Types.Init.InitialOutput,
final y_start=0)
"Filter signal"
annotation (Placement(transformation(extent={{160,70},{140,90}})));
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(final t=0.5)
"Compare filtered signal to threshold to trigger true status"
annotation (Placement(transformation(extent={{130,70},{110,90}})));
equation
connect(TOut.y, conAHU.TOut) annotation (Line(points={{-218,190},{62,190},{62,
25.4545},{96,25.4545}}, color={0,0,127}));
Expand Down Expand Up @@ -159,11 +168,6 @@ equation
annotation (Line(points={{-218,-160},{-202,-160}}, color={255,0,255}));
connect(not1.y, conAHU.u1SofSwiRes) annotation (Line(points={{-178,-160},{56,
-160},{56,-76.3636},{96,-76.3636}}, color={255,0,255}));
connect(conAHU.y1SupFan, truFalHol.u) annotation (Line(points={{184,-40},{200,
-40},{200,40},{218,40}}, color={255,0,255}));
connect(truFalHol.y, conAHU.u1SupFan) annotation (Line(points={{242,40},{250,
40},{250,70},{50,70},{50,16.3636},{96,16.3636}},
color={255,0,255}));
connect(sumDesPopBreZon.y, conAHU.VSumAdjPopBreZon_flow) annotation (Line(
points={{-178,100},{38,100},{38,5.45455},{96,5.45455}}, color={0,0,127}));
connect(sumDesAreBreZon.y, conAHU.VSumAdjAreBreZon_flow) annotation (Line(
Expand All @@ -172,6 +176,14 @@ equation
{32,-3.63636},{96,-3.63636}}, color={0,0,127}));
connect(opeMod.y, conAHU.uAhuOpeMod) annotation (Line(points={{-178,250},{80,
250},{80,38.1818},{96,38.1818}}, color={255,127,0}));
connect(booToRea.y, fil.u)
annotation (Line(points={{168,80},{162,80}}, color={0,0,127}));
connect(fil.y, greThr.u)
annotation (Line(points={{139,80},{132,80}}, color={0,0,127}));
connect(greThr.y, conAHU.u1SupFan) annotation (Line(points={{108,80},{86,80},
{86,16.3636},{96,16.3636}}, color={255,0,255}));
connect(conAHU.y1SupFan, booToRea.u) annotation (Line(points={{184,-40},{200,
-40},{200,80},{192,80}}, color={255,0,255}));
annotation (experiment(StopTime=3600.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/G36/AHUs/MultiZone/VAV/Validation/Controller.mos"
"Simulate and plot"),
Expand All @@ -184,6 +196,11 @@ Buildings.Controls.OBC.ASHRAE.G36.AHUs.MultiZone.VAV.Controller</a>.
</html>", revisions="<html>
<ul>
<li>
June 27, 2024, by Antoine Gautier:<br/>
Refactored the computation of the supply fan status.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3787\">#3787</a>.
</li>
<li>
February 8, 2022, by Jianjun Hu:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,20 @@ model Controller_UnspecifiedClimate
final period=3600)
"Freeze protection reset"
annotation (Placement(transformation(extent={{-240,-170},{-220,-150}})));
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
final trueHoldDuration=1)
"Break loop"
annotation (Placement(transformation(extent={{220,30},{240,50}})));

Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(
final realTrue=1,
final realFalse=0)
"Convert to real"
annotation (Placement(transformation(extent={{190,70},{170,90}})));
Buildings.Fluid.BaseClasses.ActuatorFilter fil(
final f=5/(2*Modelica.Constants.pi*10),
initType=Modelica.Blocks.Types.Init.InitialOutput,
final y_start=0)
"Filter signal"
annotation (Placement(transformation(extent={{160,70},{140,90}})));
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(final t=0.5)
"Compare filtered signal to threshold to trigger true status"
annotation (Placement(transformation(extent={{130,70},{110,90}})));
equation
connect(TOut.y, conAHU.TOut) annotation (Line(points={{-218,190},{62,190},{62,
25.4545},{96,25.4545}}, color={0,0,127}));
Expand Down Expand Up @@ -166,11 +175,6 @@ equation
annotation (Line(points={{-218,-160},{-202,-160}}, color={255,0,255}));
connect(not1.y, conAHU.u1SofSwiRes) annotation (Line(points={{-178,-160},{56,
-160},{56,-76.3636},{96,-76.3636}}, color={255,0,255}));
connect(conAHU.y1SupFan, truFalHol.u) annotation (Line(points={{184,-40},{200,
-40},{200,40},{218,40}}, color={255,0,255}));
connect(truFalHol.y, conAHU.u1SupFan) annotation (Line(points={{242,40},{250,
40},{250,70},{50,70},{50,16.3636},{96,16.3636}},
color={255,0,255}));
connect(sumDesPopBreZon.y, conAHU.VSumAdjPopBreZon_flow) annotation (Line(
points={{-178,100},{38,100},{38,5.45455},{96,5.45455}}, color={0,0,127}));
connect(sumDesAreBreZon.y, conAHU.VSumAdjAreBreZon_flow) annotation (Line(
Expand All @@ -179,6 +183,14 @@ equation
{32,-3.63636},{96,-3.63636}}, color={0,0,127}));
connect(opeMod.y, conAHU.uAhuOpeMod) annotation (Line(points={{-178,250},{80,
250},{80,38.1818},{96,38.1818}}, color={255,127,0}));
connect(booToRea.y, fil.u)
annotation (Line(points={{168,80},{162,80}}, color={0,0,127}));
connect(fil.y, greThr.u)
annotation (Line(points={{139,80},{132,80}}, color={0,0,127}));
connect(conAHU.y1SupFan, booToRea.u) annotation (Line(points={{184,-40},{200,
-40},{200,80},{192,80}}, color={255,0,255}));
connect(greThr.y, conAHU.u1SupFan) annotation (Line(points={{108,80},{86,80},
{86,16.3636},{96,16.3636}}, color={255,0,255}));
annotation (experiment(StopTime=3600.0, Tolerance=1e-06),
__Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/Controls/OBC/ASHRAE/G36/AHUs/MultiZone/VAV/Validation/Controller_UnspecifiedClimate.mos"
"Simulate and plot"),
Expand All @@ -192,6 +204,11 @@ warning when the climate zone is not specified.
</html>", revisions="<html>
<ul>
<li>
June 27, 2024, by Antoine Gautier:<br/>
Refactored the computation of the supply fan status.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3787\">#3787</a>.
</li>
<li>
February 8, 2022, by Jianjun Hu:<br/>
First implementation.
</li>
Expand Down
5 changes: 3 additions & 2 deletions Buildings/Controls/OBC/ASHRAE/G36/ThermalZones/Setpoints.mo
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ protected
final t=300)
"Check whether the zone has been unpopulated for 5 minutes continuously during occupied mode"
annotation (Placement(transformation(extent={{-220,-280},{-200,-260}})));
Buildings.Controls.OBC.CDL.Logical.TrueHold truHol(
final duration=60)
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truHol(
final falseHoldDuration=0,
final trueHoldDuration=60)
"When the zone is unpopulated by more than threshold time and then becomes populated, hold the change by short period"
annotation (Placement(transformation(extent={{-100,-280},{-80,-260}})));
Buildings.Controls.OBC.CDL.Logical.Edge edg1
Expand Down
Loading

0 comments on commit c39e4c0

Please sign in to comment.