Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue3989 pump control #3991

Merged
merged 13 commits into from
Oct 4, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ model ConstantSpeedPumpStage "Staging control for constant speed pumps"

Modelica.Blocks.Interfaces.IntegerInput cooMod
"Cooling mode - 0:off, 1: free cooling mode; 2: partially mechanical cooling; 3: fully mechanical cooling"
annotation (Placement(transformation(extent={{-140,30},{-100,70}})));
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-140,40},{-100,80}})));
Modelica.Blocks.Interfaces.BooleanInput on
"On signal of the plant"
annotation (Placement(transformation(extent={{-140,-40},{-100,0}}),
iconTransformation(extent={{-140,-20},{-100,20}})));
Modelica.Blocks.Interfaces.IntegerInput numOnChi
"The number of running chillers"
annotation (Placement(transformation(extent={{-140,-70},{-100,-30}})));
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}),
iconTransformation(extent={{-140,-80},{-100,-40}})));
Modelica.Blocks.Interfaces.RealOutput y[2] "On/off signal - 0: off; 1: on"
annotation (Placement(transformation(extent={{100,-10},{120,10}})));
annotation (Placement(transformation(extent={{100,30},{120,50}}),
iconTransformation(extent={{100,-10},{120,10}})));

Modelica.StateGraph.Transition con1(
enableTimer=true,
Expand All @@ -33,13 +40,13 @@ model ConstantSpeedPumpStage "Staging control for constant speed pumps"
rotation=-90,
origin={-40,10})));
Modelica.StateGraph.InitialStep off(nIn=1, nOut=1)
"Free cooling mode"
"Free cooling mode"
annotation (Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=-90,
origin={-40,70})));
Modelica.StateGraph.StepWithSignal twoOn(nIn=1, nOut=1)
"Two chillers are commanded on"
"Two chillers are commanded on"
annotation (Placement(transformation(
extent={{-10,10},{10,-10}},
rotation=-90,
Expand Down Expand Up @@ -80,19 +87,24 @@ model ConstantSpeedPumpStage "Staging control for constant speed pumps"
inner Modelica.StateGraph.StateGraphRoot stateGraphRoot
annotation (Placement(transformation(extent={{60,60},{80,80}})));
Modelica.Blocks.Tables.CombiTable1Ds combiTable1Ds(table=[0,0,0; 1,1,0; 2,1,1])
annotation (Placement(transformation(extent={{70,-10},{90,10}})));

annotation (Placement(transformation(extent={{70,30},{90,50}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt(
final integerTrue=1,
final integerFalse=0)
annotation (Placement(transformation(extent={{20,-50},{40,-30}})));
annotation (Placement(transformation(extent={{20,-60},{40,-40}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1(
final integerFalse=0, final integerTrue=2)
annotation (Placement(transformation(extent={{20,-90},{40,-70}})));
Buildings.Controls.OBC.CDL.Integers.Add addInt
annotation (Placement(transformation(extent={{60,-70},{80,-50}})));
annotation (Placement(transformation(extent={{60,-80},{80,-60}})));
Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
annotation (Placement(transformation(extent={{40,30},{60,50}})));
Buildings.Controls.OBC.CDL.Integers.Switch intSwi
"Disable pumps when the plant is disabled"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
Buildings.Controls.OBC.CDL.Integers.Sources.Constant zer(final k=0)
"Constant zero"
annotation (Placement(transformation(extent={{20,-30},{40,-10}})));

equation
connect(off.outPort[1], con1.inPort)
Expand All @@ -102,12 +114,12 @@ equation
pattern=LinePattern.Dash));
connect(con1.outPort, oneOn.inPort[1])
annotation (Line(
points={{-40,38.5},{-40,26},{-40.5,26},{-40.5,21}},
points={{-40,38.5},{-40,26},{-39.75,26},{-39.75,21}},
color={0,0,0},
pattern=LinePattern.Dash));
connect(con2.inPort, oneOn.outPort[1])
annotation (Line(
points={{-40,-36},{-40,-10},{-40.25,-10},{-40.25,-0.5}},
points={{-40,-36},{-40,-10},{-39.875,-10},{-39.875,-0.5}},
color={0,0,0},
pattern=LinePattern.Dash));
connect(con2.outPort, twoOn.inPort[1])
Expand All @@ -127,30 +139,36 @@ equation
pattern=LinePattern.Dash));
connect(con3.outPort, oneOn.inPort[2])
annotation (Line(
points={{-10,-38.5},{-10,26},{-39.5,26},{-39.5,21}},
points={{-10,-38.5},{-10,26},{-40.25,26},{-40.25,21}},
color={0,0,0},
pattern=LinePattern.Dash));
connect(con4.inPort, oneOn.outPort[2])
annotation (Line(
points={{-8,66},{-8,-10},{-39.75,-10},{-39.75,-0.5}},
points={{-8,66},{-8,-10},{-40.125,-10},{-40.125,-0.5}},
color={0,0,0},
pattern=LinePattern.Dash));
connect(combiTable1Ds.y, y)
annotation (Line(points={{91,0},{91,0},{110,0}},
color={0,0,127}));
connect(oneOn.active, booToInt.u) annotation (Line(points={{-29,10},{12,10},{
12,-40},{18,-40}}, color={255,0,255}));
annotation (Line(points={{91,40},{110,40}}, color={0,0,127}));
connect(oneOn.active, booToInt.u) annotation (Line(points={{-29,10},{12,10},{12,
-50},{18,-50}}, color={255,0,255}));
connect(twoOn.active, booToInt1.u)
annotation (Line(points={{-29,-80},{18,-80}}, color={255,0,255}));
connect(booToInt.y, addInt.u1) annotation (Line(points={{41,-40},{48,-40},{48,
-54},{58,-54}}, color={255,127,0}));
connect(booToInt1.y, addInt.u2) annotation (Line(points={{41,-80},{48,-80},{
48,-66},{58,-66}}, color={255,127,0}));
annotation (Line(points={{-29,-80},{18,-80}}, color={255,0,255}));
connect(booToInt.y, addInt.u1) annotation (Line(points={{42,-50},{48,-50},{48,
-64},{58,-64}}, color={255,127,0}));
connect(booToInt1.y, addInt.u2) annotation (Line(points={{42,-80},{48,-80},{48,
-76},{58,-76}}, color={255,127,0}));
connect(intToRea.y, combiTable1Ds.u)
annotation (Line(points={{61,0},{68,0}}, color={0,0,127}));
connect(addInt.y, intToRea.u) annotation (Line(points={{81,-60},{88,-60},{88,
-20},{30,-20},{30,0},{38,0}}, color={255,127,0}));
annotation ( Documentation(info="<html>
annotation (Line(points={{62,40},{68,40}}, color={0,0,127}));
connect(on, intSwi.u2) annotation (Line(points={{-120,-20},{0,-20},{0,0},{58,0}},
color={255,0,255}));
connect(addInt.y, intSwi.u1) annotation (Line(points={{82,-70},{90,-70},{90,-30},
{48,-30},{48,8},{58,8}}, color={255,127,0}));
connect(zer.y, intSwi.u3) annotation (Line(points={{42,-20},{54,-20},{54,-8},{
58,-8}}, color={255,127,0}));
connect(intSwi.y, intToRea.u) annotation (Line(points={{82,0},{90,0},{90,20},{
30,20},{30,40},{38,40}}, color={255,127,0}));

annotation (Documentation(info="<html>
<p>
This model describes a simple staging control for two constant-speed pumps in
a chilled water plant with two chillers and a waterside economizer (WSE). The staging sequence
Expand All @@ -168,9 +186,15 @@ equals to the number of running chillers.
</html>", revisions="<html>
<ul>
<li>
September 3, 2024, by Jianjun Hu:<br/>
Added plant on signal to pumps control.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
September 11, 2017, by Michael Wetter:<br/>
Revised switch that selects the operation mode for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/921\">issue 921</a>
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/921\">issue 921</a>.
</li>
<li>
September 2, 2017, by Michael Wetter:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@ model ConstantSpeedPumpStage
conSpePumSta(
tWai=30)
"Staging controller for constant speed pumps"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
Modelica.Blocks.Sources.IntegerTable cooMod(
table=[0,0; 360,1;
720,2; 1080,3])
"Cooling mode"
annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
annotation (Placement(transformation(extent={{-80,40},{-60,60}})));
Modelica.Blocks.Sources.IntegerTable chiNumOn(
table=[0,0; 360,1; 540,2; 720,1;
900,2; 1080,1; 1260,2; 1440,1])
"The number of running chillers"
annotation (Placement(transformation(extent={{-60,-40},{-40,-20}})));
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
Buildings.Controls.OBC.CDL.Integers.GreaterThreshold plaOn
"Check if the plant is on"
annotation (Placement(transformation(extent={{0,-10},{20,10}})));
equation
connect(cooMod.y, conSpePumSta.cooMod)
annotation (Line(points={{-39,50},{-20,50},{-20,5},{-12,5}},
annotation (Line(points={{-59,50},{40,50},{40,6},{58,6}},
color={255,127,0}));
connect(chiNumOn.y,conSpePumSta.numOnChi)
annotation (Line(points={{-39,-30},{-20,-30},{-20,-5},{-12,-5}},
annotation (Line(points={{-59,-50},{40,-50},{40,-6},{58,-6}},
color={255,127,0}));
connect(plaOn.y, conSpePumSta.on)
annotation (Line(points={{22,0},{58,0}}, color={255,0,255}));
connect(cooMod.y, plaOn.u) annotation (Line(points={{-59,50},{-20,50},{-20,0},
{-2,0}}, color={255,127,0}));
annotation ( __Dymola_Commands(file=
"modelica://Buildings/Resources/Scripts/Dymola/Applications/DataCenters/ChillerCooled/Controls/Validation/ConstantSpeedPumpStage.mos"
"Simulate and plot"),
Expand All @@ -39,6 +46,12 @@ Buildings.Applications.DataCenters.ChillerCooled.Controls.ConstantSpeedPumpStage
</html>", revisions="<html>
<ul>
<li>
September 3, 2024, by Jianjun Hu:<br/>
Added plant on signal to pumps control.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
August 25, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ The signal filter is used to smoothe the on/off signal for the valves.
revisions="<html>
<ul>
<li>
September 4, 2024, by Jianjun Hu:<br/>
Added input filter to the isolation valve 2.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
August 26, 2024, by Michael Wetter:<br/>
Implemented linear actuator travel dynamics.<br/>
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3965\">Buildings, #3965</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ equation
thickness=0.5));
connect(chiNumOn.y, CWPumCon.numOnChi)
annotation (Line(
points={{-236.9,65},{-174,65}},
points={{-236.9,65},{-206,65},{-206,64},{-174,64}},
color={255,127,0}));
connect(ahu.port_a2, roo.airPorts[1])
annotation (Line(
Expand Down Expand Up @@ -551,6 +551,8 @@ equation
{-126,226},{-126,248},{-122,248}},color={0,0,127}));
connect(plaOn.y, varSpeCon.on) annotation (Line(points={{-138,240},{-136,240},
{-136,210},{-190,210},{-190,4},{-170,4}}, color={255,0,255}));
connect(plaOn.y, CWPumCon.on) annotation (Line(points={{-138,240},{-136,240},
mwetter marked this conversation as resolved.
Show resolved Hide resolved
{-136,210},{-190,210},{-190,70},{-174,70}}, color={255,0,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-360,-200},{160,260}})),
Documentation(info="<html>
Expand All @@ -567,6 +569,12 @@ Taylor, S. T. (2014). How to design &amp; control waterside economizers. ASHRAE
</html>", revisions="<html>
<ul>
<li>
September 3, 2024, by Jianjun Hu:<br/>
Added plant on signal to control the pump speed.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
January 2, 2022, by Kathryn Hinkelman:<br/>
Passed the <code>plaOn</code> signal to the chilled water pump control
to turn them off when the plant is off.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ equation
color={0,0,127}));
connect(PriPumCon.numOnChi, chiNumOn.y)
annotation (Line(
points={{-174,27},{-182,27},{-182,65},{-236.9,65}},
points={{-174,26},{-182,26},{-182,65},{-236.9,65}},
color={255,127,0}));
connect(PriPumCon.cooMod, cooModCon.y)
annotation (Line(
points={{-174,37},{-174,36},{-182,36},{-182,110},{-187,110}},
points={{-174,38},{-182,38},{-182,110},{-187,110}},
color={255,127,0}));
connect(cooTowSpeCon.cooMod, cooModCon.y)
annotation (Line(
Expand All @@ -155,7 +155,7 @@ equation
color={255,127,0}));
connect(CWPumCon.cooMod, cooModCon.y)
annotation (Line(
points={{-174,75},{-174,74},{-182,74},{-182,110},{-187,110}},
points={{-174,76},{-182,76},{-182,110},{-187,110}},
color={255,127,0}));
connect(cooModCon.y, sigCha.u)
annotation (Line(
Expand All @@ -172,10 +172,13 @@ equation
connect(priPumSpe.y, chiWSE.yPum) annotation (Line(points={{-83,32},{-20,32},
{-20,26.5},{-1.5,26.5}}, color={0,0,127}));
connect(weaBus.TWetBul, cooModCon.TWetBul) annotation (Line(
points={{-328,-20},{-340,-20},{-340,200},{-218,200},{-218,114},{-210,114}},
points={{-327.95,-19.95},{-340,-19.95},{-340,200},{-218,200},{-218,114},{
-210,114}},
color={255,204,51},
thickness=0.5));

connect(plaOn.y, PriPumCon.on) annotation (Line(points={{-138,240},{-136,240},
{-136,210},{-190,210},{-190,32},{-174,32}}, color={255,0,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-360,-200},{320,260}})),
__Dymola_Commands(file=
Expand Down Expand Up @@ -270,6 +273,12 @@ differential pressure reset control are not implemented in this example.
</html>", revisions="<html>
<ul>
<li>
September 3, 2024, by Jianjun Hu:<br/>
Added plant on signal to pumps control.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
November 16, 2022, by Michael Wetter:<br/>
Corrected control to avoid cooling tower pumps to operate when plant is off, because
shut-off valves are off when plant is off.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ model NonIntegratedPrimarySecondaryEconomizer
annotation (Placement(transformation(extent={{66,-38},{46,-18}})));
equation
for i in 1:numChi loop

connect(chiOn[i].y, chiWSE.on[i])
annotation (Line(
points={{-109,140},{-80,140},{-80,37.6},{-1.6,37.6}},
Expand Down Expand Up @@ -157,11 +156,11 @@ equation
color={255,127,0}));
connect(priPumCon.cooMod, cooModCon.y)
annotation (Line(
points={{-174,35},{-186,35},{-186,110},{-191,110}},
points={{-174,36},{-186,36},{-186,110},{-191,110}},
color={255,127,0}));
connect(cooModCon.y, CWPumCon.cooMod)
annotation (Line(
points={{-191,110},{-186,110},{-186,75},{-174,75}},
points={{-191,110},{-186,110},{-186,76},{-174,76}},
color={255,127,0}));
connect(chiStaCon.cooMod, cooModCon.y)
annotation (Line(
Expand All @@ -176,17 +175,20 @@ equation
points={{-191,110},{-188,110},{-188,204},{162,204},{162,160},{178,160}},
color={255,127,0}));
connect(chiNumOn.y, priPumCon.numOnChi) annotation (Line(points={{-236.9,65},
{-188,65},{-188,25},{-174,25}}, color={255,127,0}));
{-188,65},{-188,24},{-174,24}}, color={255,127,0}));
connect(cooModCon.y, cooTowSpeCon.cooMod) annotation (Line(points={{-191,110},
{-186,110},{-186,182.444},{-172,182.444}}, color={255,127,0}));
connect(weaBus.TWetBul, cooModCon.TWetBul) annotation (Line(
points={{-328,-20},{-340,-20},{-340,200},{-224,200},{-224,114},{-214,114}},
points={{-327.95,-19.95},{-340,-19.95},{-340,200},{-224,200},{-224,114},{
-214,114}},
color={255,204,51},
thickness=0.5));
connect(pumSpeSig.y, secPum.u)
annotation (Line(points={{-99,-10},{-44,-10},{-44,-26}}, color={0,0,127}));
connect(priPumCon.y, priPum.u) annotation (Line(points={{-151,30},{-16,30},{-16,
12},{74,12},{74,4},{62,4}}, color={0,0,127}));
connect(plaOn.y, priPumCon.on) annotation (Line(points={{-138,240},{-136,240},
{-136,210},{-190,210},{-190,30},{-174,30}}, color={255,0,255}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-360,-200},{320,260}})),
__Dymola_Commands(file=
Expand Down Expand Up @@ -275,6 +277,12 @@ are not implemented in this example.
</html>", revisions="<html>
<ul>
<li>
September 3, 2024, by Jianjun Hu:<br/>
Added plant on signal to control the pump speed.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3989\">issue 3989</a>.
</li>
<li>
November 16, 2022, by Michael Wetter:<br/>
Corrected control to avoid cooling tower pumps to operate when plant is off, because
shut-off valves are off when plant is off.
Expand Down
Loading
Loading