Buildings.Templates.Plants.Controls.Pumps.Generic

Information

This package contains control sequences for primary or secondary pumps.

Package Content

Name Description
Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure ControlDifferentialPressure Differential pressure control for variable speed pumps
Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure ResetLocalDifferentialPressure Local differential pressure reset
Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeadered StagingHeadered Generic staging logic for headered pumps
Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP StagingHeaderedDeltaP Staging logic for headered variable speed pumps using ∆p pump speed control
Buildings.Templates.Plants.Controls.Pumps.Generic.Validation Validation Collection of validation models

Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure

Differential pressure control for variable speed pumps

Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure

Information

For plants where a remote DP sensor(s) is hardwired to the pump controller (have_senDpRemHar=true):

For plants where the remote DP sensor(s) is not hardwired to the plant controller, but a local DP sensor is hardwired to the plant controller (have_senDpRemHar=false):

Details

This logic is prescribed in ASHRAE, 2021 for:

References


Parameters

TypeNameDefaultDescription
Booleanhave_senDpRemWir Set to true for remote differential pressure sensor(s) hardwired to controller
IntegernPum Number of pumps that operate at design conditions
IntegernSenDpRem Number of remote loop differential pressure sensors used for pump speed control
Realy_min0.1Minimum pump speed [1]
Control gains
Realk1Gain of controller
RealTi60Time constant of integrator block [s]

Connectors

TypeNameDescription
input BooleanInputy1_actual[nPum]Pump status
input RealInputdpRemSet[nSenDpRem]Remote differential pressure setpoint [Pa]
input RealInputdpLocLoop differential pressure local to the plant [Pa]
input RealInputdpRem[nSenDpRem]Remote loop differential pressure [Pa]
input RealInputdpLocSet[nSenDpRem]Local differential pressure setpoint [Pa]
output RealOutputyPump speed command [1]

Modelica definition

block ControlDifferentialPressure "Differential pressure control for variable speed pumps" parameter Boolean have_senDpRemWir "Set to true for remote differential pressure sensor(s) hardwired to controller"; parameter Integer nPum( min=1) "Number of pumps that operate at design conditions"; parameter Integer nSenDpRem( min=1) "Number of remote loop differential pressure sensors used for pump speed control"; parameter Real y_min( max=1, min=0, unit="1")=0.1 "Minimum pump speed"; final parameter Real y_max( final unit="1", final min=0, final max=1)=1 "Maximum pump speed"; parameter Real k( min=100 * Buildings.Controls.OBC.CDL.Constants.eps)=1 "Gain of controller"; parameter Real Ti( min=100 * Buildings.Controls.OBC.CDL.Constants.eps, unit="s")=60 "Time constant of integrator block"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput y1_actual[nPum] "Pump status"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpRemSet[nSenDpRem]( each final unit="Pa") if have_senDpRemWir "Remote differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpLoc( final unit="Pa") if not have_senDpRemWir "Loop differential pressure local to the plant"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpRem[nSenDpRem]( each final unit="Pa") if have_senDpRemWir "Remote loop differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpLocSet[nSenDpRem]( each final unit="Pa") if not have_senDpRemWir "Local differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y( final unit="1") "Pump speed command"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyOn( final nin=nPum) "Return true when any pump is proven on"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator repEna( final nout=nSenDpRem) "Replicate"; Buildings.Controls.OBC.CDL.Reals.MultiMax maxSet( nin=nSenDpRem) if not have_senDpRemWir "Maximum DP setpoint"; Utilities.PIDWithEnable ctlDpRem[nSenDpRem]( each final k=k, each final Ti=Ti, each r=dpSca, each final yMin=y_min, each final yMax=y_max, each final y_reset=y_min, each final y_neutral=0) if have_senDpRemWir "Remote differential pressure control"; Utilities.PIDWithEnable ctlDpLoc( final k=k, final Ti=Ti, final r=dpSca, final yMin=y_min, final yMax=y_max, final y_reset=y_min, final y_neutral=0) if not have_senDpRemWir "Local differential pressure control"; Buildings.Controls.OBC.CDL.Reals.MultiMax maxY( nin=nSenDpRem) if have_senDpRemWir "Maximum control loop output"; protected parameter Real dpSca( final unit="Pa", final min=0)=1E4 "Differential pressure used as a scaling factor for PI control"; equation connect(y1_actual, anyOn.u); connect(anyOn.y, repEna.u); connect(dpLocSet, maxSet.u); connect(dpRemSet, ctlDpRem.u_s); connect(maxSet.y, ctlDpLoc.u_s); connect(dpRem, ctlDpRem.u_m); connect(repEna.y, ctlDpRem.uEna); connect(dpLoc, ctlDpLoc.u_m); connect(anyOn.y, ctlDpLoc.uEna); connect(ctlDpRem.y, maxY.u); connect(ctlDpLoc.y, y); connect(maxY.y, y); end ControlDifferentialPressure;

Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure

Local differential pressure reset

Buildings.Templates.Plants.Controls.Pumps.Generic.ResetLocalDifferentialPressure

Information

For plants where the remote DP sensor(s) is not hardwired to the plant controller, but a local DP sensor is hardwired to the plant controller, remote DP is maintained at setpoint by a reverse acting PI loop running in the controller to which the remote sensor is wired.

The loop output is a DP setpoint for the local primary loop DP sensor hardwired to the plant controller.

The local DP setpoint is reset from dpLocSet_min at 0 % loop output to dpLocSet_max at 100 % loop output.

The minimum local differential pressure setpoint dpLocSet_min is dictated by minimum flow control in primary-only plants but has no lower limit in primary-secondary plants. In primary-only plants, the minimum setpoint needs to be high enough to drive design minimum flow for the largest equipment through the minimum flow bypass valve.

Details

This logic is prescribed in ASHRAE, 2021 for:

References


Parameters

TypeNameDefaultDescription
RealdpLocSet_min5*6895Minimum loop differential pressure setpoint local to the plant [Pa]
RealdpLocSet_max Maximum loop differential pressure setpoint local to the plant [Pa]
Control gains
Realk1Gain of controller
RealTi60Time constant of integrator block [s]

Connectors

TypeNameDescription
input RealInputdpRemSetRemote loop differential pressure setpoint [Pa]
input RealInputdpRemRemote loop differential pressure [Pa]
output RealOutputdpLocSetLocal differential pressure setpoint [Pa]

Modelica definition

block ResetLocalDifferentialPressure "Local differential pressure reset" parameter Real dpLocSet_min( start=0, final unit="Pa", final min=0)=5 * 6895 "Minimum loop differential pressure setpoint local to the plant"; parameter Real dpLocSet_max( start=1E5, final unit="Pa", final min=0) "Maximum loop differential pressure setpoint local to the plant"; parameter Real k( final min=100 * Buildings.Controls.OBC.CDL.Constants.eps)=1 "Gain of controller"; parameter Real Ti( final unit="s", final min=100 * Buildings.Controls.OBC.CDL.Constants.eps)=60 "Time constant of integrator block"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpRemSet( final unit="Pa") "Remote loop differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpRem( final unit="Pa") "Remote loop differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpLocSet( final unit="Pa") "Local differential pressure setpoint "; Buildings.Controls.OBC.CDL.Reals.PID ctlDpRem( final k=k, final Ti=Ti, final r=dpLocSet_max) "Remote loop differential pressure controller"; Buildings.Controls.OBC.CDL.Reals.Line dpLocRes "Local loop differential pressure reset"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( final k=0) "Constant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one( final k=1) "Constant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dpLocSetMin( final k=dpLocSet_min) "Constant"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant dpLocSetMax( final k=dpLocSet_max) "Constant"; equation connect(dpRem, ctlDpRem.u_m); connect(zer.y, dpLocRes.x1); connect(dpLocSetMin.y, dpLocRes.f1); connect(one.y, dpLocRes.x2); connect(dpLocSetMax.y, dpLocRes.f2); connect(dpRemSet, ctlDpRem.u_s); connect(ctlDpRem.y, dpLocRes.u); connect(dpLocRes.y, dpLocSet); end ResetLocalDifferentialPressure;

Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeadered Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeadered

Generic staging logic for headered pumps

Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeadered

Information

Plants with headered primary pumps that are not controlled to maintain differential pressure or flow setpoint

Primary pumps are lead/lag alternated as described in Buildings.Templates.Plants.Controls.StagingRotation.SortRuntime.

The lead primary pump is enabled as described in Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered.

The number of operating primary pumps matches the number of operating equipment.

Plants with headered primary pumps that are controlled to maintain differential pressure or flow setpoint

Primary pumps are lead/lag alternated as described in Buildings.Templates.Plants.Controls.StagingRotation.SortRuntime.

The lead primary pump is enabled as described in Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered.

Primary pumps are staged as described in Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP.

Plants with headered secondary pumps

Secondary pumps are lead/lag alternated as described in Buildings.Templates.Plants.Controls.StagingRotation.SortRuntime.

The lead secondary pump is enabled when the plant is enabled. Otherwise, the lead secondary pump is disabled.

Secondary pumps are staged as described in Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP.

Details

At its current stage of development, this block contains no logic for handling faulted equipment. It is therefore assumed that all pumps are available at all times.

To simplify integration into the plant controller this block also serves as a pass-through for the dedicated primary pump command signal that is generated in Buildings.Templates.Plants.Controls.StagingRotation.EventSequencing.

Parameters

TypeNameDefaultDescription
Booleanis_pri Set to true for primary pumps, false for secondary pumps
Booleanis_hdr Set to true for headered pumps, false for dedicated pumps
Booleanis_ctlDp Set to true for headered variable speed pumps using ∆p pump speed control
Booleanhave_valInlIso Set to true if the system as inlet isolation valves
Booleanhave_valOutIso Set to true if the system as outlet isolation valves
IntegernEqu Number of equipment
IntegernPum Number of pumps
RealV_flow_nominal Design flow rate [m3/s]
RealdtRun600Runtime before triggering stage command [s]
RealdVOffUp0.03Stage up flow point offset [1]
RealdVOffDowdVOffUpStage down flow point offset [1]

Connectors

TypeNameDescription
input BooleanInputu1Pum[nEqu]Pump command from equipment enable logic
input BooleanInputu1Pum_actual[nPum]Pump status – Hardware point
output BooleanOutputy1[nPum]Pump command – Hardware point
output BooleanOutputy1_actual[nEqu]Pump status to equipment enable logic
input RealInputV_flowFlow rate [m3/s]
input BooleanInputu1ValInlIso[nEqu]Equipment inlet isolation valve command
input BooleanInputu1ValOutIso[nEqu]Equipment outlet isolation valve command
input BooleanInputu1PlaPlant enable signal

Modelica definition

block StagingHeadered "Generic staging logic for headered pumps" parameter Boolean is_pri(start=true) "Set to true for primary pumps, false for secondary pumps"; parameter Boolean is_hdr(start=false) "Set to true for headered pumps, false for dedicated pumps"; parameter Boolean is_ctlDp(start=false) "Set to true for headered variable speed pumps using ∆p pump speed control"; parameter Boolean have_valInlIso(start=false) "Set to true if the system as inlet isolation valves"; parameter Boolean have_valOutIso(start=false) "Set to true if the system as outlet isolation valves"; parameter Integer nEqu "Number of equipment"; parameter Integer nPum "Number of pumps"; parameter Real V_flow_nominal( min=1E-6, start=1E-6, unit="m3/s") "Design flow rate"; parameter Real dtRun( min=0, start=600, unit="s")=600 "Runtime before triggering stage command"; parameter Real dVOffUp( max=1, min=0, start=0.03, unit="1")=0.03 "Stage up flow point offset"; parameter Real dVOffDow( max=1, min=0, start=0.03, unit="1")=dVOffUp "Stage down flow point offset"; final parameter Real staPum[nPum, nPum]( each unit="1", each min=0, each max=1)={fill(i / nPum, nPum) for i in 1:nPum} "Pump staging matrix"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Pum[nEqu] if is_pri and (not is_hdr or is_hdr and not is_ctlDp) "Pump command from equipment enable logic"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Pum_actual[nPum] "Pump status – Hardware point"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1[nPum] "Pump command – Hardware point"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1_actual[nEqu] "Pump status to equipment enable logic"; Utilities.StageIndex nPumHdrDp( final have_inpAva=false, final nSta=nPum, final dtRun=dtRun) if is_hdr and is_ctlDp "Compute number of pumps to be staged on – Headered pumps using ∆p control"; Generic.StagingHeaderedDeltaP staHdrDp( final nPum=nPum, final V_flow_nominal=V_flow_nominal, final dtRun=dtRun, final dVOffUp=dVOffUp, final dVOffDow=dVOffDow) if is_hdr and is_ctlDp "Stage headered variable speed pumps using ∆p control"; StagingRotation.SortRuntime sorRunTimHdr( nin=nPum) if is_hdr "Sort by increasing staging runtime"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[nEqu]( each final integerTrue=1, each final integerFalse=0) if is_pri and is_hdr and not is_ctlDp "Convert to integer"; Buildings.Controls.OBC.CDL.Integers.MultiSum nPumHdrPriNotDp0( nin=nEqu) if is_pri and is_hdr and not is_ctlDp "Compute number of pumps to be staged on – Headered primary pumps not using ∆p control"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant u1Ava[nPum]( each final k=true) if is_hdr "Pump available signal – Block does not handle faulted equipment yet"; Buildings.Controls.OBC.CDL.Interfaces.RealInput V_flow( final unit="m3/s") if is_hdr and is_ctlDp "Flow rate"; Buildings.Controls.OBC.CDL.Routing.BooleanExtractSignal sigPumPriDed(final nin =nEqu, final nout=nPum) if is_pri and not is_hdr "Extract dedicated primary pump command signal assuming nEqu=nPum"; Buildings.Controls.OBC.CDL.Routing.BooleanExtractSignal y1Ded_actual( nin=nPum, nout=nEqu) if not is_hdr "Extract dedicated pump status assuming nEqu=nPum"; Buildings.Controls.OBC.CDL.Routing.BooleanExtractor y1LeaHdr_actual( final nin=nPum) if is_hdr "Lead headered pump status"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booScaRep( final nout=nEqu) if is_hdr "Replicate signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ValInlIso[nEqu] if is_pri and is_hdr and have_valInlIso "Equipment inlet isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ValOutIso[nEqu] if is_pri and is_hdr and have_valOutIso "Equipment outlet isolation valve command"; Primary.EnableLeadHeadered enaLeaHdrPri( final typCon=Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Parallel, final typValIso=Buildings.Templates.Plants.Controls.Types.Actuator.TwoPosition, final nValIso=2 * nEqu) if is_pri and is_hdr "Enable/disable lead primary headered pump"; Utilities.PlaceholderLogical phValInlIso[nEqu](each final have_inp= have_valInlIso, each final have_inpPh=true) if is_pri and is_hdr "Placeholder value if signal is not available"; Utilities.PlaceholderLogical phValOutIso[nEqu](each final have_inp= have_valOutIso, each final have_inpPh=true) if is_pri and is_hdr "Placeholder value if signal is not available"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Pla if not is_pri and is_hdr "Plant enable signal"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1( final integerTrue=1, final integerFalse=0) if is_pri and is_hdr and not is_ctlDp "Convert lead pump enable signal to integer"; Buildings.Controls.OBC.CDL.Integers.Multiply nPumHdrPriNotDp if is_pri and is_hdr and not is_ctlDp "Reset number of enabled pumps to zero if lead pump disabled"; StagingRotation.EquipmentEnable enaHdr( final staEqu=staPum) if is_hdr "Enable headered pumps"; equation connect(u1Pum_actual, staHdrDp.u1_actual); connect(staHdrDp.y1Up, nPumHdrDp.u1Up); connect(staHdrDp.y1Dow, nPumHdrDp.u1Dow); connect(u1Pum, booToInt.u); connect(booToInt.y, nPumHdrPriNotDp0.u); connect(u1Ava.y, sorRunTimHdr.u1Ava); connect(V_flow, staHdrDp.V_flow); connect(u1Pum, sigPumPriDed.u); connect(u1Pum_actual, y1Ded_actual.u); connect(y1Ded_actual.y, y1_actual); connect(u1Pum_actual, y1LeaHdr_actual.u); connect(y1LeaHdr_actual.y, booScaRep.u); connect(booScaRep.y, y1_actual); connect(u1ValInlIso, phValInlIso.u); connect(enaLeaHdrPri.y1, nPumHdrDp.u1Lea); connect(phValInlIso.y, enaLeaHdrPri.u1ValIso[1:nEqu]); connect(phValOutIso.y, enaLeaHdrPri.u1ValIso[nEqu + 1:2*nEqu]); connect(u1ValOutIso, phValOutIso.u); connect(u1ValOutIso, phValInlIso.uPh); connect(u1ValInlIso, phValOutIso.uPh); connect(u1Pla, nPumHdrDp.u1Lea); connect(enaLeaHdrPri.y1, booToInt1.u); connect(nPumHdrPriNotDp0.y, nPumHdrPriNotDp.u1); connect(booToInt1.y, nPumHdrPriNotDp.u2); connect(sorRunTimHdr.yIdx[1], y1LeaHdr_actual.index); connect(u1Pum_actual, sorRunTimHdr.u1Run); connect(enaHdr.y1, y1); connect(nPumHdrDp.y, enaHdr.uSta); connect(nPumHdrPriNotDp.y, enaHdr.uSta); connect(u1Ava.y, enaHdr.u1Ava); connect(sorRunTimHdr.yIdx, enaHdr.uIdxAltSor); connect(sigPumPriDed.y, y1); end StagingHeadered;

Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP

Staging logic for headered variable speed pumps using ∆p pump speed control

Buildings.Templates.Plants.Controls.Pumps.Generic.StagingHeaderedDeltaP

Information

Pumps are staged as a function of the ratio ratV_flow of current volume flow rate V_flow to design volume flow rate V_flow_nominal, the number of operating pumps nPum_actual and the number of pumps that operate at design conditions nPum. Pumps are assumed to be equally sized.

FR = V_flow / V_flow_nominal

The next lag pump is enabled whenever the following is true for dtRun:

FR > nPum_actual / nPum − dVOffUp

The last lag pump is disabled whenever the following is true for dtRun:

FR < (nPum_actual - 1) / nPum − dVOffDow

If desired, the stage down flow point dVOffDow can be offset slightly below the stage up point dVOffUp to prevent cycling between pump stages in applications with highly variable loads.

The timers are reset to zero when the status of a pump changes. This is necessary to ensure the minimum pump runtime with rapidly changing loads.

Details

This logic is prescribed in ASHRAE, 2021 for:

For other plant configurations, the pumps are staged with the equipment, i.e., the number of pumps matches the number of chillers or boilers. The actual logic for generating the pump enable commands is part of the staging event sequencing.

A "if" condition is used to generate the stage up and down command as opposed to a "when" condition. This means that the command remains true as long as the condition is verified. This is necessary, for example, if no higher stage is available when a stage up command is triggered. Using a "when" condition – which is only valid at the point in time at which the condition becomes true – would prevent the plant from staging when a higher stage becomes available again. To avoid multiple consecutive stage changes, the block that receives the stage up and down command and computes the stage index must enforce a minimum stage runtime of dtRun.

References


Parameters

TypeNameDefaultDescription
IntegernPum Number of pumps that operate at design conditions
RealV_flow_nominal Design flow rate [m3/s]
RealdtRun10*60Runtime before triggering stage command [s]
RealdVOffUp0.03Stage up flow point offset [1]
RealdVOffDowdVOffUpStage down flow point offset [1]

Connectors

TypeNameDescription
input RealInputV_flowFlow rate [m3/s]
output BooleanOutputy1UpStage up command
output BooleanOutputy1DowStage down command
input BooleanInputu1_actual[nPum]Pump status

Modelica definition

block StagingHeaderedDeltaP "Staging logic for headered variable speed pumps using ∆p pump speed control" parameter Integer nPum( final min=1) "Number of pumps that operate at design conditions"; parameter Real V_flow_nominal( final min=1E-6, final unit="m3/s") "Design flow rate"; parameter Real dtRun( final min=0, final unit="s")=10 * 60 "Runtime before triggering stage command"; parameter Real dVOffUp( final min=0, final max=1, final unit="1")=0.03 "Stage up flow point offset"; parameter Real dVOffDow( final min=0, final max=1, final unit="1")=dVOffUp "Stage down flow point offset"; Buildings.Controls.OBC.CDL.Interfaces.RealInput V_flow( final unit="m3/s") "Flow rate"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Up "Stage up command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Dow "Stage down command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1_actual[nPum] "Pump status"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter norV( final k=1 / V_flow_nominal) "Normalize to design value"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter norN( final k=1 / nPum) "Normalize to design value"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[nPum] "Convert to real value"; Buildings.Controls.OBC.CDL.Reals.Greater gre "Compare to stage up flow point"; Buildings.Controls.OBC.CDL.Reals.Less les "Compare to stage down flow point"; Buildings.Controls.OBC.CDL.Reals.AddParameter poiDow( p=- 1 / nPum - dVOffDow) "Calculate stage down flow point"; Buildings.Controls.OBC.CDL.Reals.AddParameter poiUp( p=- dVOffUp) "Calculate stage up flow point"; Buildings.Templates.Plants.Controls.Utilities.TimerWithReset runUp( final t=dtRun) "Return true if stage up condition is true for specified duration"; Buildings.Templates.Plants.Controls.Utilities.TimerWithReset runDow( final t=dtRun) "Return true if stage down condition is true for specified duration"; Buildings.Controls.OBC.CDL.Logical.Change cha[nPum] "Return true when pump status changes"; Buildings.Controls.OBC.CDL.Reals.MultiSum nOpe( nin=nPum) "Return number of operating pumps"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyCha( nin=nPum) "Return true when any pump status changes"; equation connect(norN.y, poiDow.u); connect(norN.y, poiUp.u); connect(norV.y, gre.u1); connect(poiUp.y, gre.u2); connect(poiDow.y, les.u2); connect(norV.y, les.u1); connect(les.y, runDow.u); connect(V_flow, norV.u); connect(gre.y, runUp.u); connect(runUp.passed, y1Up); connect(runDow.passed, y1Dow); connect(booToRea.y, nOpe.u); connect(u1_actual, booToRea.u); connect(u1_actual, cha.u); connect(nOpe.y, norN.u); connect(cha.y, anyCha.u); connect(anyCha.y, runUp.reset); connect(anyCha.y, runDow.reset); end StagingHeaderedDeltaP;