Buildings.Templates.Plants.Controls.HeatPumps

Controllers for heat pump plants

Information

This package contains control sequences for heat pump plants.

Package Content

Name Description
Buildings.Templates.Plants.Controls.HeatPumps.AirToWater AirToWater Controller for AWHP plant
Buildings.Templates.Plants.Controls.HeatPumps.Subsequences Subsequences Subsequences for heat pump staging controls
Buildings.Templates.Plants.Controls.HeatPumps.Validation Validation Collection of validation models

Buildings.Templates.Plants.Controls.HeatPumps.AirToWater Buildings.Templates.Plants.Controls.HeatPumps.AirToWater

Controller for AWHP plant

Buildings.Templates.Plants.Controls.HeatPumps.AirToWater

Information

This block implements the sequence of operation for plants with air-to-water heat pumps. Most parts of the sequence of operation are similar to that described in ASHRAE, 2024 for chiller plants.

The supported plant configurations are enumerated in the table below.

Configuration parameter Options Notes
Function and equipment type Heating-only with non-reversible heat pumps
Heating and cooling with reversible heat pumps
Heating and cooling with reversible heat pumps and heat recovery chiller
Heating and cooling with reversible (2-pipe) heat pumps and polyvalent (4-pipe) heat pumps
Heating and cooling with polyvalent (4-pipe) heat pumps
For configurations without polyvalent heat pumps, the heat pumps may be unequally sized, with only a subset of the units participating in lead/lag alternation.
For configurations with polyvalent heat pumps, the reversible heat pumps must be equally sized among themselves, and the polyvalent heat pumps must be equally sized among themselves. All units are lead/lag alternated within their own pool.
For the configuration with a heat recovery chiller, the chiller is considered connected in a sidestream configuration to both the CHW return and the HW return.
Type of distribution Variable primary-only
Constant primary-variable secondary centralized
It is assumed that the HW and the CHW loops have the same type of distribution, as specified by this parameter.
Most AWHPs on the market use a reverse cycle for defrosting. This requires maximum primary flow during defrost cycles. Consequently, variable primary plants commonly adopt a high minimum flow setpoint, typically close to the design flow rate, effectively operating akin to constant primary plants but with variable speed pumps controlling the loop differential pressure. While the flow rate directed towards the loads varies, the bypass valve control loop ensures a constant primary flow for a given number of staged units.
"Centralized secondary pumps" refers to configurations with a single group of secondary pumps that is typically integrated into the plant.
Distributed secondary pumps with multiple secondary loops served by dedicated secondary pumps are currently not supported.
Type of primary pump arrangement Dedicated
Headered
It is assumed that the HW and the CHW loops have the same type of primary pump arrangement, as specified by this parameter.
Primary-secondary plants with both reversible and polyvalent heat pumps must have primary dedicated pumps: primary headered pumps are not supported for this configuration.
Separate dedicated primary pumps for the CHW and HW circuits False
True
This option is only available for reversible heat pumps with dedicated primary pumps. If this option is not selected, each AWHP uses a common dedicated primary pump for CHW and HW – this pump is then denoted as the primary HW pump. Otherwise, each AWHP relies on a separate dedicated HW pump and a separate dedicated CHW pump.
Type of primary HW pumps Variable speed
Constant speed
For constant primary-variable secondary distributions, the variable speed primary pumps are commanded at fixed speeds, determined during the Testing, Adjusting and Balancing phase to provide design AWHP flow in heating and cooling modes. The same intent is achieved with constant speed primary pumps through the use of balancing valves.
This parameter is only available for constant primary-variable secondary plants.
Type of primary CHW pumps Variable speed
Constant speed
See the note above on primary HW pumps.

Details

For plants without polyvalent heat pumps, a staging matrix staEqu is required as a parameter. See the documentation of Buildings.Templates.Plants.Controls.StagingRotation.EquipmentEnable for the associated definition and requirements.

For plants with polyvalent heat pumps, the staging matrix is programmatically generated, under the assumption that all units (polyvalent heat pumps on the one hand, and optionally reversible heat pumps on the other hand) are equally sized. See the documentation of Buildings.Templates.Plants.Controls.PolyvalentHeatPumps.StagingParameters for the associated logic.

Depending on the plant configuration, the term "primary HW pumps" (and the corresponding variables containing *pumHeaWatPri*) refers either to primary HW pumps for plants with separate primary HW and CHW pumps (either headered or dedicated) or to dedicated primary pumps for plants with common primary pumps serving both the HW and CHW loops.

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

References

Parameters

TypeNameDefaultDescription
Plant configuration
PlantHeatPumptypBuildings.Templates.Plants.C...Type of plant
Booleanis_priOnlfalseSet to true for primary-only plant
Booleanhave_valHpInlIso Set to true for plants with isolation valves at heat pump inlet
Booleanhave_valHpOutIso Set to true for plants with isolation valves at heat pump outlet
Booleanhave_valPhpInlIso Set to true for isolation valves at polyvalent HP inlet
Booleanhave_valPhpOutIso Set to true for isolation valves at polyvalent HP outlet
Booleanhave_pumChiWatPriDedHp_selectfalseSet to true for HP with separate dedicated primary pumps for CHW and HW circuits
Booleanhave_pumPriHdr Set to true for headered primary pumps, false for dedicated pumps
Booleanhave_pumHeaWatPriVar_selecttrueSet to true for variable speed primary HW pumps, false for constant speed pumps
Booleanhave_pumChiWatPriVar_selecttrueSet to true for variable speed primary CHW pumps, false for constant speed pumps
IntegernHp_select Number of 2-pipe heat pumps
IntegernPhp_select Number of polyvalent heat pumps
IntegernPumHeaWatPri_selectnHp + nPhpNumber of primary HW pumps
IntegernPumChiWatPri_selectnHp + nPhpNumber of primary CHW pumps
IntegernPumHeaWatSec_selectnHp + nPhpNumber of secondary HW pumps
IntegernPumChiWatSec_selectnHp + nPhpNumber of secondary CHW pumps
Sensors
Booleanhave_senTPriRet_selectfalseSet to true for plants with primary CHW/HW return temperature sensor
Booleanhave_senTLooRet_selectfalseSet to true for plants with CHW/HW loop return temperature sensor (load side of minimum flow bypass)
Booleanhave_senDpHeaWatRemWirfalseSet to true for remote HW differential pressure sensor(s) hardwired to plant or pump controller
IntegernSenDpHeaWatRem Number of remote HW differential pressure sensors used for HW pump speed control
Booleanhave_senDpChiWatRemWirfalseSet to true for remote CHW differential pressure sensor(s) hardwired to plant or pump controller
IntegernSenDpChiWatRem Number of remote CHW differential pressure sensors used for CHW pump speed control
Information provided by designer
RealTHeaWatSup_nominal Design HW supply temperature (maximum setpoint) [K]
RealTHeaWatSupSet_min Minimum value to which the HW supply temperature can be reset [K]
RealTOutHeaWatLck294.15Outdoor air lockout temperature above which the HW loop is prevented from operating [K]
RealcapHeaHp_nominal[nHp] Design heating capacity - Each heat pump [W]
RealVHeaWatHp_flow_nominal[nHp] Design HW volume flow rate - Each heat pump [m3/s]
RealVHeaWatHp_flow_min[nHp] Minimum HW volume flow rate - Each heat pump [m3/s]
RealcapHeaPhp_nominal[nPhp] Design heating capacity - Each polyvalent heat pump [W]
RealcapHeaShcPhp_nominal[nPhp] Design heating capacity in SHC mode - Each polyvalent heat pump [W]
RealVHeaWatPhp_flow_nominal[nPhp] Design HW volume flow rate - Each polyvalent heat pump [m3/s]
RealVHeaWatPhp_flow_min[nPhp] Minimum HW volume flow rate - Each polyvalent heat pump [m3/s]
RealVHeaWatPri_flow_nominalsum(cat(1, VHeaWatHp_flow_no...Primary HW volume flow rate [m3/s]
RealVHeaWatSec_flow_nominal Design secondary HW volume flow rate [m3/s]
RealdpHeaWatRemSet_min5*6894Minimum value to which the HW differential pressure can be reset - Remote sensor [Pa]
RealTChiWatSup_nominal Design CHW supply temperature (minimum setpoint) [K]
RealTChiWatSupSet_max Maximum value to which the CHW supply temperature can be reset [K]
RealTOutChiWatLck289.15Outdoor air lockout temperature below which the CHW loop is prevented from operating [K]
RealcapCooHp_nominal[nHp] Design cooling capacity - Each heat pump [W]
RealVChiWatHp_flow_nominal[nHp] Design CHW volume flow rate - Each heat pump [m3/s]
RealVChiWatHp_flow_min[nHp] Minimum CHW volume flow rate - Each heat pump [m3/s]
RealcapCooPhp_nominal[nPhp] Design cooling capacity - Each polyvalent heat pump [W]
RealcapCooShcPhp_nominal[nPhp] Design cooling capacity in SHC mode - Each polyvalent heat pump [W]
RealVChiWatPhp_flow_nominal[nPhp] Design CHW volume flow rate - Each polyvalent heat pump [m3/s]
RealVChiWatPhp_flow_min[nPhp] Minimum CHW volume flow rate - Each polyvalent heat pump [m3/s]
RealVChiWatPri_flow_nominalsum(cat(1, VChiWatHp_flow_no...Primary CHW volume flow rate [m3/s]
RealVChiWatSec_flow_nominal Design secondary CHW volume flow rate [m3/s]
RealdpChiWatRemSet_min5*6894Minimum value to which the CHW differential pressure can be reset - Remote sensor [Pa]
Realcp_default4184Default specific heat capacity used to compute required capacity [J/(kg.K)]
Realrho_default996Default density used to compute required capacity [kg/m3]
RealTChiWatSupHrc_min Sidestream HRC – Minimum allowable CHW supply temperature [K]
RealTHeaWatSupHrc_max Sidestream HRC – Maximum allowable HW supply temperature [K]
RealCOPHeaHrc_nominal Sidestream HRC – Heating COP at design heating conditions [1]
RealcapCooHrc_min Sidestream HRC – Minimum cooling capacity below which cycling occurs [W]
RealcapHeaHrc_min Sidestream HRC – Minimum heating capacity below which cycling occurs [W]
Information provided by testing, adjusting, and balancing contractor
RealdpHeaWatRemSet_max[nSenDpHeaWatRem] Maximum HW differential pressure setpoint - Remote sensor [Pa]
RealyPumHeaWatPriHdrSet Primary HW pump speed providing design flow – Headered pumps [1]
RealyPumHeaWatPriDedHpSet Primary pump speed providing design flow in heating mode – HP dedicated pumps [1]
RealyPumHeaWatPriDedPhpSet Primary HW pump speed providing design flow – Polyvalent HP dedicated pumps [1]
RealdpChiWatRemSet_max[nSenDpChiWatRem] Maximum CHW differential pressure setpoint - Remote sensor [Pa]
RealyPumChiWatPriHdrSet Primary CHW pump speed providing design flow – Headered pumps [1]
RealyPumChiWatPriDedHpSet Primary pump speed providing design flow in cooling mode – HP dedicated pumps [1]
RealyPumChiWatPriDedPhpSet Primary CHW pump speed providing design flow – Polyvalent HP dedicated pumps [1]
Plant enable
Booleanhave_inpSchfalseSet to true to provide schedule via software input point
RealschHea[:, 2][0, 1; 24*3600, 1]Heating mode enable schedule
RealschCoo[:, 2][0, 1; 24*3600, 1]Cooling mode enable schedule
Equipment staging and rotation
RealstaHp[:, :]{i/nHp for _ in 1:nHp, i in ...Heat pump staging matrix – Equipment required for each stage [1]
IntegeridxAltHp_select[:]1:nHpIndices of lead/lag alternate heat pumps
RealplrSta0.9Staging part load ratio [1]
Advanced
Plant enable
IntegernReqIgnHeaWat0Number of ignored HW plant requests
IntegernReqIgnChiWat0Number of ignored CHW plant requests
RealdTOutLck0.5Hysteresis for outdoor air lockout temperature [K]
RealdtRunEna15*60Minimum runtime of enable and disable states [s]
RealdtReqDis3*60Runtime with low number of request before disabling [s]
Equipment staging and rotation
RealdTHea2.5Delta-T triggering stage up command for heating applications (>0) [K]
RealdTCoo1Delta-T triggering stage up command for cooling applications (>0) [K]
RealdtVal90Nominal valve timing [s]
RealdtRunSta900Minimum runtime of each stage [s]
RealdtOff900Off time required before equipment is deemed available again [s]
RealdtOffHp180Heat pump internal shutdown cycle timing (before closing isolation valves or disabling primary pumps) [s]
RealdtPri900Runtime with high primary-setpoint Delta-T before staging up [s]
RealdtSec600Runtime with high secondary-primary and secondary-setpoint Delta-T before staging up [s]
Pump staging
RealdtRunPumSta600Runtime before triggering stage change command based on efficiency condition [s]
RealdtRunFaiSafPumSta300Runtime before triggering stage change command based on failsafe condition [s]
RealdtRunFaiSafLowYPumStadtRunPumStaRuntime before triggering stage change command based on low pump speed failsafe condition [s]
RealdVOffUpPumSta0.03Stage up flow point offset [1]
RealdVOffDowPumStadVOffUpPumStaStage down flow point offset [1]
RealdpOffPumSta1E4Stage change ∆p point offset (>0) [Pa]
RealyUpPumSta0.99Stage up pump speed point [1]
RealyDowPumSta0.4Stage down pump speed point [1]
Plant reset
RealdtHol900Minimum hold time during stage change [s]
RealresDpHeaWat_max0.5Upper limit of plant reset interval for HW differential pressure reset [1]
RealresTHeaWatSup_minresDpHeaWat_maxLower limit of plant reset interval for HW supply temperature reset [1]
RealresDpChiWat_max0.5Upper limit of plant reset interval for CHW differential pressure reset [1]
RealresTChiWatSup_minresDpChiWat_maxLower limit of plant reset interval for CHW supply temperature reset [1]
Realres_init1Initial reset value [1]
Realres_min0Minimum reset value [1]
Realres_max1Maximum reset value [1]
RealdtDel900Delay time before the reset begins [s]
RealdtResHeaWat300Time step for HW plant reset [s]
IntegernReqResIgnHeaWat2Number of ignored requests for HW plant reset
RealtriHeaWat-0.02Trim amount for HW plant reset [1]
RealrspHeaWat0.03Respond amount for HW plant reset [1]
RealrspHeaWat_max0.07Maximum response per time interval for HW plant reset [1]
RealdtResChiWat300Time step for CHW plant reset [s]
IntegernReqResIgnChiWat2Number of ignored requests for CHW plant reset
RealtriChiWat-0.02Trim amount for CHW plant reset [1]
RealrspChiWat0.03Respond amount for CHW plant reset [1]
RealrspChiWat_max0.07Maximum response per time interval for CHW plant reset [1]
Pump control
RealyPumHeaWatPri_min0.1Minimum primary HW pump speed [1]
RealyPumChiWatPri_min0.1Minimum primary CHW pump speed [1]
RealyPumHeaWatSec_min0.1Minimum secondary HW pump speed [1]
RealyPumChiWatSec_min0.1Minimum secondary CHW pump speed [1]
Loop differential pressure
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]
Minimum flow control
RealkValMinByp1Gain of controller
TimeTiValMinByp60Time constant of integrator block [s]
Sidestream HRC
Booleanhave_reqFloHrcfalseSet to true if HRC provides flow request point via network interface
RealdtLoaHrc600Runtime with sufficient load before enabling [s]
RealdtTem1Hrc180Runtime with first temperature threshold exceeded before disabling [s]
RealdtTem2Hrc60Runtime with second temperature threshold exceeded before disabling [s]

Connectors

TypeNameDescription
input IntegerInputnReqPlaHeaWatNumber of HW plant requests
input RealInputTOutOutdoor air temperature [K]
input BooleanInputu1SchHeaHeating mode enable via schedule
input IntegerInputnReqPlaChiWatNumber of CHW plant requests
input BooleanInputu1SchCooCooling mode enable via schedule
input IntegerInputnReqResHeaWatSum of HW reset requests of all heating loads served
input IntegerInputnReqResChiWatSum of CHW reset requests of all heating loads served
input BooleanInputu1Php_actual[nPhp]Polyvalent heat pump status
input BooleanInputu1PumHeaWatPriDedPhp_actual[nPumHeaWatPriDedPhp]Primary HW pump status
input BooleanInputu1PumChiWatPriHdr_actual[nPumChiWatPri]Primary CHW pump status – Headered pumps
input BooleanInputu1PumHeaWatSec_actual[nPumHeaWatSec]Secondary HW pump status
input BooleanInputu1PumChiWatSec_actual[nPumChiWatSec]Secondary CHW pump status
input RealInputTHeaWatPriRetPrimary HW return temperature [K]
input RealInputVHeaWatPri_flowPrimary HW volume flow rate [m3/s]
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 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]
output BooleanOutputy1ValHeaWatHpInlIso[nHp]Heat pump inlet HW isolation valve command
output BooleanOutputy1ValHeaWatHpOutIso[nHp]Heat pump outlet HW isolation valve command
output BooleanOutputy1ValChiWatHpInlIso[nHp]Heat pump inlet CHW isolation valve command
output BooleanOutputy1ValChiWatHpOutIso[nHp]Heat pump outlet CHW isolation valve command
output BooleanOutputy1PumHeaWatPriHdr[nPumHeaWatPri]Primary HW pump start command – Headered pumps
output BooleanOutputy1PumChiWatPriHdr[nPumChiWatPri]Primary CHW pump start command – Headered pumps
output BooleanOutputy1PumHeaWatSec[nPumHeaWatSec]Secondary HW pump start command
output BooleanOutputy1PumChiWatSec[nPumChiWatSec]Secondary CHW pump start command
output BooleanOutputy1Hp[nHp]Heat pump enable command
output BooleanOutputy1HeaHp[nHp]Heat pump heating/cooling mode command: true=heating, false=cooling
output BooleanOutputy1HeaPhp[nPhp]Polyvalent HP heating on/off command
output BooleanOutputy1CooPhp[nPhp]Polyvalent HP cooling on/off command
output BooleanOutputy1ValHeaWatPhpInlIso[nPhp]Polyvalent HP inlet HW isolation valve command
output BooleanOutputy1ValChiWatPhpInlIso[nPhp]Polyvalent HP inlet CHW isolation valve command
output BooleanOutputy1ValHeaWatPhpOutIso[nPhp]Polyvalent HP outlet HW isolation valve command
output BooleanOutputy1ValChiWatPhpOutIso[nPhp]Polyvalent HP outlet CHW isolation valve command
output RealOutputdpHeaWatRemSet[nSenDpHeaWatRem]HW differential pressure setpoint [Pa]
output RealOutputdpChiWatRemSet[nSenDpChiWatRem]CHW differential pressure setpoint [Pa]
output RealOutputyPumHeaWatPriHdrPrimary HW pump speed command – Headered pumps [1]
output RealOutputyPumChiWatPriHdrPrimary CHW pump speed command – Headered pumps [1]
output RealOutputyPumHeaWatSecPrimary HW pump speed command [1]
output RealOutputyPumChiWatSecPrimary CHW pump speed command [1]
output RealOutputTChiWatSupSetPlant CHW supply temperature setpoint [K]
output RealOutputTHeaWatSupSetPlant HW supply temperature setpoint [K]
input RealInputTChiWatPriRetPrimary CHW return temperature [K]
input RealInputVChiWatPri_flowPrimary CHW volume flow rate [m3/s]
input BooleanInputu1Hp_actual[nHp]Heat pump status
output RealOutputyPumHeaWatPriDedHp[nPumHeaWatPriDedHp]Primary HW pump speed command – HP dedicated pumps [1]
output RealOutputyPumChiWatPriDedHp[nPumChiWatPriDedHp]Primary CHW pump speed command – HP dedicated pumps [1]
input RealInputTHeaWatLooOrSecRetHW loop (primary-only) or secondary (primary-secondary) return temperature [K]
input RealInputVHeaWatLooOrSec_flowHW loop (primary-only) or secondary (primary-secondary) volume flow rate [m3/s]
input RealInputTChiWatLooOrSecRetCHW loop (primary-only) or secondary (primary-secondary) return temperature [K]
input RealInputVChiWatLooOrSec_flowCHW loop (primary-only) or secondary (primary-secondary) volume flow rate [m3/s]
output RealOutputTHeaWatSupHpSet[nHp]HP HW supply temperature setpoint [K]
input RealInputTHeaWatPriSupPrimary HW supply temperature [K]
input RealInputTChiWatPriSupPrimary CHW return temperature [K]
input RealInputTHeaWatSecSupSecondary HW supply temperature [K]
input RealInputTChiWatSecSupSecondary CHW supply temperature [K]
output BooleanOutputy1HrcSidestream HRC enable command
output BooleanOutputy1CooHrcSidestream HRC mode command: true for cooling, false for heating
output BooleanOutputy1PumChiWatHrcSidestream HRC CHW pump enable command
output BooleanOutputy1PumHeaWatHrcSidestream HRC HW pump enable command
output RealOutputTHeaWatSupHrcSetSidestream HRC HW supply temperature setpoint [K]
input RealInputTChiWatRetUpsHrcCHW return temperature upstream of HRC [K]
input RealInputTHeaWatRetUpsHrcHW return temperature upstream of HRC [K]
input BooleanInputu1Hrc_actualHRC status
input BooleanInputu1ReqFloChiWatCHW flow request from HRC
input BooleanInputu1ReqFloConWatCW flow request from HRC
output RealOutputyValHeaWatMinBypHW minimum flow bypass valve command [1]
output RealOutputyValChiWatMinBypCHW minimum flow bypass valve command [1]
output RealOutputTChiWatSupHpSet[nHp]HP CHW supply temperature setpoint [K]
output RealOutputTChiWatSupHrcSetSidestream HRC CHW supply temperature setpoint [K]
input BooleanInputu1PumChiWatPriDedHp_actual[nPumChiWatPriDedHp]Primary CHW pump status – HP dedicated pumps
input BooleanInputu1PumChiWatPriDedPhp_actual[nPumChiWatPriDedPhp]Primary CHW pump status – Polyvalent HP dedicated pumps
output BooleanOutputy1PumChiWatPriDedHp[nPumChiWatPriDedHp]Primary CHW pump start command – HP dedicated pumps
output BooleanOutputy1PumChiWatPriDedPhp[nPumChiWatPriDedPhp]Primary CHW pump start command – Polyvalent HP dedicated pumps
output RealOutputyPumChiWatPriDedPhp[nPumChiWatPriDedPhp]Primary CHW pump speed command – Polyvalent HP dedicated pumps [1]
input BooleanInputu1PumHeaWatPriDedHp_actual[nPumHeaWatPriDedHp]Primary HW pump status
output BooleanOutputy1PumHeaWatPriDedHp[nPumHeaWatPriDedHp]Primary HW pump start command – HP dedicated pumps
output BooleanOutputy1PumHeaWatPriDedPhp[nPumHeaWatPriDedPhp]Primary HW pump start command – Polyvalent HP dedicated pumps
output RealOutputyPumHeaWatPriDedPhp[nPumHeaWatPriDedPhp]Primary HW pump speed command – Polyvalent HP dedicated pumps [1]
output RealOutputTHeaWatSupPhpSet[nPhp]Polyvalent HP HW supply temperature setpoint [K]
output RealOutputTChiWatSupPhpSet[nPhp]Polyvalent HP CHW supply temperature setpoint [K]
input BooleanInputu1PumHeaWatPriHdr_actual[nPumHeaWatPri]Primary HW pump status

Modelica definition

block AirToWater "Controller for AWHP plant" parameter Buildings.Templates.Plants.Controls.Types.PlantHeatPump typ = Buildings.Templates.Plants.Controls.Types.PlantHeatPump.Reversible "Type of plant"; final parameter Boolean have_heaWat = true "Set to true for plants that provide HW"; final parameter Boolean have_chiWat = typ <> Buildings.Templates.Plants.Controls.Types.PlantHeatPump.HeatingOnly "Set to true for plants that provide CHW"; final parameter Boolean have_hrc = typ == Buildings.Templates.Plants.Controls.Types.PlantHeatPump.ReversibleHeatRecovery "Set to true for plants with sidestream heat recovery chiller"; final parameter Boolean have_hp = typ <> Buildings.Templates.Plants.Controls.Types.PlantHeatPump.Polyvalent "Set to true for plants with 2-pipe heat pumps"; final parameter Boolean have_php = typ == Buildings.Templates.Plants.Controls.Types.PlantHeatPump.ReversiblePolyvalent or typ == Buildings.Templates.Plants.Controls.Types.PlantHeatPump.Polyvalent "Set to true for plants with polyvalent heat pumps"; parameter Boolean is_priOnl = false "Set to true for primary-only plant"; parameter Boolean have_valHpInlIso(start=false) "Set to true for plants with isolation valves at heat pump inlet"; parameter Boolean have_valHpOutIso(start=false) "Set to true for plants with isolation valves at heat pump outlet"; parameter Boolean have_valPhpInlIso(start=false) "Set to true for isolation valves at polyvalent HP inlet"; parameter Boolean have_valPhpOutIso(start=false) "Set to true for isolation valves at polyvalent HP outlet"; final parameter Boolean have_pumHeaWatPri = have_heaWat "Set to true for plants with primary HW pumps"; parameter Boolean have_pumChiWatPriDedHp_select(start=false) = false "Set to true for HP with separate dedicated primary pumps for CHW and HW circuits"; final parameter Boolean have_pumChiWatPriDedHp = if have_hp and have_chiWat and not have_pumPriHdr then have_pumChiWatPriDedHp_select else false "Set to true for HP with separate dedicated primary CHW pumps"; final parameter Boolean have_pumChiWatPri = have_chiWat and (have_pumPriHdr or have_pumChiWatPriDedHp or have_php) "Set to true for HP with separate dedicated primary pumps for CHW and HW circuits"; parameter Boolean have_pumPriHdr "Set to true for headered primary pumps, false for dedicated pumps"; parameter Boolean have_pumHeaWatPriVar_select(start=true) = true "Set to true for variable speed primary HW pumps, false for constant speed pumps"; parameter Boolean have_pumChiWatPriVar_select(start=true) = true "Set to true for variable speed primary CHW pumps, false for constant speed pumps"; final parameter Boolean have_pumHeaWatPriVar = have_pumHeaWatPri and (is_priOnl or have_pumHeaWatPriVar_select) "Set to true for variable speed primary HW pumps, false for constant speed pumps"; final parameter Boolean have_pumChiWatPriVar = have_pumChiWatPri and (is_priOnl or have_pumChiWatPriVar_select) "Set to true for variable speed primary CHW pumps, false for constant speed pumps"; final parameter Boolean have_pumPriCtlDp = is_priOnl "Set to true for primary variable speed pumps using ∆p pump speed control"; final parameter Boolean have_pumHeaWatSec = have_heaWat and not is_priOnl "Set to true for plants with secondary HW pumps"; final parameter Boolean have_pumChiWatSec = have_chiWat and not is_priOnl "Set to true for plants with secondary CHW pumps"; // Only headered arrangements are supported for secondary pumps. final parameter Boolean have_pumSecHdr = true "Set to true for headered secondary pumps, false for dedicated pumps"; // Only ∆p controlled variable speed pumps are supported for secondary pumps. final parameter Boolean have_pumSecCtlDp = have_pumHeaWatSec or have_pumChiWatSec "Set to true for secondary variable speed pumps using ∆p pump speed control"; // Primary flow sensor: // - Required for primary-only plants // - Not required nor recommended for primary-secondary plants final parameter Boolean have_senVPri = is_priOnl "Set to true for plants with primary CHW/HW flow sensor"; // Primary supply temperature sensor required for both primary-only plants // and primary-secondary plants ( ailsafe staging condition) final parameter Boolean have_senTPriSup = true "Set to true for plants with primary CHW/HW supply temperature sensor"; // Primary return temperature sensor: // - Required for primary-only plants (HP staging logic) // - Optional for primary-secondary plants parameter Boolean have_senTPriRet_select(start=false) = false "Set to true for plants with primary CHW/HW return temperature sensor"; final parameter Boolean have_senTPriRet = if is_priOnl then true else have_senTPriRet_select "Set to true for plants with primary CHW/HW return temperature sensor"; // CHW/HW loop return temperature sensor: // - Required for primary-only plants with HRC // - Optional for other primary-only plants parameter Boolean have_senTLooRet_select(start=false) = false "Set to true for plants with CHW/HW loop return temperature sensor (load side of minimum flow bypass)"; final parameter Boolean have_senTLooRet = is_priOnl and (if have_hrc then true else have_senTLooRet_select) "Set to true for plants with CHW/HW loop return temperature sensor"; final parameter Boolean have_senVLoo = is_priOnl and have_hrc "Set to true for plants with CHW/HW loop flow sensor"; // Secondary flow sensor required for secondary pump staging final parameter Boolean have_senVSec = not is_priOnl "Set to true for plants with secondary CHW/HW flow sensor"; // Secondary supply and return temperature sensors required for primary-secondary plants (HP staging logic) final parameter Boolean have_senTSec = not is_priOnl "Set to true for plants with secondary CHW/HW supply and return temperature sensors"; // We propagate the sensor configuration to each loop. final parameter Boolean have_senVHeaWatPri = have_heaWat and have_senVPri "Set to true for plants with primary HW flow sensor"; final parameter Boolean have_senVHeaWatLoo = have_heaWat and have_senVLoo "Set to true for plants with HW loop flow sensor"; final parameter Boolean have_senVHeaWatSec = have_heaWat and have_senVSec "Set to true for plants with secondary HW flow sensor"; final parameter Boolean have_senVChiWatPri = have_chiWat and have_senVPri "Set to true for plants with primary CHW flow sensor"; final parameter Boolean have_senVChiWatLoo = have_chiWat and have_senVLoo "Set to true for plants with CHW loop flow sensor"; final parameter Boolean have_senVChiWatSec = have_chiWat and have_senVSec "Set to true for plants with secondary CHW flow sensor"; final parameter Boolean have_senTHeaWatPriSup = have_heaWat and have_senTPriSup "Set to true for plants with primary HW supply temperature sensor"; final parameter Boolean have_senTHeaWatPriRet = have_heaWat and have_senTPriRet "Set to true for plants with primary HW return temperature sensor"; final parameter Boolean have_senTChiWatPriSup = have_chiWat and have_senTPriSup "Set to true for plants with primary CHW supply temperature sensor"; final parameter Boolean have_senTChiWatPriRet = have_chiWat and have_senTPriRet "Set to true for plants with primary CHW return temperature sensor"; final parameter Boolean have_senTHeaWatSecSup = have_heaWat and have_senTSec "Set to true for plants with secondary HW supply temperature sensor"; final parameter Boolean have_senTChiWatSecSup = have_chiWat and have_senTSec "Set to true for plants with secondary CHW supply temperature sensor"; final parameter Boolean have_senTHeaWatLooRet = have_heaWat and have_senTLooRet "Set to true for plants with HW loop return temperature sensor (load side of minimum flow bypass)"; final parameter Boolean have_senTChiWatLooRet = have_chiWat and have_senTLooRet "Set to true for plants with CHW loop return temperature sensor (load side of minimum flow bypass)"; final parameter Boolean have_senTHeaWatSecRet = have_heaWat and have_senTSec "Set to true for plants with loop/secondary HW return temperature sensor"; final parameter Boolean have_senTChiWatSecRet = have_chiWat and have_senTSec "Set to true for plants with secondary CHW return temperature sensor"; parameter Integer nHp_select(min=if have_hp then 1 else 0, start=1) "Number of 2-pipe heat pumps"; final parameter Integer nHp = if have_hp then nHp_select else 0 "Number of 2-pipe heat pumps"; parameter Integer nPhp_select(min=if have_php then 1 else 0, start=1) "Number of polyvalent heat pumps"; final parameter Integer nPhp = if have_php then nPhp_select else 0 "Number of polyvalent heat pumps"; parameter Integer nPumHeaWatPri_select( min=if have_pumHeaWatPri then 1 else 0, start=0) = nHp + nPhp "Number of primary HW pumps"; final parameter Integer nPumHeaWatPriDedHp = if have_hp and not have_pumPriHdr then nHp else 0 "Number of dedicated primary HW pumps serving HP"; final parameter Integer nPumHeaWatPriDedPhp = if have_php and not have_pumPriHdr then nPhp else 0 "Number of dedicated primary HW pumps serving polyvalent HP"; final parameter Integer nPumHeaWatPri = if have_pumHeaWatPri and have_pumPriHdr then nPumHeaWatPri_select elseif have_pumHeaWatPri and not have_pumPriHdr then nHp + nPhp else 0 "Number of primary HW pumps"; parameter Integer nPumChiWatPri_select( min=if have_pumChiWatPri then 1 else 0, start=0) = nHp + nPhp "Number of primary CHW pumps"; final parameter Integer nPumChiWatPriDedHp = if have_pumChiWatPriDedHp then nHp else 0 "Number of dedicated primary CHW pumps serving HP"; final parameter Integer nPumChiWatPriDedPhp = if have_php and not have_pumPriHdr then nPhp else 0 "Number of dedicated primary CHW pumps serving polyvalent HP"; final parameter Integer nPumChiWatPri = if have_pumChiWatPri and have_pumPriHdr then nPumChiWatPri_select elseif have_pumChiWatPri and not have_pumPriHdr then nPumChiWatPriDedHp + nPumChiWatPriDedPhp else 0 "Number of primary CHW pumps"; parameter Integer nPumHeaWatSec_select( min=if have_pumHeaWatSec then 1 else 0, start=0) = nHp + nPhp "Number of secondary HW pumps"; final parameter Integer nPumHeaWatSec = if have_pumHeaWatSec then nPumHeaWatSec_select else 0 "Number of secondary HW pumps"; parameter Integer nPumChiWatSec_select( min=if have_pumChiWatSec then 1 else 0, start=0) = nHp + nPhp "Number of secondary CHW pumps"; final parameter Integer nPumChiWatSec = if have_pumChiWatSec then nPumChiWatSec_select else 0 "Number of secondary CHW pumps"; parameter Boolean have_senDpHeaWatRemWir(start=false) = false "Set to true for remote HW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpHeaWatRem(min=if have_heaWat then 1 else 0, start=0) "Number of remote HW differential pressure sensors used for HW pump speed control"; parameter Boolean have_senDpChiWatRemWir(start=false) = false "Set to true for remote CHW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpChiWatRem(min=if have_chiWat then 1 else 0, start=0) "Number of remote CHW differential pressure sensors used for CHW pump speed control"; parameter Real THeaWatSup_nominal( min=273.15, start=50 + 273.15, unit="K", displayUnit="degC") "Design HW supply temperature (maximum setpoint)"; parameter Real THeaWatSupSet_min( min=273.15, start=25 + 273.15, unit="K", displayUnit="degC") "Minimum value to which the HW supply temperature can be reset"; parameter Real TOutHeaWatLck( min=273.15, start=21 + 273.15, unit="K", displayUnit="degC") = 294.15 "Outdoor air lockout temperature above which the HW loop is prevented from operating"; parameter Real capHeaHp_nominal[nHp]( min=fill(0, nHp), start=fill(1, nHp), unit=fill("W", nHp)) "Design heating capacity - Each heat pump"; parameter Real VHeaWatHp_flow_nominal[nHp]( min=fill(0, nHp), start=fill(1E-6, nHp), unit=fill("m3/s", nHp)) "Design HW volume flow rate - Each heat pump"; parameter Real VHeaWatHp_flow_min[nHp]( min=fill(0, nHp), start=fill(0, nHp), unit=fill("m3/s", nHp)) "Minimum HW volume flow rate - Each heat pump"; parameter Real capHeaPhp_nominal[nPhp]( min=fill(0, nPhp), start=fill(1, nPhp), unit=fill("W", nPhp)) "Design heating capacity - Each polyvalent heat pump"; parameter Real capHeaShcPhp_nominal[nPhp]( min=fill(0, nPhp), start=fill(1, nPhp), unit=fill("W", nPhp)) "Design heating capacity in SHC mode - Each polyvalent heat pump"; parameter Real VHeaWatPhp_flow_nominal[nPhp]( min=fill(0, nPhp), start=fill(0, nPhp), unit=fill("m3/s", nPhp)) "Design HW volume flow rate - Each polyvalent heat pump"; parameter Real VHeaWatPhp_flow_min[nPhp]( min=fill(0, nPhp), start=fill(0, nPhp), unit=fill("m3/s", nPhp)) "Minimum HW volume flow rate - Each polyvalent heat pump"; parameter Real VHeaWatPri_flow_nominal(min=0, start=0, unit="m3/s") = sum( cat(1, VHeaWatHp_flow_nominal, VHeaWatPhp_flow_nominal)) "Primary HW volume flow rate"; parameter Real VHeaWatSec_flow_nominal(min=0, start=0, unit="m3/s") "Design secondary HW volume flow rate"; parameter Real dpHeaWatRemSet_max[nSenDpHeaWatRem]( min=fill(0, nSenDpHeaWatRem), start=fill(5E4, nSenDpHeaWatRem), unit=fill("Pa", nSenDpHeaWatRem)) "Maximum HW differential pressure setpoint - Remote sensor"; parameter Real dpHeaWatRemSet_min(min=0, start=5 * 6894, unit="Pa") = 5 * 6894 "Minimum value to which the HW differential pressure can be reset - Remote sensor"; parameter Real yPumHeaWatPriHdrSet(max=2, min=0, start=1, unit="1") "Primary HW 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 yPumHeaWatPriDedPhpSet(max=2, min=0, start=1, unit="1") "Primary HW pump speed providing design flow – Polyvalent HP dedicated pumps"; parameter Real TChiWatSup_nominal( min=273.15, start=7 + 273.15, unit="K", displayUnit="degC") "Design CHW supply temperature (minimum setpoint)"; parameter Real TChiWatSupSet_max( min=273.15, start=15 + 273.15, unit="K", displayUnit="degC") "Maximum value to which the CHW supply temperature can be reset"; parameter Real TOutChiWatLck( min=273.15, start=16 + 273.15, unit="K", displayUnit="degC") = 289.15 "Outdoor air lockout temperature below which the CHW loop is prevented from operating"; parameter Real capCooHp_nominal[nHp]( min=fill(0, nHp), start=fill(1, nHp), unit=fill("W", nHp)) "Design cooling capacity - Each heat pump"; parameter Real VChiWatHp_flow_nominal[nHp]( min=fill(0, nHp), start=fill(1E-6, nHp), unit=fill("m3/s", nHp)) "Design CHW volume flow rate - Each heat pump"; parameter Real VChiWatHp_flow_min[nHp]( min=fill(0, nHp), start=fill(0, nHp), unit=fill("m3/s", nHp)) "Minimum CHW volume flow rate - Each heat pump"; parameter Real capCooPhp_nominal[nPhp]( min=fill(0, nPhp), start=fill(1, nPhp), unit=fill("W", nPhp)) "Design cooling capacity - Each polyvalent heat pump"; parameter Real capCooShcPhp_nominal[nPhp]( min=fill(0, nPhp), start=fill(1, nPhp), unit=fill("W", nPhp)) "Design cooling capacity in SHC mode - Each polyvalent heat pump"; parameter Real VChiWatPhp_flow_nominal[nPhp]( min=fill(0, nPhp), start=fill(1E-6, nPhp), unit=fill("m3/s", nPhp)) "Design CHW volume flow rate - Each polyvalent heat pump"; parameter Real VChiWatPhp_flow_min[nPhp]( min=fill(0, nPhp), start=fill(0, nPhp), unit=fill("m3/s", nPhp)) "Minimum CHW volume flow rate - Each polyvalent heat pump"; parameter Real VChiWatPri_flow_nominal(min=0, start=0, unit="m3/s") = sum( cat(1, VChiWatHp_flow_nominal, VChiWatPhp_flow_nominal)) "Primary CHW volume flow rate"; parameter Real VChiWatSec_flow_nominal(min=0, start=1E-6, unit="m3/s") "Design secondary CHW volume flow rate"; parameter Real dpChiWatRemSet_max[nSenDpChiWatRem]( min=fill(0, nSenDpChiWatRem), start=fill(5E4, nSenDpChiWatRem), unit=fill("Pa", nSenDpChiWatRem)) "Maximum CHW differential pressure setpoint - Remote sensor"; parameter Real dpChiWatRemSet_min(min=0, start=5 * 6894, unit="Pa") = 5 * 6894 "Minimum value to which the CHW differential pressure can be reset - Remote sensor"; parameter Real yPumChiWatPriHdrSet(max=2, min=0, start=1, unit="1") "Primary CHW pump speed providing design flow – Headered 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 yPumChiWatPriDedPhpSet(max=2, min=0, start=1, unit="1") "Primary CHW pump speed providing design flow – Polyvalent HP dedicated pumps"; parameter Real cp_default(min=0, unit="J/(kg.K)") = 4184 "Default specific heat capacity used to compute required capacity"; parameter Real rho_default(min=0, unit="kg/m3") = 996 "Default density used to compute required capacity"; parameter Boolean have_inpSch = false "Set to true to provide schedule via software input point"; parameter Real schHea[:, 2](start=[0, 1; 24 * 3600, 1]) = [0, 1; 24 * 3600, 1] "Heating mode enable schedule"; parameter Real schCoo[:, 2](start=[0, 1; 24 * 3600, 1]) = [0, 1; 24 * 3600, 1] "Cooling mode enable schedule"; parameter Integer nReqIgnHeaWat(min=0) = 0 "Number of ignored HW plant requests"; parameter Integer nReqIgnChiWat(min=0) = 0 "Number of ignored CHW plant requests"; parameter Real dTOutLck(min=0, unit="K") = 0.5 "Hysteresis for outdoor air lockout temperature"; parameter Real dtRunEna(min=0, unit="s") = 15 * 60 "Minimum runtime of enable and disable states"; parameter Real dtReqDis(min=0, unit="s") = 3 * 60 "Runtime with low number of request before disabling"; final parameter Integer nStaHp = size(staHp, 1) "Number of stages in heat pump staging matrix"; // We don't use a start attribute for staHp to avoid // incompatible sizes for variable and its start value. parameter Real staHp[:, :]( each final max=1, each final min=0, each final unit="1") = {i / nHp for _ in 1:nHp, i in 1:nHp} "Heat pump staging matrix – Equipment required for each stage"; final parameter Integer nSta = if have_php then nHp + nPhp else nStaHp "Number of stages"; final parameter Integer nAltHp(final min=0) = if have_hp and not have_php then (if nHp == 1 then 1 else max( {sum( {(if staHp[i, j] > 0 and staHp[i, j] < 1 then 1 else 0) for j in 1:nHp}) for i in 1:nStaHp})) else nHp "Number of lead/lag alternate heat pumps"; // We don't use a start attribute for idxAltHp_select to avoid // incompatible sizes for variable and its start value. parameter Integer idxAltHp_select[:](each final min=1) = 1:nHp "Indices of lead/lag alternate heat pumps"; final parameter Integer idxAltHp[:] = if have_hp and not have_php then idxAltHp_select else 1:nHp "Indices of lead/lag alternate heat pumps"; parameter Real plrSta(max=1, min=0, start=0.9, unit="1") = 0.9 "Staging part load ratio"; parameter Real dTHea(min=0, unit="K") = 2.5 "Delta-T triggering stage up command for heating applications (>0)"; parameter Real dTCoo(min=0, unit="K") = 1 "Delta-T triggering stage up command for cooling applications (>0)"; parameter Real dtVal(min=0, start=90, unit="s") = 90 "Nominal valve timing"; parameter Real dtRunSta(min=0, unit="s", displayUnit="min") = 900 "Minimum runtime of each stage"; parameter Real dtOff(min=0, unit="s") = 900 "Off time required before equipment is deemed available again"; parameter Real dtOffHp(min=0, unit="s") = 180 "Heat pump internal shutdown cycle timing (before closing isolation valves or disabling primary pumps)"; parameter Real dtPri(min=0, unit="s") = 900 "Runtime with high primary-setpoint Delta-T before staging up"; parameter Real dtSec(min=0, start=600, unit="s") = 600 "Runtime with high secondary-primary and secondary-setpoint Delta-T before staging up"; parameter Real dtRunPumSta(min=0, start=600, unit="s") = 600 "Runtime before triggering stage change command based on efficiency condition"; parameter Real dtRunFaiSafPumSta(min=0, start=300, unit="s") = 300 "Runtime before triggering stage change command based on failsafe condition"; parameter Real dtRunFaiSafLowYPumSta(min=0, start=600, unit="s") = dtRunPumSta "Runtime before triggering stage change command based on low pump speed failsafe condition"; parameter Real dVOffUpPumSta(max=1, min=0, start=0.03, unit="1") = 0.03 "Stage up flow point offset"; parameter Real dVOffDowPumSta(max=1, min=0, start=0.03, unit="1") = dVOffUpPumSta "Stage down flow point offset"; parameter Real dpOffPumSta(min=0, start=1E4, unit="Pa") = 1E4 "Stage change ∆p point offset (>0)"; parameter Real yUpPumSta(min=0, start=0.99, unit="1") = 0.99 "Stage up pump speed point"; parameter Real yDowPumSta(min=0, start=0.4, unit="1") = 0.4 "Stage down pump speed point"; parameter Real dtHol(min=0, unit="s") = 900 "Minimum hold time during stage change"; parameter Real resDpHeaWat_max(max=1, min=0, unit="1") = 0.5 "Upper limit of plant reset interval for HW differential pressure reset"; parameter Real resTHeaWatSup_min(max=1, min=0, unit="1") = resDpHeaWat_max "Lower limit of plant reset interval for HW supply temperature reset"; parameter Real resDpChiWat_max(max=1, min=0, unit="1") = 0.5 "Upper limit of plant reset interval for CHW differential pressure reset"; parameter Real resTChiWatSup_min(max=1, min=0, unit="1") = resDpChiWat_max "Lower limit of plant reset interval for CHW supply temperature reset"; parameter Real res_init(max=1, min=0, unit="1") = 1 "Initial reset value"; parameter Real res_min(max=1, min=0, unit="1") = 0 "Minimum reset value"; parameter Real res_max(max=1, min=0, unit="1") = 1 "Maximum reset value"; parameter Real dtDel(min=100 * 1E-15, unit="s") = 900 "Delay time before the reset begins"; parameter Real dtResHeaWat(min=1E-3, unit="s") = 300 "Time step for HW plant reset"; parameter Integer nReqResIgnHeaWat(min=0) = 2 "Number of ignored requests for HW plant reset"; parameter Real triHeaWat(max=0, unit="1") = -0.02 "Trim amount for HW plant reset"; parameter Real rspHeaWat(min=0, unit="1") = 0.03 "Respond amount for HW plant reset"; parameter Real rspHeaWat_max(min=0, unit="1") = 0.07 "Maximum response per time interval for HW plant reset"; parameter Real dtResChiWat(min=1E-3, unit="s") = 300 "Time step for CHW plant reset"; parameter Integer nReqResIgnChiWat(min=0) = 2 "Number of ignored requests for CHW plant reset"; parameter Real triChiWat(max=0, unit="1") = -0.02 "Trim amount for CHW plant reset"; parameter Real rspChiWat(min=0, unit="1") = 0.03 "Respond amount for CHW plant reset"; parameter Real rspChiWat_max(min=0, unit="1") = 0.07 "Maximum response per time interval for CHW plant reset"; 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 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"; parameter Real yPumHeaWatSec_min(max=1, min=0, start=0.1, unit="1") = 0.1 "Minimum secondary HW pump speed"; parameter Real yPumChiWatSec_min(max=1, min=0, start=0.1, unit="1") = 0.1 "Minimum secondary CHW pump speed"; parameter Real kValMinByp(min=0, start=1) = 1 "Gain of controller"; parameter Modelica.Units.SI.Time TiValMinByp( min=Buildings.Controls.OBC.CDL.Constants.small, start=0.5) = 60 "Time constant of integrator block"; // Sidestream HRC parameters parameter Boolean have_reqFloHrc(start=false) = false "Set to true if HRC provides flow request point via network interface"; parameter Real TChiWatSupHrc_min( min=273.15, start=4 + 273.15, unit="K", displayUnit="degC") "Sidestream HRC – Minimum allowable CHW supply temperature"; parameter Real THeaWatSupHrc_max( min=273.15, start=60 + 273.15, unit="K", displayUnit="degC") "Sidestream HRC – Maximum allowable HW supply temperature"; parameter Real COPHeaHrc_nominal(min=1.1, start=2.8, unit="1") "Sidestream HRC – Heating COP at design heating conditions"; parameter Real capCooHrc_min(min=0, start=0, unit="W") "Sidestream HRC – Minimum cooling capacity below which cycling occurs"; parameter Real capHeaHrc_min(min=0, start=0, unit="W") "Sidestream HRC – Minimum heating capacity below which cycling occurs"; parameter Real dtLoaHrc(min=0, start=600, unit="s") = 600 "Runtime with sufficient load before enabling"; parameter Real dtTem1Hrc(min=0, start=180, unit="s") = 180 "Runtime with first temperature threshold exceeded before disabling"; parameter Real dtTem2Hrc(min=0, start=60, unit="s") = 60 "Runtime with second temperature threshold exceeded before disabling"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqPlaHeaWat if have_heaWat "Number of HW plant requests"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut( final unit="K", final quantity="ThermodynamicTemperature", displayUnit="degC") "Outdoor air temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SchHea if have_heaWat and have_inpSch "Heating mode enable via schedule"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqPlaChiWat if have_chiWat "Number of CHW plant requests"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SchCoo if have_chiWat and have_inpSch "Cooling mode enable via schedule"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqResHeaWat if have_heaWat "Sum of HW reset requests of all heating loads served"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput nReqResChiWat if have_chiWat "Sum of CHW reset requests of all heating loads served"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Php_actual[nPhp] if have_php "Polyvalent heat pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedPhp_actual[nPumHeaWatPriDedPhp] if have_pumHeaWatPri and not have_pumPriHdr and have_php "Primary HW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriHdr_actual[nPumChiWatPri] if have_pumChiWatPri and have_pumPriHdr "Primary CHW pump status – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatSec_actual[nPumHeaWatSec] if have_pumHeaWatSec "Secondary HW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatSec_actual[nPumChiWatSec] if have_pumChiWatSec "Secondary CHW pump status"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriRet( final unit="K", displayUnit="degC") if have_senTHeaWatPriRet "Primary HW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatPri_flow( final unit="m3/s") if have_senVHeaWatPri "Primary HW volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLoc(final unit="Pa") if have_heaWat and not have_senDpHeaWatRemWir "Local HW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpHeaWatLocSet[nSenDpHeaWatRem]( each final unit="Pa") if have_heaWat 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_senDpHeaWatRemWir "Remote HW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLoc(final unit="Pa") if have_chiWat and not have_senDpChiWatRemWir "Local CHW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatLocSet[nSenDpChiWatRem]( each final unit="Pa") if have_chiWat 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_senDpChiWatRemWir "Remote CHW differential pressure"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatHpInlIso[nHp] if have_heaWat and have_valHpInlIso and have_hp "Heat pump inlet HW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatHpOutIso[nHp] if have_heaWat and have_valHpOutIso and have_hp "Heat pump outlet HW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpInlIso[nHp] if have_chiWat and have_valHpInlIso and have_hp "Heat pump inlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpOutIso[nHp] if have_chiWat and have_valHpOutIso and have_hp "Heat pump outlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatPriHdr[nPumHeaWatPri] if have_pumHeaWatPri and have_pumPriHdr "Primary HW pump start command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatPriHdr[nPumChiWatPri] if have_pumChiWatPri and have_pumPriHdr "Primary CHW pump start command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatSec[nPumHeaWatSec] if have_pumHeaWatSec "Secondary HW pump start command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatSec[nPumChiWatSec] if have_pumChiWatSec "Secondary CHW pump start command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Hp[nHp] if have_hp "Heat pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HeaHp[nHp] if have_hp and have_heaWat and have_chiWat "Heat pump heating/cooling mode command: true=heating, false=cooling"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HeaPhp[nPhp] if have_php "Polyvalent HP heating on/off command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1CooPhp[nPhp] if have_php "Polyvalent HP cooling on/off command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatPhpInlIso[nPhp] if have_php and have_valPhpInlIso "Polyvalent HP inlet HW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatPhpInlIso[nPhp] if have_php and have_valPhpInlIso "Polyvalent HP inlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatPhpOutIso[nPhp] if have_php and have_valPhpOutIso "Polyvalent HP outlet HW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatPhpOutIso[nPhp] if have_php and have_valPhpOutIso "Polyvalent HP outlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpHeaWatRemSet[nSenDpHeaWatRem]( each final min=0, each final unit="Pa") if have_heaWat "HW differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpChiWatRemSet[nSenDpChiWatRem]( each final min=0, each final unit="Pa") if have_chiWat "CHW differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriHdr( final unit="1") if have_pumHeaWatPriVar and have_pumPriHdr "Primary HW pump speed command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriHdr( final unit="1") if have_pumChiWatPriVar and have_pumPriHdr "Primary CHW pump speed command – Headered pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatSec(final unit="1") if have_pumHeaWatSec "Primary HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatSec(final unit="1") if have_pumChiWatSec "Primary CHW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupSet( final unit="K", displayUnit="degC") if have_chiWat "Plant CHW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupSet( final unit="K", displayUnit="degC") if have_heaWat "Plant HW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriRet( final unit="K", displayUnit="degC") if have_senTChiWatPriRet "Primary CHW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatPri_flow( final unit="m3/s") if have_senVChiWatPri "Primary CHW volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Hp_actual[nHp] if have_hp "Heat pump status"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDedHp[nPumHeaWatPriDedHp]( each final unit="1") if have_pumHeaWatPriVar and not have_pumPriHdr and have_hp "Primary HW pump speed command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDedHp[nPumChiWatPriDedHp]( each final unit="1") if have_pumChiWatPriVar and have_pumChiWatPriDedHp "Primary CHW pump speed command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatLooOrSecRet( final unit="K", displayUnit="degC") if have_senTHeaWatSecRet or have_senTHeaWatLooRet "HW loop (primary-only) or secondary (primary-secondary) return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatLooOrSec_flow( final unit="m3/s") if have_senVHeaWatSec or have_senVHeaWatLoo "HW loop (primary-only) or secondary (primary-secondary) volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatLooOrSecRet( final unit="K", displayUnit="degC") if have_senTChiWatSecRet or have_senTChiWatLooRet "CHW loop (primary-only) or secondary (primary-secondary) return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatLooOrSec_flow( final unit="m3/s") if have_senVChiWatSec or have_senVChiWatLoo "CHW loop (primary-only) or secondary (primary-secondary) volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupHpSet[nHp]( each final unit="K", each final quantity="ThermodynamicTemperature", each displayUnit="degC") if have_heaWat and have_hp "HP HW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriSup( final unit="K", displayUnit="degC") if have_senTHeaWatPriSup "Primary HW supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriSup( final unit="K", displayUnit="degC") if have_senTChiWatPriSup "Primary CHW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSecSup( final unit="K", displayUnit="degC") if have_senTHeaWatSecSup "Secondary HW supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSecSup( final unit="K", displayUnit="degC") if have_senTChiWatSecSup "Secondary CHW supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Hrc if have_hrc "Sidestream HRC enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1CooHrc if have_hrc "Sidestream HRC mode command: true for cooling, false for heating"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatHrc if have_hrc "Sidestream HRC CHW pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatHrc if have_hrc "Sidestream HRC HW pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupHrcSet( final unit="K", displayUnit="degC") if have_hrc "Sidestream HRC HW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatRetUpsHrc( final unit="K", displayUnit="degC") if have_hrc "CHW return temperature upstream of HRC"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatRetUpsHrc( final unit="K", displayUnit="degC") if have_hrc "HW return temperature upstream of HRC"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Hrc_actual if have_hrc "HRC status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ReqFloChiWat if have_hrc and have_reqFloHrc "CHW flow request from HRC"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ReqFloConWat if have_hrc and have_reqFloHrc "CW flow request from HRC"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValHeaWatMinByp( final unit="1") if have_heaWat and is_priOnl "HW minimum flow bypass valve command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValChiWatMinByp( final unit="1") if have_chiWat and is_priOnl "CHW minimum flow bypass valve command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupHpSet[nHp]( each final unit="K", each final quantity="ThermodynamicTemperature", each displayUnit="degC") if have_chiWat and have_hp "HP CHW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupHrcSet( final unit="K", displayUnit="degC") if have_hrc "Sidestream HRC CHW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedHp_actual[nPumChiWatPriDedHp] if have_pumChiWatPri and have_pumChiWatPriDedHp "Primary CHW pump status – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPriDedPhp_actual[nPumChiWatPriDedPhp] if have_pumChiWatPri and not have_pumPriHdr and have_php "Primary CHW pump status – Polyvalent HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatPriDedHp[nPumChiWatPriDedHp] if have_pumChiWatPri and have_pumChiWatPriDedHp "Primary CHW pump start command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatPriDedPhp[nPumChiWatPriDedPhp] if have_pumChiWatPri and not have_pumPriHdr and have_php "Primary CHW pump start command – Polyvalent HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDedPhp[nPumChiWatPriDedPhp]( each final unit="1") if have_pumChiWatPriVar and not have_pumPriHdr and have_php "Primary CHW pump speed command – Polyvalent HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriDedHp_actual[nPumHeaWatPriDedHp] if have_pumHeaWatPri and not have_pumPriHdr and have_hp "Primary HW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatPriDedHp[nPumHeaWatPriDedHp] if have_pumHeaWatPri and have_hp and not have_pumPriHdr "Primary HW pump start command – HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatPriDedPhp[nPumHeaWatPriDedPhp] if have_pumHeaWatPri and have_php and not have_pumPriHdr "Primary HW pump start command – Polyvalent HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDedPhp[nPumHeaWatPriDedPhp]( each final unit="1") if have_pumHeaWatPriVar and not have_pumPriHdr and have_php "Primary HW pump speed command – Polyvalent HP dedicated pumps"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupPhpSet[nPhp]( each final unit="K", each final quantity="ThermodynamicTemperature", each displayUnit="degC") if have_heaWat and have_php "Polyvalent HP HW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupPhpSet[nPhp]( each final unit="K", each final quantity="ThermodynamicTemperature", each displayUnit="degC") if have_chiWat and have_php "Polyvalent HP CHW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant u1AvaHp[nHp](each k=true) if have_hp "Heat pump available signal – Block does not handle faulted equipment yet"; Enabling.Enable enaHea( final typ=Buildings.Templates.Plants.Controls.Types.Application.Heating, final TOutLck=TOutHeaWatLck, final dTOutLck=dTOutLck, final dtReq=dtReqDis, final dtRun=dtRunEna, final have_inpSch=have_inpSch, final nReqIgn=nReqIgnHeaWat, final sch=schHea) if have_heaWat "Heating mode enable"; Utilities.StageIndex idxStaHea( final use_twoMod=have_php, final nSta=nSta, final dtRun=dtRunSta) if have_heaWat "Compute heating stage index"; StagingRotation.StageAvailability avaStaHea( final have_php=have_php, final staEqu=if have_php then staPhp.staHea else staHp) if have_heaWat "Evaluate heating stage availability"; Subsequences.SelectModeState selMod( final have_chiWat=have_chiWat, final nStaHp=nStaHp, final staHp=staHp, final nHp=nHp, final nAltHp_select=nAltHp, final nPhp=nPhp) "Compute enable command for equipment in heating mode"; Subsequences.EventSequencingMultiple seqEve( final nHp=nHp, final nPhp=nPhp, final have_heaWat=have_heaWat, final have_chiWat=have_chiWat, final have_valHpInlIso=have_valHpInlIso, final have_valHpOutIso=have_valHpOutIso, final have_valPhpInlIso=have_valPhpInlIso, final have_valPhpOutIso=have_valPhpOutIso, final have_pumPriHdr=have_pumPriHdr, final have_pumChiWatPriDedHp=have_pumChiWatPriDedHp, final nPumHeaWatPri=nPumHeaWatPri, final nPumChiWatPri=nPumChiWatPri, final dtVal=dtVal, final dtOff=dtOffHp) "Event sequencing"; StagingRotation.StageAvailability avaStaCoo( final have_php=have_php, final staEqu=if have_php then staPhp.staCoo else staHp) if have_chiWat "Evaluate cooling stage availability"; StagingRotation.StageChangeCommand chaStaHea( typ=Buildings.Templates.Plants.Controls.Types.Application.Heating, final have_php=have_php, final have_pumSec=have_pumHeaWatSec, final have_inpPlrSta=false, final plrSta=plrSta, final staEqu=if have_php then staPhp.staHea else staHp, final capEqu={if i <= nHp then capHeaHp_nominal[i] elseif i <= nHp + nPhp then capHeaPhp_nominal[i - nHp] else capHeaShcPhp_nominal[i - nHp - nPhp] for i in 1:nHp + 2 * nPhp}, final dtRun=dtRunSta, final cp_default=cp_default, final rho_default=rho_default, final dT=dTHea, final dtPri=dtPri, final dtSec=dtSec) if have_heaWat "Generate heating stage transition command"; Enabling.Enable enaCoo( final typ=Buildings.Templates.Plants.Controls.Types.Application.Cooling, final TOutLck=TOutChiWatLck, final dTOutLck=dTOutLck, final dtReq=dtReqDis, final dtRun=dtRunEna, final have_inpSch=have_inpSch, final nReqIgn=nReqIgnChiWat, final sch=schCoo) if have_chiWat "Cooling mode enable"; StagingRotation.StageChangeCommand chaStaCoo( final typ=Buildings.Templates.Plants.Controls.Types.Application.Cooling, final have_php=have_php, final have_pumSec=have_pumChiWatSec, final have_inpPlrSta=false, final plrSta=plrSta, final staEqu=if have_php then staPhp.staCoo else staHp, final capEqu={if i <= nHp then capCooHp_nominal[i] elseif i <= nHp + nPhp then capCooPhp_nominal[i - nHp] else capCooShcPhp_nominal[i - nHp - nPhp] for i in 1:nHp + 2 * nPhp}, final dtRun=dtRunSta, final cp_default=cp_default, final rho_default=rho_default, final dT=dTCoo, final dtPri=dtPri, final dtSec=dtSec) if have_chiWat "Generate cooling stage transition command"; Utilities.StageIndex idxStaCoo( final use_twoMod=have_php, final nSta=nSta, final dtRun=dtRunSta) if have_chiWat "Compute cooling stage index"; Subsequences.EquipmentAvailability avaHeaCooHp[nHp]( each final is_php=false, each final have_heaWat=have_heaWat, each final have_chiWat=have_chiWat, each final dtOff=dtOff) if have_hp "Evaluate HP availability in heating or cooling mode"; StagingRotation.SortRuntime sorRunTimHp(final idxEquAlt=idxAltHp, nin=nHp) if have_hp "Sort lead/lag alternate HP by increasing runtime"; Pumps.Generic.StagingHeadered staPumHeaWatPri( final is_pri=true, final is_ctlDp=have_pumPriCtlDp, final have_valInlIso=if have_hp then have_valHpInlIso else have_valPhpInlIso, final have_valOutIso=if have_hp then have_valHpOutIso else have_valPhpOutIso, final nEqu=nHp + nPhp, final nPum=nPumHeaWatPri, final is_hdr=have_pumPriHdr, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta, final nSenDp=if have_senDpHeaWatRemWir then nSenDpHeaWatRem else 1, final V_flow_nominal=VHeaWatPri_flow_nominal, final dtRunFaiSaf=dtRunFaiSafPumSta, final dtRunFaiSafLowY=dtRunFaiSafLowYPumSta, final dpOff=dpOffPumSta, final yUp=yUpPumSta, final yDow=yDowPumSta) if have_pumHeaWatPri "Primary HW pump staging"; Pumps.Generic.StagingHeadered staPumChiWatPri( final is_pri=true, final is_ctlDp=have_pumPriCtlDp, final have_valInlIso=if have_hp then have_valHpInlIso else have_valPhpInlIso, final have_valOutIso=if have_hp then have_valHpOutIso else have_valPhpOutIso, final nEqu=nHp + nPhp, final nPum=nPumChiWatPri, final is_hdr=have_pumPriHdr, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta, final nSenDp=if have_senDpChiWatRemWir then nSenDpChiWatRem else 1, final V_flow_nominal=VChiWatPri_flow_nominal, final dtRunFaiSaf=dtRunFaiSafPumSta, final dtRunFaiSafLowY=dtRunFaiSafLowYPumSta, final dpOff=dpOffPumSta, final yUp=yUpPumSta, final yDow=yDowPumSta) if have_pumChiWatPri "Primary CHW pump staging"; Pumps.Generic.StagingHeadered staPumChiWatSec( final is_pri=false, final nEqu=nHp + nPhp, final nPum=nPumChiWatSec, final is_hdr=have_pumSecHdr, final is_ctlDp=have_pumSecCtlDp, final nSenDp=if have_senDpChiWatRemWir then nSenDpChiWatRem else 1, final V_flow_nominal=VChiWatSec_flow_nominal, final dtRun=dtRunPumSta, final dtRunFaiSaf=dtRunFaiSafPumSta, final dtRunFaiSafLowY=dtRunFaiSafLowYPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta, final dpOff=dpOffPumSta, final yUp=yUpPumSta, final yDow=yDowPumSta) if have_pumChiWatSec "Secondary CHW pump staging"; Pumps.Generic.StagingHeadered staPumHeaWatSec( final is_pri=false, final nEqu=nHp + nPhp, final nPum=nPumHeaWatSec, final is_hdr=have_pumSecHdr, final is_ctlDp=have_pumSecCtlDp, final nSenDp=if have_senDpHeaWatRemWir then nSenDpHeaWatRem else 1, final V_flow_nominal=VHeaWatSec_flow_nominal, final dtRun=dtRunPumSta, final dtRunFaiSaf=dtRunFaiSafPumSta, final dtRunFaiSafLowY=dtRunFaiSafLowYPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta, final dpOff=dpOffPumSta, final yUp=yUpPumSta, final yDow=yDowPumSta) if have_pumHeaWatSec "Secondary HW pump staging"; Utilities.PlaceholderReal THeaWatRet( final have_inp=have_senTHeaWatPriRet and have_senVHeaWatPri, final have_inpPh=true) if have_heaWat "For staging logic select primary sensor if both temperature and flow sensors available"; Utilities.PlaceholderReal VHeaWatSta_flow( final have_inp=have_senTHeaWatPriRet and have_senVHeaWatPri, final have_inpPh=true) if have_heaWat "For staging logic select primary sensor if both temperature and flow sensors available"; Utilities.PlaceholderReal TChiWatRet( final have_inp=have_senTChiWatPriRet and have_senVChiWatPri, final have_inpPh=true) if have_chiWat "For staging logic select primary sensor if both temperature and flow sensors available"; Utilities.PlaceholderReal VChiWatSta_flow( final have_inp=have_senTChiWatPriRet and have_senVChiWatPri, final have_inpPh=true) if have_chiWat "For staging logic select primary sensor if both temperature and flow sensors available"; StagingRotation.StageCompletion comStaCoo(final nPhp=nPhp, nin=nHp + 2 * nPhp) if have_chiWat "Check successful completion of cooling stage change"; StagingRotation.StageCompletion comStaHea(final nPhp=nPhp, nin=nHp + 2 * nPhp) if have_heaWat "Check successful completion of heating stage change"; Setpoints.PlantReset resHeaWat( final TSup_nominal=THeaWatSup_nominal, final TSupSetLim=THeaWatSupSet_min, final dpSet_max=dpHeaWatRemSet_max, final dpSet_min=dpHeaWatRemSet_min, final dtDel=dtDel, final dtHol=dtHol, final dtRes=dtResHeaWat, final nReqResIgn=nReqResIgnHeaWat, final nSenDpRem=nSenDpHeaWatRem, final resDp_max=resDpHeaWat_max, final resTSup_min=resTHeaWatSup_min, final res_init=res_init, final res_max=res_max, final res_min=res_min, final rsp=rspHeaWat, final rsp_max=rspHeaWat_max, final tri=triHeaWat) if have_heaWat "HW plant reset"; Setpoints.PlantReset resChiWat( final TSup_nominal=TChiWatSup_nominal, final TSupSetLim=TChiWatSupSet_max, final dpSet_max=dpChiWatRemSet_max, final dpSet_min=dpChiWatRemSet_min, final dtDel=dtDel, final dtHol=dtHol, final dtRes=dtResChiWat, final nReqResIgn=nReqResIgnChiWat, final nSenDpRem=nSenDpChiWatRem, final resDp_max=resDpChiWat_max, final resTSup_min=resTChiWatSup_min, final res_init=res_init, final res_max=res_max, final res_min=res_min, final rsp=rspChiWat, final rsp_max=rspChiWat_max, final tri=triChiWat) if have_chiWat "CHW plant reset"; Pumps.Primary.VariableSpeedWithHeatPumps ctlPumPri( final have_heaWat=have_heaWat, final have_chiWat=have_chiWat, final have_pumPriCtlDp=have_pumPriCtlDp, final have_pumPriHdr=have_pumPriHdr, final have_pumChiWatPriDedHp=have_pumChiWatPriDedHp, final nHp=nHp, final nPhp=nPhp, final nPumHeaWatPri=nPumHeaWatPri, final nPumChiWatPri=nPumChiWatPri, final yPumHeaWatPriHdrSet=yPumHeaWatPriHdrSet, final yPumChiWatPriHdrSet=yPumChiWatPriHdrSet, final yPumHeaWatPriDedHpSet=yPumHeaWatPriDedHpSet, final yPumChiWatPriDedHpSet=yPumChiWatPriDedHpSet, final yPumHeaWatPriDedPhpSet=yPumHeaWatPriDedPhpSet, final yPumChiWatPriDedPhpSet=yPumChiWatPriDedPhpSet, final have_senDpChiWatRemWir=have_senDpChiWatRemWir, final have_senDpHeaWatRemWir=have_senDpHeaWatRemWir, final kCtlDpChiWat=kCtlDpChiWat, final kCtlDpHeaWat=kCtlDpHeaWat, final nSenDpChiWatRem=nSenDpChiWatRem, final nSenDpHeaWatRem=nSenDpHeaWatRem, final TiCtlDpChiWat=TiCtlDpChiWat, final TiCtlDpHeaWat=TiCtlDpHeaWat, final yPumChiWatPri_min=yPumChiWatPri_min, final yPumHeaWatPri_min=yPumHeaWatPri_min) if have_pumHeaWatPriVar or have_pumChiWatPriVar "Primary pump speed control"; Pumps.Generic.ControlDifferentialPressure ctlPumHeaWatSec( final have_senDpRemWir=have_senDpHeaWatRemWir, final nPum=nPumHeaWatSec, final nSenDpRem=nSenDpHeaWatRem, final y_min=yPumHeaWatSec_min, final k=kCtlDpHeaWat, final Ti=TiCtlDpHeaWat) if have_pumHeaWatSec and have_pumSecCtlDp "Secondary HW pump speed control"; Pumps.Generic.ControlDifferentialPressure ctlPumChiWatSec( final have_senDpRemWir=have_senDpChiWatRemWir, final nPum=nPumChiWatSec, final nSenDpRem=nSenDpChiWatRem, final y_min=yPumChiWatSec_min, final k=kCtlDpChiWat, final Ti=TiCtlDpChiWat) if have_pumChiWatSec and have_pumSecCtlDp "Secondary CHW pump speed control"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTChiWatSupHpSet( final nout=nHp) if have_chiWat and have_hp "Replicate CHWST setpoint"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTHeaWatSupHpSet( final nout=nHp) if have_heaWat and have_hp "Replicate HWST setpoint"; HeatRecoveryChillers.Controller hrc( final COPHea_nominal=COPHeaHrc_nominal, final TChiWatSup_min=TChiWatSupHrc_min, final THeaWatSup_max=THeaWatSupHrc_max, final capCoo_min=capCooHrc_min, final capHea_min=capHeaHrc_min, final cp_default=cp_default, final dtLoa=dtLoaHrc, final dtRun=dtRunEna, final dtTem1=dtTem1Hrc, final dtTem2=dtTem2Hrc, final have_reqFlo=have_reqFloHrc, final rho_default=rho_default) if have_hrc "Sidestream heat recovery chiller control"; Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasDpHeaWatRemSet( final nin=nSenDpHeaWatRem, final nout=nSenDpHeaWatRem) if have_heaWat and have_senDpHeaWatRemWir "Direct pass through for HW ∆p setpoint"; Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasDpChiWatRemSet( final nin=nSenDpChiWatRem, final nout=nSenDpChiWatRem) if have_chiWat and have_senDpChiWatRemWir "Direct pass through for CHW ∆p setpoint"; MinimumFlow.ControllerHeatPumps ctlFloMin( final have_chiWat=have_chiWat, final have_heaWat=have_heaWat, final have_pumPriHdr=have_pumPriHdr, have_pumChiWatPriDedHp=have_pumChiWatPriDedHp, final nHp=nHp, final nPhp=nPhp, final have_valInlIso=have_valHpInlIso or have_valPhpInlIso, final have_valOutIso=have_valHpOutIso or have_valPhpOutIso, final k=kValMinByp, final Ti=TiValMinByp, final VChiWat_flow_min={if i <= nHp then VChiWatHp_flow_min[i] else VChiWatPhp_flow_min[i - nHp] for i in 1:nHp + nPhp}, final VChiWat_flow_nominal={if i <= nHp then VChiWatHp_flow_nominal[i] else VChiWatPhp_flow_nominal[i - nHp] for i in 1:nHp + nPhp}, final VHeaWat_flow_min={if i <= nHp then VHeaWatHp_flow_min[i] else VHeaWatPhp_flow_min[i - nHp] for i in 1:nHp + nPhp}, final VHeaWat_flow_nominal={if i <= nHp then VHeaWatHp_flow_nominal[i] else VHeaWatPhp_flow_nominal[i - nHp] for i in 1:nHp + nPhp}) if is_priOnl "CHW/HW minimum flow bypass valve controller"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant u1AvaPhp[nPhp]( each k=true) if have_php "Polyvalent heat pump available signal – Block does not handle faulted equipment yet"; PolyvalentHeatPumps.StagingParameters staPhp(final nHp=nHp, final nPhp=nPhp) "Staging parameters for plants with polyvalent HP"; Subsequences.EquipmentAvailability avaHeaCooPhp[nPhp]( each final is_php=true, each final have_heaWat=have_heaWat, each final have_chiWat=have_chiWat, each final dtOff=dtOff) if have_php "Evaluate polyvalent HP availability in heating or cooling mode"; Subsequences.RoutingPrimaryPumpStatus rouPumChiWatPri( final have_pumPriHdr=have_pumPriHdr, final nPumPriDedHp=nPumChiWatPriDedHp, final nPumPriDedPhp=nPumChiWatPriDedPhp, final nPumPri=nPumChiWatPri) if have_pumChiWatPri "Reroute primary CHW pump status signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatPriHdr_actual[nPumHeaWatPri] if have_pumHeaWatPri and have_pumPriHdr "Primary HW pump status"; Subsequences.RoutingPrimaryPumpStatus rouPumHeaWatPri( final have_pumPriHdr=have_pumPriHdr, final nPumPriDedHp=nPumHeaWatPriDedHp, final nPumPriDedPhp=nPumHeaWatPriDedPhp, final nPumPri=nPumHeaWatPri) if have_pumHeaWatPri "Reroute primary HW pump status signal"; Buildings.Controls.OBC.CDL.Utilities.Assert assPlaCfg( message="Primary-secondary plants with headered pumps are not supported when both reversible and polyvalent HP are present") "Assert unsupported plant configuration"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant conIsPriOnl(final k=is_priOnl) "Constant flagging primary-only plant configuration"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant conNotRevPhp( k=typ <> Buildings.Templates.Plants.Controls.Types.PlantHeatPump.ReversiblePolyvalent) "Constant flagging plant type other than reversible and polyvalent HP"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant conNotHavePumPriHdr( final k=not have_pumPriHdr) "Constant flagging plant without headered primary pumps"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOrConfSupported(nin=3) "Evaluate whether plant configuration is supported"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTHeaWatSupPhpSet( final nout=nPhp) if have_heaWat and have_php "Replicate HWST setpoint"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTChiWatSupPhpSet( final nout=nPhp) if have_chiWat and have_php "Replicate CHWST setpoint"; PolyvalentHeatPumps.AssertMinimumRuntime assMinRunTimPhp(final nUni=nPhp) if have_php "Assert polyvalent HP minimum runtime"; PolyvalentHeatPumps.AssertMinimumRuntime assMinOffTimPhp( use_runTim=false, final nUni=nPhp, dt_min=15 * 60) if have_php "Assert polyvalent HP minimum off-time"; StagingRotation.SortRuntime sorRunTimPhp(nin=nPhp) if have_php "Sort polyvalent HP by increasing runtime"; Buildings.Controls.OBC.CDL.Logical.And y1ShcPhp[nPhp] if have_php "Polyvalent HP commanded in SHC mode"; Subsequences.AssertMinimumRuntime assMinRunTimHp( final have_chiWat=have_chiWat, final nUni=nHp) if have_hp "Assert HP minimum runtime"; Subsequences.AssertMinimumRuntime assMinOffTimHp( final have_chiWat=have_chiWat, use_runTim=false, final nUni=nHp, dt_min=15 * 60) if have_hp "Assert HP minimum off-time"; equation connect(u1SchHea, enaHea.u1Sch); connect(nReqPlaHeaWat, enaHea.nReqPla); connect(TOut, enaHea.TOut); connect(enaHea.y1, idxStaHea.u1Lea); connect(avaStaHea.y1, idxStaHea.u1AvaSta); connect(idxStaHea.y, selMod.uStaHea); connect(seqEve.y1ValHeaWatOutIso[1:nHp], y1ValHeaWatHpOutIso); connect(seqEve.y1ValHeaWatInlIso[1:nHp], y1ValHeaWatHpInlIso); connect(seqEve.y1ValChiWatInlIso[1:nHp], y1ValChiWatHpInlIso); connect(seqEve.y1ValChiWatOutIso[1:nHp], y1ValChiWatHpOutIso); connect(idxStaHea.y, chaStaHea.uSta); connect(chaStaHea.y1Dow, idxStaHea.u1Dow); connect(chaStaHea.y1Up, idxStaHea.u1Up); connect(chaStaHea.y1Lck, chaStaCoo.u1Lck); connect(chaStaHea.uStaOppNexHig, chaStaCoo.yStaNexHig); connect(avaStaHea.y1, chaStaHea.u1AvaSta); connect(nReqPlaChiWat, enaCoo.nReqPla); connect(TOut, enaCoo.TOut); connect(u1SchCoo, enaCoo.u1Sch); connect(avaStaCoo.y1, chaStaCoo.u1AvaSta); connect(enaCoo.y1, idxStaCoo.u1Lea); connect(chaStaCoo.y1Up, idxStaCoo.u1Up); connect(chaStaCoo.y1Dow, idxStaCoo.u1Dow); connect(idxStaCoo.y, selMod.uStaCoo); connect(avaStaCoo.y1, idxStaCoo.u1AvaSta); connect(idxStaCoo.y, chaStaCoo.uSta); connect(staPumHeaWatPri.y1Ded_actual, seqEve.u1PumHeaWatPriDed_actual); connect(staPumHeaWatPri.y1Hdr_actual, seqEve.u1PumHeaWatPriHdr_actual); connect(staPumHeaWatPri.y1, y1PumHeaWatPriHdr); connect(staPumHeaWatPri.y1[nPumHeaWatPri - nPumHeaWatPriDedPhp + 1:nPumHeaWatPri], y1PumHeaWatPriDedPhp); connect(staPumHeaWatPri.y1[1:nPumHeaWatPriDedHp], y1PumHeaWatPriDedHp); connect(staPumChiWatPri.y1Ded_actual, seqEve.u1PumChiWatPriDed_actual); connect(staPumChiWatPri.y1Hdr_actual, seqEve.u1PumChiWatPriHdr_actual); connect(staPumChiWatPri.y1, y1PumChiWatPriHdr); connect(staPumChiWatPri.y1[nPumChiWatPri - nPumChiWatPriDedPhp + 1:nPumChiWatPri], y1PumChiWatPriDedPhp); connect(staPumChiWatPri.y1[1:nPumChiWatPriDedHp], y1PumChiWatPriDedHp); connect(seqEve.y1PumChiWatPri, staPumChiWatPri.u1PumPri); connect(rouPumChiWatPri.y1, staPumChiWatPri.u1Pum_actual); connect(rouPumHeaWatPri.y1, staPumHeaWatPri.u1Pum_actual); connect(staPumHeaWatSec.y1, y1PumHeaWatSec); connect(staPumChiWatSec.y1, y1PumChiWatSec); connect(u1PumHeaWatSec_actual, staPumHeaWatSec.u1Pum_actual); connect(u1PumChiWatSec_actual, staPumChiWatSec.u1Pum_actual); connect(staPumHeaWatPri.y1, y1PumHeaWatPriHdr); connect(seqEve.y1PumHeaWatPri, staPumHeaWatPri.u1PumPri); connect(VHeaWatLooOrSec_flow, staPumHeaWatSec.V_flow); connect(VChiWatLooOrSec_flow, staPumChiWatSec.V_flow); connect(THeaWatPriRet, THeaWatRet.u); connect(THeaWatRet.y, chaStaHea.TRet); connect(THeaWatLooOrSecRet, THeaWatRet.uPh); connect(VHeaWatPri_flow, VHeaWatSta_flow.u); connect(VHeaWatSta_flow.y, chaStaHea.V_flow); connect(VHeaWatLooOrSec_flow, VHeaWatSta_flow.uPh); connect(TChiWatPriRet, TChiWatRet.u); connect(TChiWatRet.y, chaStaCoo.TRet); connect(TChiWatLooOrSecRet, TChiWatRet.uPh); connect(VChiWatPri_flow, VChiWatSta_flow.u); connect(VChiWatSta_flow.y, chaStaCoo.V_flow); connect(VChiWatLooOrSec_flow, VChiWatSta_flow.uPh); connect(enaHea.y1, staPumHeaWatSec.u1Pla); connect(enaCoo.y1, staPumChiWatSec.u1Pla); connect(seqEve.y1ValHeaWatInlIso, staPumHeaWatPri.u1ValInlIso); connect(seqEve.y1ValHeaWatOutIso, staPumHeaWatPri.u1ValOutIso); connect(seqEve.y1ValChiWatInlIso, staPumChiWatPri.u1ValInlIso); connect(seqEve.y1ValChiWatOutIso, staPumChiWatPri.u1ValOutIso); connect(u1Hp_actual, sorRunTimHp.u1Run); connect(u1AvaHp.y, sorRunTimHp.u1Ava); connect(idxStaCoo.y, comStaCoo.uSta); connect(comStaCoo.y1, chaStaCoo.u1StaPro); connect(u1Hp_actual, comStaCoo.u1_actual[1:nHp]); connect(u1Php_actual, comStaCoo.u1_actual[nHp + 1:nHp + nPhp]); connect(u1Php_actual, comStaCoo.u1_actual[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(y1Hp, comStaCoo.u1[1:nHp]); connect(y1CooPhp, comStaCoo.u1[nHp + 1:nHp + nPhp]); connect(idxStaHea.y, comStaHea.uSta); connect(u1Hp_actual, comStaHea.u1_actual[1:nHp]); connect(u1Php_actual, comStaHea.u1_actual[nHp + 1:nHp + nPhp]); connect(u1Php_actual, comStaHea.u1_actual[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(y1Hp, comStaHea.u1[1:nHp]); connect(y1HeaPhp, comStaHea.u1[nHp + 1:nHp + nPhp]); connect(comStaHea.y1, chaStaHea.u1StaPro); connect(resHeaWat.dpSet, dpHeaWatRemSet); connect(resChiWat.dpSet, dpChiWatRemSet); connect(nReqResHeaWat, resHeaWat.nReqRes); connect(nReqResChiWat, resChiWat.nReqRes); connect(enaCoo.y1, resChiWat.u1Ena); connect(enaHea.y1, resHeaWat.u1Ena); connect(comStaHea.y1, resHeaWat.u1StaPro); connect(comStaCoo.y1, resChiWat.u1StaPro); connect(resChiWat.TSupSet, chaStaCoo.TSupSet); connect(resHeaWat.TSupSet, chaStaHea.TSupSet); connect(ctlPumPri.yPumHeaWatPriHdr, yPumHeaWatPriHdr); connect(ctlPumPri.yPumChiWatPriHdr, yPumChiWatPriHdr); connect(ctlPumPri.yPumHeaWatPriDedHp, yPumHeaWatPriDedHp); connect(ctlPumPri.yPumHeaWatPriDedPhp, yPumHeaWatPriDedPhp); connect(y1PumHeaWatPriHdr, ctlPumPri.u1PumHeaWatPriHdr); connect(y1PumChiWatPriHdr, ctlPumPri.u1PumChiWatPriHdr); connect(y1PumHeaWatPriDedHp, ctlPumPri.u1PumHeaWatPriDedHp); connect(y1PumChiWatPriDedHp, ctlPumPri.u1PumChiWatPriDedHp); connect(y1PumHeaWatPriDedPhp, ctlPumPri.u1PumHeaWatPriDedPhp); connect(y1PumChiWatPriDedPhp, ctlPumPri.u1PumChiWatPriDedPhp); connect(y1HeaHp, ctlPumPri.u1HeaHp); connect(ctlPumHeaWatSec.y, yPumHeaWatSec); connect(ctlPumChiWatSec.y, yPumChiWatSec); connect(u1PumHeaWatSec_actual, ctlPumHeaWatSec.y1_actual); connect(u1PumChiWatSec_actual, ctlPumChiWatSec.y1_actual); connect(resChiWat.dpSet, ctlPumChiWatSec.dpRemSet); connect(dpHeaWatRem, ctlPumHeaWatSec.dpRem); connect(resHeaWat.dpSet, ctlPumHeaWatSec.dpRemSet); connect(dpHeaWatLoc, ctlPumHeaWatSec.dpLoc); connect(dpHeaWatLocSet, ctlPumHeaWatSec.dpLocSet); connect(dpChiWatRem, ctlPumChiWatSec.dpRem); connect(dpChiWatLocSet, ctlPumChiWatSec.dpLocSet); connect(dpChiWatLoc, ctlPumChiWatSec.dpLoc); connect(resChiWat.TSupSet, repTChiWatSupHpSet.u); connect(resHeaWat.TSupSet, repTHeaWatSupHpSet.u); connect(resChiWat.TSupSet, TChiWatSupSet); connect(resHeaWat.TSupSet, THeaWatSupSet); connect(hrc.y1, y1Hrc); connect(hrc.y1Coo, y1CooHrc); connect(hrc.y1PumChiWat, y1PumChiWatHrc); connect(hrc.y1PumHeaWat, y1PumHeaWatHrc); connect(TChiWatSupSet, hrc.TChiWatSupSet); connect(THeaWatSupSet, hrc.THeaWatSupSet); connect(enaCoo.y1, hrc.u1Coo); connect(enaHea.y1, hrc.u1Hea); connect(TChiWatRetUpsHrc, hrc.TChiWatRetUpsHrc); connect(THeaWatRetUpsHrc, hrc.THeaWatRetUpsHrc); connect(THeaWatLooOrSecRet, hrc.THeaWatHrcLvg); connect(TChiWatLooOrSecRet, hrc.TChiWatHrcLvg); connect(u1Hrc_actual, hrc.u1Hrc_actual); connect(u1ReqFloChiWat, hrc.u1ReqFloChiWat); connect(u1ReqFloConWat, hrc.u1ReqFloConWat); connect(TChiWatPriSup, chaStaCoo.TPriSup); connect(THeaWatSecSup, chaStaHea.TSecSup); connect(TChiWatSecSup, chaStaCoo.TSecSup); connect(THeaWatPriSup, chaStaHea.TPriSup); connect(ctlPumHeaWatSec.y, staPumHeaWatSec.y); connect(ctlPumChiWatSec.y, staPumChiWatSec.y); connect(ctlPumHeaWatSec.dpLocSetMax, staPumHeaWatSec.dpSet[1]); connect(ctlPumChiWatSec.dpLocSetMax, staPumChiWatSec.dpSet[1]); connect(dpHeaWatLoc, staPumHeaWatSec.dp[1]); connect(dpChiWatLoc, staPumChiWatSec.dp[1]); connect(dpChiWatRem, staPumChiWatSec.dp); connect(dpHeaWatRem, staPumHeaWatSec.dp); connect(resHeaWat.dpSet, pasDpHeaWatRemSet.u); connect(pasDpHeaWatRemSet.y, staPumHeaWatSec.dpSet); connect(pasDpChiWatRemSet.y, staPumChiWatSec.dpSet); connect(resChiWat.dpSet, pasDpChiWatRemSet.u); connect(resChiWat.dpSet, ctlPumPri.dpChiWatRemSet); connect(resHeaWat.dpSet, ctlPumPri.dpHeaWatRemSet); connect(dpHeaWatRem, ctlPumPri.dpHeaWatRem); connect(dpHeaWatLocSet, ctlPumPri.dpHeaWatLocSet); connect(dpHeaWatLoc, ctlPumPri.dpHeaWatLoc); connect(pasDpHeaWatRemSet.y, staPumHeaWatPri.dpSet); connect(pasDpChiWatRemSet.y, staPumChiWatPri.dpSet); connect(ctlPumPri.dpChiWatLocSetMax, staPumChiWatPri.dpSet[1]); connect(ctlPumPri.dpHeaWatLocSetMax, staPumHeaWatPri.dpSet[1]); connect(ctlPumPri.yPumHeaWatPriHdr, staPumHeaWatPri.y); connect(ctlPumPri.yPumChiWatPriHdr, staPumChiWatPri.y); connect(ctlPumPri.yPumChiWatPriDedHp, yPumChiWatPriDedHp); connect(ctlPumPri.yPumChiWatPriDedPhp, yPumChiWatPriDedPhp); connect(u1PumHeaWatPriHdr_actual, ctlPumPri.u1PumHeaWatPriHdr_actual); connect(u1PumChiWatPriHdr_actual, ctlPumPri.u1PumChiWatPriHdr_actual); connect(u1PumHeaWatPriDedHp_actual, ctlPumPri.u1PumHeaWatPriDedHp_actual); connect(u1PumChiWatPriDedHp_actual, ctlPumPri.u1PumChiWatPriDedHp_actual); connect(u1PumHeaWatPriDedPhp_actual, ctlPumPri.u1PumHeaWatPriDedPhp_actual); connect(u1PumChiWatPriDedPhp_actual, ctlPumPri.u1PumChiWatPriDedPhp_actual); connect(dpChiWatRem, ctlPumPri.dpChiWatRem); connect(dpChiWatLocSet, ctlPumPri.dpChiWatLocSet); connect(dpChiWatLoc, ctlPumPri.dpChiWatLoc); connect(dpHeaWatRem, staPumHeaWatPri.dp); connect(dpChiWatRem, staPumChiWatPri.dp); connect(dpHeaWatLoc, staPumHeaWatPri.dp[1]); connect(dpChiWatLoc, staPumChiWatPri.dp[1]); connect(VChiWatPri_flow, staPumChiWatPri.V_flow); connect(VHeaWatPri_flow, staPumHeaWatPri.V_flow); connect(ctlFloMin.yValHeaWatMinByp, yValHeaWatMinByp); connect(ctlFloMin.yValChiWatMinByp, yValChiWatMinByp); connect(y1Hp, ctlFloMin.u1Hp); connect(y1HeaHp, ctlFloMin.u1HeaHp); connect(y1HeaPhp, ctlFloMin.u1HeaPhp); connect(y1CooPhp, ctlFloMin.u1CooPhp); connect(seqEve.y1ValHeaWatInlIso, ctlFloMin.u1ValHeaWatInlIso); connect(seqEve.y1ValHeaWatOutIso, ctlFloMin.u1ValHeaWatOutIso); connect(seqEve.y1ValChiWatInlIso, ctlFloMin.u1ValChiWatInlIso); connect(seqEve.y1ValChiWatOutIso, ctlFloMin.u1ValChiWatOutIso); connect(u1PumHeaWatPriDedHp_actual, ctlFloMin.u1PumHeaWatPriDedHp_actual); connect(u1PumHeaWatPriDedPhp_actual, ctlFloMin.u1PumHeaWatPriDedPhp_actual); connect(u1PumChiWatPriDedHp_actual, ctlFloMin.u1PumChiWatPriDedHp_actual); connect(u1PumChiWatPriDedPhp_actual, ctlFloMin.u1PumChiWatPriDedPhp_actual); connect(VHeaWatPri_flow, ctlFloMin.VHeaWatPri_flow); connect(VChiWatPri_flow, ctlFloMin.VChiWatPri_flow); connect(repTHeaWatSupHpSet.y, THeaWatSupHpSet); connect(repTChiWatSupHpSet.y, TChiWatSupHpSet); connect(TChiWatSupSet, TChiWatSupHrcSet); connect(THeaWatSupSet, THeaWatSupHrcSet); connect(idxStaCoo.y, avaStaHea.uStaOpp); connect(idxStaHea.y, avaStaCoo.uStaOpp); connect(idxStaCoo.y, chaStaHea.uStaOpp); connect(idxStaHea.y, chaStaCoo.uStaOpp); connect(chaStaHea.staTra, selMod.staTraHea); connect(chaStaCoo.staTra, selMod.staTraCoo); connect(sorRunTimHp.yIdx, selMod.uIdxSorHp); connect(sorRunTimPhp.yIdx, selMod.uIdxSorPhp); connect(u1AvaHp.y, avaHeaCooHp.u1Ava); connect(avaHeaCooHp.y1Hea, avaStaHea.u1Ava[1:nHp]); connect(avaHeaCooHp.y1Coo, avaStaCoo.u1Ava[1:nHp]); connect(avaHeaCooPhp.y1Coo, avaStaCoo.u1Ava[nHp + 1:nHp + nPhp]); connect(avaHeaCooPhp.y1Shc, avaStaCoo.u1Ava[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(avaHeaCooPhp.y1Hea, avaStaHea.u1Ava[nHp + 1:nHp + nPhp]); connect(avaHeaCooPhp.y1Shc, avaStaHea.u1Ava[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(u1AvaPhp.y, avaHeaCooPhp.u1Ava); connect(selMod.y1HeaPhp, avaHeaCooPhp.u1EnaHea); connect(selMod.y1ShcPhp, avaHeaCooPhp.u1EnaShc); connect(selMod.y1HeaHp, avaHeaCooHp.u1EnaHea); connect(selMod.y1CooPhp, avaHeaCooPhp.u1EnaCoo); connect(selMod.y1CooHp, avaHeaCooHp.u1EnaCoo); connect(avaHeaCooHp.y1Coo, selMod.u1AvaCooHp); connect(avaHeaCooHp.y1Hea, selMod.u1AvaHeaHp); connect(avaHeaCooPhp.y1Hea, selMod.u1AvaHeaPhp); connect(avaHeaCooPhp.y1Shc, selMod.u1AvaShcPhp); connect(avaHeaCooPhp.y1Coo, selMod.u1AvaCooPhp); connect(seqEve.y1ValHeaWatInlIso[nHp + 1:nHp + nPhp], y1ValHeaWatPhpInlIso); connect(seqEve.y1ValChiWatInlIso[nHp + 1:nHp + nPhp], y1ValChiWatPhpInlIso); connect(seqEve.y1ValHeaWatOutIso[nHp + 1:nHp + nPhp], y1ValHeaWatPhpOutIso); connect(seqEve.y1ValChiWatOutIso[nHp + 1:nHp + nPhp], y1ValChiWatPhpOutIso); connect(idxStaCoo.y, idxStaHea.uStaOpp); connect(idxStaHea.y, idxStaCoo.uStaOpp); connect(u1PumChiWatPriHdr_actual, rouPumChiWatPri.u1PumPriHdr_actual); connect(u1PumChiWatPriDedHp_actual, rouPumChiWatPri.u1PumPriDedHp_actual); connect(u1PumChiWatPriDedPhp_actual, rouPumChiWatPri.u1PumPriDedPhp_actual); connect(u1PumHeaWatPriHdr_actual, rouPumHeaWatPri.u1PumPriHdr_actual); connect(u1PumHeaWatPriDedHp_actual, rouPumHeaWatPri.u1PumPriDedHp_actual); connect(u1PumHeaWatPriDedPhp_actual, rouPumHeaWatPri.u1PumPriDedPhp_actual); connect(conIsPriOnl.y, mulOrConfSupported.u[1]); connect(conNotRevPhp.y, mulOrConfSupported.u[2]); connect(conNotHavePumPriHdr.y, mulOrConfSupported.u[3]); connect(mulOrConfSupported.y, assPlaCfg.u); connect(resChiWat.TSupSet, repTChiWatSupPhpSet.u); connect(resHeaWat.TSupSet, repTHeaWatSupPhpSet.u); connect(repTHeaWatSupPhpSet.y, THeaWatSupPhpSet); connect(repTChiWatSupPhpSet.y, TChiWatSupPhpSet); connect(seqEve.y1Hp, y1Hp); connect(seqEve.y1HeaHp, y1HeaHp); connect(seqEve.y1HeaPhp, y1HeaPhp); connect(seqEve.y1CooPhp, y1CooPhp); connect(selMod.y1HeaHpPhp, seqEve.u1HeaHpPhp); connect(selMod.y1ShcPhp, seqEve.u1ShcPhp); connect(selMod.y1CooHpPhp, seqEve.u1CooHpPhp); connect(y1HeaPhp, assMinRunTimPhp.u1Hea); connect(y1CooPhp, assMinRunTimPhp.u1Coo); connect(y1HeaPhp, assMinOffTimPhp.u1Hea); connect(y1CooPhp, assMinOffTimPhp.u1Coo); connect(u1Php_actual, sorRunTimPhp.u1Run); connect(u1AvaPhp.y, sorRunTimPhp.u1Ava); connect(idxStaCoo.y, selMod.uStaCoo); connect(chaStaCoo.staTra, selMod.staTraCoo); connect(y1HeaPhp, y1ShcPhp.u1); connect(y1CooPhp, y1ShcPhp.u2); connect(y1ShcPhp.y, comStaCoo.u1[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(y1ShcPhp.y, comStaHea.u1[nHp + nPhp + 1:nHp + 2 * nPhp]); connect(y1Hp, assMinRunTimHp.u1); connect(y1HeaHp, assMinRunTimHp.u1Hea); connect(y1Hp, assMinOffTimHp.u1); connect(y1HeaHp, assMinOffTimHp.u1Hea); connect(VChiWatLooOrSec_flow, hrc.VChiWatLoa_flow); connect(VHeaWatLooOrSec_flow, hrc.VHeaWatLoa_flow); end AirToWater;