Buildings.Templates.Plants.Controls.HeatPumps

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.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, 2021 for chiller plants.

The supported plant configurations are enumerated in the table below.

Configuration parameterOptionsNotes
Function Heating and cooling
Heating-only
Cooling-only
Type of distribution Constant primary-variable secondary centralized "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.
Options are limited to constant primary distributions because most AWHPs on the market use a reverse cycle for defrosting. This requires maximum primary flow during defrost cycles and hinders variable primary distributions.
An option for constant primary-only distributions with ∆p-controlled variable speed pumps will be added in a next release.
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.
Separate dedicated primary CHW pumps False
True
This option is only available for heating and cooling plants with dedicated primary pumps. If this option is not selected, each AWHP uses a common dedicated primary pump for HW and CHW. 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.
Type of primary CHW pumps Variable speed
Constant speed
See the note above on primary HW pumps.

Details

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.

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
Booleanhave_heaWat Set to true for plants that provide HW
Booleanhave_chiWat Set to true for plants that provide CHW
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_pumChiWatPriDed_selectfalseSet to true for plants with separate dedicated primary CHW pumps
Booleanhave_pumPriHdr Set to true for headered primary pumps, false for dedicated pumps
Booleanhave_pumHeaWatPriVartrueSet to true for variable speed primary HW pumps, false for constant speed pumps
Booleanhave_pumChiWatPriVartrueSet to true for variable speed primary CHW pumps, false for constant speed pumps
Booleanhave_pumHeaWatSec_select Set to true for plants with secondary HW pumps
Booleanhave_pumChiWatSec_select Set to true for plants with secondary CHW pumps
IntegernHp Number of heat pumps
IntegernPumHeaWatPrinHpNumber of primary HW pumps
IntegernPumChiWatPriif have_pumChiWatPri then nH...Number of primary CHW pumps
IntegernPumHeaWatSecnHpNumber of secondary HW pumps
IntegernPumChiWatSecnHpNumber of secondary CHW pumps
Sensors
Booleanhave_senVHeaWatPri_select Set to true for plants with primary HW flow sensor
Booleanhave_senVChiWatPri_select Set to true for plants with primary CHW flow sensor
Booleanhave_senTHeaWatPriRet_select Set to true for plants with primary HW return temperature sensor
Booleanhave_senTChiWatPriRet_select Set to true for plants with primary CHW return temperature sensor
Booleanhave_senTHeaWatSecRet Set to true for plants with secondary HW return temperature sensor
Booleanhave_senTChiWatSecRet Set to true for plants with secondary CHW return temperature sensor
Booleanhave_senDpHeaWatRemWirtrueSet 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_senDpChiWatRemWirtrueSet 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]
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]
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]
Information provided by testing, adjusting, and balancing contractor
RealdpHeaWatRemSet_max[nSenDpHeaWatRem] Maximum HW differential pressure setpoint - Remote sensor [Pa]
RealyPumHeaWatPriSet Primary pump speed providing design heat pump flow in heating mode [1]
RealdpChiWatRemSet_max[nSenDpChiWatRem] Maximum CHW differential pressure setpoint - Remote sensor [Pa]
RealyPumChiWatPriSet Primary pump speed providing design heat pump flow in cooling mode [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
RealstaEqu[:, nHp] Staging matrix – Equipment required for each stage [1]
IntegeridxEquAlt[nEquAlt] Indices of lead/lag alternate equipment
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
RealdtVal90Nominal valve timing [s]
RealdtHp180[s]
RealdtRunSta900Minimum runtime of each stage [s]
RealdtOff900Off time required before equipment is deemed available again [s]
Pump staging
RealdtRunPumSta600Runtime before triggering stage command [s]
RealdVOffUpPumSta0.03Stage up flow point offset [1]
RealdVOffDowPumStadVOffUpPumStaStage down flow point offset [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]
RealdtResHeaWat300Reset period 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 reset period for HW plant reset [1]
RealdtResChiWat300Reset period 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 reset period for CHW plant reset [1]
Secondary HW pumps
RealyPumHeaWatSec_min0.1Minimum pump speed [1]
RealkPumHeaWatSec1Gain of controller
RealTiPumHeaWatSec60Time constant of integrator block [s]
Secondary CHW pumps
RealyPumChiWatSec_min0.1Minimum pump speed [1]
RealkPumChiWatSec1Gain of controller
RealTiPumChiWatSec60Time constant of integrator block [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 BooleanInputu1PumHeaWatPri_actual[nPumHeaWatPri]Primary HW pump status
input BooleanInputu1PumChiWatPri_actual[nPumChiWatPri]Primary CHW pump status
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 inlet 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 BooleanOutputy1PumHeaWatPri[nPumHeaWatPri]Primary HW pump start command
output BooleanOutputy1PumChiWatPri[nPumChiWatPri]Primary CHW pump start command
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 RealOutputdpHeaWatRemSet[nSenDpHeaWatRem]HW differential pressure setpoint [Pa]
output RealOutputdpChiWatRemSet[nSenDpChiWatRem]CHW differential pressure setpoint [Pa]
output RealOutputyPumHeaWatPriHdrPrimary headered HW pump speed command [1]
output RealOutputyPumChiWatPriHdrPrimary headered CHW pump speed command [1]
output RealOutputyPumHeaWatSecPrimary HW pump speed command [1]
output RealOutputyPumChiWatSecPrimary CHW pump speed command [1]
output RealOutputTChiWatSupSetCHW supply temperature setpoint [K]
output RealOutputTHeaWatSupSetHW 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 RealOutputyPumHeaWatPriDed[nPumHeaWatPri]Primary dedicated HW pump speed command [1]
output RealOutputyPumChiWatPriDed[nPumChiWatPri]Primary dedicated CHW pump speed command [1]
input RealInputTHeaWatSecRetSecondary HW return temperature [K]
input RealInputVHeaWatSec_flowSecondary HW volume flow rate [m3/s]
input RealInputTChiWatSecRetSecondary CHW return temperature [K]
input RealInputVChiWatSec_flowSecondary CHW volume flow rate [m3/s]
output RealOutputTSupSet[nHp]Active HP 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 return temperature [K]

Modelica definition

block AirToWater "Controller for AWHP plant" 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_valHpInlIso "Set to true for plants with isolation valves at heat pump inlet"; parameter Boolean have_valHpOutIso "Set to true for plants with isolation valves at heat pump outlet"; final parameter Boolean have_pumHeaWatPri=have_heaWat "Set to true for plants with primary HW pumps"; parameter Boolean have_pumChiWatPriDed_select(start=false)=false "Set to true for plants with separate dedicated primary CHW pumps"; final parameter Boolean have_pumChiWatPriDed= if have_chiWat and not have_pumPriHdr then have_pumChiWatPriDed_select else false "Set to true for plants with separate dedicated primary CHW pumps"; final parameter Boolean have_pumChiWatPri= have_chiWat and (have_pumPriHdr or have_pumChiWatPriDed) "Set to true for plants with separate primary CHW pumps"; parameter Boolean have_pumPriHdr "Set to true for headered primary pumps, false for dedicated pumps"; parameter Boolean have_pumHeaWatPriVar(start=true)=true "Set to true for variable speed primary HW pumps, false for constant speed pumps"; parameter Boolean have_pumChiWatPriVar(start=true)=true "Set to true for variable speed primary CHW pumps, false for constant speed pumps"; // Only constant primary is supported for AWHP. final parameter Boolean have_pumPriCtlDp=false "Set to true for primary headered variable speed pumps using ∆p pump speed control"; parameter Boolean have_pumHeaWatSec_select(start=false) "Set to true for plants with secondary HW pumps"; final parameter Boolean have_pumHeaWatSec= if have_heaWat then have_pumHeaWatSec_select else false "Set to true for plants with secondary HW pumps"; parameter Boolean have_pumChiWatSec_select(start=false) "Set to true for plants with secondary CHW pumps"; final parameter Boolean have_pumChiWatSec= if have_chiWat then have_pumChiWatSec_select else false "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 headered variable speed pumps using ∆p pump speed control"; // RFE(AntoineGautier): Add option for sidestream HRC. Always excluded for now. final parameter Boolean have_hrc( start=false)=false "Set to true for plants with a sidestream heat recovery chiller"; parameter Boolean have_senVHeaWatPri_select(start=false) "Set to true for plants with primary HW flow sensor"; final parameter Boolean have_senVHeaWatPri=have_heaWat and (if have_hrc or not have_senVHeaWatSec then true else have_senVHeaWatPri_select) "Set to true for plants with primary HW flow sensor"; // Secondary flow sensor required for secondary HW pump staging. final parameter Boolean have_senVHeaWatSec=have_pumHeaWatSec "Set to true for plants with secondary HW flow sensor"; parameter Boolean have_senVChiWatPri_select(start=false) "Set to true for plants with primary CHW flow sensor"; final parameter Boolean have_senVChiWatPri=have_chiWat and (if have_hrc or not have_senVChiWatSec then true else have_senVChiWatPri_select) "Set to true for plants with primary CHW flow sensor"; // Secondary flow sensor required for secondary CHW pump staging. final parameter Boolean have_senVChiWatSec(start=false)=have_pumChiWatSec "Set to true for plants with secondary CHW flow sensor"; parameter Boolean have_senTHeaWatPriRet_select(start=false) "Set to true for plants with primary HW return temperature sensor"; final parameter Boolean have_senTHeaWatPriRet=have_heaWat and (if have_hrc or not have_senTHeaWatSecRet then true else have_senTHeaWatPriRet_select) "Set to true for plants with primary HW return temperature sensor"; parameter Boolean have_senTChiWatPriRet_select(start=false) "Set to true for plants with primary CHW return temperature sensor"; final parameter Boolean have_senTChiWatPriRet=have_chiWat and (if have_hrc or not have_senTChiWatSecRet then true else have_senTChiWatPriRet_select) "Set to true for plants with primary CHW return temperature sensor"; // For primary-secondary plants, SHWST sensor is required for plant staging. final parameter Boolean have_senTHeaWatSecSup=have_pumHeaWatSec "Set to true for plants with secondary HW supply temperature sensor"; // For primary-secondary plants, SCHWST sensor is required for plant staging. final parameter Boolean have_senTChiWatSecSup=have_pumChiWatSec "Set to true for plants with secondary CHW supply temperature sensor"; parameter Boolean have_senTHeaWatSecRet(start=false) "Set to true for plants with secondary HW return temperature sensor"; parameter Boolean have_senTChiWatSecRet(start=false) "Set to true for plants with secondary CHW return temperature sensor"; parameter Integer nHp(final min=1) "Number of heat pumps"; parameter Integer nPumHeaWatPri( final min=if have_pumHeaWatPri then 1 else 0, start=0)=nHp "Number of primary HW pumps"; parameter Integer nPumChiWatPri( final min=if have_pumChiWatPri then 1 else 0, start=if have_pumChiWatPri then nHp else 0)=if have_pumChiWatPri then nHp else 0 "Number of primary CHW pumps"; parameter Integer nPumHeaWatSec( final min=if have_pumHeaWatSec then 1 else 0, start=0)=nHp "Number of secondary HW pumps"; parameter Integer nPumChiWatSec( final min=if have_pumChiWatSec then 1 else 0, start=0)=nHp "Number of secondary CHW pumps"; parameter Boolean have_senDpHeaWatRemWir(start=true)=true "Set to true for remote HW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpHeaWatRem(final min=if have_heaWat and have_pumHeaWatSec then 1 else 0, start=0) "Number of remote HW differential pressure sensors used for HW pump speed control"; parameter Boolean have_senDpChiWatRemWir(start=true)=true "Set to true for remote CHW differential pressure sensor(s) hardwired to plant or pump controller"; parameter Integer nSenDpChiWatRem(final min=if have_chiWat and have_pumChiWatSec then 1 else 0, start=0) "Number of remote CHW differential pressure sensors used for CHW pump speed control"; parameter Real THeaWatSup_nominal( final min=273.15, start=50 + 273.15, final unit="K", displayUnit="degC") "Design HW supply temperature (maximum setpoint)"; parameter Real THeaWatSupSet_min( final min=273.15, start=25 + 273.15, final unit="K", displayUnit="degC") "Minimum value to which the HW supply temperature can be reset"; parameter Real TOutHeaWatLck( final min=273.15, start=21 + 273.15, final unit="K", displayUnit="degC")=294.15 "Outdoor air lockout temperature above which the HW loop is prevented from operating"; parameter Real capHeaHp_nominal[nHp]( final min=fill(0, nHp), start=fill(1, nHp), final unit=fill("W", nHp)) "Design heating capacity - Each heat pump"; parameter Real VHeaWatSec_flow_nominal( final min=0, start=1E-6, final unit="m3/s") "Design secondary HW volume flow rate"; parameter Real dpHeaWatRemSet_max[nSenDpHeaWatRem]( final min=fill(0, nSenDpHeaWatRem), start=fill(5E4, nSenDpHeaWatRem), final unit=fill("Pa", nSenDpHeaWatRem)) "Maximum HW differential pressure setpoint - Remote sensor"; parameter Real dpHeaWatRemSet_min( final min=0, start=5*6894, final unit="Pa")=5*6894 "Minimum value to which the HW differential pressure can be reset - Remote sensor"; parameter Real yPumHeaWatPriSet( final max=1, final min=0, start=1, final unit="1") "Primary pump speed providing design heat pump flow in heating mode"; parameter Real TChiWatSup_nominal( final min=273.15, start=7 + 273.15, final unit="K", displayUnit="degC") "Design CHW supply temperature (minimum setpoint)"; parameter Real TChiWatSupSet_max( final min=273.15, start=15 + 273.15, final unit="K", displayUnit="degC") "Maximum value to which the CHW supply temperature can be reset"; parameter Real TOutChiWatLck( final min=273.15, start=16 + 273.15, final unit="K", displayUnit="degC")=289.15 "Outdoor air lockout temperature below which the CHW loop is prevented from operating"; parameter Real capCooHp_nominal[nHp]( final min=fill(0, nHp), start=fill(1, nHp), final unit=fill("W", nHp)) "Design cooling capacity - Each heat pump"; parameter Real VChiWatSec_flow_nominal( final min=0, start=1E-6, final unit="m3/s") "Design secondary CHW volume flow rate"; parameter Real dpChiWatRemSet_max[nSenDpChiWatRem]( final min=fill(0, nSenDpChiWatRem), start=fill(5E4, nSenDpChiWatRem), final unit=fill("Pa", nSenDpChiWatRem)) "Maximum CHW differential pressure setpoint - Remote sensor"; parameter Real dpChiWatRemSet_min( final min=0, start=5*6894, final unit="Pa")=5*6894 "Minimum value to which the CHW differential pressure can be reset - Remote sensor"; parameter Real yPumChiWatPriSet( final max=1, final min=0, start=1, final unit="1") "Primary pump speed providing design heat pump flow in cooling mode"; parameter Real cp_default( final min=0, final unit="J/(kg.K)")=4184 "Default specific heat capacity used to compute required capacity"; parameter Real rho_default( final min=0, final 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(final min=0)=0 "Number of ignored HW plant requests"; parameter Integer nReqIgnChiWat(final min=0)=0 "Number of ignored CHW plant requests"; parameter Real dTOutLck( final min=0, final unit="K")=0.5 "Hysteresis for outdoor air lockout temperature"; parameter Real dtRunEna( final min=0, final unit="s")=15*60 "Minimum runtime of enable and disable states"; parameter Real dtReqDis( final min=0, final unit="s")=3*60 "Runtime with low number of request before disabling"; parameter Real staEqu[:, nHp]( each final max=1, each final min=0, each final unit="1") "Staging matrix – Equipment required for each stage"; final parameter Integer nSta( final min=1)=size(staEqu, 1) "Number of stages"; final parameter Integer nEquAlt( final min=0)=max({sum({(if staEqu[i, j] > 0 and staEqu[i, j] < 1 then 1 else 0) for j in 1:nHp}) for i in 1:nSta}) "Number of lead/lag alternate equipment"; parameter Integer idxEquAlt[nEquAlt]( each final min=1) "Indices of lead/lag alternate equipment"; parameter Real dtVal( final min=0, start=90, final unit="s")=90 "Nominal valve timing"; parameter Real dtHp( final min=0, final unit="s")=180; parameter Real plrSta( final max=1, final min=0, start=0.9, final unit="1")=0.9 "Staging part load ratio"; parameter Real dtRunSta( final min=0, final unit="s", displayUnit="min")=900 "Minimum runtime of each stage"; parameter Real dtOff( final min=0, final unit="s")=900 "Off time required before equipment is deemed available again"; parameter Real dtRunPumSta( final min=0, start=600, final unit="s")=600 "Runtime before triggering stage command"; parameter Real dVOffUpPumSta( final max=1, final min=0, start=0.03, final unit="1")=0.03 "Stage up flow point offset"; parameter Real dVOffDowPumSta( final max=1, final min=0, start=0.03, final unit="1")=dVOffUpPumSta "Stage down flow point offset"; parameter Real dtHol( final min=0, final unit="s")=900 "Minimum hold time during stage change"; parameter Real resDpHeaWat_max( final max=1, final min=0, final unit="1")=0.5 "Upper limit of plant reset interval for HW differential pressure reset"; parameter Real resTHeaWatSup_min( final max=1, final min=0, final unit="1")=resDpHeaWat_max "Lower limit of plant reset interval for HW supply temperature reset"; parameter Real resDpChiWat_max( final max=1, final min=0, final unit="1")=0.5 "Upper limit of plant reset interval for CHW differential pressure reset"; parameter Real resTChiWatSup_min( final max=1, final min=0, final unit="1")=resDpChiWat_max "Lower limit of plant reset interval for CHW supply temperature reset"; parameter Real res_init( final max=1, final min=0, final unit="1")=1 "Initial reset value"; parameter Real res_min( final max=1, final min=0, final unit="1")=0 "Minimum reset value"; parameter Real res_max( final max=1, final min=0, final unit="1")=1 "Maximum reset value"; parameter Real dtDel( final min=100*1E-15, final unit="s")=900 "Delay time before the reset begins"; parameter Real dtResHeaWat( final min=1E-3, final unit="s")=300 "Reset period for HW plant reset"; parameter Integer nReqResIgnHeaWat(final min=0)=2 "Number of ignored requests for HW plant reset"; parameter Real triHeaWat( final max=0, final unit="1")=-0.02 "Trim amount for HW plant reset"; parameter Real rspHeaWat( final min=0, final unit="1")=0.03 "Respond amount for HW plant reset"; parameter Real rspHeaWat_max( final min=0, final unit="1")=0.07 "Maximum response per reset period for HW plant reset"; parameter Real dtResChiWat( final min=1E-3, final unit="s")=300 "Reset period for CHW plant reset"; parameter Integer nReqResIgnChiWat(final min=0)=2 "Number of ignored requests for CHW plant reset"; parameter Real triChiWat( final max=0, final unit="1")=-0.02 "Trim amount for CHW plant reset"; parameter Real rspChiWat( final min=0, final unit="1")=0.03 "Respond amount for CHW plant reset"; parameter Real rspChiWat_max( final min=0, final unit="1")=0.07 "Maximum response per reset period for CHW plant reset"; parameter Real yPumHeaWatSec_min( final max=1, final min=0, start=0.1, final unit="1")=0.1 "Minimum pump speed"; parameter Real kPumHeaWatSec( final min=100*Buildings.Controls.OBC.CDL.Constants.eps, start=1)=1 "Gain of controller"; parameter Real TiPumHeaWatSec( final min=100*Buildings.Controls.OBC.CDL.Constants.eps, start=60, final unit="s")=60 "Time constant of integrator block"; parameter Real yPumChiWatSec_min( final max=1, final min=0, start=0.1, final unit="1")=0.1 "Minimum pump speed"; parameter Real kPumChiWatSec( final min=100*Buildings.Controls.OBC.CDL.Constants.eps, start=1)=1 "Gain of controller"; parameter Real TiPumChiWatSec( final min=100*Buildings.Controls.OBC.CDL.Constants.eps, start=60, final unit="s")=60 "Time constant of integrator block"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant u1AvaHp[nHp](each k=true) "Heat pump available signal – Block does not handle faulted equipment yet"; 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 u1PumHeaWatPri_actual[nPumHeaWatPri] if have_heaWat and have_pumHeaWatPri "Primary HW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatPri_actual[nPumChiWatPri] if have_chiWat and have_pumChiWatPri "Primary CHW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumHeaWatSec_actual[nPumHeaWatSec] if have_heaWat and have_pumHeaWatSec "Secondary HW pump status"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1PumChiWatSec_actual[nPumChiWatSec] if have_chiWat and have_pumChiWatSec "Secondary CHW pump status"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriRet( final unit="K", displayUnit="degC") if have_heaWat and have_senTHeaWatPriRet "Primary HW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatPri_flow( final unit="m3/s") if have_heaWat and 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 "Heat pump inlet HW inlet isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValHeaWatHpOutIso[nHp] if have_heaWat and have_valHpOutIso "Heat pump outlet HW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpInlIso[nHp] if have_chiWat and have_valHpInlIso "Heat pump inlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ValChiWatHpOutIso[nHp] if have_chiWat and have_valHpOutIso "Heat pump outlet CHW isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumHeaWatPri[nPumHeaWatPri] if have_pumHeaWatPri "Primary HW pump start command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1PumChiWatPri[nPumChiWatPri] if have_pumChiWatPri and have_chiWat "Primary CHW pump start command"; 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 and have_chiWat "Secondary CHW pump start command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Hp[nHp] "Heat pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HeaHp[nHp] if have_heaWat and have_chiWat "Heat pump heating/cooling mode command: true=heating, false=cooling"; 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_heaWat and have_pumHeaWatPriVar and have_pumPriHdr "Primary headered HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriHdr( final unit="1") if have_chiWat and have_pumChiWatPri and have_pumChiWatPriVar and have_pumPriHdr "Primary headered CHW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatSec( final unit="1") if have_heaWat and have_pumHeaWatSec "Primary HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatSec( final unit="1") if have_chiWat and have_pumChiWatSec "Primary CHW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupSet( final unit="K", displayUnit="degC") if have_chiWat "CHW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupSet( final unit="K", displayUnit="degC") if have_heaWat "HW supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriRet( final unit="K", displayUnit="degC") if have_chiWat and have_senTChiWatPriRet "Primary CHW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatPri_flow( final unit="m3/s") if have_chiWat and have_senVChiWatPri "Primary CHW volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Hp_actual[nHp] "Heat pump status"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumHeaWatPriDed[nPumHeaWatPri]( each final unit="1") if have_heaWat and have_pumHeaWatPriVar and not have_pumPriHdr "Primary dedicated HW pump speed command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPumChiWatPriDed[nPumChiWatPri]( each final unit="1") if have_chiWat and have_pumChiWatPriDed and have_pumChiWatPriVar "Primary dedicated CHW pump speed command"; 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 nSta=nSta, final dtRun=dtRunSta) if have_heaWat "Compute heating stage index"; StagingRotation.StageAvailability avaStaHea( final staEqu=staEqu) if have_heaWat "Evaluate heating stage availability"; StagingRotation.EquipmentEnable enaEquHea( final staEqu=staEqu) if have_heaWat "Compute enable command for equipment in heating mode"; StagingRotation.EventSequencing seqEve[nHp]( each final have_heaWat=have_heaWat, each final have_chiWat=have_chiWat, each final have_valInlIso=have_valHpInlIso, each final have_valOutIso=have_valHpOutIso, each final have_pumHeaWatPri=have_pumHeaWatPri, each final have_pumChiWatPri=have_pumChiWatPri, each final have_pumHeaWatSec=have_pumHeaWatSec, each final have_pumChiWatSec=have_pumChiWatSec, each final dtVal=dtVal, each final dtOff=dtHp) "Event sequencing"; StagingRotation.StageAvailability avaStaCoo( final staEqu=staEqu) if have_chiWat "Evaluate cooling stage availability"; StagingRotation.StageChangeCommand chaStaHea( final have_inpPlrSta=false, final plrSta=plrSta, final staEqu=staEqu, final capEqu=capHeaHp_nominal, final dtRun=dtRunSta, final cp_default=cp_default, final rho_default=rho_default) if have_heaWat "Generate heating stage transition command"; StagingRotation.SortRuntime sorRunTimHea( idxEquAlt=idxEquAlt, nin=nHp) if have_heaWat "Sort lead/lag alternate equipment by staging runtime – Heating mode"; 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 have_inpPlrSta=false, final plrSta=plrSta, final staEqu=staEqu, final capEqu=capCooHp_nominal, final dtRun=dtRunSta, final cp_default=cp_default, final rho_default=rho_default) if have_chiWat "Generate cooling stage transition command"; Utilities.StageIndex idxStaCoo( final nSta=nSta, final dtRun=dtRunSta) if have_chiWat "Compute cooling stage index"; StagingRotation.EquipmentEnable enaEquCoo( final staEqu=staEqu) if have_chiWat "Compute enable command for equipment in cooling mode"; StagingRotation.EquipmentAvailability avaEquHeaCoo[nHp]( each final have_heaWat=have_heaWat, each final have_chiWat=have_chiWat, each final dtOff=dtOff) "Evaluate equipment availability in heating or cooling mode"; Buildings.Controls.OBC.CDL.Logical.Pre y1HeaPre[nHp] if have_heaWat and have_chiWat "Left-limit of command signal to break algebraic loop"; StagingRotation.SortRuntime sorRunTimCoo( final idxEquAlt=idxEquAlt, nin=nHp) if have_chiWat "Sort lead/lag alternate equipment by staging runtime – Cooling mode"; Pumps.Generic.StagingHeadered staPumHeaWatPri( final is_pri=true, final have_valInlIso=have_valHpInlIso, final have_valOutIso=have_valHpOutIso, final nEqu=nHp, final nPum=nPumHeaWatPri, final is_hdr=have_pumPriHdr, final is_ctlDp=have_pumPriCtlDp, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta) if have_pumHeaWatPri "Primary HW pump staging"; Pumps.Generic.StagingHeadered staPumChiWatPri( final is_pri=true, final have_valInlIso=have_valHpInlIso, final have_valOutIso=have_valHpOutIso, final nEqu=nHp, final nPum=nPumChiWatPri, final is_hdr=have_pumPriHdr, final is_ctlDp=have_pumPriCtlDp, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta) if have_pumChiWatPri and have_chiWat "Primary CHW pump staging"; Pumps.Generic.StagingHeadered staPumChiWatSec( final is_pri=false, final nEqu=nHp, final nPum=nPumChiWatSec, final is_hdr=have_pumSecHdr, final is_ctlDp=have_pumSecCtlDp, final V_flow_nominal=VChiWatSec_flow_nominal, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta) if have_pumChiWatSec and have_chiWat "Secondary CHW pump staging"; Pumps.Generic.StagingHeadered staPumHeaWatSec( final is_pri=false, final nEqu=nHp, final nPum=nPumHeaWatSec, final is_hdr=have_pumSecHdr, final is_ctlDp=have_pumSecCtlDp, final V_flow_nominal=VHeaWatSec_flow_nominal, final dtRun=dtRunPumSta, final dVOffUp=dVOffUpPumSta, final dVOffDow=dVOffDowPumSta) if have_pumHeaWatSec "Secondary HW pump staging"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSecRet( final unit="K", displayUnit="degC") if have_heaWat and have_senTHeaWatSecRet "Secondary HW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VHeaWatSec_flow( final unit="m3/s") if have_heaWat and have_senVHeaWatSec "Secondary HW volume flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSecRet( final unit="K", displayUnit="degC") if have_chiWat and have_senTChiWatSecRet "Secondary CHW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWatSec_flow( final unit="m3/s") if have_chiWat and have_senVChiWatSec "Secondary CHW volume flow rate"; Utilities.PlaceholderReal THeaWatRet(have_inp=have_heaWat and have_senTHeaWatPriRet, have_inpPh=true) if have_heaWat "Select HW return temperature sensor"; Utilities.PlaceholderReal VHeaWat_flow(have_inp=have_heaWat and have_senVHeaWatPri, have_inpPh=true) if have_heaWat "Select HW flow sensor"; Utilities.PlaceholderReal TChiWatRet(have_inp=have_chiWat and have_senTChiWatPriRet, have_inpPh=true) if have_chiWat "Select CHW return temperature sensor"; Utilities.PlaceholderReal VChiWat_flow(have_inp=have_chiWat and have_senVChiWatPri, have_inpPh=true) if have_chiWat "Select CHW flow sensor"; Buildings.Controls.OBC.CDL.Logical.Pre y1HpPre[nHp] "Left-limit of command signal to break algebraic loop"; StagingRotation.StageCompletion comStaCoo( nin=nHp) if have_chiWat "Check successful completion of cooling stage change"; StagingRotation.StageCompletion comStaHea( nin=nHp) 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.VariableSpeedNoDpControl ctlPumPri( final have_heaWat=have_heaWat, final have_chiWat=have_chiWat, final have_pumChiWatPriDed=have_pumChiWatPriDed, final have_pumPriHdr=have_pumPriHdr, final nEqu=nHp, final nPumHeaWatPri=nPumHeaWatPri, final nPumChiWatPri=nPumChiWatPri, final yPumHeaWatPriSet=yPumHeaWatPriSet, final yPumChiWatPriSet=yPumChiWatPriSet) "Primary pump speed control"; Pumps.Generic.ControlDifferentialPressure ctlPumHeaWatSec( final have_senDpRemWir=have_senDpHeaWatRemWir, nPum=nPumHeaWatSec, final nSenDpRem=nSenDpHeaWatRem, final y_min=yPumHeaWatSec_min, final k=kPumHeaWatSec, final Ti=TiPumHeaWatSec) if have_pumHeaWatSec "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=kPumChiWatSec, final Ti=TiPumChiWatSec) if have_chiWat and have_pumChiWatSec "Secondary CHW pump speed control"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TSupSet[nHp]( each final unit="K", each final quantity="ThermodynamicTemperature", each displayUnit="degC") "Active HP supply temperature setpoint"; Buildings.Controls.OBC.CDL.Reals.Switch swiTSupSet[nHp] if have_heaWat and have_chiWat "Select supply temperature setpoint based on operating mode"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTChiWatSupSet(final nout=nHp) if have_chiWat "Replicate CHWST setpoint"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator repTHeaWatSupSet(final nout=nHp) if have_heaWat "Replicate HWST setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatPriSup(final unit="K", displayUnit="degC") if have_heaWat "Primary HW supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatPriSup(final unit="K", displayUnit="degC") if have_chiWat "Primary CHW return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSecSup(final unit="K", displayUnit="degC") if have_chiWat and have_senTHeaWatSecSup "Secondary HW supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSecSup(final unit="K", displayUnit="degC") if have_chiWat and have_senTChiWatSecSup "Secondary CHW return temperature"; Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasTHeaWatSupSet(final nin =nHp, final nout=nHp) if have_heaWat and not have_chiWat "Direct pass through for HWST setpoint"; Buildings.Controls.OBC.CDL.Routing.RealExtractSignal pasTChiWatSupSet(final nin =nHp, final nout=nHp) if have_chiWat and not have_heaWat "Direct pass through for CHWST setpoint"; 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, enaEquHea.uSta); connect(seqEve.y1, y1Hp); connect(seqEve.y1Hea, y1HeaHp); connect(seqEve.y1ValHeaWatOutIso, y1ValHeaWatHpOutIso); connect(seqEve.y1ValHeaWatInlIso, y1ValHeaWatHpInlIso); connect(seqEve.y1ValChiWatInlIso, y1ValChiWatHpInlIso); connect(seqEve.y1ValChiWatOutIso, y1ValChiWatHpOutIso); connect(idxStaHea.y, chaStaHea.uSta); connect(chaStaHea.y1Dow, idxStaHea.u1Dow); connect(chaStaHea.y1Up, idxStaHea.u1Up); connect(avaStaHea.y1, chaStaHea.u1AvaSta); connect(sorRunTimHea.yIdx, enaEquHea.uIdxAltSor); 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, enaEquCoo.uSta); connect(enaEquHea.y1, seqEve.u1Hea); connect(enaEquCoo.y1, seqEve.u1Coo); connect(y1HeaHp, y1HeaPre.u); connect(y1HeaPre.y, avaEquHeaCoo.u1Hea); connect(avaEquHeaCoo.y1Hea, avaStaHea.u1Ava); connect(avaEquHeaCoo.y1Coo, avaStaCoo.u1Ava); connect(avaStaCoo.y1, idxStaCoo.u1AvaSta); connect(avaEquHeaCoo.y1Hea, enaEquHea.u1Ava); connect(avaEquHeaCoo.y1Coo, enaEquCoo.u1Ava); connect(sorRunTimCoo.yIdx, enaEquCoo.uIdxAltSor); connect(idxStaCoo.y, chaStaCoo.uSta); connect(avaEquHeaCoo.y1Hea, sorRunTimHea.u1Ava); connect(avaEquHeaCoo.y1Coo, sorRunTimCoo.u1Ava); connect(staPumChiWatPri.y1, y1PumChiWatPri); connect(staPumChiWatPri.y1_actual, seqEve.u1PumChiWatPri_actual); connect(seqEve.y1PumChiWatPri, staPumChiWatPri.u1Pum); connect(u1PumChiWatPri_actual, staPumChiWatPri.u1Pum_actual); connect(u1PumHeaWatPri_actual, staPumHeaWatPri.u1Pum_actual); connect(staPumHeaWatPri.y1_actual, seqEve.u1PumHeaWatPri_actual); connect(staPumHeaWatSec.y1, y1PumHeaWatSec); connect(staPumChiWatSec.y1, y1PumChiWatSec); connect(u1PumHeaWatSec_actual, staPumHeaWatSec.u1Pum_actual); connect(u1PumChiWatSec_actual, staPumChiWatSec.u1Pum_actual); connect(staPumHeaWatPri.y1, y1PumHeaWatPri); connect(staPumChiWatSec.y1_actual, seqEve.u1PumChiWatSec_actual); connect(seqEve.y1PumHeaWatPri, staPumHeaWatPri.u1Pum); connect(staPumHeaWatSec.y1_actual, seqEve.u1PumHeaWatSec_actual); connect(VHeaWatSec_flow, staPumHeaWatSec.V_flow); connect(VChiWatSec_flow, staPumChiWatSec.V_flow); connect(THeaWatPriRet, THeaWatRet.u); connect(THeaWatRet.y, chaStaHea.TRet); connect(THeaWatSecRet, THeaWatRet.uPh); connect(VHeaWatPri_flow, VHeaWat_flow.u); connect(VHeaWat_flow.y, chaStaHea.V_flow); connect(VHeaWatSec_flow, VHeaWat_flow.uPh); connect(TChiWatPriRet, TChiWatRet.u); connect(TChiWatRet.y, chaStaCoo.TRet); connect(TChiWatSecRet, TChiWatRet.uPh); connect(VChiWatPri_flow, VChiWat_flow.u); connect(VChiWat_flow.y, chaStaCoo.V_flow); connect(VChiWatSec_flow, VChiWat_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, sorRunTimHea.u1Run); connect(u1Hp_actual, sorRunTimCoo.u1Run); connect(y1Hp, y1HpPre.u); connect(y1HpPre.y, avaEquHeaCoo.u1); connect(idxStaCoo.y, comStaCoo.uSta); connect(comStaCoo.y1, chaStaCoo.u1StaPro); connect(u1Hp_actual, comStaCoo.u1_actual); connect(y1HpPre.y, comStaCoo.u1); connect(idxStaHea.y, comStaHea.uSta); connect(u1Hp_actual, comStaHea.u1_actual); connect(y1HpPre.y, comStaHea.u1); 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.yPumHeaWatPriDed, yPumHeaWatPriDed); connect(ctlPumPri.yPumChiWatPriDed, yPumChiWatPriDed); connect(staPumHeaWatPri.y1, ctlPumPri.u1PumHeaWatPri); connect(staPumChiWatPri.y1, ctlPumPri.u1PumChiWatPri); connect(seqEve.y1Hea, ctlPumPri.u1Hea); 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(u1AvaHp.y, avaEquHeaCoo.u1Ava); connect(repTChiWatSupSet.y, swiTSupSet.u3); connect(repTHeaWatSupSet.y, swiTSupSet.u1); connect(resChiWat.TSupSet, repTChiWatSupSet.u); connect(resHeaWat.TSupSet, repTHeaWatSupSet.u); connect(seqEve.y1Hea, swiTSupSet.u2); connect(swiTSupSet.y, TSupSet); connect(pasTChiWatSupSet.y, TSupSet); connect(pasTHeaWatSupSet.y, TSupSet); connect(repTChiWatSupSet.y, pasTChiWatSupSet.u); connect(repTHeaWatSupSet.y, pasTHeaWatSupSet.u); connect(resChiWat.TSupSet, TChiWatSupSet); connect(resHeaWat.TSupSet, THeaWatSupSet); end AirToWater;