diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/ChilledWater/Controller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/ChilledWater/Controller.mo index 29b9444b7e4..30bfd3b5a34 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/ChilledWater/Controller.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/ChilledWater/Controller.mo @@ -102,7 +102,7 @@ block Controller final unit=fill("Pa", nSen), final quantity=fill("PressureDifference",nSen)) "Chilled water differential static pressure setpoint" - annotation (Placement(transformation(extent={{-320,-260},{-280,-220}}), + annotation (Placement(transformation(extent={{-320,-270},{-280,-230}}), iconTransformation(extent={{-140,-120},{-100,-80}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yLea "Lead pump status setpoint" @@ -155,7 +155,7 @@ block Controller final Ti=Ti, final Td=Td) if have_locSen "Chilled water pump speed control with local DP sensor" - annotation (Placement(transformation(extent={{-60,-210},{-40,-190}}))); + annotation (Placement(transformation(extent={{0,-220},{20,-200}}))); Buildings.Controls.OBC.ASHRAE.PrimarySystem.ChillerPlant.Pumps.ChilledWater.Subsequences.Speed_primary_remoteDp pumSpeRemDp( final nSen=nSen, @@ -201,7 +201,7 @@ protected Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicator intRep2( final nout=nPum) if have_heaPum "Replicate integer input" - annotation (Placement(transformation(extent={{0,-110},{20,-90}}))); + annotation (Placement(transformation(extent={{20,-100},{40,-80}}))); Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep2( final nout=nPum) if have_heaPum "Replicate boolean input" @@ -237,10 +237,10 @@ protected Buildings.Controls.OBC.CDL.Routing.RealExtractor lasLagPum( final nin=nPum) if have_heaPum "Last lag pump" - annotation (Placement(transformation(extent={{-80,-110},{-60,-90}}))); + annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt2 if have_heaPum "Convert real input to integer output" - annotation (Placement(transformation(extent={{-40,-110},{-20,-90}}))); + annotation (Placement(transformation(extent={{-50,-100},{-30,-80}}))); Buildings.Controls.OBC.CDL.Integers.Equal intEqu3[nPum] if have_heaPum "Check next lag pump" annotation (Placement(transformation(extent={{60,-100},{80,-80}}))); @@ -251,7 +251,7 @@ protected Buildings.Controls.OBC.CDL.Integers.MultiSum mulSumInt( final nin=nPum) if have_heaPum "Sum of integer inputs" - annotation (Placement(transformation(extent={{-180,-130},{-160,-110}}))); + annotation (Placement(transformation(extent={{-200,-130},{-180,-110}}))); Buildings.Controls.OBC.CDL.Integers.Add addInt if have_heaPum "Integer add" annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); @@ -314,6 +314,20 @@ protected Buildings.Controls.OBC.CDL.Logical.Or or2 "Check if the lead pump is enabled" annotation (Placement(transformation(extent={{-60,90},{-40,110}}))); + Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr + "Check if there is any pump running" + annotation (Placement(transformation(extent={{-160,-170},{-140,-150}}))); + Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1(final k=1) + "Dummy index" + annotation (Placement(transformation(extent={{-200,-190},{-180,-170}}))); + Buildings.Controls.OBC.CDL.Integers.Switch intSwi + "Output 1 when there is no pump running, to avoid warning downstream" + annotation (Placement(transformation(extent={{-100,-170},{-80,-150}}))); + Buildings.Controls.OBC.CDL.Integers.Multiply mulInt + annotation (Placement(transformation(extent={{-10,-100},{10,-80}}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2 + "Convert boolean to integer" + annotation (Placement(transformation(extent={{-50,-130},{-30,-110}}))); equation connect(enaDedLeaPum.uLeaChiEna, uLeaChiEna) @@ -338,7 +352,7 @@ equation connect(intRep.y, intEqu1.u1) annotation (Line(points={{22,230},{30,230},{30,190},{58,190}}, color={255,127,0})); connect(pumIndCon.y, intEqu1.u2) - annotation (Line(points={{-198,170},{40,170},{40,182},{58,182}}, + annotation (Line(points={{-198,170},{50,170},{50,182},{58,182}}, color={255,127,0})); connect(intEqu1.y, leaPumSta.u2) annotation (Line(points={{82,190},{118,190}}, color={255,0,255})); @@ -356,9 +370,9 @@ equation connect(reaToInt1.y, intRep1.u) annotation (Line(points={{-18,-50},{-2,-50}}, color={255,127,0})); connect(intRep1.y, intEqu2.u2) - annotation (Line(points={{22,-50},{30,-50},{30,-38},{58,-38}}, color={255,127,0})); + annotation (Line(points={{22,-50},{40,-50},{40,-38},{58,-38}}, color={255,127,0})); connect(pumIndCon.y, intEqu2.u1) - annotation (Line(points={{-198,170},{40,170},{40,-30},{58,-30}}, + annotation (Line(points={{-198,170},{50,170},{50,-30},{58,-30}}, color={255,127,0})); connect(intEqu2.y, nexLagPumSta.u2) annotation (Line(points={{82,-30},{118,-30}}, color={255,0,255})); @@ -369,14 +383,12 @@ equation annotation (Line(points={{-300,140},{100,140},{100,-38},{118,-38}}, color={255,0,255})); connect(lasLagPum.y, reaToInt2.u) - annotation (Line(points={{-58,-100},{-42,-100}}, color={0,0,127})); - connect(reaToInt2.y, intRep2.u) - annotation (Line(points={{-18,-100},{-2,-100}}, color={255,127,0})); + annotation (Line(points={{-58,-90},{-52,-90}}, color={0,0,127})); connect(intRep2.y, intEqu3.u2) - annotation (Line(points={{22,-100},{30,-100},{30,-98},{58,-98}}, + annotation (Line(points={{42,-90},{46,-90},{46,-98},{58,-98}}, color={255,127,0})); connect(pumIndCon.y, intEqu3.u1) - annotation (Line(points={{-198,170},{40,170},{40,-90},{58,-90}}, + annotation (Line(points={{-198,170},{50,170},{50,-90},{58,-90}}, color={255,127,0})); connect(intEqu3.y, lasLagPumSta.u2) annotation (Line(points={{82,-90},{118,-90}}, color={255,0,255})); @@ -387,7 +399,7 @@ equation annotation (Line(points={{-300,140},{-260,140},{-260,-3.8},{-242,-3.8}}, color={255,0,255})); connect(intToRea.y, lasLagPum.u) - annotation (Line(points={{-198,230},{-160,230},{-160,-100},{-82,-100}}, + annotation (Line(points={{-198,230},{-160,230},{-160,-90},{-82,-90}}, color={0,0,127})); connect(booRep2.y, lasLagPumSta.u1) annotation (Line(points={{82,0},{90,0},{90,-82},{118,-82}}, @@ -402,17 +414,17 @@ equation annotation (Line(points={{142,190},{160,190},{160,-30},{178,-30}}, color={255,0,255})); connect(pumSpeLocDp.dpChiWat_local, dpChiWat_local) - annotation (Line(points={{-62,-192},{-240,-192},{-240,-160},{-300,-160}}, + annotation (Line(points={{-2,-202},{-240,-202},{-240,-160},{-300,-160}}, color={0,0,127})); connect(pumSpeLocDp.dpChiWat_remote, dpChiWat_remote) - annotation (Line(points={{-62,-204},{-200,-204},{-200,-200},{-300,-200}}, + annotation (Line(points={{-2,-214},{-270,-214},{-270,-200},{-300,-200}}, color={0,0,127})); connect(pumSpeLocDp.dpChiWatSet_remote, dpChiWatSet_remote) annotation (Line( - points={{-62,-208},{-220,-208},{-220,-240},{-300,-240}}, color={0,0,127})); - connect(dpChiWat_remote, pumSpeRemDp.dpChiWat_remote) annotation (Line(points= - {{-300,-200},{-200,-200},{-200,-240},{-62,-240}}, color={0,0,127})); + points={{-2,-218},{-220,-218},{-220,-250},{-300,-250}}, color={0,0,127})); + connect(dpChiWat_remote, pumSpeRemDp.dpChiWat_remote) annotation (Line(points={{-300, + -200},{-270,-200},{-270,-240},{-62,-240}}, color={0,0,127})); connect(dpChiWatSet_remote, pumSpeRemDp.dpChiWatSet_remote) annotation (Line( - points={{-300,-240},{-220,-240},{-220,-248},{-62,-248}}, color={0,0,127})); + points={{-300,-250},{-220,-250},{-220,-248},{-62,-248}}, color={0,0,127})); connect(enaPum.y, pumSta.u2) annotation (Line(points={{202,-30},{210,-30},{210,-50},{150,-50},{150,-98}, {178,-98}}, color={255,0,255})); @@ -437,28 +449,27 @@ equation annotation (Line(points={{-300,140},{-260,140},{-260,-120},{-242,-120}}, color={255,0,255})); connect(booToInt.y, mulSumInt.u) - annotation (Line(points={{-218,-120},{-182,-120}}, color={255,127,0})); + annotation (Line(points={{-218,-120},{-202,-120}}, color={255,127,0})); connect(addInt.y, nexLagPum.index) annotation (Line(points={{-118,-70},{-70,-70},{-70,-62}},color={255,127,0})); connect(mulSumInt.y, addInt.u2) - annotation (Line(points={{-158,-120},{-150,-120},{-150,-76},{-142,-76}}, + annotation (Line(points={{-178,-120},{-170,-120},{-170,-76},{-142,-76}}, color={255,127,0})); connect(conInt.y, addInt.u1) annotation (Line(points={{-198,200},{-150,200},{-150,-64},{-142,-64}}, color={255,127,0})); - connect(mulSumInt.y, lasLagPum.index) - annotation (Line(points={{-158,-120},{-70,-120},{-70,-112}}, color={255,127,0})); connect(enaDedLeaPum.uPla, uPla) annotation (Line(points={{-202,118},{-240,118},{-240,180},{-300,180}}, color={255,0,255})); connect(uChiWatPum, pumSpeLocDp.uChiWatPum) annotation (Line(points={{-300,140}, - {-260,140},{-260,-196},{-62,-196}}, color={255,0,255})); + {-260,140},{-260,-206},{-2,-206}}, color={255,0,255})); connect(uChiWatPum, pumSpeRemDp.uChiWatPum) annotation (Line(points={{-300,140}, {-260,140},{-260,-232},{-62,-232}}, color={255,0,255})); connect(pumSpeLocDp.yChiWatPumSpe, yPumSpe) - annotation (Line(points={{-38,-200},{300,-200}}, color={0,0,127})); + annotation (Line(points={{22,-210},{162,-210},{162,-200},{300,-200}}, + color={0,0,127})); connect(pumSpeRemDp.yChiWatPumSpe, yPumSpe) annotation (Line(points={{-39,-240}, - {-20,-240},{-20,-200},{300,-200}}, color={0,0,127})); + {40,-240},{40,-200},{300,-200}}, color={0,0,127})); connect(enaLagChiPum.yUp, enaNexLag.u) annotation (Line(points={{-218,4},{-210, 4},{-210,30},{-2,30}}, color={255,0,255})); connect(enaNexLag.y, booRep1.u) @@ -486,7 +497,7 @@ equation connect(pre1.y, booToInt1.u) annotation (Line(points={{242,-120},{260,-120},{260, -140},{-250,-140},{-250,-70},{-242,-70}}, color={255,0,255})); connect(pumSpeLocDp.dpChiWatPumSet_local, dpChiWatPumSet_local) annotation ( - Line(points={{-38,-206},{200,-206},{200,-240},{300,-240}}, color={0,0,127})); + Line(points={{22,-216},{200,-216},{200,-240},{300,-240}}, color={0,0,127})); connect(booRep.y, pumSta1.u1) annotation (Line(points={{22,100},{90,100},{90,40}, {238,40}}, color={255,0,255})); connect(addPum.y, pumSta1.u2) annotation (Line(points={{262,0},{268,0},{268,20}, @@ -509,6 +520,24 @@ equation 80}}, color={255,0,255})); connect(or2.y, booRep.u) annotation (Line(points={{-38,100},{-2,100}}, color={255,0,255})); + connect(mulSumInt.y, intGreThr.u) annotation (Line(points={{-178,-120},{-170,-120}, + {-170,-160},{-162,-160}}, color={255,127,0})); + connect(intGreThr.y, intSwi.u2) + annotation (Line(points={{-138,-160},{-102,-160}}, color={255,0,255})); + connect(intSwi.y, lasLagPum.index) annotation (Line(points={{-78,-160},{-70,-160}, + {-70,-102}}, color={255,127,0})); + connect(mulSumInt.y, intSwi.u1) annotation (Line(points={{-178,-120},{-130,-120}, + {-130,-152},{-102,-152}}, color={255,127,0})); + connect(conInt1.y, intSwi.u3) annotation (Line(points={{-178,-180},{-130,-180}, + {-130,-168},{-102,-168}}, color={255,127,0})); + connect(intGreThr.y, booToInt2.u) annotation (Line(points={{-138,-160},{-120,-160}, + {-120,-120},{-52,-120}}, color={255,0,255})); + connect(booToInt2.y, mulInt.u2) annotation (Line(points={{-28,-120},{-20,-120}, + {-20,-96},{-12,-96}}, color={255,127,0})); + connect(reaToInt2.y, mulInt.u1) annotation (Line(points={{-28,-90},{-20,-90},{ + -20,-84},{-12,-84}}, color={255,127,0})); + connect(mulInt.y, intRep2.u) + annotation (Line(points={{12,-90},{18,-90}}, color={255,127,0})); annotation ( defaultComponentName="chiWatPum", Diagram(coordinateSystem(preserveAspectRatio=false, @@ -548,7 +577,7 @@ annotation ( horizontalAlignment=TextAlignment.Right, textString="Disable last lag pump"), Rectangle( - extent={{-276,-144},{156,-256}}, + extent={{-276,-146},{156,-258}}, fillColor={210,210,210}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/CondenserWater/Subsequences/Speed.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/CondenserWater/Subsequences/Speed.mo index e6017649e2b..02ffc9ea24f 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/CondenserWater/Subsequences/Speed.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Pumps/CondenserWater/Subsequences/Speed.mo @@ -108,6 +108,11 @@ protected Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt1 if fixSpe "Convert real input to integer output" annotation (Placement(transformation(extent={{60,-70},{80,-50}}))); + Buildings.Controls.OBC.CDL.Integers.AddParameter addPar( + final p=1) + if fixSpe + "Change the chiller stage index to the index for downstream selection" + annotation (Placement(transformation(extent={{-80,-90},{-60,-70}}))); equation connect(con1.y,conWatPumSpe. u) @@ -144,8 +149,6 @@ equation color={255,127,0})); connect(con4.y, add2.u2) annotation (Line(points={{-98,0},{-90,0},{-90,94},{-82,94}}, color={0,0,127})); - connect(uChiSta, conWatPumOn1.index) annotation (Line(points={{-160,100},{-130, - 100},{-130,-80},{30,-80},{30,-72}},color={255,127,0})); connect(con5.y, conWatPumOn1.u) annotation (Line(points={{2,-60},{18,-60}}, color={0,0,127})); connect(conWatPumOn1.y, reaToInt1.u) @@ -157,6 +160,10 @@ equation connect(con3.y, sub1.u2) annotation (Line(points={{-18,60},{-10,60},{-10,74},{ -2,74}}, color={0,0,127})); + connect(addPar.y, conWatPumOn1.index) + annotation (Line(points={{-58,-80},{30,-80},{30,-72}}, color={255,127,0})); + connect(uChiSta, addPar.u) annotation (Line(points={{-160,100},{-130,100},{-130, + -80},{-82,-80}}, color={255,127,0})); annotation ( defaultComponentName="conPumSpe", Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo index ce8ca3696b7..fbc94a2b0cb 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Down.mo @@ -298,11 +298,10 @@ protected Buildings.Controls.OBC.CDL.Routing.RealExtractor curDisChi( final nin=nChi) "Current disabling chiller" - annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); + annotation (Placement(transformation(extent={{-100,-20},{-80,0}}))); Buildings.Controls.OBC.CDL.Reals.LessThreshold lesEquThr( - final t=0.5) - "Check if the disabled chiller has chilled water request" - annotation (Placement(transformation(extent={{-40,-20},{-20,0}}))); + final t=0.5) "Check if the disabled chiller has not chilled water request" + annotation (Placement(transformation(extent={{-60,-20},{-40,0}}))); Buildings.Controls.OBC.CDL.Logical.And and4 "Logical and" annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); Buildings.Controls.OBC.CDL.Logical.Switch logSwi2 "Logical switch" @@ -312,7 +311,7 @@ protected Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep4( final nout=nChi) "Replicate boolean input" - annotation (Placement(transformation(extent={{40,70},{60,90}}))); + annotation (Placement(transformation(extent={{60,70},{80,90}}))); Buildings.Controls.OBC.CDL.Reals.Switch swi[nChi] "Chilled water isolvation valve position" annotation (Placement(transformation(extent={{140,70},{160,90}}))); @@ -322,13 +321,13 @@ protected Buildings.Controls.OBC.CDL.Routing.RealExtractor curDisChi1( final nin=nChi) "Current disabling chiller" - annotation (Placement(transformation(extent={{-80,-130},{-60,-110}}))); + annotation (Placement(transformation(extent={{-100,-130},{-80,-110}}))); Buildings.Controls.OBC.CDL.Reals.LessThreshold lesEquThr1( final t=0.5) "Check if the disabled chiller is not requiring condenser water" - annotation (Placement(transformation(extent={{-40,-130},{-20,-110}}))); + annotation (Placement(transformation(extent={{-60,-130},{-40,-110}}))); Buildings.Controls.OBC.CDL.Logical.And and5 "Logical and" - annotation (Placement(transformation(extent={{60,-130},{80,-110}}))); + annotation (Placement(transformation(extent={{80,-130},{100,-110}}))); Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep1( final nout=nChi) "Replicate boolean input" @@ -371,6 +370,10 @@ protected "Logical and" annotation (Placement(transformation(extent={{120,-130},{140,-110}}))); + CDL.Logical.And and6 "Logical and" + annotation (Placement(transformation(extent={{60,-20},{80,0}}))); + CDL.Logical.And and7 "Logical and" + annotation (Placement(transformation(extent={{-26,-130},{-6,-110}}))); equation connect(nexChi.yEnaSmaChi,dowSta. nexEnaChi) annotation (Line(points={{-18,331},{30,331},{30,226},{58,226}}, @@ -379,41 +382,38 @@ equation annotation (Line(points={{58,222},{-60,222},{-60,100},{-300,100}}, color={0,0,127})); connect(nexChi.yLasDisChi,dowSta. nexDisChi) - annotation (Line(points={{-18,336},{20,336},{20,220},{58,220}}, + annotation (Line(points={{-18,334},{20,334},{20,220},{58,220}}, color={255,127,0})); connect(uChiWatReq, booToRea1.u) annotation (Line(points={{-300,-10},{-242,-10}}, color={255,0,255})); connect(booToRea1.y, curDisChi.u) - annotation (Line(points={{-218,-10},{-82,-10}}, color={0,0,127})); + annotation (Line(points={{-218,-10},{-102,-10}},color={0,0,127})); connect(curDisChi.y, lesEquThr.u) - annotation (Line(points={{-58,-10},{-42,-10}}, color={0,0,127})); + annotation (Line(points={{-78,-10},{-62,-10}}, color={0,0,127})); connect(nexChi.yOnOff, logSwi2.u2) - annotation (Line(points={{-18,340},{0,340},{0,20},{58,20}}, + annotation (Line(points={{-18,337},{0,337},{0,20},{58,20}}, color={255,0,255})); connect(and4.y, logSwi2.u1) annotation (Line(points={{-18,30},{40,30},{40,28},{58,28}}, color={255,0,255})); connect(nexChi.yLasDisChi, curDisChi.index) - annotation (Line(points={{-18,336},{20,336},{20,120},{-140,120},{-140,-30},{ - -70,-30},{-70,-22}}, + annotation (Line(points={{-18,334},{20,334},{20,120},{-140,120},{-140,-30}, + {-90,-30},{-90,-22}}, color={255,127,0})); - connect(lesEquThr.y, and1.u2) - annotation (Line(points={{-18,-10},{120,-10},{120,12},{138,12}}, - color={255,0,255})); connect(logSwi2.y, and1.u1) annotation (Line(points={{82,20},{138,20}}, color={255,0,255})); connect(nexChi.yLasDisChi, disChiIsoVal.nexChaChi) - annotation (Line(points={{-18,336},{20,336},{20,68},{198,68}}, + annotation (Line(points={{-18,334},{20,334},{20,68},{198,68}}, color={255,127,0})); connect(and1.y,disChiIsoVal.uUpsDevSta) annotation (Line(points={{162,20},{180,20},{180,55},{198,55}}, color={255,0,255})); connect(nexChi.yOnOff, booRep4.u) - annotation (Line(points={{-18,340},{0,340},{0,80},{38,80}}, color={255,0,255})); + annotation (Line(points={{-18,337},{0,337},{0,80},{58,80}}, color={255,0,255})); connect(booRep4.y, swi.u2) - annotation (Line(points={{62,80},{138,80}}, color={255,0,255})); + annotation (Line(points={{82,80},{138,80}}, color={255,0,255})); connect(uChiWatIsoVal, swi.u3) - annotation (Line(points={{-300,100},{80,100},{80,72},{138,72}}, + annotation (Line(points={{-300,100},{88,100},{88,72},{138,72}}, color={0,0,127})); connect(dowSta.yChiWatIsoVal, swi.u1) annotation (Line(points={{82,228},{96,228},{96,88},{138,88}}, @@ -424,21 +424,23 @@ equation connect(uConWatReq, booToRea2.u) annotation (Line(points={{-300,-120},{-242,-120}}, color={255,0,255})); connect(booToRea2.y, curDisChi1.u) - annotation (Line(points={{-218,-120},{-82,-120}},color={0,0,127})); + annotation (Line(points={{-218,-120},{-102,-120}}, + color={0,0,127})); connect(curDisChi1.y, lesEquThr1.u) - annotation (Line(points={{-58,-120},{-42,-120}}, color={0,0,127})); + annotation (Line(points={{-78,-120},{-62,-120}}, color={0,0,127})); connect(logSwi2.y, and5.u1) - annotation (Line(points={{82,20},{90,20},{90,-20},{10,-20},{10,-120},{58,-120}}, + annotation (Line(points={{82,20},{90,20},{90,-50},{50,-50},{50,-120},{78, + -120}}, color={255,0,255})); connect(uChi,dowSta. uChi) annotation (Line(points={{-300,220},{-200,220},{-200,234},{58,234}}, color={255,0,255})); connect(nexChi.yLasDisChi, curDisChi1.index) - annotation (Line(points={{-18,336},{20,336},{20,120},{-140,120},{-140,-140}, - {-70,-140},{-70,-132}}, + annotation (Line(points={{-18,334},{20,334},{20,120},{-140,120},{-140,-140}, + {-90,-140},{-90,-132}}, color={255,127,0})); connect(nexChi.yOnOff, booRep1.u) - annotation (Line(points={{-18,340},{0,340},{0,-70},{58,-70}}, + annotation (Line(points={{-18,337},{0,337},{0,-70},{58,-70}}, color={255,0,255})); connect(booRep1.y, logSwi.u2) annotation (Line(points={{82,-70},{138,-70}}, color={255,0,255})); @@ -446,7 +448,7 @@ equation annotation (Line(points={{82,232},{100,232},{100,-62},{138,-62}}, color={255,0,255})); connect(nexChi.yLasDisChi, disHeaCon.nexChaChi) - annotation (Line(points={{-18,336},{20,336},{20,-104},{198,-104}}, + annotation (Line(points={{-18,334},{20,334},{20,-104},{198,-104}}, color={255,127,0})); connect(logSwi.y, disHeaCon.uChiHeaCon) annotation (Line(points={{162,-70},{180,-70},{180,-108},{198,-108}}, @@ -476,7 +478,7 @@ equation annotation (Line(points={{-138,200},{-120,200},{-120,-311},{98,-311}}, color={255,0,255})); connect(nexChi.yOnOff, minChiWatFlo.uOnOff) - annotation (Line(points={{-18,340},{0,340},{0,-327},{98,-327}}, + annotation (Line(points={{-18,337},{0,337},{0,-327},{98,-327}}, color={255,0,255})); connect(dowSta.yChiDem, yChiDem) annotation (Line(points={{82,239},{179.5,239},{179.5,260},{300,260}}, @@ -512,8 +514,8 @@ equation annotation (Line(points={{-158,360},{-140,360},{-140,328},{-260,328},{-260,12}, {58,12}}, color={255,0,255})); connect(lat.y, disHeaCon.chaPro) - annotation (Line(points={{-158,360},{-140,360},{-140,328},{-260,328},{-260,-100}, - {198,-100}}, color={255,0,255})); + annotation (Line(points={{-158,360},{-140,360},{-140,328},{-260,328},{-260, + -100},{198,-100}},color={255,0,255})); connect(lat.y, minChiWatFlo.uStaDow) annotation (Line(points={{-158,360},{-140,360},{-140,328},{-260,328},{-260,-329}, {98,-329}}, color={255,0,255})); @@ -544,7 +546,7 @@ equation annotation (Line(points={{-300,220},{-200,220},{-200,-316},{98,-316}}, color={255,0,255})); connect(nexChi.yLasDisChi, minChiWatFlo.nexDisChi) - annotation (Line(points={{-18,336},{20,336},{20,-321},{98,-321}}, + annotation (Line(points={{-18,334},{20,334},{20,-321},{98,-321}}, color={255,127,0})); connect(nexChi.yEnaSmaChi, minChiWatFlo.nexEnaChi) annotation (Line(points={{-18,331},{30,331},{30,-319},{98,-319}}, @@ -610,7 +612,7 @@ equation annotation (Line(points={{222,-330},{240,-330},{240,-350},{60,-350}, {60,-378},{98,-378}}, color={0,0,127})); connect(nexChi.yOnOff, dowSta.uOnOff) - annotation (Line(points={{-18,340},{0,340},{0,228},{58,228}}, + annotation (Line(points={{-18,337},{0,337},{0,228},{58,228}}, color={255,0,255})); connect(edg1.y, dowSta.clr) annotation (Line(points={{222,-370},{260,-370},{260,-390},{-190,-390}, @@ -622,8 +624,8 @@ equation annotation (Line(points={{222,-370},{260,-370},{260,-390},{-190,-390}, {-190,-36},{198,-36}}, color={255,0,255})); connect(disHeaCon.yEnaHeaCon, lat4.u) - annotation (Line(points={{222,-94},{240,-94},{240,-114},{180,-114}, - {180,-130},{198,-130}}, color={255,0,255})); + annotation (Line(points={{222,-94},{240,-94},{240,-114},{180,-114},{180, + -130},{198,-130}}, color={255,0,255})); connect(lat4.y, yTowStaDow) annotation (Line(points={{222,-130},{250,-130},{250,-60},{300,-60}}, color={255,0,255})); @@ -653,28 +655,40 @@ equation connect(uChiSta, disNexCWP.uChiSta) annotation (Line(points={{-300,160},{-150,160},{-150,-165},{98,-165}}, color={255,127,0})); - connect(dowSta.uChiHeaCon, uChiHeaCon) annotation (Line(points={{58,224},{-100, - 224},{-100,130},{-300,130}}, color={255,0,255})); - connect(uChiHeaCon, logSwi.u3) annotation (Line(points={{-300,130},{-100,130}, - {-100,-86},{120,-86},{120,-78},{138,-78}}, color={255,0,255})); + connect(dowSta.uChiHeaCon, uChiHeaCon) annotation (Line(points={{58,224},{ + -110,224},{-110,130},{-300,130}}, + color={255,0,255})); + connect(uChiHeaCon, logSwi.u3) annotation (Line(points={{-300,130},{-110,130}, + {-110,-86},{120,-86},{120,-78},{138,-78}}, color={255,0,255})); connect(conWatPumCon.uConWatPum, uConWatPum) annotation (Line(points={{138,-191}, {70,-191},{70,-380},{-300,-380}}, color={255,0,255})); - connect(con.y, disHeaCon.uEnaPla) annotation (Line(points={{-138,200},{-120,200}, - {-120,-92},{198,-92}}, color={255,0,255})); + connect(con.y, disHeaCon.uEnaPla) annotation (Line(points={{-138,200},{-120, + 200},{-120,-92},{198,-92}}, + color={255,0,255})); connect(con.y, conWatPumCon.uEnaPla) annotation (Line(points={{-138,200},{ -120,200},{-120,-180},{138,-180}}, color={255,0,255})); connect(and5.y, and3.u1) - annotation (Line(points={{82,-120},{118,-120}}, color={255,0,255})); + annotation (Line(points={{102,-120},{118,-120}},color={255,0,255})); connect(and3.y, disHeaCon.uUpsDevSta) annotation (Line(points={{142,-120},{ 160,-120},{160,-96},{198,-96}}, color={255,0,255})); connect(lat3.y, and3.u2) annotation (Line(points={{222,-30},{240,-30},{240, -50},{110,-50},{110,-128},{118,-128}}, color={255,0,255})); - connect(lesEquThr1.y, and5.u2) annotation (Line(points={{-18,-120},{-10,-120}, - {-10,-128},{58,-128}}, color={255,0,255})); connect(edg1.y, yEndStaTri) annotation (Line(points={{222,-370},{300,-370}}, color={255,0,255})); connect(edg1.y, nexChi.endPro) annotation (Line(points={{222,-370},{260,-370}, {260,-390},{-190,-390},{-190,333},{-42,333}}, color={255,0,255})); + connect(lesEquThr.y, and6.u1) + annotation (Line(points={{-38,-10},{58,-10}}, color={255,0,255})); + connect(and6.y, and1.u2) annotation (Line(points={{82,-10},{120,-10},{120,12}, + {138,12}}, color={255,0,255})); + connect(nexChi.yDow, and6.u2) annotation (Line(points={{-18,347},{10,347},{10, + -18},{58,-18}}, color={255,0,255})); + connect(and7.y, and5.u2) annotation (Line(points={{-4,-120},{40,-120},{40, + -128},{78,-128}}, color={255,0,255})); + connect(lesEquThr1.y, and7.u1) + annotation (Line(points={{-38,-120},{-28,-120}}, color={255,0,255})); + connect(nexChi.yDow, and7.u2) annotation (Line(points={{-18,347},{10,347},{10, + -18},{-32,-18},{-32,-128},{-28,-128}}, color={255,0,255})); annotation ( defaultComponentName="dowProCon", Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-280,-400},{280,400}})), diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Subsequences/NextChiller.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Subsequences/NextChiller.mo index 55d59b5a14b..87d36f1d1db 100644 --- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Subsequences/NextChiller.mo +++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Staging/Processes/Subsequences/NextChiller.mo @@ -5,218 +5,267 @@ block NextChiller "Identify next enable and disable chillers" Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uStaSet "Chiller stage setpoint" - annotation (Placement(transformation(extent={{-260,110},{-220,150}}), + annotation (Placement(transformation(extent={{-280,110},{-240,150}}), iconTransformation(extent={{-140,50},{-100,90}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChiSet[nChi] "Vector of chillers status setpoint" - annotation (Placement(transformation(extent={{-260,-40},{-220,0}}), + annotation (Placement(transformation(extent={{-280,-40},{-240,0}}), iconTransformation(extent={{-140,-20},{-100,20}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanInput endPro "True: the staging process is end" - annotation (Placement(transformation(extent={{-260,-180},{-220,-140}}), + annotation (Placement(transformation(extent={{-280,-180},{-240,-140}}), iconTransformation(extent={{-140,-90},{-100,-50}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yUp + "True if it is in staging up process" + annotation (Placement(transformation(extent={{240,180},{280,220}}), + iconTransformation(extent={{100,70},{140,110}}))); + Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yDow + "True if it is in staging down process" + annotation (Placement(transformation(extent={{240,120},{280,160}}), + iconTransformation(extent={{100,50},{140,90}}))); Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yNexEnaChi "Next enabling chiller index" - annotation (Placement(transformation(extent={{220,140},{260,180}}), - iconTransformation(extent={{100,70},{140,110}}))); + annotation (Placement(transformation(extent={{240,70},{280,110}}), + iconTransformation(extent={{100,20},{140,60}}))); Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yDisSmaChi "Smaller chiller to be disabled in staging-up process" - annotation (Placement(transformation(extent={{220,90},{260,130}}), - iconTransformation(extent={{100,20},{140,60}}))); + annotation (Placement(transformation(extent={{240,20},{280,60}}), + iconTransformation(extent={{100,-12},{140,28}}))); Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOnOff "True: if the stage change require one chiller to be enabled while another is disabled" - annotation (Placement(transformation(extent={{220,-40},{260,0}}), - iconTransformation(extent={{100,-20},{140,20}}))); + annotation (Placement(transformation(extent={{240,-40},{280,0}}), + iconTransformation(extent={{100,-50},{140,-10}}))); Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yLasDisChi "Disable last chiller when it is in stage-down process" - annotation (Placement(transformation(extent={{220,-120},{260,-80}}), - iconTransformation(extent={{100,-60},{140,-20}}))); + annotation (Placement(transformation(extent={{240,-120},{280,-80}}), + iconTransformation(extent={{100,-80},{140,-40}}))); Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yEnaSmaChi "Smaller chiller to be enabled in stage-down process" - annotation (Placement(transformation(extent={{220,-180},{260,-140}}), + annotation (Placement(transformation(extent={{240,-170},{280,-130}}), iconTransformation(extent={{100,-110},{140,-70}}))); +protected + parameter Integer chiInd[nChi]={i for i in 1:nChi} + "Chiller index, {1,2,...,n}"; + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[nChi] + "Boolean to integer" + annotation (Placement(transformation(extent={{-100,30},{-80,50}}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[nChi] + "Boolean to integer" + annotation (Placement(transformation(extent={{-100,-110},{-80,-90}}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2 + "Boolean to integer" + annotation (Placement(transformation(extent={{0,-70},{20,-50}}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3 + "Boolean to integer" + annotation (Placement(transformation(extent={{-100,150},{-80,170}}))); + Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt4 + "Boolean to integer" + annotation (Placement(transformation(extent={{-100,70},{-80,90}}))); + Buildings.Controls.OBC.CDL.Integers.Sources.Constant chiIndVec[nChi]( + final k=chiInd) "Vector of chiller index" + annotation (Placement(transformation(extent={{-140,-10},{-120,10}}))); + Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep( + final nout=nChi) + "Replicate boolean input" + annotation (Placement(transformation(extent={{-180,-170},{-160,-150}}))); + Buildings.Controls.OBC.CDL.Integers.Sources.Constant one( + final k=1) "Constant 1" + annotation (Placement(transformation(extent={{80,-50},{100,-30}}))); Buildings.Controls.OBC.CDL.Integers.Change cha "Check if it is stage up or stage down" - annotation (Placement(transformation(extent={{-200,120},{-180,140}}))); + annotation (Placement(transformation(extent={{-220,120},{-200,140}}))); Buildings.Controls.OBC.CDL.Logical.Edge edg[nChi] "Check if the chiller is being enabled" - annotation (Placement(transformation(extent={{-200,30},{-180,50}}))); + annotation (Placement(transformation(extent={{-220,30},{-200,50}}))); Buildings.Controls.OBC.CDL.Logical.FallingEdge falEdg[nChi] "Check if the chiller is being disabled" - annotation (Placement(transformation(extent={{-200,-110},{-180,-90}}))); + annotation (Placement(transformation(extent={{-220,-110},{-200,-90}}))); Buildings.Controls.OBC.CDL.Logical.Latch enaChi[nChi] "True when the chiller should be enabled" - annotation (Placement(transformation(extent={{-120,30},{-100,50}}))); + annotation (Placement(transformation(extent={{-140,30},{-120,50}}))); Buildings.Controls.OBC.CDL.Logical.Latch disChi[nChi] "True when the chiller should be disabled" - annotation (Placement(transformation(extent={{-120,-110},{-100,-90}}))); + annotation (Placement(transformation(extent={{-140,-110},{-120,-90}}))); Buildings.Controls.OBC.CDL.Logical.MultiOr anyEnaChi(final nin=nChi) "Check if there is any enabling chiller" - annotation (Placement(transformation(extent={{-80,-30},{-60,-10}}))); + annotation (Placement(transformation(extent={{-100,-30},{-80,-10}}))); Buildings.Controls.OBC.CDL.Logical.MultiOr anyDisChi(final nin=nChi) "Check if there is any disabling chiller" - annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); + annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); Buildings.Controls.OBC.CDL.Logical.And enaDis "Check if enabling and disabling chillers at the same process" - annotation (Placement(transformation(extent={{-20,-30},{0,-10}}))); + annotation (Placement(transformation(extent={{-40,-30},{-20,-10}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt[nChi] "Find out the index of enabling chiller" - annotation (Placement(transformation(extent={{-20,30},{0,50}}))); + annotation (Placement(transformation(extent={{-40,30},{-20,50}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt1[nChi] "Find out the index of disabling chiller" - annotation (Placement(transformation(extent={{-20,-110},{0,-90}}))); + annotation (Placement(transformation(extent={{-40,-110},{-20,-90}}))); Buildings.Controls.OBC.CDL.Integers.MultiSum enaChiInd(final nin = nChi) "Enabling chiller index" - annotation (Placement(transformation(extent={{20,30},{40,50}}))); + annotation (Placement(transformation(extent={{0,30},{20,50}}))); Buildings.Controls.OBC.CDL.Integers.MultiSum disChiInd(final nin = nChi) "Disabling chiller index" - annotation (Placement(transformation(extent={{20,-110},{40,-90}}))); + annotation (Placement(transformation(extent={{0,-110},{20,-90}}))); Buildings.Controls.OBC.CDL.Logical.Latch upPro "True when it is in stage up process" - annotation (Placement(transformation(extent={{-120,150},{-100,170}}))); + annotation (Placement(transformation(extent={{-140,150},{-120,170}}))); Buildings.Controls.OBC.CDL.Logical.Latch dowPro "True when it is in stage down process" - annotation (Placement(transformation(extent={{-120,80},{-100,100}}))); + annotation (Placement(transformation(extent={{-140,70},{-120,90}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt2 "Find out the index of enabling chiller" - annotation (Placement(transformation(extent={{120,150},{140,170}}))); + annotation (Placement(transformation(extent={{80,80},{100,100}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt3 "Staging up process and it requires chiller on and off" - annotation (Placement(transformation(extent={{120,110},{140,130}}))); + annotation (Placement(transformation(extent={{80,20},{100,40}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt4 "Disabling chiller during stage up process" - annotation (Placement(transformation(extent={{180,100},{200,120}}))); + annotation (Placement(transformation(extent={{120,10},{140,30}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt5 "Find out the index of disabling chiller" - annotation (Placement(transformation(extent={{120,-110},{140,-90}}))); + annotation (Placement(transformation(extent={{80,-110},{100,-90}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt6 "Staging down process and it requires chiller on and off" - annotation (Placement(transformation(extent={{120,-150},{140,-130}}))); + annotation (Placement(transformation(extent={{80,-160},{100,-140}}))); Buildings.Controls.OBC.CDL.Integers.Multiply proInt7 "Enabling chiller during stage down process" - annotation (Placement(transformation(extent={{180,-170},{200,-150}}))); - -protected - parameter Integer chiInd[nChi]={i for i in 1:nChi} - "Chiller index, {1,2,...,n}"; - Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[nChi] - "Boolean to integer" - annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[nChi] - "Boolean to integer" - annotation (Placement(transformation(extent={{-80,-110},{-60,-90}}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2 - "Boolean to integer" - annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3 - "Boolean to integer" - annotation (Placement(transformation(extent={{-80,150},{-60,170}}))); - Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt4 - "Boolean to integer" - annotation (Placement(transformation(extent={{-80,80},{-60,100}}))); - Buildings.Controls.OBC.CDL.Integers.Sources.Constant chiIndVec[nChi]( - final k=chiInd) - "Vector of chiller index" - annotation (Placement(transformation(extent={{-120,-10},{-100,10}}))); - Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep( - final nout=nChi) - "Replicate boolean input" - annotation (Placement(transformation(extent={{-160,-170},{-140,-150}}))); + annotation (Placement(transformation(extent={{120,-180},{140,-160}}))); + Buildings.Controls.OBC.CDL.Integers.Switch intSwi + "Output 1 when it is not in the staging up process" + annotation (Placement(transformation(extent={{200,30},{220,50}}))); + Buildings.Controls.OBC.CDL.Integers.Switch intSwi1 + "Output 1 when it is not in the staging up process" + annotation (Placement(transformation(extent={{200,80},{220,100}}))); + Buildings.Controls.OBC.CDL.Integers.Switch intSwi2 + "Output 1 when it is not in the staging down process" + annotation (Placement(transformation(extent={{200,-160},{220,-140}}))); + Buildings.Controls.OBC.CDL.Integers.Switch intSwi3 + "Output 1 when it is not in the staging down process" + annotation (Placement(transformation(extent={{200,-110},{220,-90}}))); equation - connect(uChiSet, edg.u) annotation (Line(points={{-240,-20},{-210,-20},{-210,40}, - {-202,40}}, color={255,0,255})); + connect(uChiSet, edg.u) annotation (Line(points={{-260,-20},{-230,-20},{-230,40}, + {-222,40}}, color={255,0,255})); connect(edg.y, enaChi.u) - annotation (Line(points={{-178,40},{-122,40}}, color={255,0,255})); + annotation (Line(points={{-198,40},{-142,40}}, color={255,0,255})); connect(falEdg.y, disChi.u) - annotation (Line(points={{-178,-100},{-122,-100}}, color={255,0,255})); - connect(booRep.y, enaChi.clr) annotation (Line(points={{-138,-160},{-130,-160}, - {-130,34},{-122,34}}, color={255,0,255})); - connect(booRep.y, disChi.clr) annotation (Line(points={{-138,-160},{-130,-160}, - {-130,-106},{-122,-106}}, color={255,0,255})); - connect(enaChi.y, anyEnaChi.u) annotation (Line(points={{-98,40},{-90,40},{-90, - -20},{-82,-20}},color={255,0,255})); - connect(anyEnaChi.y, enaDis.u1) annotation (Line(points={{-58,-20},{-22,-20}}, + annotation (Line(points={{-198,-100},{-142,-100}}, color={255,0,255})); + connect(booRep.y, enaChi.clr) annotation (Line(points={{-158,-160},{-150,-160}, + {-150,34},{-142,34}}, color={255,0,255})); + connect(booRep.y, disChi.clr) annotation (Line(points={{-158,-160},{-150,-160}, + {-150,-106},{-142,-106}}, color={255,0,255})); + connect(enaChi.y, anyEnaChi.u) annotation (Line(points={{-118,40},{-110,40},{-110, + -20},{-102,-20}}, color={255,0,255})); + connect(anyEnaChi.y, enaDis.u1) annotation (Line(points={{-78,-20},{-42,-20}}, color={255,0,255})); - connect(disChi.y, anyDisChi.u) annotation (Line(points={{-98,-100},{-90,-100}, - {-90,-60},{-82,-60}},color={255,0,255})); - connect(anyDisChi.y, enaDis.u2) annotation (Line(points={{-58,-60},{-30,-60},{ - -30,-28},{-22,-28}}, color={255,0,255})); - connect(enaDis.y, yOnOff) annotation (Line(points={{2,-20},{240,-20}}, + connect(disChi.y, anyDisChi.u) annotation (Line(points={{-118,-100},{-110,-100}, + {-110,-60},{-102,-60}}, color={255,0,255})); + connect(anyDisChi.y, enaDis.u2) annotation (Line(points={{-78,-60},{-50,-60},{ + -50,-28},{-42,-28}}, color={255,0,255})); + connect(enaDis.y, yOnOff) annotation (Line(points={{-18,-20},{260,-20}}, color={255,0,255})); connect(uStaSet, cha.u) - annotation (Line(points={{-240,130},{-202,130}}, color={255,127,0})); + annotation (Line(points={{-260,130},{-222,130}}, color={255,127,0})); connect(disChi.y, booToInt1.u) - annotation (Line(points={{-98,-100},{-82,-100}}, color={255,0,255})); + annotation (Line(points={{-118,-100},{-102,-100}}, color={255,0,255})); connect(enaChi.y, booToInt.u) - annotation (Line(points={{-98,40},{-82,40}}, color={255,0,255})); - connect(booToInt.y, proInt.u1) annotation (Line(points={{-58,40},{-40,40},{-40, - 46},{-22,46}}, color={255,127,0})); - connect(booToInt1.y, proInt1.u2) annotation (Line(points={{-58,-100},{-40,-100}, - {-40,-106},{-22,-106}}, color={255,127,0})); - connect(chiIndVec.y, proInt.u2) annotation (Line(points={{-98,0},{-40,0},{-40, - 34},{-22,34}}, color={255,127,0})); + annotation (Line(points={{-118,40},{-102,40}}, color={255,0,255})); + connect(booToInt.y, proInt.u1) annotation (Line(points={{-78,40},{-60,40},{-60, + 46},{-42,46}}, color={255,127,0})); + connect(booToInt1.y, proInt1.u2) annotation (Line(points={{-78,-100},{-60,-100}, + {-60,-106},{-42,-106}}, color={255,127,0})); + connect(chiIndVec.y, proInt.u2) annotation (Line(points={{-118,0},{-60,0},{-60, + 34},{-42,34}}, color={255,127,0})); connect(proInt.y, enaChiInd.u) - annotation (Line(points={{2,40},{18,40}}, color={255,127,0})); - connect(chiIndVec.y, proInt1.u1) annotation (Line(points={{-98,0},{-40,0},{-40, - -94},{-22,-94}}, color={255,127,0})); + annotation (Line(points={{-18,40},{-2,40}}, color={255,127,0})); + connect(chiIndVec.y, proInt1.u1) annotation (Line(points={{-118,0},{-60,0},{-60, + -94},{-42,-94}}, color={255,127,0})); connect(proInt1.y, disChiInd.u) - annotation (Line(points={{2,-100},{18,-100}}, color={255,127,0})); - connect(cha.up, upPro.u) annotation (Line(points={{-178,136},{-140,136},{-140, - 160},{-122,160}}, color={255,0,255})); - connect(cha.down, dowPro.u) annotation (Line(points={{-178,124},{-140,124},{-140, - 90},{-122,90}}, color={255,0,255})); - connect(enaDis.y, booToInt2.u) annotation (Line(points={{2,-20},{20,-20},{20,-60}, - {38,-60}}, color={255,0,255})); + annotation (Line(points={{-18,-100},{-2,-100}}, color={255,127,0})); + connect(cha.up, upPro.u) annotation (Line(points={{-198,136},{-160,136},{-160, + 160},{-142,160}}, color={255,0,255})); + connect(cha.down, dowPro.u) annotation (Line(points={{-198,124},{-160,124},{-160, + 80},{-142,80}}, color={255,0,255})); + connect(enaDis.y, booToInt2.u) annotation (Line(points={{-18,-20},{-10,-20},{-10, + -60},{-2,-60}}, color={255,0,255})); connect(upPro.y, booToInt3.u) - annotation (Line(points={{-98,160},{-82,160}}, color={255,0,255})); - connect(booToInt3.y, proInt2.u1) annotation (Line(points={{-58,160},{-20,160}, - {-20,166},{118,166}}, color={255,127,0})); - connect(enaChiInd.y, proInt2.u2) annotation (Line(points={{42,40},{80,40},{80, - 154},{118,154}}, color={255,127,0})); - connect(proInt2.y, yNexEnaChi) - annotation (Line(points={{142,160},{240,160}}, color={255,127,0})); - connect(booToInt3.y, proInt3.u1) annotation (Line(points={{-58,160},{-20,160}, - {-20,126},{118,126}},color={255,127,0})); - connect(booToInt2.y, proInt3.u2) annotation (Line(points={{62,-60},{70,-60},{70, - 114},{118,114}},color={255,127,0})); - connect(proInt3.y, proInt4.u1) annotation (Line(points={{142,120},{160,120},{160, - 116},{178,116}}, color={255,127,0})); - connect(disChiInd.y, proInt4.u2) annotation (Line(points={{42,-100},{90,-100}, - {90,104},{178,104}}, color={255,127,0})); - connect(proInt4.y, yDisSmaChi) - annotation (Line(points={{202,110},{240,110}}, color={255,127,0})); + annotation (Line(points={{-118,160},{-102,160}}, color={255,0,255})); + connect(booToInt3.y, proInt2.u1) annotation (Line(points={{-78,160},{70,160},{ + 70,96},{78,96}}, color={255,127,0})); + connect(enaChiInd.y, proInt2.u2) annotation (Line(points={{22,40},{40,40},{40, + 84},{78,84}}, color={255,127,0})); + connect(booToInt3.y, proInt3.u1) annotation (Line(points={{-78,160},{70,160},{ + 70,36},{78,36}}, color={255,127,0})); + connect(booToInt2.y, proInt3.u2) annotation (Line(points={{22,-60},{60,-60},{60, + 24},{78,24}}, color={255,127,0})); + connect(proInt3.y, proInt4.u1) annotation (Line(points={{102,30},{110,30},{110, + 26},{118,26}}, color={255,127,0})); + connect(disChiInd.y, proInt4.u2) annotation (Line(points={{22,-100},{50,-100}, + {50,14},{118,14}}, color={255,127,0})); connect(dowPro.y, booToInt4.u) - annotation (Line(points={{-98,90},{-82,90}}, color={255,0,255})); - connect(booToInt4.y, proInt5.u1) annotation (Line(points={{-58,90},{100,90},{100, - -94},{118,-94}}, color={255,127,0})); - connect(disChiInd.y, proInt5.u2) annotation (Line(points={{42,-100},{90,-100}, - {90,-106},{118,-106}}, color={255,127,0})); - connect(proInt5.y, yLasDisChi) - annotation (Line(points={{142,-100},{240,-100}}, color={255,127,0})); - connect(booToInt2.y, proInt6.u2) annotation (Line(points={{62,-60},{70,-60},{70, - -146},{118,-146}}, color={255,127,0})); - connect(booToInt4.y, proInt6.u1) annotation (Line(points={{-58,90},{100,90},{100, - -134},{118,-134}}, color={255,127,0})); - connect(proInt6.y, proInt7.u1) annotation (Line(points={{142,-140},{160,-140}, - {160,-154},{178,-154}}, color={255,127,0})); - connect(enaChiInd.y, proInt7.u2) annotation (Line(points={{42,40},{80,40},{80, - -166},{178,-166}}, color={255,127,0})); - connect(proInt7.y, yEnaSmaChi) - annotation (Line(points={{202,-160},{240,-160}}, color={255,127,0})); - connect(endPro, dowPro.clr) annotation (Line(points={{-240,-160},{-170,-160},{ - -170,84},{-122,84}}, color={255,0,255})); - connect(endPro, upPro.clr) annotation (Line(points={{-240,-160},{-170,-160},{-170, - 154},{-122,154}}, color={255,0,255})); + annotation (Line(points={{-118,80},{-102,80}}, color={255,0,255})); + connect(booToInt4.y, proInt5.u1) annotation (Line(points={{-78,80},{30,80},{30, + -94},{78,-94}}, color={255,127,0})); + connect(disChiInd.y, proInt5.u2) annotation (Line(points={{22,-100},{50,-100}, + {50,-106},{78,-106}}, color={255,127,0})); + connect(booToInt2.y, proInt6.u2) annotation (Line(points={{22,-60},{60,-60},{60, + -156},{78,-156}}, color={255,127,0})); + connect(booToInt4.y, proInt6.u1) annotation (Line(points={{-78,80},{30,80},{30, + -144},{78,-144}}, color={255,127,0})); + connect(proInt6.y, proInt7.u1) annotation (Line(points={{102,-150},{110,-150}, + {110,-164},{118,-164}}, color={255,127,0})); + connect(enaChiInd.y, proInt7.u2) annotation (Line(points={{22,40},{40,40},{40, + -176},{118,-176}}, color={255,127,0})); + connect(endPro, dowPro.clr) annotation (Line(points={{-260,-160},{-190,-160},{ + -190,74},{-142,74}}, color={255,0,255})); + connect(endPro, upPro.clr) annotation (Line(points={{-260,-160},{-190,-160},{-190, + 154},{-142,154}}, color={255,0,255})); connect(endPro, booRep.u) - annotation (Line(points={{-240,-160},{-162,-160}}, color={255,0,255})); - connect(uChiSet, falEdg.u) annotation (Line(points={{-240,-20},{-210,-20},{ - -210,-100},{-202,-100}}, color={255,0,255})); + annotation (Line(points={{-260,-160},{-182,-160}}, color={255,0,255})); + connect(uChiSet, falEdg.u) annotation (Line(points={{-260,-20},{-230,-20},{-230, + -100},{-222,-100}}, color={255,0,255})); + connect(upPro.y, yUp) annotation (Line(points={{-118,160},{-110,160},{-110,200}, + {260,200}},color={255,0,255})); + connect(dowPro.y, yDow) annotation (Line(points={{-118,80},{-110,80},{-110,140}, + {260,140}},color={255,0,255})); + connect(upPro.y, intSwi1.u2) annotation (Line(points={{-118,160},{-110,160},{-110, + 200},{160,200},{160,90},{198,90}}, color={255,0,255})); + connect(proInt2.y, intSwi1.u1) annotation (Line(points={{102,90},{140,90},{140, + 98},{198,98}}, color={255,127,0})); + connect(one.y, intSwi1.u3) annotation (Line(points={{102,-40},{180,-40},{180,82}, + {198,82}}, color={255,127,0})); + connect(intSwi1.y, yNexEnaChi) + annotation (Line(points={{222,90},{260,90}}, color={255,127,0})); + connect(upPro.y, intSwi.u2) annotation (Line(points={{-118,160},{-110,160},{-110, + 200},{160,200},{160,40},{198,40}}, color={255,0,255})); + connect(proInt4.y, intSwi.u1) annotation (Line(points={{142,20},{170,20},{170, + 48},{198,48}}, color={255,127,0})); + connect(one.y, intSwi.u3) annotation (Line(points={{102,-40},{180,-40},{180,32}, + {198,32}}, color={255,127,0})); + connect(intSwi.y, yDisSmaChi) + annotation (Line(points={{222,40},{260,40}}, color={255,127,0})); + connect(intSwi3.y, yLasDisChi) + annotation (Line(points={{222,-100},{260,-100}}, color={255,127,0})); + connect(dowPro.y, intSwi3.u2) annotation (Line(points={{-118,80},{-110,80},{-110, + 140},{150,140},{150,-100},{198,-100}}, color={255,0,255})); + connect(dowPro.y, intSwi2.u2) annotation (Line(points={{-118,80},{-110,80},{-110, + 140},{150,140},{150,-150},{198,-150}}, color={255,0,255})); + connect(proInt5.y, intSwi3.u1) annotation (Line(points={{102,-100},{140,-100}, + {140,-92},{198,-92}}, color={255,127,0})); + connect(proInt7.y, intSwi2.u1) annotation (Line(points={{142,-170},{160,-170}, + {160,-142},{198,-142}}, color={255,127,0})); + connect(intSwi2.y, yEnaSmaChi) + annotation (Line(points={{222,-150},{260,-150}}, color={255,127,0})); + connect(one.y, intSwi3.u3) annotation (Line(points={{102,-40},{180,-40},{180,-108}, + {198,-108}}, color={255,127,0})); + connect(one.y, intSwi2.u3) annotation (Line(points={{102,-40},{180,-40},{180,-158}, + {198,-158}}, color={255,127,0})); annotation ( defaultComponentName="nexChi", Diagram(coordinateSystem(preserveAspectRatio=false, - extent={{-220,-180},{220,180}})), + extent={{-240,-220},{240,220}})), Icon(coordinateSystem(extent={{-100,-100},{100,100}}), graphics={ Rectangle( @@ -238,7 +287,7 @@ annotation ( pattern=LinePattern.Dash, textString="uChiSet"), Text( - extent={{50,100},{98,80}}, + extent={{50,50},{98,30}}, textColor={255,127,0}, pattern=LinePattern.Dash, textString="yNexEnaChi"), @@ -248,12 +297,12 @@ annotation ( pattern=LinePattern.Dash, textString="endPro"), Text( - extent={{50,52},{98,32}}, + extent={{50,20},{98,0}}, textColor={255,127,0}, pattern=LinePattern.Dash, textString="yDisSmaChi"), Text( - extent={{50,-28},{98,-48}}, + extent={{50,-48},{98,-68}}, textColor={255,127,0}, pattern=LinePattern.Dash, textString="yDisLasChi"), @@ -263,14 +312,24 @@ annotation ( pattern=LinePattern.Dash, textString="yEnaSmaChi"), Text( - extent={{54,8},{96,-4}}, + extent={{54,-22},{96,-34}}, textColor={255,0,255}, pattern=LinePattern.Dash, textString="yOnOff"), Text( extent={{-100,100},{100,-100}}, textColor={0,0,0}, - textString="?")}), + textString="?"), + Text( + extent={{60,96},{102,84}}, + textColor={255,0,255}, + pattern=LinePattern.Dash, + textString="yUp"), + Text( + extent={{60,76},{102,64}}, + textColor={255,0,255}, + pattern=LinePattern.Dash, + textString="yDow")}), Documentation(info="
This block identifies index of next enable (yNexEnaChi
and
diff --git a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Towers/Staging/Subsequences/CellsNumber.mo b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Towers/Staging/Subsequences/CellsNumber.mo
index d88cd544e46..721f3a30196 100644
--- a/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Towers/Staging/Subsequences/CellsNumber.mo
+++ b/Buildings/Controls/OBC/ASHRAE/PrimarySystem/ChillerPlant/Towers/Staging/Subsequences/CellsNumber.mo
@@ -43,17 +43,27 @@ block CellsNumber
iconTransformation(extent={{-140,-110},{-100,-70}})));
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yNumCel
"Total number of enabled cells"
- annotation (Placement(transformation(extent={{260,-20},{300,20}}),
+ annotation (Placement(transformation(extent={{260,90},{300,130}}),
iconTransformation(extent={{100,-20},{140,20}})));
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yLeaCel
"Lead tower cell status"
annotation (Placement(transformation(extent={{260,-110},{300,-70}}),
iconTransformation(extent={{100,-80},{140,-40}})));
+ CDL.Integers.Switch intSwi
+ annotation (Placement(transformation(extent={{80,20},{100,40}})));
+ CDL.Integers.Sources.Constant conInt(k=1)
+ annotation (Placement(transformation(extent={{0,0},{20,20}})));
+ CDL.Integers.GreaterThreshold intGreThr
+ annotation (Placement(transformation(extent={{200,-50},{220,-30}})));
+ CDL.Conversions.BooleanToReal booToRea
+ annotation (Placement(transformation(extent={{80,60},{100,80}})));
+ CDL.Reals.Multiply mul
+ annotation (Placement(transformation(extent={{180,100},{200,120}})));
protected
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt
"Convert real input to integer output"
- annotation (Placement(transformation(extent={{220,-10},{240,10}})));
+ annotation (Placement(transformation(extent={{220,100},{240,120}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea1
"Convert boolean input to real output"
annotation (Placement(transformation(extent={{-160,-50},{-140,-30}})));
@@ -83,11 +93,11 @@ protected
Buildings.Controls.OBC.CDL.Routing.RealExtractor celOnNum(
final nin=totSta)
"Number of cells should be enabled at current plant stage"
- annotation (Placement(transformation(extent={{180,-10},{200,10}})));
+ annotation (Placement(transformation(extent={{120,140},{140,160}})));
Buildings.Controls.OBC.CDL.Reals.Sources.Constant con5[totSta](
final k=towCelOnSet)
"Number of enabling cells at each stage"
- annotation (Placement(transformation(extent={{140,-10},{160,10}})));
+ annotation (Placement(transformation(extent={{80,140},{100,160}})));
Buildings.Controls.OBC.CDL.Reals.Hysteresis proOn[nConWatPum](
final uLow=fill(speChe, nConWatPum),
final uHigh=fill(2*speChe, nConWatPum))
@@ -138,11 +148,8 @@ equation
connect(sub4.y, greEquThr.u)
annotation (Line(points={{22,-40},{38,-40}}, color={0,0,127}));
connect(con5.y, celOnNum.u)
- annotation (Line(points={{162,0},{178,0}}, color={0,0,127}));
- connect(mulSumInt.y, celOnNum.index)
- annotation (Line(points={{182,-40},{190,-40},{190,-12}}, color={255,127,0}));
- connect(celOnNum.y, reaToInt.u)
- annotation (Line(points={{202,0},{218,0}}, color={0,0,127}));
+ annotation (Line(points={{102,150},{118,150}},
+ color={0,0,127}));
connect(booToInt.y, mulSumInt.u)
annotation (Line(points={{142,-40},{158,-40}}, color={255,127,0}));
connect(uConWatPumSpe, proOn.u)
@@ -169,7 +176,8 @@ equation
connect(swi.y, add3.u1) annotation (Line(points={{-98,100},{-90,100},{-90,-14},
{-82,-14}}, color={0,0,127}));
connect(reaToInt.y, yNumCel)
- annotation (Line(points={{242,0},{280,0}}, color={255,127,0}));
+ annotation (Line(points={{242,110},{280,110}},
+ color={255,127,0}));
connect(proOn.y, mulOr.u) annotation (Line(points={{-198,-160},{-170,-160},{-170,
-160},{-142,-160}}, color={255,0,255}));
connect(uEnaPla, or2.u1)
@@ -184,6 +192,24 @@ equation
annotation (Line(points={{-198,100},{-122,100}}, color={255,0,255}));
connect(mulOr.y, or2.u2) annotation (Line(points={{-118,-160},{-80,-160},{-80,
-98},{198,-98}}, color={255,0,255}));
+ connect(mulSumInt.y, intGreThr.u)
+ annotation (Line(points={{182,-40},{198,-40}}, color={255,127,0}));
+ connect(intGreThr.y, intSwi.u2) annotation (Line(points={{222,-40},{230,-40},
+ {230,-10},{60,-10},{60,30},{78,30}}, color={255,0,255}));
+ connect(mulSumInt.y, intSwi.u1) annotation (Line(points={{182,-40},{190,-40},
+ {190,-20},{50,-20},{50,38},{78,38}}, color={255,127,0}));
+ connect(conInt.y, intSwi.u3) annotation (Line(points={{22,10},{40,10},{40,22},
+ {78,22}}, color={255,127,0}));
+ connect(intSwi.y, celOnNum.index)
+ annotation (Line(points={{102,30},{130,30},{130,138}}, color={255,127,0}));
+ connect(intGreThr.y, booToRea.u) annotation (Line(points={{222,-40},{230,-40},
+ {230,-10},{60,-10},{60,70},{78,70}}, color={255,0,255}));
+ connect(celOnNum.y, mul.u1) annotation (Line(points={{142,150},{160,150},{160,
+ 116},{178,116}}, color={0,0,127}));
+ connect(booToRea.y, mul.u2) annotation (Line(points={{102,70},{160,70},{160,
+ 104},{178,104}}, color={0,0,127}));
+ connect(mul.y, reaToInt.u)
+ annotation (Line(points={{202,110},{218,110}}, color={0,0,127}));
annotation (
defaultComponentName="enaCelNum",
Icon(coordinateSystem(extent={{-100,-100},{100,100}}),