Buildings.Templates.Plants.Controls.Pumps.Primary

Sequences for primary pumps

Information

This package contains control sequences for primary pumps.

Package Content

Name Description
Buildings.Templates.Plants.Controls.Pumps.Primary.DisableDedicated DisableDedicated Pump disable for plants with dedicated primary pumps
Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered EnableLeadHeadered Lead primary pump enable/disable for plants with headered primary pumps
Buildings.Templates.Plants.Controls.Pumps.Primary.VariableSpeedWithHeatPumps VariableSpeedWithHeatPumps Variable speed primary pumps in heat pump plants
Buildings.Templates.Plants.Controls.Pumps.Primary.Validation Validation Collection of validation models

Buildings.Templates.Plants.Controls.Pumps.Primary.DisableDedicated Buildings.Templates.Plants.Controls.Pumps.Primary.DisableDedicated

Pump disable for plants with dedicated primary pumps

Buildings.Templates.Plants.Controls.Pumps.Primary.DisableDedicated

Information

The pump is disabled when the associated plant equipment is disabled and:

When the flow request point is available, the default value for the pump disable delay dtOff is increased from 3 min to 10 min to ensure that flow is not cut off too soon.

Details

Used in Guideline 36 for disabling dedicated primary pumps in chiller and boiler plants.

The enable signal u1 is yielded by the staging event sequencing logic.

Parameters

TypeNameDefaultDescription
Booleanhave_reqFlofalseSet to true if plant equipment provides flow request point via network interface
RealdtOffif not have_reqFlo then 3*60...Runtime with lead equipment proven off before disabling [s]

Connectors

TypeNameDescription
input BooleanInputu1ReqFloFlow request from equipment
input BooleanInputu1Enable signal from system enable logic
input BooleanInputu1EquEquipment enable signal
input BooleanInputu1Equ_actualEquipment status
output BooleanOutputy1Lead pump enable signal

Modelica definition

block DisableDedicated "Pump disable for plants with dedicated primary pumps" parameter Boolean have_reqFlo=false "Set to true if plant equipment provides flow request point via network interface"; parameter Real dtOff( min=0, unit="s")=if not have_reqFlo then 3 * 60 else 10 * 60 "Runtime with lead equipment proven off before disabling"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ReqFlo if have_reqFlo "Flow request from equipment"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1 "Enable signal from system enable logic"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Equ "Equipment enable signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Equ_actual "Equipment status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1 "Lead pump enable signal"; Buildings.Controls.OBC.CDL.Logical.Latch lat "Clear enable signal if disable conditions are met"; Buildings.Controls.OBC.CDL.Logical.Not dis "Return true if lead equipment is disabled"; Buildings.Controls.OBC.CDL.Logical.Not off "Return true if lead equipment is proven off"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant fal( final k=false) if not have_reqFlo "Placeholder constant"; Buildings.Controls.OBC.CDL.Logical.Or offOrNotReq "Return true if lead equipment proven off OR not requesting flow"; Buildings.Controls.OBC.CDL.Logical.Timer timOff( final t=dtOff) "Return true if lead equipment is proven off for specified duration"; Buildings.Controls.OBC.CDL.Logical.And disAndOffOrNotReq "Return true if lead equipment disabled AND (proven off OR not requesting flow)"; Buildings.Controls.OBC.CDL.Logical.Edge edg(pre_u_start=true) "Trigger true signal when disable conditions turn true"; Buildings.Controls.OBC.CDL.Logical.Not noReq if have_reqFlo "Return true if no flow request"; equation connect(lat.y, y1); connect(u1, lat.u); connect(u1Equ, dis.u); connect(u1Equ_actual, off.u); connect(fal.y, offOrNotReq.u2); connect(off.y, timOff.u); connect(timOff.passed, offOrNotReq.u1); connect(u1ReqFlo, noReq.u); connect(noReq.y, offOrNotReq.u2); connect(dis.y, disAndOffOrNotReq.u1); connect(offOrNotReq.y, disAndOffOrNotReq.u2); connect(disAndOffOrNotReq.y, edg.u); connect(edg.y, lat.clr); end DisableDedicated;

Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered

Lead primary pump enable/disable for plants with headered primary pumps

Buildings.Templates.Plants.Controls.Pumps.Primary.EnableLeadHeadered

Information

Plants with parallel piped equipment

The lead primary pump is enabled when any equipment isolation valve is commanded open.

The lead primary pump is disabled when all equipment isolation valves are commanded closed.

For modulating valves, the "valve commanded open" condition is evaluated based on a command signal > 0 %. The "valve commanded closed" condition is evaluated as the negation of the previous condition.

Plants with series piped equipment

The lead primary pump is enabled when any equipment isolation valve is commanded closed.

The lead primary pump is disabled when all equipment isolation valves are commanded open.

For modulating valves, the "valve commanded closed" condition is evaluated based on a command signal < 100 %. The "valve commanded open" condition is evaluated as the negation of the previous condition.

Details

This logic is prescribed in ASHRAE, 2024 for:

The valve command is used in contrast to the feedback of the valve position or the end switch status, as prescribed by Guideline 36. This is for the sake of simplicity, as there is no harm in deadheading the pump for a couple seconds and it simplifies the programming.

For modulating valves, the "valve commanded open/closed" condition is evaluated without hysteresis because the valve command signal is generated by the enabling or staging logic and both use minimum runtime conditions. Therefore, the valve command signal is not subject to any oscillatory behavior.

References

Parameters

TypeNameDefaultDescription
EquipmentConnectiontypCon Type of connection between equipment and primary loop
ActuatortypValIsoBuildings.Templates.Plants.C...Type of isolation valve
IntegernValIso Number of isolation valves

Connectors

TypeNameDescription
input BooleanInputu1ValIso[nValIso]Isolation valve command
input RealInputuValIso[nValIso]Isolation valve command
output BooleanOutputy1Lead pump enable signal

Modelica definition

block EnableLeadHeadered "Lead primary pump enable/disable for plants with headered primary pumps" parameter Buildings.Templates.Plants.Controls.Types.EquipmentConnection typCon "Type of connection between equipment and primary loop"; parameter Buildings.Templates.Plants.Controls.Types.Actuator typValIso= Buildings.Templates.Plants.Controls.Types.Actuator.TwoPosition "Type of isolation valve"; parameter Integer nValIso( final min=1) "Number of isolation valves"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ValIso[nValIso] if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.TwoPosition "Isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uValIso[nValIso] if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.Modulating "Isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1 "Lead pump enable signal"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyOpePar( nin=nValIso) if typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Parallel "Return true if any valve is commanded open - Parallel piped equipment"; Buildings.Controls.OBC.CDL.Logical.MultiAnd allCloPar( nin=nValIso) if typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Parallel "Return true if all valves are commanded closed - Parallel piped equipment"; Buildings.Controls.OBC.CDL.Logical.Not cloParMod[nValIso] if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.Modulating and typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Parallel "Return true if valve is commanded closed"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold opeParMod[nValIso]( each final t=0) if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.Modulating and typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Parallel "Return true if valve commanded > 0 % open"; Buildings.Controls.OBC.CDL.Logical.Latch lat "Clear enable signal if disable conditions are met"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyCloSer( nin=nValIso) if typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Series "Return true if any valve is commanded closed - Series piped equipment"; Buildings.Controls.OBC.CDL.Logical.MultiAnd allOpeSer( nin=nValIso) if typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Series "Return true if all valves are commanded open - Series piped equipment"; Buildings.Controls.OBC.CDL.Reals.LessThreshold cloSerMod[nValIso]( each final t=0.99) if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.Modulating and typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Series "Return true if valve commanded < 99 % open"; Buildings.Controls.OBC.CDL.Logical.Not opeSerMod[nValIso] if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.Modulating and typCon == Buildings.Templates.Plants.Controls.Types.EquipmentConnection.Series "Return true if valve is commanded open"; Buildings.Controls.OBC.CDL.Logical.Not cloTwo[nValIso] if typValIso == Buildings.Templates.Plants.Controls.Types.Actuator.TwoPosition "Return true if valve is commanded closed"; equation connect(uValIso, opeParMod.u); connect(opeParMod.y, cloParMod.u); connect(lat.y, y1); connect(anyOpePar.y, lat.u); connect(allCloPar.y, lat.clr); connect(allOpeSer.y, lat.clr); connect(anyCloSer.y, lat.u); connect(uValIso, cloSerMod.u); connect(cloSerMod.y, opeSerMod.u); connect(u1ValIso, cloTwo.u); connect(cloTwo.y, anyCloSer.u); connect(u1ValIso, anyOpePar.u); connect(cloTwo.y, allCloPar.u); connect(u1ValIso, allOpeSer.u); connect(cloParMod.y, allCloPar.u); connect(cloSerMod.y, anyCloSer.u); connect(opeSerMod.y, allOpeSer.u); connect(opeParMod.y, anyOpePar.u); end EnableLeadHeadered;

Buildings.Templates.Plants.Controls.Pumps.Primary.VariableSpeedWithHeatPumps Buildings.Templates.Plants.Controls.Pumps.Primary.VariableSpeedWithHeatPumps

Variable speed primary pumps in heat pump plants

Buildings.Templates.Plants.Controls.Pumps.Primary.VariableSpeedWithHeatPumps

Information

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

Heating-only plants

When commanded on, the primary HW pumps are commanded at a fixed speed yPumHeaWatPriSet, as determined during the Testing, Adjusting, and Balancing phase to provide the design heat pump flow.

Cooling-only plants

When commanded on, the primary CHW pumps are commanded at a fixed speed yPumChiWatPriSet, as determined during the Testing, Adjusting, and Balancing phase to provide the design heat pump flow.

Heating and cooling plants with common primary CHW and HW pumps

When commanded on, the primary pumps are commanded at a fixed speed yPumHeaWatPriSet in heating mode or yPumChiWatPriSet in cooling mode, as determined during the Testing, Adjusting, and Balancing phase to provide the design heat pump flow in heating mode or cooling mode. The operating mode of the associated heat pump is determined and latched at the time the pump is enabled.

Heating and cooling plants with separate primary CHW and HW pumps

When commanded on, the primary HW pumps are commanded at a fixed speed yPumHeaWatPriSet. When commanded on, the primary CHW pumps are commanded at a fixed speed yPumChiWatPriSet. The pump speed yPumHeaWatPriSet or yPumChiWatPriSet is determined during the Testing, Adjusting, and Balancing phase to provide the design heat pump flow in heating mode or cooling mode.

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

Heating-only plants

The pumps are controlled as described in Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure. The "pump proven on" condition is evaluated based on the primary HW pump status.

Cooling-only plants

The pumps are controlled as described in Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure. The "pump proven on" condition is evaluated based on the primary CHW pump status.

Heating and cooling plants with common primary CHW and HW pumps

The pumps are controlled as described in Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure. For the HW loop, the "pump proven on" condition is evaluated based on the status of the primary pumps associated with heat pumps that are commanded in heating mode. For the CHW loop, the "pump proven on" condition is evaluated based on the status of the primary pumps associated with heat pumps that are commanded in cooling mode. The operating mode of the associated heat pump is determined and latched at the time the pump is enabled.

Heating and cooling plants with separate primary CHW and HW pumps

The pumps are controlled as described in Buildings.Templates.Plants.Controls.Pumps.Generic.ControlDifferentialPressure. For the HW loop, the "pump proven on" condition is evaluated based on the status of the primary HW pumps. For the CHW loop, the "pump proven on" condition is evaluated based on the status of the primary CHW pumps.

Parameters

TypeNameDefaultDescription
Plant configuration
Booleanhave_heaWat Set to true for plants that provide HW
Booleanhave_chiWat Set to true for plants that provide CHW
Booleanhave_pumPriHdr Set to true for headered primary pumps, false for dedicated pumps
Booleanhave_pumChiWatPriDedHpfalseSet to true for HP with separate dedicated primary pumps for CHW and HW circuits
IntegernHp Number of 2-pipe heat pumps
IntegernPhp Number of polyvalent heat pumps
Booleanhave_pumPriCtlDp Set to true for primary variable speed pumps using ∆p pump speed control
IntegernPumHeaWatPri Number of primary HW pumps
IntegernPumChiWatPri Number of primary CHW pumps
Booleanhave_senDpHeaWatRemWir Set to true for remote HW differential pressure sensor(s) hardwired to controller
IntegernSenDpHeaWatRem Number of remote HW differential pressure sensors used for pump speed control
Booleanhave_senDpChiWatRemWir Set to true for remote CHW differential pressure sensor(s) hardwired to controller
IntegernSenDpChiWatRem Number of remote CHW differential pressure sensors used for pump speed control
Information provided by testing, adjusting, and balancing contractor
RealyPumHeaWatPriHdrSet Primary HW pump speed providing design flow – Headered pumps [1]
RealyPumChiWatPriHdrSet Primary CHW pump speed providing design flow – Headered pumps [1]
RealyPumHeaWatPriDedHpSet Primary pump speed providing design flow in heating mode – HP dedicated pumps [1]
RealyPumChiWatPriDedHpSet Primary pump speed providing design flow in cooling mode – HP dedicated pumps [1]
RealyPumHeaWatPriDedPhpSet Primary HW pump speed providing design flow – Polyvalent HP dedicated pumps [1]
RealyPumChiWatPriDedPhpSet Primary CHW pump speed providing design flow – Polyvalent HP dedicated pumps [1]
RealyPumHeaWatPri_min0.1Minimum primary HW pump speed [1]
RealyPumChiWatPri_min0.1Minimum primary CHW pump speed [1]
Control gains
RealkCtlDpHeaWat1Gain of controller for HW loop ∆p control
RealTiCtlDpHeaWat60Time constant of integrator block for HW loop ∆p control [s]
RealkCtlDpChiWat1Gain of controller for CHW loop ∆p control
RealTiCtlDpChiWat60Time constant of integrator block for CHW loop ∆p control [s]

Connectors

TypeNameDescription
input BooleanInputu1PumHeaWatPriHdr[nPumHeaWatPri]Primary HW pump start command – Headered pumps
output RealOutputyPumHeaWatPriHdrHeadered primary HW pump speed command
input BooleanInputu1PumChiWatPriHdr[nPumChiWatPri]Primary CHW pump start command – Headered pumps
output RealOutputyPumChiWatPriHdrHeadered primary CHW pump speed command
output RealOutputyPumHeaWatPriDedHp[nHp]HP dedicated primary HW pump speed command
output RealOutputyPumChiWatPriDedHp[nHp]HP dedicated primary CHW pump speed command
input BooleanInputu1HeaHp[nHp]HP heating/cooling mode command
input BooleanInputu1PumHeaWatPriHdr_actual[nPumHeaWatPri]Primary HW pump status – Headered pumps
input BooleanInputu1PumChiWatPriHdr_actual[nPumChiWatPri]Primary CHW pump status – Headered pumps
input RealInputdpChiWatLocLocal CHW differential pressure [Pa]
input RealInputdpChiWatLocSet[nSenDpChiWatRem]Local CHW differential pressure setpoint output from each of the remote loops [Pa]
input RealInputdpChiWatRem[nSenDpChiWatRem]Remote CHW differential pressure [Pa]
input RealInputdpHeaWatLocLocal HW differential pressure [Pa]
input RealInputdpHeaWatLocSet[nSenDpHeaWatRem]Local HW differential pressure setpoint output from each of the remote loops [Pa]
input RealInputdpHeaWatRem[nSenDpHeaWatRem]Remote HW differential pressure [Pa]
input RealInputdpHeaWatRemSet[nSenDpHeaWatRem]Remote HW differential pressure setpoint [Pa]
input RealInputdpChiWatRemSet[nSenDpChiWatRem]Remote CHW differential pressure setpoint [Pa]
output RealOutputdpHeaWatLocSetMaxMaximum HW local differential pressure setpoint [Pa]
output RealOutputdpChiWatLocSetMaxMaximum CHW local differential pressure setpoint [Pa]
input BooleanInputu1PumHeaWatPriDedHp_actual[nHp]Primary HW pump status – HP dedicated pumps
input BooleanInputu1PumHeaWatPriDedPhp_actual[nPhp]Primary HW pump status – PHP dedicated pumps
input BooleanInputu1PumChiWatPriDedHp_actual[nHp]Primary CHW pump status – HP dedicated pumps
input BooleanInputu1PumChiWatPriDedPhp_actual[nPhp]Primary CHW pump status – PHP dedicated pumps
input BooleanInputu1PumHeaWatPriDedHp[nHp]Primary HW pump start command – HP dedicated pumps
input BooleanInputu1PumHeaWatPriDedPhp[nPhp]Primary HW pump start command – PHP dedicated pumps
input BooleanInputu1PumChiWatPriDedHp[nHp]Primary CHW pump start command – HP dedicated pumps
input BooleanInputu1PumChiWatPriDedPhp[nPhp]Primary CHW pump start command – PHP dedicated pumps
output RealOutputyPumHeaWatPriDedPhp[nPhp]PHP dedicated primary HW pump speed command
output RealOutputyPumChiWatPriDedPhp[nPhp]PHP dedicated primary CHW pump speed command

Modelica definition

block VariableSpeedWithHeatPumps "Variable speed primary pumps in heat pump plants" parameter Boolean have_heaWat "Set to true for plants that provide HW"; parameter Boolean have_chiWat "Set to true for plants that provide CHW"; parameter Boolean have_pumPriHdr "Set to true for headered primary pumps, false for dedicated pumps"; parameter Boolean have_pumChiWatPriDedHp(start=false) = false "Set to true for HP with separate dedicated primary pumps for CHW and HW circuits"; final parameter Boolean have_pumPriComDedHp = nHp > 0 and have_heaWat and have_chiWat and not have_pumPriHdr and not have_pumChiWatPriDedHp "Set to true for HP with single dedicated primary pump serving both CHW and HW circuits"; parameter Integer nHp "Number of 2-pipe heat pumps"; parameter Integer nPhp "Number of polyvalent heat pumps"; final parameter Integer nEqu = nHp + nPhp "Heating or cooling equipment count"; parameter Boolean have_pumPriCtlDp "Set to true for primary variable speed pumps using ∆p pump speed control"; parameter Integer nPumHeaWatPri(start=0) "Number of primary HW pumps"; parameter Integer nPumChiWatPri(start=0) "Number of primary CHW pumps"; parameter Real yPumHeaWatPriHdrSet(max=2, min=0, start=1, unit="1") "Primary HW pump speed providing design flow – Headered pumps"; parameter Real yPumChiWatPriHdrSet(max=2, min=0, start=1, unit="1") "Primary CHW pump speed providing design flow – Headered pumps"; parameter Real yPumHeaWatPriDedHpSet(max=2, min=0, start=1, unit="1") "Primary pump speed providing design flow in heating mode – HP dedicated pumps"; parameter Real yPumChiWatPriDedHpSet(max=2, min=0, start=1, unit="1") "Primary pump speed providing design flow in cooling mode – HP dedicated pumps"; parameter Real yPumHeaWatPriDedPhpSet(max=2, min=0, start=1, unit="1") "Primary HW pump speed providing design flow – Polyvalent HP dedicated pumps"; parameter Real yPumChiWatPriDedPhpSet(max=2, min=0, start=1, unit="1") "Primary CHW pump speed providing design flow – Polyvalent HP dedicated pumps"; parameter Boolean have_senDpHeaWatRemWir(start=false) "Set to true for remote HW differential pressure sensor(s) hardwired to controller"; parameter Integer nSenDpHeaWatRem(start=0) "Number of remote HW differential pressure sensors used for pump speed control"; parameter Real yPumHeaWatPri_min(max=1, min=0, start=0.1, unit="1") = 0.1 "Minimum primary HW pump speed"; parameter Real kCtlDpHeaWat( min=100 * Buildings.Controls.OBC.CDL.Constants.eps, start=1) = 1 "Gain of controller for HW loop ∆p control"; parameter Real TiCtlDpHeaWat( min=100 * Buildings.Controls.OBC.CDL.Constants.eps, start=60, unit="s") = 60 "Time constant of integrator block for HW loop ∆p control"; parameter Boolean have_senDpChiWatRemWir(start=false) "Set to true for remote CHW differential pressure sensor(s) hardwired to controller"; parameter Integer nSenDpChiWatRem(start=0) "Number of remote CHW differential pressure sensors used for pump speed control"; parameter Real yPumChiWatPri_min(max=1, min=0, start=0.1, unit="1") = 0.1 "Minimum primary CHW pump speed"; parameter Real kCtlDpChiWat( min=100 * Buildings.Controls.OBC.CDL.Constants.eps, start=1) = 1 "Gain of controller for CHW loop ∆p control"; parameter Real TiCtlDpChiWat( min=100 * Buildings.Controls.OBC.CDL.Constants.eps, start=60, unit="s") = 60 "Time constant of integrator block for CHW loop ∆p control"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriHdr[nPumHeaWatPri] if have_heaWat and have_pumPriHdr "Primary HW pump start command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriHdr if have_heaWat and have_pumPriHdr "Headered primary HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriHdr[nPumChiWatPri] if have_chiWat and have_pumPriHdr "Primary CHW pump start command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriHdr if have_chiWat and have_pumPriHdr "Headered primary CHW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDedHp[nHp] if have_heaWat and not have_pumPriHdr and nHp > 0 "HP dedicated primary HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDedHp[nHp] if have_chiWat and nHp > 0 and have_pumChiWatPriDedHp "HP dedicated primary CHW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HeaHp[nHp] if have_pumPriComDedHp "HP heating/cooling mode command"; Buildings.Controls.OBC.CDL.Reals.Switch setPumChiWatPriDedHp[nHp] if have_chiWat and nHp > 0 and have_pumChiWatPriDedHp "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(final k=0) "Constant"; Buildings.Controls.OBC.CDL.Reals.Switch setPumHeaWatPriDedHp[nHp] if have_heaWat and nHp > 0 and not have_pumPriHdr "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep(nout=nHp) if nHp > 0 "Replicate signal"; Buildings.Controls.OBC.CDL.Reals.Switch setPumChiWatPriHdr if have_chiWat and have_pumPriHdr "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Reals.Switch setPumHeaWatPriHdr if have_heaWat and have_pumPriHdr "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyPumChiWatPri(nin=nPumChiWatPri) if have_chiWat and have_pumPriHdr "Return true if any pump is enabled"; Buildings.Controls.OBC.CDL.Logical.MultiOr anyPumHeaWatPri(nin=nPumHeaWatPri) if have_heaWat and have_pumPriHdr "Return true if any pump is enabled"; Buildings.Controls.OBC.CDL.Reals.Switch selSpeHeaCooHp[nHp] if have_pumPriComDedHp "Select prescribed pump speed depending on heating/cooling mode – HP with common CHW and HW dedicated pumps"; Utilities.PlaceholderReal ph[nHp]( each final have_inp=have_pumPriComDedHp, each final have_inpPh=true) if have_heaWat and not have_pumPriHdr and nHp > 0 "Always use HW pump speed in case of separate dedicated CHW pumps "; Generic.ControlDifferentialPressure ctlDpHeaWat( final have_senDpRemWir=have_senDpHeaWatRemWir, final k=kCtlDpHeaWat, final nPum=nPumHeaWatPri, final nSenDpRem=nSenDpHeaWatRem, final Ti=TiCtlDpHeaWat, final y_min=yPumHeaWatPri_min) if have_heaWat and have_pumPriCtlDp "HW loop ∆p control"; Utilities.PlaceholderReal phSpePumHeaWatPriHp( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumHeaWatPriDedHpSet) if have_heaWat and nHp > 0 "Replace with fixed speed – HP"; Generic.ControlDifferentialPressure ctlDpChiWat( final have_senDpRemWir=have_senDpChiWatRemWir, final k=kCtlDpChiWat, final nPum=nPumChiWatPri + (if nHp > 0 and not have_pumPriHdr and not have_pumChiWatPriDedHp then nHp else 0), final nSenDpRem=nSenDpChiWatRem, final Ti=TiCtlDpChiWat, final y_min=if have_chiWat then yPumChiWatPri_min else yPumHeaWatPri_min) if have_chiWat and have_pumPriCtlDp "CHW loop ∆p control"; Utilities.PlaceholderReal phSpePumChiWatPriHp( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumChiWatPriDedHpSet) if nHp > 0 and have_chiWat "Replace with fixed speed – HP"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriHdr_actual[nPumHeaWatPri] if have_heaWat and have_pumPriCtlDp and have_pumPriHdr "Primary HW pump status – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriHdr_actual[nPumChiWatPri] if have_chiWat and have_pumPriCtlDp and have_pumPriHdr "Primary CHW pump status – Headered pumps"; Buildings.Controls.OBC.CDL.Logical.Not u1CooHp[nHp] if have_pumPriComDedHp "Return true if HP cooling mode command"; Buildings.Controls.OBC.CDL.Logical.And u1CooAndOnDedHp[nHp] if have_pumPriCtlDp and have_pumPriComDedHp "Return true if cooling mode command and pump proven on – HP with dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLoc(final unit="Pa") if have_chiWat and have_pumPriCtlDp and not have_senDpChiWatRemWir "Local CHW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLocSet[nSenDpChiWatRem]( each final unit="Pa") if have_chiWat and have_pumPriCtlDp and not have_senDpChiWatRemWir "Local CHW differential pressure setpoint output from each of the remote loops"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatRem[nSenDpChiWatRem]( each final unit="Pa") if have_chiWat and have_pumPriCtlDp and have_senDpChiWatRemWir "Remote CHW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLoc(final unit="Pa") if have_heaWat and have_pumPriCtlDp and not have_senDpHeaWatRemWir "Local HW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLocSet[nSenDpHeaWatRem]( each final unit="Pa") if have_heaWat and have_pumPriCtlDp and not have_senDpHeaWatRemWir "Local HW differential pressure setpoint output from each of the remote loops"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatRem[nSenDpHeaWatRem]( each final unit="Pa") if have_heaWat and have_pumPriCtlDp and have_senDpHeaWatRemWir "Remote HW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatRemSet[nSenDpHeaWatRem]( each final unit="Pa") if have_heaWat and have_pumPriCtlDp and have_senDpHeaWatRemWir "Remote HW differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatRemSet[nSenDpChiWatRem]( each final unit="Pa") if have_chiWat and have_pumPriCtlDp and have_senDpChiWatRemWir "Remote CHW differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpHeaWatLocSetMax( final unit="Pa") if have_heaWat and have_pumPriCtlDp and not have_senDpHeaWatRemWir "Maximum HW local differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpChiWatLocSetMax( final unit="Pa") if have_chiWat and have_pumPriCtlDp and not have_senDpChiWatRemWir "Maximum CHW local differential pressure setpoint"; Buildings.Controls.OBC.CDL.Logical.Latch latCoo[nHp] if have_pumPriComDedHp "Latch signal until pump is re-enabled with equipment commanded to alternative mode"; Buildings.Controls.OBC.CDL.Logical.Edge edgU1PumHeaWatPri[nHp] if have_pumPriComDedHp "Return true exactly when the pump is enabled"; Buildings.Controls.OBC.CDL.Logical.And edgU1Coo[nHp] if have_pumPriComDedHp "Return true if equipment commanded in cooling mode when the pump is enabled"; Buildings.Controls.OBC.CDL.Logical.And edgU1AndHea[nHp] if have_pumPriComDedHp "Return true if equipment commanded in heating mode when the pump is enabled"; Buildings.Controls.OBC.CDL.Logical.Latch latHea[nHp] if have_pumPriComDedHp "Latch signal until pump is re-enabled with equipment commanded to alternative mode"; Buildings.Controls.OBC.CDL.Logical.And u1HeaAndOnDedHp[nHp] if have_pumPriCtlDp and have_pumPriComDedHp "Return true if heating mode command and pump proven on – HP with dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedHp_actual[nHp] if have_heaWat and have_pumPriCtlDp and not have_pumPriHdr and nHp > 0 "Primary HW pump status – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedPhp_actual[nPhp] if have_heaWat and have_pumPriCtlDp and not have_pumPriHdr and nPhp > 0 "Primary HW pump status – PHP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedHp_actual[nHp] if have_pumChiWatPriDedHp and have_pumPriCtlDp and nHp > 0 "Primary CHW pump status – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedPhp_actual[nPhp] if have_chiWat and have_pumPriCtlDp and not have_pumPriHdr and nPhp > 0 "Primary CHW pump status – PHP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedHp[nHp] if have_heaWat and not have_pumPriHdr and nHp > 0 "Primary HW pump start command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedPhp[nPhp] if have_heaWat and not have_pumPriHdr and nPhp > 0 "Primary HW pump start command – PHP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedHp[nHp] if have_chiWat and nHp > 0 and have_pumChiWatPriDedHp "Primary CHW pump start command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedPhp[nPhp] if have_chiWat and nPhp > 0 and not have_pumPriHdr "Primary CHW pump start command – PHP dedicated pumps"; Utilities.PlaceholderLogical pumDedOnAndHeaHp[nHp]( each final have_inp=have_pumPriCtlDp and have_pumPriComDedHp, each final have_inpPh=true) if have_heaWat and have_pumPriCtlDp and not have_pumPriHdr and nHp > 0 "Dedicated pump on and heating mode – HP"; Utilities.ConcatenateSelectLogical pumDedOnHea( have_u1=nHp > 0, final have_u2=nPhp > 0, final nin2=nPhp, final nin1=nHp) if have_heaWat and have_pumPriCtlDp and not have_pumPriHdr "Dedicated pump on and heating mode"; Utilities.PlaceholderLogical pumDedOnAndHeaHp2[nHp]( each final have_inp=have_pumPriCtlDp and have_pumPriComDedHp, each final have_inpPh=true) if have_chiWat and have_pumPriCtlDp and not have_pumPriHdr and nHp > 0 "Dedicated pump on and heating mode – HP"; Utilities.ConcatenateSelectLogical pumDedOnCoo( final have_u1=nHp > 0, final have_u2=nPhp > 0, final nin2=nPhp, final nin1=nHp) if have_chiWat and have_pumPriCtlDp and not have_pumPriHdr "Dedicated pump on and cooling mode"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep3(final nout=nHp) if have_heaWat and nHp > 0 "Replicate signal"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep4(final nout=nHp) if nHp > 0 and have_chiWat "Replicate signal"; Utilities.PlaceholderReal phSpePumHeaWatPriPhp( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumHeaWatPriDedPhpSet) if have_heaWat and nPhp > 0 "Replace with fixed speed – PHP"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep5(final nout=nPhp) if have_heaWat and nPhp > 0 "Replicate signal"; Utilities.PlaceholderReal phSpePumChiWatPriPhp( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumChiWatPriDedPhpSet) if have_chiWat and nPhp > 0 "Replace with fixed speed – PHP"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep6(final nout=nPhp) if have_chiWat and nPhp > 0 "Replicate signal"; Utilities.PlaceholderReal phSpePumHeaWatPri( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumHeaWatPriHdrSet) if have_heaWat and have_pumPriHdr "Replace with fixed speed"; Utilities.PlaceholderReal phSpePumChiWatPri( final have_inp=have_pumPriCtlDp, final have_inpPh=false, final u_internal=yPumChiWatPriHdrSet) if have_chiWat and have_pumPriHdr "Replace with fixed speed"; Buildings.Controls.OBC.CDL.Reals.Switch setPumChiWatPriDedPhp[nPhp] if have_chiWat and not have_pumPriHdr and nPhp > 0 "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Reals.Switch setPumHeaWatPriDedPhp[nPhp] if have_heaWat and not have_pumPriHdr and nPhp > 0 "Set prescribed speed when pump is enabled"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDedPhp[nPhp] if have_heaWat and not have_pumPriHdr and nPhp > 0 "PHP dedicated primary HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDedPhp[nPhp] if have_chiWat and not have_pumPriHdr and nPhp > 0 "PHP dedicated primary CHW pump speed command"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep1(nout=nPhp) if nPhp > 0 "Replicate signal"; equation connect(setPumChiWatPriDedHp.y, yPumChiWatPriDedHp); connect(setPumHeaWatPriDedHp.y, yPumHeaWatPriDedHp); connect(zer.y, rep.u); connect(setPumHeaWatPriHdr.y, yPumHeaWatPriHdr); connect(setPumChiWatPriHdr.y, yPumChiWatPriHdr); connect(zer.y, setPumChiWatPriHdr.u3); connect(rep.y, setPumHeaWatPriDedHp.u3); connect(zer.y, setPumHeaWatPriHdr.u3); connect(u1PumChiWatPriHdr, anyPumChiWatPri.u); connect(u1PumHeaWatPriHdr, anyPumHeaWatPri.u); connect(anyPumHeaWatPri.y, setPumHeaWatPriHdr.u2); connect(anyPumChiWatPri.y, setPumChiWatPriHdr.u2); connect(u1HeaHp, u1CooHp.u); connect(dpHeaWatRemSet, ctlDpHeaWat.dpRemSet); connect(dpHeaWatRem, ctlDpHeaWat.dpRem); connect(dpHeaWatLocSet, ctlDpHeaWat.dpLocSet); connect(dpHeaWatLoc, ctlDpHeaWat.dpLoc); connect(dpChiWatRemSet, ctlDpChiWat.dpRemSet); connect(dpChiWatRem, ctlDpChiWat.dpRem); connect(dpChiWatLocSet, ctlDpChiWat.dpLocSet); connect(dpChiWatLoc, ctlDpChiWat.dpLoc); connect(ctlDpHeaWat.dpLocSetMax, dpHeaWatLocSetMax); connect(ctlDpChiWat.dpLocSetMax, dpChiWatLocSetMax); connect(u1HeaHp, edgU1AndHea.u2); connect(edgU1AndHea.y, latHea.u); connect(latCoo.y, u1CooAndOnDedHp.u2); connect(latHea.y, u1HeaAndOnDedHp.u2); connect(u1CooHp.y, edgU1Coo.u2); connect(edgU1PumHeaWatPri.y, edgU1Coo.u1); connect(edgU1PumHeaWatPri.y, edgU1AndHea.u1); connect(edgU1Coo.y, latCoo.u); connect(edgU1AndHea.y, latCoo.clr); connect(edgU1Coo.y, latHea.clr); connect(u1PumHeaWatPriDedHp_actual, u1HeaAndOnDedHp.u1); connect(u1PumHeaWatPriDedHp_actual, u1CooAndOnDedHp.u1); connect(u1PumHeaWatPriDedHp, edgU1PumHeaWatPri.u); connect(u1HeaAndOnDedHp.y, pumDedOnAndHeaHp.u); connect(u1PumHeaWatPriDedHp_actual, pumDedOnAndHeaHp.uPh); connect(pumDedOnAndHeaHp.y, pumDedOnHea.u1); connect(u1PumHeaWatPriDedPhp_actual, pumDedOnHea.u2); connect(pumDedOnHea.y, ctlDpHeaWat.y1_actual); connect(u1PumHeaWatPriHdr_actual, ctlDpHeaWat.y1_actual); connect(u1PumChiWatPriHdr_actual, ctlDpChiWat.y1_actual); connect(pumDedOnCoo.y, ctlDpChiWat.y1_actual); connect(pumDedOnAndHeaHp2.y, pumDedOnCoo.u1); connect(u1CooAndOnDedHp.y, pumDedOnAndHeaHp2.u); connect(u1PumChiWatPriDedHp_actual, pumDedOnAndHeaHp2.uPh); connect(u1PumChiWatPriDedPhp_actual, pumDedOnCoo.u2); connect(latHea.y, selSpeHeaCooHp.u2); connect(phSpePumHeaWatPriHp.y, rep3.u); connect(ctlDpHeaWat.y, phSpePumHeaWatPriHp.u); connect(ctlDpChiWat.y, phSpePumChiWatPriHp.u); connect(phSpePumChiWatPriHp.y, rep4.u); connect(rep3.y, selSpeHeaCooHp.u1); connect(rep4.y, selSpeHeaCooHp.u3); connect(selSpeHeaCooHp.y, ph.u); connect(rep3.y, ph.uPh); connect(phSpePumHeaWatPriPhp.y, rep5.u); connect(phSpePumChiWatPriPhp.y, rep6.u); connect(ctlDpHeaWat.y, phSpePumHeaWatPriPhp.u); connect(ctlDpChiWat.y, phSpePumChiWatPriPhp.u); connect(phSpePumHeaWatPri.y, setPumHeaWatPriHdr.u1); connect(ctlDpHeaWat.y, phSpePumHeaWatPri.u); connect(phSpePumChiWatPri.y, setPumChiWatPriHdr.u1); connect(ctlDpChiWat.y, phSpePumChiWatPri.u); connect(ph.y, setPumHeaWatPriDedHp.u1); connect(rep4.y, setPumChiWatPriDedHp.u1); connect(u1PumChiWatPriDedHp, setPumChiWatPriDedHp.u2); connect(u1PumHeaWatPriDedHp, setPumHeaWatPriDedHp.u2); connect(setPumChiWatPriDedPhp.y, yPumChiWatPriDedPhp); connect(setPumHeaWatPriDedPhp.y, yPumHeaWatPriDedPhp); connect(u1PumHeaWatPriDedPhp, setPumHeaWatPriDedPhp.u2); connect(u1PumChiWatPriDedPhp, setPumChiWatPriDedPhp.u2); connect(rep.y, setPumChiWatPriDedHp.u3); connect(zer.y, rep1.u); connect(rep1.y, setPumHeaWatPriDedPhp.u3); connect(rep1.y, setPumChiWatPriDedPhp.u3); connect(rep5.y, setPumHeaWatPriDedPhp.u1); connect(rep6.y, setPumChiWatPriDedPhp.u1); end VariableSpeedWithHeatPumps;