Skip to content

Commit

Permalink
Remove time events in ETS model with heat recovery chiller (#4059)
Browse files Browse the repository at this point in the history
* Reduced number of time events for ETS model

For #4058

* Added pre block to break algebraic loop during initialization

This is needed for OpenModelica

* Removed duplicate connection

* Increase minimum cycle time

* Update results

---------

Co-authored-by: Antoine Gautier <[email protected]>
  • Loading branch information
mwetter and AntoineGautier authored Nov 25, 2024
1 parent ba8277f commit 32156a1
Show file tree
Hide file tree
Showing 12 changed files with 209 additions and 157 deletions.
7 changes: 7 additions & 0 deletions Buildings/DHC/ETS/Combined/ChillerBorefield.mo
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,13 @@ equation
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Reduced number of time events by replacing zero order hold with true and false hold,
and increasing the minimum cycle time.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4058\">#4058</a>.
</li>
<li>
March 27, 2024, by David Blum:<br/>
Update icon.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3606\">issue #3606</a>.
Expand Down
35 changes: 24 additions & 11 deletions Buildings/DHC/ETS/Combined/Controls/SideCold.mo
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,18 @@ model SideCold
iconTransformation(extent={{100,-20},{140,20}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea
"Convert DO to AO signal"
annotation (Placement(transformation(extent={{40,-110},{60,-90}})));
annotation (Placement(transformation(origin = {40, 0}, extent = {{80, -110}, {100, -90}})));
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(
t=0.01)
"Control signal is non zero (with 1% tolerance)"
annotation (Placement(transformation(extent={{0,-110},{20,-90}})));
Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold(
samplePeriod=60)
annotation (Placement(transformation(extent={{80,-110},{100,-90}})));
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
trueHoldDuration=300) "Hold logical signal to avoid short cycling"
annotation (Placement(transformation(origin = {40, 0}, extent = {{40, -110}, {60, -90}})));
protected
Buildings.Controls.OBC.CDL.Logical.Pre pre
"Block to avoid an algebraic loop during initialization" annotation(
Placement(transformation(origin = {50, -100}, extent = {{-10, -10}, {10, 10}})));
equation
connect(x1.y,mapFun.x1)
annotation (Line(points={{62,20},{80,20},{80,8},{98,8}},color={0,0,127}));
Expand Down Expand Up @@ -172,12 +176,6 @@ equation
annotation (Line(points={{-58,60},{0,60},{0,88},{98,88}},color={0,0,127}));
connect(uCol,greThr.u)
annotation (Line(points={{-200,0},{-160,0},{-160,-100},{-2,-100}},color={0,0,127}));
connect(greThr.y,booToRea.u)
annotation (Line(points={{22,-100},{38,-100}},color={255,0,255}));
connect(booToRea.y,zeroOrderHold.u)
annotation (Line(points={{62,-100},{78,-100}},color={0,0,127}));
connect(zeroOrderHold.y,yValIso)
annotation (Line(points={{101,-100},{160,-100},{160,0},{200,0}},color={0,0,127}));
connect(mapFunTChiSupSet.y,ramLimHea.u)
annotation (Line(points={{122,80},{138,80}},color={0,0,127}));
connect(zer.y,max1.u2)
Expand All @@ -188,12 +186,27 @@ equation
annotation (Line(points={{-128,-20},{-122,-20}}, color={0,0,127}));
connect(gai.y, addPar.u)
annotation (Line(points={{-98,-20},{-82,-20}}, color={0,0,127}));
connect(truFalHol.y, booToRea.u)
annotation (Line(points={{102,-100},{118,-100}}, color={255,0,255}));
connect(booToRea.y, yValIso) annotation (Line(points={{142,-100},{160,-100},{
160,0},{200,0}}, color={0,0,127}));
connect(greThr.y, pre.u) annotation(
Line(points = {{22, -100}, {38, -100}}, color = {255, 0, 255}));
connect(pre.y, truFalHol.u) annotation(
Line(points = {{62, -100}, {78, -100}}, color = {255, 0, 255}));
annotation (
defaultComponentName="conCol",
Documentation(
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Reduced number of time events by replacing zero order hold with true and false hold,
and increasing the minimum cycle time.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4058\">#4058</a>.
</li>
<li>
July 31, 2020, by Antoine Gautier:<br/>
First implementation.
</li>
Expand Down Expand Up @@ -243,7 +256,7 @@ Control signal for the evaporator loop isolation valve <code>yIsoAmb</code><br/>
The valve is commanded to be fully open whenever the cold rejection control signal
is greater than zero.
The command signal is held for 60s to avoid short cycling.
The command signal is held for 5&nbsp;min to avoid short cycling.
</li>
</ul>
</html>"),
Expand Down
43 changes: 28 additions & 15 deletions Buildings/DHC/ETS/Combined/Controls/SideHot.mo
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ block SideHot
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(
final t=0.01)
"Control signal is non zero (with 1% tolerance)"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
annotation (Placement(transformation(origin = {-40, 0}, extent = {{40, -10}, {60, 10}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea
"Convert DO to AO signal"
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
annotation (Placement(transformation(extent={{120,-10},{140,10}})));
PIDWithEnable conHeaRej(
final k=k,
final Ti=Ti,
Expand Down Expand Up @@ -126,9 +126,6 @@ block SideHot
p=dTDea)
"Add dead band"
annotation (Placement(transformation(extent={{-130,-10},{-110,10}})));
Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold(
samplePeriod=60)
annotation (Placement(transformation(extent={{120,-10},{140,10}})));
Buildings.Controls.OBC.CDL.Reals.AddParameter addLoc(
p=dTLoc)
"Add temperature difference for lockout"
Expand All @@ -137,6 +134,13 @@ block SideHot
h=0.1)
"Check if temperature is below cold rejection lockout"
annotation (Placement(transformation(extent={{-90,50},{-70,70}})));
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
trueHoldDuration=300) "Hold logical signal to avoid short cycling"
annotation (Placement(transformation(extent={{80,-10},{100,10}})));
protected
Buildings.Controls.OBC.CDL.Logical.Pre pre
"Block to avoid algebraic loop during initialization" annotation(
Placement(transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}})));
equation
connect(mapFun.y,yAmb)
annotation (Line(points={{122,60},{200,60}},color={0,0,127}));
Expand All @@ -145,7 +149,7 @@ equation
connect(TTop,conColRej.u_m)
annotation (Line(points={{-200,-40},{-160,-40},{-160,-58},{0,-58},{0,-52}},color={0,0,127}));
connect(conHeaRej.y,greThr.u)
annotation (Line(points={{-68,0},{38,0}},color={0,0,127}));
annotation (Line(points={{-68,0},{-2,0}},color={0,0,127}));
connect(x1.y,mapFun.x1)
annotation (Line(points={{82,80},{90,80},{90,68},{98,68}},color={0,0,127}));
connect(conHeaRej.y,rep.u)
Expand Down Expand Up @@ -174,30 +178,39 @@ equation
annotation (Line(points={{-200,0},{-132,0}},color={0,0,127}));
connect(addDea.y,conHeaRej.u_s)
annotation (Line(points={{-108,0},{-92,0}},color={0,0,127}));
connect(greThr.y,booToRea.u)
annotation (Line(points={{62,0},{78,0}},color={255,0,255}));
connect(booToRea.y,zeroOrderHold.u)
annotation (Line(points={{102,0},{118,0}},color={0,0,127}));
connect(zeroOrderHold.y,yValIso)
annotation (Line(points={{141,0},{200,0}},color={0,0,127}));
connect(TSet,addLoc.u)
annotation (Line(points={{-200,0},{-140,0},{-140,40},{-132,40}},color={0,0,127}));
connect(TTop,isBelLoc.u1)
annotation (Line(points={{-200,-40},{-160,-40},{-160,60},{-92,60}},color={0,0,127}));
connect(addLoc.y,isBelLoc.u2)
annotation (Line(points={{-108,40},{-100,40},{-100,52},{-92,52}},color={0,0,127}));
connect(uHeaCoo,mulAnd.u[1])
annotation (Line(points={{-200,100},{-56,100},{-56,-75.3333},{-42,-75.3333}},color={255,0,255}));
annotation (Line(points={{-200,100},{-56,100},{-56,-82.3333},{-42,-82.3333}},color={255,0,255}));
connect(isValIsoConClo.y,mulAnd.u[2])
annotation (Line(points={{-138,-80},{-42,-80}},color={255,0,255}));
connect(isBelLoc.y,mulAnd.u[3])
annotation (Line(points={{-68,60},{-60,60},{-60,-84.6667},{-42,-84.6667}},color={255,0,255}));
annotation (Line(points={{-68,60},{-60,60},{-60,-77.6667},{-42,-77.6667}},color={255,0,255}));
connect(truFalHol.y, booToRea.u)
annotation (Line(points={{102,0},{118,0}}, color={255,0,255}));
connect(booToRea.y, yValIso)
annotation (Line(points={{142,0},{200,0}}, color={0,0,127}));
connect(greThr.y, pre.u) annotation(
Line(points = {{22, 0}, {38, 0}}, color = {255, 0, 255}));
connect(pre.y, truFalHol.u) annotation(
Line(points = {{62, 0}, {78, 0}}, color = {255, 0, 255}));
annotation (
defaultComponentName="conHot",
Documentation(
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Reduced number of time events by replacing zero order hold with true and false hold,
and increasing the minimum cycle time.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4058\">#4058</a>.
</li>
<li>
July 31, 2020, by Antoine Gautier:<br/>
First implementation.
</li>
Expand Down Expand Up @@ -260,7 +273,7 @@ Control signal for the condenser loop isolation valve <code>yIsoAmb</code><br/>
The valve is commanded to be fully open whenever the controller
for heat rejection yields an output signal greater than zero.
The command signal is held for 60s to avoid short cycling.
The command signal is held for 5&nbsp;min to avoid short cycling.
</li>
</ul>
</html>"),
Expand Down
6 changes: 4 additions & 2 deletions Buildings/DHC/ETS/Combined/Examples/ChillerOnly.mo
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ equation
annotation (Line(points={{-266,60},{-252,60}},color={0,0,127}));
connect(loaNorCoo.y,loaCooNor.u)
annotation (Line(points={{286,60},{272,60}},color={0,0,127}));
connect(TDisWatSup.y[1],disWat.T_in)
annotation (Line(points={{-309,-140},{-140,-140},{-140,-136},{-122,-136}},color={0,0,127}));
annotation (
__Dymola_Commands(
file="modelica://Buildings/Resources/Scripts/Dymola/DHC/ETS/Combined/Examples/ChillerOnly.mos" "Simulate and plot"),
Expand All @@ -66,6 +64,10 @@ equation
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Removed duplicate connection.
</li>
<li>
July 31, 2020, by Antoine Gautier:<br/>
First implementation.
</li>
Expand Down
6 changes: 4 additions & 2 deletions Buildings/DHC/ETS/Combined/Validation/ChillerOnly.mo
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ model ChillerOnly
"District water supply temperature"
annotation (Placement(transformation(extent={{-330,-150},{-310,-130}})));
equation
connect(TDisWatSup.y[1],disWat.T_in)
annotation (Line(points={{-309,-140},{-140,-140},{-140,-136},{-122,-136}},color={0,0,127}));
connect(loa.y[2],heaLoaNor.u)
annotation (Line(points={{-309,160},{-300,160},{-300,60},{-252,60}},color={0,0,127}));
connect(loa.y[1],loaCooNor.u)
Expand All @@ -33,6 +31,10 @@ equation
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Removed duplicate connection.
</li>
<li>
July 31, 2020, by Antoine Gautier:<br/>
First implementation.
</li>
Expand Down
6 changes: 4 additions & 2 deletions Buildings/DHC/ETS/Combined/Validation/ChillerWSE.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ model ChillerWSE
"District water supply temperature"
annotation (Placement(transformation(extent={{-330,-150},{-310,-130}})));
equation
connect(TDisWatSup.y[1],disWat.T_in)
annotation (Line(points={{-309,-140},{-140,-140},{-140,-136},{-122,-136}},color={0,0,127}));
connect(loa.y[2],heaLoaNor.u)
annotation (Line(points={{-309,160},{-300,160},{-300,60},{-252,60}},color={0,0,127}));
connect(loa.y[1],loaCooNor.u)
Expand All @@ -36,6 +34,10 @@ equation
revisions="<html>
<ul>
<li>
November 22, 2024, by Michael Wetter:<br/>
Removed duplicate connection.
</li>
<li>
July 31, 2020, by Antoine Gautier:<br/>
First implementation.
</li>
Expand Down
Loading

0 comments on commit 32156a1

Please sign in to comment.