Skip to content

Commit

Permalink
Merge branch 'issue1374_template_CHW_final' of github.com:lbl-srg/mod…
Browse files Browse the repository at this point in the history
…elica-buildings into issue3266_template_HW_plant
  • Loading branch information
AntoineGautier committed Feb 12, 2025
2 parents 4959db4 + 0c2e878 commit e99200b
Show file tree
Hide file tree
Showing 4,972 changed files with 340,255 additions and 77,651 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
20 changes: 18 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: pip3 install --upgrade pip wheel

- name: "Install BuildingsPy"
run: pip3 install git+https://github.com/lbl-srg/BuildingsPy@50ac74d8e4fd067179bb38bc23140c2c9254c94c
run: pip3 install git+https://github.com/lbl-srg/BuildingsPy@0bc654fd913c83f64163be167807e8989eff0293

- name: Check for UTF-8 BOM
run : |
Expand All @@ -55,9 +55,11 @@ jobs:
- name: "Test experiment setup"
run : ../bin/runUnitTests.py --validate-experiment-setup

- name: "Test if package.order are correct"
- name: "Test if package.order are correct, and revert order in UsersGuide"
run : |
python -c 'import buildingspy.development.refactor as r; r.write_package_order(".", recursive=True)'
git checkout UsersGuide/ReleaseNotes/package.order
git checkout UsersGuide/package.order
git diff --exit-code .
- name: "Verify files for invalid strings"
Expand Down Expand Up @@ -119,3 +121,17 @@ jobs:
chmod u=rw,og=rw $ff
done
done
test-checksum:
# Skip if the commit message contains "ci skip"
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-22.04

steps:
# Checks-out repository under $GITHUB_WORKSPACE, so job can access it
- name: Checkout code
uses: actions/checkout@v3

- name: Compute the checksum and check that it matches the value from the last commit
run: ./Resources/Scripts/travis/templates/checkandrun.sh --checksum --skip --diffhead
160 changes: 88 additions & 72 deletions .travis.yml

Large diffs are not rendered by default.

1,063 changes: 1,038 additions & 25 deletions Buildings/.copiedFiles.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ model ControllerChillerDXHeatingEconomizer
annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
Buildings.Controls.OBC.CDL.Reals.Switch swiFan "Switch fan on"
annotation (Placement(transformation(extent={{70,120},{90,140}})));
Buildings.Controls.OBC.CDL.Reals.Hysteresis hysHea(
final uLow=0.01,
final uHigh=0.05)
"Hysteresis for heating"
annotation (Placement(transformation(extent={{-30,120},{-10,140}})));
Buildings.Controls.OBC.CDL.Logical.MultiOr orFan(nin=3)
"Switch fan on if heating, cooling, or occupied"
annotation (Placement(transformation(extent={{40,94},{60,114}})));
Expand All @@ -226,6 +221,9 @@ model ControllerChillerDXHeatingEconomizer
"Chiller on signal based on room temperature"
annotation (Placement(transformation(extent={{20,-80},{40,-60}})));

Controls.OBC.CDL.Reals.Greater heaOnTRoo(h=0.5)
"Heater on signal based on room temperature"
annotation (Placement(transformation(extent={{-60,120},{-40,140}})));
protected
Modelica.Blocks.Sources.Constant TSetSupChiConst(
final k=TSupChi_nominal)
Expand Down Expand Up @@ -271,21 +269,17 @@ equation
138},{68,138}}, color={0,0,127}));
connect(swiFan.y, yFan) annotation (Line(points={{92,130},{96,130},{96,90},{
110,90}}, color={0,0,127}));
connect(conSup.yHea, hysHea.u) annotation (Line(points={{-39,86},{-34,86},{
-34,130},{-32,130}}, color={0,0,127}));
connect(swiFan.u2, orFan.y) annotation (Line(points={{68,130},{64,130},{64,104},{62,104}},
color={255,0,255}));
connect(hysHea.y, orFan.u[1]) annotation (Line(points={{-8,130},{24,130},{24,
108.667},{38,108.667}},
color={255,0,255}));
connect(conEco.TMixSet, conCooVal.u_s) annotation (Line(points={{39,78},{-10,
78},{-10,-20},{-2,-20}}, color={0,0,127}));
connect(and1.y, chiOn) annotation (Line(points={{91,-30},{96,-30},{96,-54},{110,
-54}}, color={255,0,255}));
connect(conEco.yCoiSta, and1.u1) annotation (Line(points={{61,62},{64,62},{64,
-30},{68,-30}}, color={255,0,255}));
connect(uOcc, orFan.u[2]) annotation (Line(points={{-120,0},{-14,0},{-14,104},
{38,104}}, color={255,0,255}));
connect(uOcc, orFan.u[1]) annotation (Line(points={{-120,0},{-14,0},{-14,
101.667},{38,101.667}},
color={255,0,255}));
connect(TMix, conEco.TMix) annotation (Line(points={{-120,30},{-26,30},{-26,75},
{39,75}}, color={0,0,127}));
connect(TOut, conEco.TOut) annotation (Line(points={{-120,-40},{-66,-40},{-66,
Expand All @@ -303,8 +297,14 @@ equation
connect(chiOnTRoo.y, conEco.cooSta) annotation (Line(points={{42,-70},{50,-70},
{50,40},{34,40},{34,62},{39,62}}, color={255,0,255}));

connect(chiOnTRoo.y, orFan.u[3]) annotation (Line(points={{42,-70},{50,-70},{
50,40},{34,40},{34,99.3333},{38,99.3333}}, color={255,0,255}));
connect(chiOnTRoo.y, orFan.u[2]) annotation (Line(points={{42,-70},{50,-70},{
50,40},{34,40},{34,104},{38,104}}, color={255,0,255}));
connect(heaOnTRoo.y, orFan.u[3]) annotation (Line(points={{-38,130},{20,130},
{20,106.333},{38,106.333}}, color={255,0,255}));
connect(heaOnTRoo.u2, TRoo) annotation (Line(points={{-62,122},{-86,122},{-86,
-80},{-120,-80}}, color={0,0,127}));
connect(TSetRooHea, heaOnTRoo.u1) annotation (Line(points={{-120,120},{-80,
120},{-80,130},{-62,130}}, color={0,0,127}));
annotation (
defaultComponentName="conChiDXHeaEco",
Icon(graphics={Line(points={{-100,-100},{0,2},{-100,100}}, color=
Expand All @@ -316,6 +316,11 @@ heating coil and a cooling coil.
</html>", revisions="<html>
<ul>
<li>
March 28, 2024, by David Blum:<br/>
Adjust heating hysteresis to avoid chattering.
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3735\">issue 3735</a>.
</li>
<li>
November 20, 2020, by David Blum:<br/>
Turn fan on when setup cooling required.
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2265\">issue 2265</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,52 +29,59 @@ model ControllerEconomizer "Controller for economizer"
displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Mixed air setpoint temperature"
annotation (Placement(transformation(extent={{-120,70},{-100,90}})));
annotation (Placement(transformation(extent={{-160,70},{-140,90}}),
iconTransformation(extent={{-120,70},{-100,90}})));
Modelica.Blocks.Interfaces.RealInput TMix(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Measured mixed air temperature"
annotation (Placement(transformation(extent={{-120,40},{-100,60}})));
annotation (Placement(transformation(extent={{-160,40},{-140,60}}),
iconTransformation(extent={{-120,40},{-100,60}})));
Modelica.Blocks.Interfaces.RealInput TOut(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Measured outside air temperature"
annotation (Placement(
transformation(extent={{-120,-60},{-100,-40}})));
transformation(extent={{-160,-60},{-140,-40}}), iconTransformation(
extent={{-120,-60},{-100,-40}})));
Modelica.Blocks.Interfaces.BooleanInput cooSta "Cooling status"
annotation (Placement(transformation(extent={{-120,-90},{-100,-70}})));
annotation (Placement(transformation(extent={{-160,-90},{-140,-70}}),
iconTransformation(extent={{-120,-90},{-100,-70}})));
Modelica.Blocks.Interfaces.RealInput TRet(
final unit="K",
displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Return air temperature"
annotation (Placement(transformation(extent={{-120,10},{-100,30}})));
annotation (Placement(transformation(extent={{-160,10},{-140,30}}),
iconTransformation(extent={{-120,10},{-100,30}})));
Modelica.Blocks.Interfaces.RealInput minOAFra(
final min = 0,
final max = 1,
final unit="1")
"Minimum outside air fraction"
annotation (Placement(transformation(extent={{-120,-30},{-100,-10}})));
annotation (Placement(transformation(extent={{-160,-30},{-140,-10}}),
iconTransformation(extent={{-120,-30},{-100,-10}})));
Modelica.Blocks.Interfaces.RealOutput yOutAirFra(
final unit="1")
"Control signal for outside air fraction"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
annotation (Placement(transformation(extent={{140,-10},{160,10}}),
iconTransformation(extent={{100,-10},{120,10}})));

Modelica.Blocks.Nonlinear.VariableLimiter Limiter(
final strict=true)
"Signal limiter"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
Modelica.Blocks.Sources.Constant const(
final k=1)
"Constant output signal with value 1"
annotation (Placement(transformation(extent={{20,60},{40,80}})));
annotation (Placement(transformation(extent={{60,60},{80,80}})));
Modelica.Blocks.Logical.Switch switch1 "Switch to select control output"
annotation (Placement(transformation(extent={{20,10},{40,30}})));
annotation (Placement(transformation(extent={{60,10},{80,30}})));
Modelica.Blocks.MathBoolean.And and1(
final nu=3) "Logical and"
annotation (Placement(transformation(extent={{20,-60},{40,-40}})));
annotation (Placement(transformation(extent={{-30,-40},{-10,-20}})));
Controls.Continuous.LimPID con(
final controllerType=controllerTypeEco,
final k=kEco,
Expand All @@ -84,91 +91,101 @@ model ControllerEconomizer "Controller for economizer"
final yMax=1,
final yMin=0)
"Controller"
annotation (Placement(transformation(extent={{-90,70},{-70,90}})));
annotation (Placement(transformation(extent={{-130,70},{-110,90}})));
Modelica.Blocks.Math.Feedback feedback "Control error"
annotation (Placement(transformation(extent={{-80,-40},{-60,-20}})));
annotation (Placement(transformation(extent={{-120,-40},{-100,-20}})));
Modelica.Blocks.Math.Feedback feedback1
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
annotation (Placement(transformation(extent={{-120,20},{-100,40}})));
Controls.OBC.CDL.Reals.Hysteresis hysChiPla(
final uLow=0.95,
final uHigh=0.98)
"Hysteresis with delay to switch on cooling"
annotation (Placement(transformation(extent={{60,-60},{80,-40}})));
annotation (Placement(transformation(extent={{100,-60},{120,-40}})));
Modelica.Blocks.Logical.Or or1 "Saturated ecnomizer or no economizer"
annotation (Placement(transformation(extent={{70,-90},{90,-70}})));
annotation (Placement(transformation(extent={{110,-90},{130,-70}})));
Modelica.Blocks.Interfaces.BooleanOutput yCoiSta "Cooling coil status"
annotation (Placement(transformation(extent={{100,-90},{120,-70}})));
annotation (Placement(transformation(extent={{140,-90},{160,-70}}),
iconTransformation(extent={{100,-90},{120,-70}})));
Modelica.Blocks.Logical.Not not1 "No economizer"
annotation (Placement(transformation(extent={{40,-100},{60,-80}})));
annotation (Placement(transformation(extent={{60,-90},{80,-70}})));

Controls.OBC.CDL.Reals.Hysteresis hysCooPot(
final uLow=0,
final uHigh=0.5)
"Hysteresis with delay to check for cooling potential of outside air"
annotation (Placement(transformation(extent={{-54,20},{-34,40}})));
annotation (Placement(transformation(extent={{-94,20},{-74,40}})));
Controls.OBC.CDL.Logical.TrueFalseHold truFalHolCooPot(
final trueHoldDuration=60*15)
"True/false hold for cooling potential"
annotation (Placement(transformation(extent={{-26,20},{-6,40}})));
annotation (Placement(transformation(extent={{-66,20},{-46,40}})));
Controls.OBC.CDL.Logical.TrueFalseHold truFalHolTMix(
final trueHoldDuration=60*15)
"True/false hold for mixing temperature"
annotation (Placement(transformation(extent={{-24,-40},{-4,-20}})));
annotation (Placement(transformation(extent={{-64,-40},{-44,-20}})));
Controls.OBC.CDL.Reals.Hysteresis hysTMix(
final uLow=-0.5,
final uHigh=0.5)
"Hysteresis with delay for mixed air temperature"
annotation (Placement(transformation(extent={{-52,-40},{-32,-20}})));
annotation (Placement(transformation(extent={{-92,-40},{-72,-20}})));
protected
Controls.OBC.CDL.Logical.Pre pre1
"Use left-limit of signal to break algebraic loop"
annotation (Placement(transformation(extent={{10,-40},{30,-20}})));
equation
connect(Limiter.limit2, minOAFra) annotation (Line(points={{58,-8},{-20,-8},{
-20,-8},{-94,-8},{-94,-20},{-110,-20},{-110,-20}},
color={0,0,127}));
connect(const.y, Limiter.limit1) annotation (Line(points={{41,70},{50,70},{50,
8},{58,8}}, color={0,0,127}));
connect(minOAFra, switch1.u3) annotation (Line(points={{-110,-20},{-94,-20},{
-94,12},{18,12}}, color={0,0,127}));
connect(switch1.y, Limiter.u) annotation (Line(points={{41,20},{46,20},{46,0},
{58,0}}, color={0,0,127}));
connect(and1.y, switch1.u2) annotation (Line(points={{41.5,-50},{48,-50},{48,
-6},{10,-6},{10,20},{18,20}},
color={255,0,255}));
connect(con.u_s, TMixSet) annotation (Line(points={{-92,80},{-92,80},{-110,80}}, color={0,0,127}));
connect(TMix, con.u_m) annotation (Line(points={{-110,50},{-80,50},{-80,68}}, color={0,0,127}));
connect(con.y, switch1.u1) annotation (Line(points={{-69,80},{12,80},{12,28},
{18,28}}, color={0,0,127}));
connect(TOut, feedback.u2) annotation (Line(points={{-110,-50},{-70,-50},{-70,
-38}}, color={0,0,127}));
connect(feedback.u1, TMix) annotation (Line(points={{-78,-30},{-90,-30},{-90,50},
{-110,50}}, color={0,0,127}));
connect(Limiter.y, yOutAirFra) annotation (Line(points={{81,0},{110,0}}, color={0,0,127}));
connect(feedback1.u1, TRet) annotation (Line(points={{-78,30},{-96,30},{-96,
20},{-110,20}}, color={0,0,127}));
connect(feedback1.u2,TOut) annotation (Line(points={{-70,22},{-70,16},{-86,
16},{-86,-50},{-110,-50}}, color={0,0,127}));
connect(Limiter.y, hysChiPla.u) annotation (Line(points={{81,0},{90,0},{90,
-20},{52,-20},{52,-50},{58,-50}}, color={0,0,127}));
connect(or1.y, yCoiSta) annotation (Line(points={{91,-80},{110,-80}}, color={255,0,255}));
connect(not1.y, or1.u2) annotation (Line(points={{61,-90},{64,-90},{64,-88},{
68,-88}}, color={255,0,255}));
connect(and1.y, not1.u) annotation (Line(points={{41.5,-50},{48,-50},{48,-70},
{30,-70},{30,-90},{38,-90}}, color={255,0,255}));
connect(hysChiPla.y, or1.u1) annotation (Line(points={{82,-50},{88,-50},{88,
-64},{62,-64},{62,-80},{68,-80}}, color={255,0,255}));
connect(Limiter.limit2, minOAFra) annotation (Line(points={{98,-8},{-94,-8},{
-94,-20},{-150,-20}}, color={0,0,127}));
connect(const.y, Limiter.limit1) annotation (Line(points={{81,70},{90,70},{90,
8},{98,8}}, color={0,0,127}));
connect(minOAFra, switch1.u3) annotation (Line(points={{-150,-20},{-134,-20},
{-134,12},{58,12}},color={0,0,127}));
connect(switch1.y, Limiter.u) annotation (Line(points={{81,20},{86,20},{86,0},
{98,0}}, color={0,0,127}));
connect(con.u_s, TMixSet) annotation (Line(points={{-132,80},{-150,80}}, color={0,0,127}));
connect(TMix, con.u_m) annotation (Line(points={{-150,50},{-120,50},{-120,
68}}, color={0,0,127}));
connect(con.y, switch1.u1) annotation (Line(points={{-109,80},{20,80},{20,28},
{58,28}}, color={0,0,127}));
connect(TOut, feedback.u2) annotation (Line(points={{-150,-50},{-110,-50},{
-110,-38}},
color={0,0,127}));
connect(feedback.u1, TMix) annotation (Line(points={{-118,-30},{-130,-30},{
-130,50},{-150,50}},
color={0,0,127}));
connect(Limiter.y, yOutAirFra) annotation (Line(points={{121,0},{150,0}},color={0,0,127}));
connect(feedback1.u1, TRet) annotation (Line(points={{-118,30},{-136,30},{
-136,20},{-150,20}}, color={0,0,127}));
connect(feedback1.u2,TOut) annotation (Line(points={{-110,22},{-110,16},{
-126,16},{-126,-50},{-150,-50}}, color={0,0,127}));
connect(Limiter.y, hysChiPla.u) annotation (Line(points={{121,0},{130,0},{130,
-20},{92,-20},{92,-50},{98,-50}}, color={0,0,127}));
connect(or1.y, yCoiSta) annotation (Line(points={{131,-80},{150,-80}},color={255,0,255}));
connect(not1.y, or1.u2) annotation (Line(points={{81,-80},{90,-80},{90,-88},{
108,-88}},color={255,0,255}));
connect(hysChiPla.y, or1.u1) annotation (Line(points={{122,-50},{126,-50},{
126,-64},{100,-64},{100,-80},{108,-80}},
color={255,0,255}));

connect(feedback.y, hysTMix.u)
annotation (Line(points={{-61,-30},{-54,-30}}, color={0,0,127}));
annotation (Line(points={{-101,-30},{-94,-30}},color={0,0,127}));
connect(hysTMix.y, truFalHolTMix.u)
annotation (Line(points={{-30,-30},{-26,-30}}, color={255,0,255}));
annotation (Line(points={{-70,-30},{-66,-30}}, color={255,0,255}));
connect(feedback1.y, hysCooPot.u)
annotation (Line(points={{-61,30},{-56,30}}, color={0,0,127}));
annotation (Line(points={{-101,30},{-96,30}},color={0,0,127}));
connect(hysCooPot.y, truFalHolCooPot.u)
annotation (Line(points={{-32,30},{-28,30}}, color={255,0,255}));
connect(truFalHolCooPot.y, and1.u[1]) annotation (Line(points={{-4,30},{8,30},
{8,-45.3333},{20,-45.3333}}, color={255,0,255}));
connect(truFalHolTMix.y, and1.u[2]) annotation (Line(points={{-2,-30},{4,-30},
{4,-50},{20,-50}}, color={255,0,255}));
connect(cooSta, and1.u[3]) annotation (Line(points={{-110,-80},{-44,-80},{-44,
-54.6667},{20,-54.6667}}, color={255,0,255}));
annotation (Line(points={{-72,30},{-68,30}}, color={255,0,255}));
connect(truFalHolCooPot.y, and1.u[1]) annotation (Line(points={{-44,30},{-40,
30},{-40,-32.3333},{-30,-32.3333}},
color={255,0,255}));
connect(truFalHolTMix.y, and1.u[2]) annotation (Line(points={{-42,-30},{-30,
-30}}, color={255,0,255}));
connect(cooSta, and1.u[3]) annotation (Line(points={{-150,-80},{-38,-80},{-38,
-27.6667},{-30,-27.6667}},color={255,0,255}));
connect(and1.y, pre1.u)
annotation (Line(points={{-8.5,-30},{8,-30}}, color={255,0,255}));
connect(pre1.y, switch1.u2) annotation (Line(points={{32,-30},{40,-30},{40,20},
{58,20}}, color={255,0,255}));
connect(pre1.y, not1.u) annotation (Line(points={{32,-30},{40,-30},{40,-80},{
58,-80}}, color={255,0,255}));
annotation (
defaultComponentName="conEco",
Documentation(info="<html>
Expand All @@ -178,6 +195,12 @@ Economizer controller.
</html>", revisions="<html>
<ul>
<li>
June 26, 2024, by Antoine Gautier:<br/>
Added a <code>pre</code> block to break the algebraic loop involving the mixed air temperature.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3915\">#3915</a>.
</li>
<li>
September 30, 2020, by Michael Wetter:<br/>
Refactored implementation of hysteresis with hold, which was using a block that is now obsolete.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2134\">issue 2134</a>.
Expand All @@ -195,5 +218,6 @@ June 1, 2017, by David Blum:<br/>
First implementation.
</li>
</ul>
</html>"));
</html>"),
Diagram(coordinateSystem(extent={{-140,-100},{140,100}})));
end ControllerEconomizer;
Loading

0 comments on commit e99200b

Please sign in to comment.