Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers

Chiller plant control sequences

Information

This package contains control sequences for a chiller plant comprising a single chiller or multiple chillers, chilled and condenser water pumps, cooling towers, and an optional water side economizer.

The control sequences are implemented based on ASHRAE Guideline 36-2021.

Package Content

Name Description
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Controller Controller Chiller plant controller
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Economizers Economizers Waterside economizer (WSE) sequences
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic Generic Generic control sequences
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.HeadPressure HeadPressure Chiller head pressure control sequence
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.MinimumFlowBypass MinimumFlowBypass Sequences for controlling chilled water minimum flow bypass valve
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Pumps Pumps Sequences for condenser water and chiller water pumps control
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.SetPoints SetPoints Sequences for setting the setpoints for chilled water control
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Staging Staging Chiller staging sequences
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Towers Towers Package of sequences for cooling tower control
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types Types Package with type definitions for control sequences
Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Validation Validation Collection of validation models

Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Controller Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Controller

Chiller plant controller

Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Controller

Information

The chiller plant control sequence is implemented according to ASHRAE Guideline 36-2021. It is composed by the subsequences in this package. The applicability of some sequences is listed in the table below. The yes means that the sequence is applicable to the system type.

Subsequences Primary
only
Primary
Secondary
Parallel
chillers
Series
chillers
Headered
CHWP
Dedicated
CHWP
Headered
CWP
Dedicated
CWP
VarSpe
CWP
ConSpe
CWP
Water
cooled
Air
cooled
With
WSE
Plant
reset
yes yes yes not
implemented
yes yes yes yes yes yes yes yes yes Chilled water plant reset
and Chilled water supply
Waterside
economizers
yes yes yes yes yes yes yes yes yes yes yes yes yes Economizer controller
Head pressure
control
yes yes yes yes yes yes yes yes yes yes yes not
applicable
yes Head pressure controller
Minimum
flow
yes not
specified
yes yes yes yes yes yes yes yes yes yes yes Bypass valve controller
and Bypass flow setpoint
Primary chilled
water pumps
yes not
implemented
yes not
implemented
yes yes yes yes yes yes yes yes yes Chilled water pump controller
Condenser water
pumps
yes yes yes not
specified
yes yes yes yes yes yes yes not
applicable
yes Condenser water pump controller
Chillers
staging
yes not
implemented
yes not
implemented
yes not
implemented
yes not
implemented
yes yes yes yes yes Staging up
and Staging down
Cooling
towers
yes yes yes yes yes yes yes yes yes yes yes yes yes Tower controller

1. Plant reset

In Guideline 36-2021, the sequences for following types of plant have been specified. However, they have not yet been implemented in this library.

2. Head pressure control

If there is the head pressure control signal from chiller, the sequence is not needed. In Guideline 36-2021, it assumes:

The sequence is not applicable to the plants with air-cooled chillers.

3. Minimum chilled water flow

In Guideline 36-2021, the sequences for the following types of plants have not been specified.

4. Primary chilled water (CHW) pump control

In Guideline 36-2021, the sequences for the following types of plants have been specified. However, they have not yet been implemented in this library.

5. Secondary chilled water pumps control

In Guideline 36-2021, the secondary chilled water pumps controls have been specified. However, they have not yet been implemented in this library, section 5.20.7.

6. Condenser water (CW) pumps control

For the headered condenser water pumps, the sequence assumes that all the pumps have same size. In Guideline 36-2021, the sequences for the following types of plants have not been specified.

The sequence is not applicable to the plants with air-cooled chillers.

7. Chiller staging control

In Guideline 36-2021, the sequences for the following types of plants have been specified. However, they have not yet been implemented in this library.

8. Cooling tower control

In the current implementation, the tower sequence assumes that the cells are enabled in the order as it is labelled, meaning that it enables the cells as cell 1, 2, 3, etc. Note from the Guideline 36-2021,

In Guideline 36-2021, the sequences for the following types of plants have been specified. However, they have not yet been implemented in this library.

The sequence is not applicable to the plants with air-cooled chillers.

9. Device lead-lag

The devices lead-lag control is not implemented.

Parameters

TypeNameDefaultDescription
Chillers configuration
IntegernChi Total number of chillers
Booleanhave_airCoofalseTrue: the plant has air cooled chiller
Booleanhave_parChitrueFlag: true means that the plant has parallel chillers
Booleanhave_ponChifalseTrue: have pony chiller
Booleanuse_loadShedtrueSet to true if a load shed logic is used
ChillersAndStageschiTyp[nChi] Chiller type
RealchiDesCap[nChi] Design chiller capacities vector [W]
RealchiMinCap[nChi] Chiller minimum cycling loads vector [W]
RealTChiWatSupMin[nChi] Minimum chilled water supply temperature [K]
RealdTChiMinLif[nChi] Minimum LIFT of each chiller [K]
RealdTChiMaxLif[nChi] Maximum LIFT of each chiller [K]
HeadPressureControlchiHeaPreConBuildings.Controls.OBC.ASHRA...Chiller head pressure controlled type
ActuatorchiIsoValTypBuildings.Controls.OBC.ASHRA...Chiller CHW isolation valve type
Booleanhave_twoPosEndSwiChiValfalseTrue for chiller CHW isolation valves with end switch status feedback
Booleanhave_modPosChiValfalseTrue for chiller CHW isolation valves with position feedback
Waterside economizer
Booleanhave_WSEtrueTrue if the plant has waterside economizer. When the plant has waterside economizer, the condenser water pump speed must be variable
RealheaExcAppDes Design heat exchanger approach [K]
Booleanhave_byPasValConfalseTrue: chilled water flow through economizer is controlled using heat exchanger bypass valve
Chilled water pump
IntegernChiWatPum Total number of primary chilled water pumps
Booleanhave_senDpChiWatRemWirtrueTrue: there is remote differential pressure sensor hardwired to the plant controller
IntegernSenChiWatPum Total number of remote differential pressure sensors
Condenser water pump
IntegernConWatPum Total number of condenser water pumps
Booleanhave_fixSpeConWatPumfalseTrue: the plant has fixed speed condenser water pumps. When the plant has waterside economizer, it must be false
Booleanhave_heaConWatPumtrueTrue: headered condenser water pumps
Staging configuration
IntegernStasize(staMat, 1)Number of chiller stages, neither zero stage nor the stages with enabled waterside economizer is included
IntegernPlaStaif have_WSE then 2*(nSta + 1...Number of plant stages, including zero stage and the stages with enabled waterside economizer, if applicable
IntegerstaMat[:, :] Chiller staging matrix with chiller stage as row index and chiller as column index, not including stage zero: 0 for disabled, 1 for enabled
IntegerconWatPumStaMat[:, :] Condenser water pump staging matrix, with plant stage as row index and condenser water pump as column index: 0 for disabled, 1 for enabled
RealdesConWatPumSpe[nPlaSta] Array of design condenser water pump speed setpoints, according to the plant stage
IntegertowCelOnSet[nPlaSta] Array of design number of tower fan cells that should be enabled, according to the plant stage
Cooling tower
IntegernTowCel Total number of cooling tower cells
RealcooTowAppDes Design cooling tower approach [K]
Plant enable
RealTChiLocOut277.5Outdoor air lockout temperature below which the chiller plant should be disabled [K]
RealplaThrTim900Threshold time to check status of chiller plant [s]
RealreqThrTim180Threshold time to check current chiller plant request [s]
IntegerignReq0Ignorable chiller plant requests
RealiniPumDel5Time to delay pump operation when the plant is just initiated [s]
Waterside economizer
Enable parameters
RealholdPeriod1200WSE minimum on or off time [s]
RealdelDis120Delay disable time period [s]
RealTOffsetEna2Temperature offset between the chilled water return upstream of WSE and the predicted WSE output [K]
RealTOffsetDis1Temperature offset between the chilled water return upstream and downstream WSE [K]
Design parameters
RealTOutWetDes Design outdoor air wet bulb temperature [K]
RealVHeaExcDes_flow Design heat exchanger chilled water volume flow rate [m3/s]
Tuning
Realstep0.02Tuning step
RealwseOnTimDec3600Economizer enable time needed to allow decrease of the tuning parameter [s]
RealwseOnTimInc1800Economizer enable time needed to allow increase of the tuning parameter [s]
Valve or pump control
RealdpDes3E4Design waterside economizer chilled water pressure drop
SimpleControllerecoValConBuildings.Controls.OBC.CDL.T...Type of controller for controlling economizer valve or pump
RealkEcoVal0.1Gain of controller
RealTiEcoVal10Time constant of integrator block
RealTdEcoVal0.1Time constant of derivative block
RealminEcoSpe0.1Minimum economizer chilled water pump speed
Head pressure
Limits
RealminConWatPumSpe0.1Minimum condenser water pump speed [1]
RealminHeaPreValPos0.1Minimum head pressure control valve position [1]
Loop signal
SimpleControllerconTypHeaPreBuildings.Controls.OBC.CDL.T...Type of controller for controlling chiller head pressure
RealkHeaPreCon0.1Gain of controller
RealTiHeaPreCon10Time constant of integrator block [s]
RealTdHeaPreCon0.1Time constant of derivative block
Minimum flow bypass
Time parameters
RealbyPasSetTim300Time constant for resetting minimum bypass flow [s]
Flow limits
RealminFloSet[nChi] Minimum chilled water flow through each chiller [m3/s]
RealmaxFloSet[nChi] Maximum chilled water flow through each chiller [m3/s]
Controller
SimpleControllerconTypMinFloBypBuildings.Controls.OBC.CDL.T...Type of controller for controlling minimum chilled water flow
RealkMinFloBypCon0.1Gain of controller
RealTiMinFloBypCon10Time constant of integrator block [s]
RealTdMinFloBypCon0Time constant of derivative block [s]
RealyMaxFloBypCon1Upper limit of output [1]
RealyMinFloBypCon0.1Lower limit of output [1]
Chilled water pumps
Speed controller
RealminChiWatPumSpe0.1Minimum chilled pump speed for primary-only plants [1]
RealmaxChiWatPumSpe1Maximum chilled pump speed for primary-only plants [1]
SimpleControllerconTypChiWatPumBuildings.Controls.OBC.CDL.T...Type of controller for controlling chilled water pumps
RealkChiWatPum0.1Gain of controller
RealTiChiWatPum10Time constant of integrator block [s]
RealTdChiWatPum0.1Time constant of derivative block [s]
Nominal conditions
IntegernPum_nominal Total number of pumps that operate at design conditions
RealVChiWat_flow_nominal Total plant design chilled water flow rate [m3/s]
Pump speed control when there is local DP sensor
RealminLocDp5*6894.75Minimum chilled water loop local differential pressure setpoint [Pa]
RealmaxLocDp15*6894.75Maximum chilled water loop local differential pressure setpoint [Pa]
Plant reset
RealholTim900Time to fix plant reset value [s]
Trim and respond
RealiniSet1Initial setpoint [1]
RealminSet0Minimum plant reset value [1]
RealmaxSet1Maximum plant reset value [1]
RealdelTim900Delay time after which trim and respond is activated [s]
RealsamplePeriod300Sample period time [s]
IntegernumIgnReq2Number of ignored requests
RealtriAmo-0.02Trim amount
RealresAmo0.03Respond amount (must be opposite in to triAmo)
RealmaxRes0.07Maximum response per time interval (same sign as resAmo)
Chilled water supply
RealdpChiWatMin[nSenChiWatPum]fill(34473.8, nSenChiWatPum)Minimum chilled water differential pressure setpoint, the array size equals to the number of remote pressure sensor [Pa]
RealdpChiWatMax[nSenChiWatPum] Maximum chilled water differential pressure setpoint, the array size equals to the number of remote pressure sensor [Pa]
RealTPlaChiWatSupMax288.706Maximum plant chilled water supply temperature, default 60 degF [K]
RealhalSet0.5Half plant reset value
Staging
Hold and delay
RealavePer300Time period for the capacity requirement rolling average [s]
RealdelStaCha900Hold period for each stage change [s]
RealparLoaRatDelay900Enable delay for operating and staging part load ratio condition [s]
RealfaiSafTruDelay900Enable delay for failsafe condition [s]
RealeffConTruDelay900Enable delay for efficiency condition [s]
RealshortTDelay600Short enable delay for staging from zero to first available stage up [s]
ReallongTDelay1200Long enable delay for staging from zero to first available stage up [s]
Staging part load ratio
RealposDisMult0.8Positive displacement chiller type staging multiplier [1]
RealconSpeCenMult0.9Constant speed centrifugal chiller type staging multiplier [1]
RealanyOutOfScoMult0.9Outside of G36 recommended staging order chiller type SPLR multiplier [1]
RealvarSpeStaMin0.45Minimum stage up or down part load ratio for variable speed centrifugal stage types [1]
RealvarSpeStaMax0.9Maximum stage up or down part load ratio for variable speed centrifugal stage types [1]
Value comparison
RealsmallTDif1Offset between the chilled water supply temperature and its setpoint for the long condition [K]
ReallargeTDif2Offset between the chilled water supply temperature and its setpoint for the short condition [K]
RealfaiSafTDif1Offset between the chilled water supply temperature and its setpoint for the failsafe condition [K]
RealdpDif2*6895Offset between the chilled water pump diferential static pressure and its setpoint [Pa]
RealTDif1Offset between the chilled water supply temperature and its setpoint for staging down to WSE only [K]
RealfaiSafDpDif2*6895Offset between the chilled water differential pressure and its setpoint [Pa]
RealeffConSigDif0.05Signal hysteresis deadband
Up and down process
RealchiDemRedFac0.75Demand reducing factor of current operating chillers [1]
RealholChiDemTim300Maximum time to wait for the actual demand less than percentage of current load [s]
RealaftByPasSetTim60Time to allow loop to stabilize after resetting minimum chilled water flow setpoint [s]
RealwaiTim30Waiting time after enabling next head pressure control [s]
RealchaChiWatIsoTim300Time to slowly change isolation valve, should be determined in the field [s]
RealproOnTim300Threshold time to check after newly enabled chiller being operated [s]
RealthrTimEnb10Threshold time to enable head pressure control after condenser water pump being reset [s]
Cooling towers
Fan speed
BooleancloseCoupledPlantfalseTrue: the plant is close coupled, i.e. the pipe length from the chillers to cooling towers does not exceed approximately 100 feet
RealfanSpeMin0.1Minimum tower fan speed [1]
Fan speed controller with WSE enabled
SimpleControllerintOpeConBuildings.Controls.OBC.CDL.T...Controller in the mode if WSE and chillers are enabled
RealkIntOpeTowFan0.1Gain of controller, if both WSE and chillers are enabled
RealTiIntOpeTowFan10Time constant of integrator block, if both WSE and chillers are enabled [s]
RealTdIntOpeTowFan0.1Time constant of derivative block, if both WSE and chillers are enabled [s]
SimpleControllerchiWatConTowFanBuildings.Controls.OBC.CDL.T...Controller in the mode if only WSE is enabled
RealkWSETowFan0.1Gain of controller, if only WSE is enabled
RealTiWSETowFan10Time constant of integrator block, if only WSE is enabled [s]
RealTdWSETowFan0.1Time constant of derivative block, if only WSE is enabled [s]
Fan speed: return temperature control
RealTConWatSup_nominal[nChi] Condenser water supply temperature (condenser entering) of each chiller [K]
RealTConWatRet_nominal[nChi] Condenser water return temperature (condenser leaving) of each chiller [K]
SimpleControllercouPlaConBuildings.Controls.OBC.CDL.T...Type of coupled plant controller
RealkCouPla0.1Gain of controller, for close coupled plant
RealTiCouPla10Time constant of integrator block, for close coupled plant [s]
RealTdCouPla0.1Time constant of derivative block, for close coupled plant [s]
RealyCouPlaMax1Upper limit of output of controller, for close coupled plant [1]
RealyCouPlaMin0Lower limit of output of controller, for close coupled plant [1]
RealsamplePeriodConTDiff30Period of sampling condenser water supply and return temperature difference [s]
SimpleControllersupWatConBuildings.Controls.OBC.CDL.T...Condenser supply water temperature controller for less coupled plant
RealkSupCon0.1Gain of controller, for less coupled plant
RealTiSupCon10Time constant of integrator block, for less coupled plant [s]
RealTdSupCon0.1Time constant of derivative block, for less coupled plant [s]
RealySupConMax1Upper limit of output of controller, for less coupled plant
RealySupConMin0Lower limit of output of controller, for less coupled plant
Advanced
RealiniPlaTim600Time to hold return temperature at initial setpoint after plant being enabled [s]
RealramTim180Time to ramp return water temperature from initial value to setpoint [s]
RealcheMinFanSpe300Threshold time for checking duration when tower fan equals to the minimum tower fan speed [s]
RealcheMaxTowSpe300Threshold time for checking duration when any enabled chiller maximum cooling speed equals to the minimum tower fan speed [s]
RealcheTowOff60Threshold time for checking duration when there is no enabled tower fan [s]
Staging
Booleanhave_towInlIsoValtrueTrue: tower cells have the inlet isolation valve
Booleanhave_towOutIsoValfalseTrue: tower cells have the outlet isolation valve
Booleanhave_towIsoValEndSwifalseTrue: tower cells isolatiove valve have the end switch feedback
RealchaTowCelIsoTim300Time to slowly change isolation valve [s]
Makeup water
RealwatLevMin Minimum cooling tower water level recommended by manufacturer [m]
RealwatLevMax Maximum cooling tower water level recommended by manufacturer [m]
Advanced
Plant enable
ReallocDt1Offset temperature for lockout chiller [K]
Waterside economizer
RealhysDt1Deadband temperature used in hysteresis block [K]
Staging
RealdpDifHys0.5*6895Pressure difference hysteresis deadband [Pa]
RealrelFloThr0.95Relative flow rate to check if the flow has achieved setpoint
Cooling towers
RealspeChe0.01Lower threshold value to check fan or pump speed

Connectors

TypeNameDescription
input BooleanInputuChiWatReq[nChi]True: chiller requires the chilled water
input BooleanInputuConWatReq[nChi]True: chiller requires the condenser water
input BooleanInputuChiWatPum[nChiWatPum]True: chilled water pump proven on status
input RealInputdpChiWat_localChilled water differential static pressure from local sensor [Pa]
input RealInputdpChiWatSet_localChilled water local differential pressure setpoint [Pa]
input RealInputdpChiWat_remote[nSenChiWatPum]Chilled water differential static pressure from remote sensor [Pa]
input RealInputVChiWat_flowMeasured chilled water volume flow rate for primary-only plant [m3/s]
input BooleanInputuChi[nChi]True: chiller is enabled
input RealInputphiOutdoor relative humidity [1]
input RealInputTChiWatRetDowChiller water return temperature downstream of the WSE [K]
input RealInputTChiWatRetUpChilled water return temperature upstream of the WSE [K]
input RealInputTConWatRet[nChi]Measured condenser water return temperature (condenser leaving) from each chiller [K]
input RealInputTChiWatSupChi[nChi]Measured chilled water supply temperature from each chiller [K]
input RealInputTChiWatSupMeasured chilled water supply temperature to the load [K]
input RealInputuHeaPreCon[nChi]Chiller head pressure control loop signal from chiller controller
input RealInputdpChiWatDifferential static pressure across economizer in the chilled water side [Pa]
input BooleanInputuEcoPumTrue: economizer heat exchanger pump is proven on
input RealInputTEntHexChilled water temperature entering economizer heat exchanger [K]
input RealInputTChiWatEntChiChilled water entering chiller [K]
input RealInputuChiWatIsoVal[nChi]Chilled water isolvation valve position feedback [1]
input BooleanInputu1ChiWatIsoValOpe[nChi]Chiller chilled water isolation valve open end switch. True: the valve is fully open
input BooleanInputu1ChiWatIsoValClo[nChi]Chiller chilled water isolation valve close end switch. True: the valve is fully closed
input IntegerInputTChiWatSupResReqChilled water supply temperature setpoint reset request
input IntegerInputchiPlaReqNumber of chiller plant cooling requests
input BooleanInputuConWatPum[nConWatPum]True: condenser water pump is enabled
input BooleanInputuPlaSchEnaPlant schedule enable: true=Enable
input RealInputTOutOutdoor air dry bulb temperature [K]
input RealInputTConWatTowRetCondenser water return temperature (condenser leaving) to the cooling tower [K]
input RealInputTConWatSupCondenser water supply temperature (condenser entering) [K]
input BooleanInputu1TowInlIsoValOpe[nTowCel]Tower cells inlet isolation valve open end switch. True: the isolation valve is fully open
input BooleanInputu1TowOutIsoValOpe[nTowCel]Tower cells outlet isolation valve open end switch. True: the isolation valve is fully open
input BooleanInputu1TowInlIsoValClo[nTowCel]Tower cells inlet isolation valve close end switch. True: the isolation valve is fully closed
input BooleanInputu1TowOutIsoValClo[nTowCel]Tower cells outlet isolation valve close end switch. True: the isolation valve is fully closed
input RealInputwatLevMeasured water level [m]
input BooleanInputuTowSta[nTowCel]Vector of tower cell proven on status: true=running tower cell. Note that the tower fan could be disabled
output BooleanOutputyEcoConWatIsoValEconomizer condenser water isolation valve enable command
output RealOutputyWseRetValWSE in-line CHW return line valve position setpoint [1]
output BooleanOutputyWsePumOnHeat exchanger pump enable command
output BooleanOutputy1WseChiWatBypValEconomizer-only chiller water bypass valve enable command
output RealOutputyWsePumSpeHeat exchanger pump speed setpoint [1]
output RealOutputTChiWatSupSet[nChi]Chilled water supply temperature setpoint [K]
output RealOutputdpChiWatSet[nSenChiWatPum]Chilled water differential pressure setpoint for the remote sensors [Pa]
output BooleanOutputyChiWatPum[nChiWatPum]Chilled water pump enable command
output RealOutputyChiPumSpeChilled water pump speed setpoint [1]
output RealOutputyChiDemChiller demand setpoint to set through BACnet or similar [W]
output BooleanOutputyChi[nChi]Chiller enable command
output BooleanOutputy1ConWatIsoVal[nChi]Chiller condenser water isolation valve command
output RealOutputyConWatIsoVal[nChi]Condenser water isolation valve commanded position [1]
output RealOutputyConWatPumSpeCondenser water pump speed setpoint [1]
output RealOutputyChiWatMinFloSetChilled water minimum flow setpoint [m3/s]
output BooleanOutputyConWatPum[nConWatPum]Condenser water pump enable command
output BooleanOutputy1ChiWatIsoVal[nChi]Chilled water isolation valve position commanded on
output RealOutputyChiWatIsoVal[nChi]Chilled water isolation valve position setpoint [1]
output BooleanOutputyReaChiDemLimRelease chiller demand limit, normally true
output RealOutputyMinValPosSetChilled water minimum flow bypass valve position setpoint [1]
output BooleanOutputyTowCelIsoVal[nTowCel]Cooling tower cells isolation valve position setpoints
output BooleanOutputyTowCel[nTowCel]Vector of tower cells enable commands
output RealOutputyTowFanSpeFan speed setpoint of enabled cooling tower cell [1]
output BooleanOutputyMakUpMakeup water valve On-Off status

Modelica definition

block Controller "Chiller plant controller" // ---- General: Chiller configuration ---- parameter Integer nChi "Total number of chillers"; parameter Boolean have_airCoo=false "True: the plant has air cooled chiller"; final parameter Boolean have_priOnl=true "True: the primary-only plant; False: the primary-secondary plant"; parameter Boolean have_parChi=true "Flag: true means that the plant has parallel chillers"; parameter Boolean have_ponChi=false "True: have pony chiller"; parameter Boolean use_loadShed=true "Set to true if a load shed logic is used"; parameter Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.ChillersAndStages chiTyp[nChi] "Chiller type"; parameter Real chiDesCap[nChi](unit=fill("W", nChi)) "Design chiller capacities vector"; parameter Real chiMinCap[nChi](unit=fill("W", nChi)) "Chiller minimum cycling loads vector"; parameter Real TChiWatSupMin[nChi]( unit=fill("K", nChi), displayUnit=fill("degC", nChi)) "Minimum chilled water supply temperature"; parameter Real dTChiMinLif[nChi](unit=fill("K", nChi)) "Minimum LIFT of each chiller"; parameter Real dTChiMaxLif[nChi](unit=fill("K", nChi)) "Maximum LIFT of each chiller"; final parameter Boolean have_chiHeaPreCon= chiHeaPreCon==Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.HeadPressureControl.ByChiller "True: the chiller head pressure is controlled by the chiller itself"; final parameter Boolean have_plaHeaPreCon= chiHeaPreCon==Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.HeadPressureControl.ByPlant "True: the chiller head pressure is controlled by the plant controller"; final parameter Boolean need_heaPreCon= not chiHeaPreCon==Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.HeadPressureControl.NotRequired "True: the plant requires chiller head pressure control"; parameter Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.HeadPressureControl chiHeaPreCon= Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.HeadPressureControl.ByPlant "Chiller head pressure controlled type"; parameter Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator chiIsoValTyp= Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating "Chiller CHW isolation valve type"; parameter Boolean have_twoPosEndSwiChiVal=false "True for chiller CHW isolation valves with end switch status feedback"; parameter Boolean have_modPosChiVal=false "True for chiller CHW isolation valves with position feedback"; // ---- General: Waterside economizer ---- parameter Boolean have_WSE=true "True if the plant has waterside economizer. When the plant has waterside economizer, the condenser water pump speed must be variable"; parameter Real heaExcAppDes( start=2, unit="K", displayUnit="K") "Design heat exchanger approach"; parameter Boolean have_byPasValCon=false "True: chilled water flow through economizer is controlled using heat exchanger bypass valve"; // ----- General: Chilled water pump --- parameter Integer nChiWatPum(start=2) "Total number of primary chilled water pumps"; final parameter Boolean have_heaChiWatPum=true "Flag of headered chilled water pumps design: true=headered, false=dedicated"; parameter Boolean have_senDpChiWatRemWir=true "True: there is remote differential pressure sensor hardwired to the plant controller"; parameter Integer nSenChiWatPum "Total number of remote differential pressure sensors"; // ---- General: Condenser water pump ---- parameter Integer nConWatPum(start=2) "Total number of condenser water pumps"; parameter Boolean have_fixSpeConWatPum = false "True: the plant has fixed speed condenser water pumps. When the plant has waterside economizer, it must be false"; parameter Boolean have_heaConWatPum=true "True: headered condenser water pumps"; // ---- General: Chiller staging settings ---- parameter Integer nSta=size(staMat,1) "Number of chiller stages, neither zero stage nor the stages with enabled waterside economizer is included"; parameter Integer nPlaSta = if have_WSE then 2*(nSta+1) else nSta+1 "Number of plant stages, including zero stage and the stages with enabled waterside economizer, if applicable"; parameter Integer staMat[:, :] "Chiller staging matrix with chiller stage as row index and chiller as column index, not including stage zero: 0 for disabled, 1 for enabled"; parameter Integer conWatPumStaMat[:, :](start=fill(0, nPlaSta, nConWatPum)) "Condenser water pump staging matrix, with plant stage as row index and condenser water pump as column index: 0 for disabled, 1 for enabled"; parameter Real desConWatPumSpe[nPlaSta]( max=fill(1, nPlaSta), min=fill(0, nPlaSta), start=fill(0, nPlaSta)) "Array of design condenser water pump speed setpoints, according to the plant stage"; parameter Integer towCelOnSet[nPlaSta](start=fill(0, nPlaSta)) "Array of design number of tower fan cells that should be enabled, according to the plant stage"; final parameter Integer desConWatPumNum[nPlaSta](start=fill(0, nPlaSta)) = { sum(conWatPumStaMat[i,:]) for i in 1:nPlaSta} "Design number of condenser water pumps that should be enabled, according to the plant stage"; final parameter Integer desChiNum[nSta+1]={if i == 0 then 0 else sum(staMat[i]) for i in 0:nSta} "Design number of chiller that should be enabled at each chiller stage, including the zero stage"; final parameter Real staVec[nPlaSta]={0.5*(i-1) for i in 1:nPlaSta} "Plant stage vector, element value like x.5 means chiller stage x plus WSE"; // ---- General: Cooling tower ---- parameter Integer nTowCel(start=2) "Total number of cooling tower cells"; parameter Real cooTowAppDes( start=4, unit="K", displayUnit="K") "Design cooling tower approach"; // ---- Plant enable ---- parameter Real TChiLocOut( unit="K", displayUnit="degC")=277.5 "Outdoor air lockout temperature below which the chiller plant should be disabled"; parameter Real plaThrTim(unit="s")=900 "Threshold time to check status of chiller plant"; parameter Real reqThrTim(unit="s")=180 "Threshold time to check current chiller plant request"; parameter Integer ignReq = 0 "Ignorable chiller plant requests"; parameter Real iniPumDel(unit="s")=5 "Time to delay pump operation when the plant is just initiated"; // ---- Waterside economizer ---- parameter Real holdPeriod(unit="s")=1200 "WSE minimum on or off time"; parameter Real delDis(unit="s")=120 "Delay disable time period"; parameter Real TOffsetEna(unit="K")=2 "Temperature offset between the chilled water return upstream of WSE and the predicted WSE output"; parameter Real TOffsetDis(unit="K")=1 "Temperature offset between the chilled water return upstream and downstream WSE"; parameter Real TOutWetDes( start=288.15, unit="K", displayUnit="degC") "Design outdoor air wet bulb temperature"; parameter Real VHeaExcDes_flow(start=0, unit="m3/s") "Design heat exchanger chilled water volume flow rate"; parameter Real step=0.02 "Tuning step"; parameter Real wseOnTimDec(unit="s")=3600 "Economizer enable time needed to allow decrease of the tuning parameter"; parameter Real wseOnTimInc(unit="s")=1800 "Economizer enable time needed to allow increase of the tuning parameter"; parameter Real dpDes=3E4 "Design waterside economizer chilled water pressure drop"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController ecoValCon= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for controlling economizer valve or pump"; parameter Real kEcoVal=0.1 "Gain of controller"; parameter Real TiEcoVal=10 "Time constant of integrator block"; parameter Real TdEcoVal=0.1 "Time constant of derivative block"; parameter Real minEcoSpe=0.1 "Minimum economizer chilled water pump speed"; // ---- Head pressure ---- parameter Real minConWatPumSpe(unit="1")=0.1 "Minimum condenser water pump speed"; parameter Real minHeaPreValPos(unit="1")=0.1 "Minimum head pressure control valve position"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController conTypHeaPre= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for controlling chiller head pressure"; parameter Real kHeaPreCon=0.1 "Gain of controller"; parameter Real TiHeaPreCon(unit="s")=10 "Time constant of integrator block"; parameter Real TdHeaPreCon=0.1 "Time constant of derivative block"; // ---- Minimum flow bypass ---- parameter Real byPasSetTim(unit="s")=300 "Time constant for resetting minimum bypass flow"; parameter Real minFloSet[nChi](unit=fill("m3/s", nChi)) "Minimum chilled water flow through each chiller"; parameter Real maxFloSet[nChi](unit=fill("m3/s", nChi)) "Maximum chilled water flow through each chiller"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController conTypMinFloByp= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for controlling minimum chilled water flow"; parameter Real kMinFloBypCon=0.1 "Gain of controller"; parameter Real TiMinFloBypCon(unit="s")=10 "Time constant of integrator block"; parameter Real TdMinFloBypCon(unit="s")=0 "Time constant of derivative block"; parameter Real yMaxFloBypCon(unit="1")=1 "Upper limit of output"; parameter Real yMinFloBypCon(unit="1")=0.1 "Lower limit of output"; // ---- Chilled water pumps ---- parameter Real minChiWatPumSpe(unit="1")=0.1 "Minimum chilled pump speed for primary-only plants"; parameter Real maxChiWatPumSpe(unit="1")=1 "Maximum chilled pump speed for primary-only plants"; parameter Integer nPum_nominal(max=nChiWatPum, min=1) "Total number of pumps that operate at design conditions"; parameter Real VChiWat_flow_nominal(unit="m3/s") "Total plant design chilled water flow rate"; parameter Real minLocDp(unit="Pa")=5*6894.75 "Minimum chilled water loop local differential pressure setpoint"; parameter Real maxLocDp(unit="Pa")=15*6894.75 "Maximum chilled water loop local differential pressure setpoint"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController conTypChiWatPum= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller for controlling chilled water pumps"; parameter Real kChiWatPum=0.1 "Gain of controller"; parameter Real TiChiWatPum(unit="s")=10 "Time constant of integrator block"; parameter Real TdChiWatPum(unit="s")=0.1 "Time constant of derivative block"; // ---- Plant reset ---- parameter Real holTim(unit="s")=900 "Time to fix plant reset value"; parameter Real iniSet(unit="1")=1 "Initial setpoint"; parameter Real minSet(unit="1")=0 "Minimum plant reset value"; parameter Real maxSet(unit="1")=1 "Maximum plant reset value"; parameter Real delTim(unit="s")=900 "Delay time after which trim and respond is activated"; parameter Real samplePeriod(unit="s")=300 "Sample period time"; parameter Integer numIgnReq = 2 "Number of ignored requests"; parameter Real triAmo = -0.02 "Trim amount"; parameter Real resAmo = 0.03 "Respond amount (must be opposite in to triAmo)"; parameter Real maxRes = 0.07 "Maximum response per time interval (same sign as resAmo)"; parameter Real dpChiWatMin[nSenChiWatPum](unit=fill("Pa", nSenChiWatPum))= fill(34473.8, nSenChiWatPum) "Minimum chilled water differential pressure setpoint, the array size equals to the number of remote pressure sensor"; parameter Real dpChiWatMax[nSenChiWatPum]( unit=fill("Pa", nSenChiWatPum), displayUnit=fill("Pa", nSenChiWatPum)) "Maximum chilled water differential pressure setpoint, the array size equals to the number of remote pressure sensor"; parameter Real TPlaChiWatSupMax( unit="K", displayUnit="degC")=288.706 "Maximum plant chilled water supply temperature, default 60 degF"; parameter Real halSet = 0.5 "Half plant reset value"; // ---- Staging setpoints ---- parameter Real avePer(unit="s")=300 "Time period for the capacity requirement rolling average"; parameter Real delStaCha(unit="s")=900 "Hold period for each stage change"; parameter Real parLoaRatDelay(unit="s")=900 "Enable delay for operating and staging part load ratio condition"; parameter Real faiSafTruDelay(unit="s")=900 "Enable delay for failsafe condition"; parameter Real effConTruDelay(unit="s")=900 "Enable delay for efficiency condition"; parameter Real shortTDelay(unit="s")=600 "Short enable delay for staging from zero to first available stage up"; parameter Real longTDelay(unit="s")=1200 "Long enable delay for staging from zero to first available stage up"; parameter Real posDisMult(unit="1")=0.8 "Positive displacement chiller type staging multiplier"; parameter Real conSpeCenMult(unit="1")=0.9 "Constant speed centrifugal chiller type staging multiplier"; parameter Real anyOutOfScoMult(unit="1")=0.9 "Outside of G36 recommended staging order chiller type SPLR multiplier"; parameter Real varSpeStaMin(unit="1")=0.45 "Minimum stage up or down part load ratio for variable speed centrifugal stage types"; parameter Real varSpeStaMax(unit="1")=0.9 "Maximum stage up or down part load ratio for variable speed centrifugal stage types"; parameter Real smallTDif(unit="K")=1 "Offset between the chilled water supply temperature and its setpoint for the long condition"; parameter Real largeTDif(unit="K")=2 "Offset between the chilled water supply temperature and its setpoint for the short condition"; parameter Real faiSafTDif(unit="K")=1 "Offset between the chilled water supply temperature and its setpoint for the failsafe condition"; parameter Real dpDif( unit="Pa", displayUnit="Pa")=2*6895 "Offset between the chilled water pump diferential static pressure and its setpoint"; parameter Real TDif(unit="K")=1 "Offset between the chilled water supply temperature and its setpoint for staging down to WSE only"; parameter Real faiSafDpDif( unit="Pa", displayUnit="Pa")=2*6895 "Offset between the chilled water differential pressure and its setpoint"; parameter Real effConSigDif( max=1, min=0)=0.05 "Signal hysteresis deadband"; // ---- Staging up and down process ---- parameter Real chiDemRedFac(unit="1")=0.75 "Demand reducing factor of current operating chillers"; parameter Real holChiDemTim(unit="s")=300 "Maximum time to wait for the actual demand less than percentage of current load"; parameter Real aftByPasSetTim(unit="s")=60 "Time to allow loop to stabilize after resetting minimum chilled water flow setpoint"; parameter Real waiTim(unit="s")=30 "Waiting time after enabling next head pressure control"; parameter Real chaChiWatIsoTim(unit="s")=300 "Time to slowly change isolation valve, should be determined in the field"; parameter Real proOnTim(unit="s")=300 "Threshold time to check after newly enabled chiller being operated"; parameter Real thrTimEnb(unit="s")=10 "Threshold time to enable head pressure control after condenser water pump being reset"; // ---- Cooling tower: fan speed ---- final parameter Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.TowerSpeedControl fanSpeCon= Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.TowerSpeedControl.CondenserWaterReturnTemperaure "Tower fan speed control type"; final parameter Boolean have_conWatRetCon = fanSpeCon==Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.TowerSpeedControl.CondenserWaterReturnTemperaure "True: the fan speed is controlled to maintain the condenser water return temperature setpoint"; parameter Boolean closeCoupledPlant=false "True: the plant is close coupled, i.e. the pipe length from the chillers to cooling towers does not exceed approximately 100 feet"; parameter Real fanSpeMin(unit="1")=0.1 "Minimum tower fan speed"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController intOpeCon= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Controller in the mode if WSE and chillers are enabled"; parameter Real kIntOpeTowFan=0.1 "Gain of controller, if both WSE and chillers are enabled"; parameter Real TiIntOpeTowFan(unit="s")=10 "Time constant of integrator block, if both WSE and chillers are enabled"; parameter Real TdIntOpeTowFan(unit="s")=0.1 "Time constant of derivative block, if both WSE and chillers are enabled"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController chiWatConTowFan= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Controller in the mode if only WSE is enabled"; parameter Real kWSETowFan=0.1 "Gain of controller, if only WSE is enabled"; parameter Real TiWSETowFan(unit="s")=10 "Time constant of integrator block, if only WSE is enabled"; parameter Real TdWSETowFan(unit="s")=0.1 "Time constant of derivative block, if only WSE is enabled"; // Fan speed control: controlling condenser return water temperature when WSE is not enabled parameter Real TConWatSup_nominal[nChi]( start=fill(4, nChi), unit=fill("K", nChi), displayUnit=fill("degC", nChi)) "Condenser water supply temperature (condenser entering) of each chiller"; parameter Real TConWatRet_nominal[nChi]( start=fill(4, nChi), unit=fill("K", nChi), displayUnit=fill("degC", nChi)) "Condenser water return temperature (condenser leaving) of each chiller"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController couPlaCon= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of coupled plant controller"; parameter Real kCouPla=0.1 "Gain of controller, for close coupled plant"; parameter Real TiCouPla(unit="s")=10 "Time constant of integrator block, for close coupled plant"; parameter Real TdCouPla(unit="s")=0.1 "Time constant of derivative block, for close coupled plant"; parameter Real yCouPlaMax(unit="1")=1 "Upper limit of output of controller, for close coupled plant"; parameter Real yCouPlaMin(unit="1")=0 "Lower limit of output of controller, for close coupled plant"; parameter Real samplePeriodConTDiff(unit="s")=30 "Period of sampling condenser water supply and return temperature difference"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController supWatCon= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Condenser supply water temperature controller for less coupled plant"; parameter Real kSupCon=0.1 "Gain of controller, for less coupled plant"; parameter Real TiSupCon(unit="s")=10 "Time constant of integrator block, for less coupled plant"; parameter Real TdSupCon(unit="s")=0.1 "Time constant of derivative block, for less coupled plant"; parameter Real ySupConMax=1 "Upper limit of output of controller, for less coupled plant"; parameter Real ySupConMin=0 "Lower limit of output of controller, for less coupled plant"; parameter Real iniPlaTim(unit="s")=600 "Time to hold return temperature at initial setpoint after plant being enabled"; parameter Real ramTim(unit="s")=180 "Time to ramp return water temperature from initial value to setpoint"; parameter Real cheMinFanSpe(unit="s")=300 "Threshold time for checking duration when tower fan equals to the minimum tower fan speed"; parameter Real cheMaxTowSpe(unit="s")=300 "Threshold time for checking duration when any enabled chiller maximum cooling speed equals to the minimum tower fan speed"; parameter Real cheTowOff(unit="s")=60 "Threshold time for checking duration when there is no enabled tower fan"; // ---- Cooling tower: staging ---- parameter Boolean have_towInlIsoVal=true "True: tower cells have the inlet isolation valve"; parameter Boolean have_towOutIsoVal=false "True: tower cells have the outlet isolation valve"; parameter Boolean have_towIsoValEndSwi=false "True: tower cells isolatiove valve have the end switch feedback"; parameter Real chaTowCelIsoTim(unit="s")=300 "Time to slowly change isolation valve"; // ---- Cooling tower: Water level control ---- parameter Real watLevMin( min=0, start=0, unit="m") "Minimum cooling tower water level recommended by manufacturer"; parameter Real watLevMax(start=0, unit="m") "Maximum cooling tower water level recommended by manufacturer"; // ---- Advanced ---- parameter Real locDt(unit="K")=1 "Offset temperature for lockout chiller"; parameter Real hysDt( unit="K", displayUnit="K")=1 "Deadband temperature used in hysteresis block"; parameter Real dpDifHys( unit="Pa", displayUnit="Pa")=0.5*6895 "Pressure difference hysteresis deadband"; parameter Real relFloThr=0.95 "Relative flow rate to check if the flow has achieved setpoint"; parameter Real speChe=0.01 "Lower threshold value to check fan or pump speed"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChiWatReq[nChi] "True: chiller requires the chilled water"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uConWatReq[nChi] if not have_airCoo "True: chiller requires the condenser water"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChiWatPum[nChiWatPum] "True: chilled water pump proven on status"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWat_local( final quantity="PressureDifference", final unit="Pa") if not have_senDpChiWatRemWir "Chilled water differential static pressure from local sensor"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWatSet_local( final quantity="PressureDifference", final unit="Pa") if not have_senDpChiWatRemWir "Chilled water local differential pressure setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWat_remote[nSenChiWatPum]( final unit=fill("Pa", nSenChiWatPum), final quantity=fill("PressureDifference", nSenChiWatPum)) if have_senDpChiWatRemWir "Chilled water differential static pressure from remote sensor"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VChiWat_flow( final quantity="VolumeFlowRate", final unit="m3/s") "Measured chilled water volume flow rate for primary-only plant"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uChi[nChi] "True: chiller is enabled"; Buildings.Controls.OBC.CDL.Interfaces.RealInput phi( final unit="1") if have_WSE and not have_airCoo "Outdoor relative humidity"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatRetDow( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") if have_WSE "Chiller water return temperature downstream of the WSE"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatRetUp( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") if have_WSE "Chilled water return temperature upstream of the WSE"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TConWatRet[nChi]( final unit=fill("K", nChi), displayUnit=fill("degC", nChi), final quantity=fill("ThermodynamicTemperature", nChi)) if need_heaPreCon and not have_airCoo and have_plaHeaPreCon "Measured condenser water return temperature (condenser leaving) from each chiller"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSupChi[nChi]( final unit=fill("K", nChi), displayUnit=fill("degC", nChi), final quantity=fill("ThermodynamicTemperature", nChi)) if need_heaPreCon and not have_airCoo and have_plaHeaPreCon "Measured chilled water supply temperature from each chiller"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSup( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Measured chilled water supply temperature to the load"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uHeaPreCon[nChi] if have_chiHeaPreCon and not have_airCoo "Chiller head pressure control loop signal from chiller controller"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpChiWat( final unit="Pa", final quantity="PressureDifference") if have_WSE and have_byPasValCon "Differential static pressure across economizer in the chilled water side"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEcoPum if have_WSE and not have_byPasValCon and not have_airCoo "True: economizer heat exchanger pump is proven on"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEntHex( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") if have_WSE and not have_byPasValCon and not have_airCoo "Chilled water temperature entering economizer heat exchanger"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatEntChi( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Chilled water entering chiller"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uChiWatIsoVal[nChi]( final unit=fill("1", nChi), min=fill(0, nChi), max=fill(1, nChi)) if have_modPosChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating "Chilled water isolvation valve position feedback"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ChiWatIsoValOpe[nChi] if have_twoPosEndSwiChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.TwoPosition "Chiller chilled water isolation valve open end switch. True: the valve is fully open"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1ChiWatIsoValClo[nChi] if have_twoPosEndSwiChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.TwoPosition "Chiller chilled water isolation valve close end switch. True: the valve is fully closed"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput TChiWatSupResReq "Chilled water supply temperature setpoint reset request"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput chiPlaReq "Number of chiller plant cooling requests"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uConWatPum[nConWatPum] if not have_airCoo "True: condenser water pump is enabled"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uPlaSchEna "Plant schedule enable: true=Enable"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TOut( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Outdoor air dry bulb temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TConWatTowRet( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Condenser water return temperature (condenser leaving) to the cooling tower"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TConWatSup( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") if not closeCoupledPlant and not have_airCoo "Condenser water supply temperature (condenser entering)"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1TowInlIsoValOpe[nTowCel] if have_towInlIsoVal and have_towIsoValEndSwi and not have_airCoo "Tower cells inlet isolation valve open end switch. True: the isolation valve is fully open"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1TowOutIsoValOpe[nTowCel] if have_towIsoValEndSwi and have_towOutIsoVal and not have_airCoo "Tower cells outlet isolation valve open end switch. True: the isolation valve is fully open"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1TowInlIsoValClo[nTowCel] if have_towInlIsoVal and have_towIsoValEndSwi and not have_airCoo "Tower cells inlet isolation valve close end switch. True: the isolation valve is fully closed"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1TowOutIsoValClo[nTowCel] if have_towIsoValEndSwi and have_towOutIsoVal and not have_airCoo "Tower cells outlet isolation valve close end switch. True: the isolation valve is fully closed"; Buildings.Controls.OBC.CDL.Interfaces.RealInput watLev( final unit="m") if not have_airCoo "Measured water level"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uTowSta[nTowCel] "Vector of tower cell proven on status: true=running tower cell. Note that the tower fan could be disabled"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEcoConWatIsoVal if have_WSE "Economizer condenser water isolation valve enable command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWseRetVal( final min=0, final max=1, final unit="1") if have_byPasValCon and have_WSE "WSE in-line CHW return line valve position setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yWsePumOn if have_WSE and not have_byPasValCon "Heat exchanger pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1WseChiWatBypVal if have_WSE and have_priOnl and have_parChi and not have_airCoo "Economizer-only chiller water bypass valve enable command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWsePumSpe( final min=0, final unit="1", final max=1) if have_WSE and not have_byPasValCon and not have_airCoo "Heat exchanger pump speed setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupSet[nChi]( final unit=fill("K", nChi), displayUnit=fill("degC", nChi), final quantity=fill("ThermodynamicTemperature", nChi)) "Chilled water supply temperature setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpChiWatSet[nSenChiWatPum]( final quantity=fill("PressureDifference", nSenChiWatPum), final unit=fill("Pa", nSenChiWatPum)) if not have_senDpChiWatRemWir "Chilled water differential pressure setpoint for the remote sensors"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yChiWatPum[nChiWatPum] if have_heaChiWatPum "Chilled water pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiPumSpe( final min=0, final max=1, final unit="1") "Chilled water pump speed setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiDem( final quantity="HeatFlowRate", final unit="W") if have_priOnl or use_loadShed "Chiller demand setpoint to set through BACnet or similar "; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yChi[nChi] "Chiller enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ConWatIsoVal[nChi] if (not have_airCoo) and have_heaConWatPum and (not need_heaPreCon or not have_fixSpeConWatPum and not have_WSE) "Chiller condenser water isolation valve command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yConWatIsoVal[nChi]( final min=fill(0, nChi), final max=fill(1, nChi), final unit=fill("1", nChi)) if (not have_airCoo) and have_heaConWatPum and not (not need_heaPreCon or not have_fixSpeConWatPum and not have_WSE) "Condenser water isolation valve commanded position"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yConWatPumSpe( final unit="1", final min=0, final max=1) if (not have_airCoo) and not have_fixSpeConWatPum "Condenser water pump speed setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiWatMinFloSet( final quantity="VolumeFlowRate", final unit="m3/s", final min=0) "Chilled water minimum flow setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yConWatPum[nConWatPum] if not have_airCoo "Condenser water pump enable command"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ChiWatIsoVal[nChi] if chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.TwoPosition "Chilled water isolation valve position commanded on"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yChiWatIsoVal[nChi]( final min=fill(0, nChi), final max=fill(1, nChi), final unit=fill("1", nChi)) if chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating "Chilled water isolation valve position setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yReaChiDemLim if have_priOnl or use_loadShed "Release chiller demand limit, normally true"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yMinValPosSet( final min=0, final max=1, final unit="1") "Chilled water minimum flow bypass valve position setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yTowCelIsoVal[nTowCel] if have_towInlIsoVal and not have_airCoo "Cooling tower cells isolation valve position setpoints"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yTowCel[nTowCel] if not have_airCoo "Vector of tower cells enable commands"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTowFanSpe( final min=0, final max=1, final unit="1") if not have_airCoo "Fan speed setpoint of enabled cooling tower cell"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yMakUp if not have_airCoo "Makeup water valve On-Off status"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Economizers.Controller wseSta( final have_byPasValCon=have_byPasValCon, final have_priOnl=have_priOnl, final have_parChi=have_parChi, final nChi=nChi, final nSta=nSta, final chiIsoValTyp=chiIsoValTyp, final have_modPosChiVal=have_modPosChiVal, final chaChiWatIsoTim=chaChiWatIsoTim, final holdPeriod=holdPeriod, final delDis=delDis, final TOffsetEna=TOffsetEna, final TOffsetDis=TOffsetDis, final heaExcAppDes=heaExcAppDes, final cooTowAppDes=cooTowAppDes, final TOutWetDes=TOutWetDes, final VHeaExcDes_flow=VHeaExcDes_flow, final hysDt=hysDt, final step=step, final wseOnTimDec=wseOnTimDec, final wseOnTimInc=wseOnTimInc, final dpDes=dpDes, final valCon=ecoValCon, final k=kEcoVal, final Ti=TiEcoVal, final Td=TdEcoVal, final minSpe=minEcoSpe) if have_WSE and not have_airCoo "Waterside economizer (WSE) enable/disable status"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.PlantEnable.Enable plaEna( final TChiLocOut=TChiLocOut, final plaThrTim=plaThrTim, final reqThrTim=reqThrTim, final ignReq=ignReq, final locDt=locDt) "Sequence to enable and disable plant"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.HeadPressure.Controller heaPreCon[nChi]( final have_fixSpeConWatPum=fill(have_fixSpeConWatPum, nChi), final have_chiHeaPreCon=fill(have_chiHeaPreCon, nChi), final have_WSE=fill(have_WSE and not have_airCoo, nChi), final minTowSpe=fill(fanSpeMin, nChi), final minConWatPumSpe=fill(minConWatPumSpe, nChi), final minHeaPreValPos=fill(minHeaPreValPos, nChi), final controllerType=fill(conTypHeaPre, nChi), final minChiLif=dTChiMinLif, final k=fill(kHeaPreCon, nChi), final Ti=fill(TiHeaPreCon, nChi), final Td=fill(TdHeaPreCon, nChi)) if need_heaPreCon and not have_airCoo "Chiller head pressure controller"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.MinimumFlowBypass.Controller minBypValCon( final nChi=nChi, final minFloSet=minFloSet, final controllerType=conTypMinFloByp, final k=kMinFloBypCon, final Ti=TiMinFloBypCon, final Td=TdMinFloBypCon, final yMax=yMaxFloBypCon, final yMin=yMinFloBypCon) "Controller for chilled water minimum flow bypass valve"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Pumps.ChilledWater.Controller chiWatPumCon( final have_heaPum=have_heaChiWatPum, final have_senDpChiWatRemWir=have_senDpChiWatRemWir, final have_WSE=have_WSE and not have_airCoo, final nChi=nChi, final nPum=nChiWatPum, final nSen=nSenChiWatPum, final minPumSpe=minChiWatPumSpe, final maxPumSpe=maxChiWatPumSpe, final nPum_nominal=nPum_nominal, final VChiWat_flow_nominal=VChiWat_flow_nominal, final controllerType=conTypChiWatPum, final k=kChiWatPum, final Ti=TiChiWatPum, final Td=TdChiWatPum) "Sequences to control chilled water pumps in primary-only plant system"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.SetPoints.ChilledWaterPlantReset chiWatPlaRes( final nPum=nChiWatPum, final holTim=holTim, final iniSet=iniSet, final minSet=minSet, final maxSet=maxSet, final delTim=delTim, final samplePeriod=samplePeriod, final numIgnReq=numIgnReq, final triAmo=triAmo, final resAmo=resAmo, final maxRes=maxRes) "Sequences to generate chilled water plant reset"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.SetPoints.ChilledWaterSupply chiWatSupSet( final nRemDpSen=nSenChiWatPum, final dpChiWatMin=dpChiWatMin, final dpChiWatMax=dpChiWatMax, final TChiWatSupMin=TChiWatSupMin_Lowest, final TPlaChiWatSupMax=TPlaChiWatSupMax, final minSet=minSet, final maxSet=maxSet, final halSet=halSet) "Sequences to generate setpoints of chilled water supply temperature and the pump differential static pressure"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Staging.SetPoints.SetpointController staSetCon( final have_WSE=have_WSE and not have_airCoo, final have_serChi=have_serChi, final have_senDpChiWatRemWir=have_senDpChiWatRemWir, final nRemSen=nSenChiWatPum, final anyVsdCen=anyVsdCen, final nChi=nChi, final chiDesCap=chiDesCap, final chiMinCap=chiMinCap, final chiTyp=chiTyp, final nSta=nSta, final staMat=staMat, final avePer=avePer, final delStaCha=delStaCha, final parLoaRatDelay=parLoaRatDelay, final faiSafTruDelay=faiSafTruDelay, final effConTruDelay=effConTruDelay, final shortTDelay=shortTDelay, final longTDelay=longTDelay, final posDisMult=posDisMult, final conSpeCenMult=conSpeCenMult, final anyOutOfScoMult=anyOutOfScoMult, final varSpeStaMin=varSpeStaMin, final varSpeStaMax=varSpeStaMax, final smallTDif=smallTDif, final largeTDif=largeTDif, final faiSafTDif=faiSafTDif, final dpDif=dpDif, final TDif=TDif, final TDifHys=hysDt, final faiSafDpDif=faiSafDpDif, final dpDifHys=dpDifHys, final effConSigDif=effConSigDif) "Calculates the chiller stage status setpoint signal"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Towers.Controller towCon( final chiHeaPreCon=chiHeaPreCon, final nChi=nChi, final nPlaSta=nPlaSta, final nTowCel=nTowCel, final nConWatPum=nConWatPum, final fanSpeCon=fanSpeCon, final closeCoupledPlant=closeCoupledPlant, final have_WSE=have_WSE, final desCap=desCap, final fanSpeMin=fanSpeMin, final chiMinCap=chiMinCap, final intOpeCon=intOpeCon, final kIntOpe=kIntOpeTowFan, final TiIntOpe=TiIntOpeTowFan, final TdIntOpe=TdIntOpeTowFan, final chiWatCon=chiWatConTowFan, final kWSE=kWSETowFan, final TiWSE=TiWSETowFan, final TdWSE=TdWSETowFan, final minChiLif=dTChiMinLif, final TConWatSup_nominal=TConWatSup_nominal, final TConWatRet_nominal=TConWatRet_nominal, final TChiWatSupMin=TChiWatSupMin, final couPlaCon=couPlaCon, final kCouPla=kCouPla, final TiCouPla=TiCouPla, final TdCouPla=TdCouPla, final yCouPlaMax=yCouPlaMax, final yCouPlaMin=yCouPlaMin, final samplePeriod=samplePeriodConTDiff, final supWatCon=supWatCon, final kSupCon=kSupCon, final TiSupCon=TiSupCon, final TdSupCon=TdSupCon, final ySupConMax=ySupConMax, final ySupConMin=ySupConMin, final speChe=speChe, final iniPlaTim=iniPlaTim, final ramTim=ramTim, final cheMinFanSpe=cheMinFanSpe, final cheMaxTowSpe=cheMaxTowSpe, final cheTowOff=cheTowOff, final staVec=staVec, final towCelOnSet=towCelOnSet, final have_inlIsoVal=have_towInlIsoVal, final have_outIsoVal=have_towOutIsoVal, final have_endSwi=have_towIsoValEndSwi, final chaTowCelIsoTim=chaTowCelIsoTim, final watLevMin=watLevMin, final watLevMax=watLevMax) if not have_airCoo "Cooling tower controller"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Staging.Processes.Down dowProCon( final nChi=nChi, final nConWatPum=nConWatPum, final nPlaSta=nPlaSta, final nChiSta=nSta + 1, final have_airCoo=have_airCoo, final have_WSE=have_WSE, final have_ponChi=have_ponChi, final have_parChi=have_parChi, final have_heaConWatPum=have_heaConWatPum, final have_fixSpeConWatPum=have_fixSpeConWatPum, final need_reduceChillerDemand=have_priOnl or use_loadShed, final chiDemRedFac=chiDemRedFac, final holChiDemTim=holChiDemTim, final waiTim=waiTim, final proOnTim=proOnTim, final chiIsoValTyp=chiIsoValTyp, final have_twoPosEndSwiChiVal=have_twoPosEndSwiChiVal, final chaChiWatIsoTim=chaChiWatIsoTim, final staVec=staVec, final desConWatPumSpe=desConWatPumSpe, final desConWatPumNum=desConWatPumNum, final byPasSetTim=byPasSetTim, final minFloSet=minFloSet, final maxFloSet=maxFloSet, final aftByPasSetTim=aftByPasSetTim, final relFloThr=relFloThr, final desChiNum=desChiNum) "Staging down process controller"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Staging.Processes.Up upProCon( final nChi=nChi, final nConWatPum=nConWatPum, final nPlaSta=nPlaSta, final nChiSta=nSta + 1, final have_airCoo=have_airCoo, final have_WSE=have_WSE, final have_ponChi=have_ponChi, final have_parChi=have_parChi, final have_heaConWatPum=have_heaConWatPum, final have_fixSpeConWatPum=have_fixSpeConWatPum, final need_reduceChillerDemand=have_priOnl or use_loadShed, final delStaCha=delStaCha, final chiDemRedFac=chiDemRedFac, final holChiDemTim=holChiDemTim, final byPasSetTim=byPasSetTim, final minFloSet=minFloSet, final maxFloSet=maxFloSet, final aftByPasSetTim=aftByPasSetTim, final staVec=staVec, final desConWatPumSpe=desConWatPumSpe, final desConWatPumNum=desConWatPumNum, final thrTimEnb=thrTimEnb, final waiTim=waiTim, final chiIsoValTyp=chiIsoValTyp, final have_twoPosEndSwiChiVal=have_twoPosEndSwiChiVal, final chaChiWatIsoTim=chaChiWatIsoTim, final proOnTim=proOnTim, final relFloThr=relFloThr, final desChiNum=desChiNum) "Staging up process controller"; Buildings.Controls.OBC.CDL.Logical.Or chaProUpDown "Either in staging up or in staging down process"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr( final nin=nChiWatPum) "Check if there is any chilled water pump is enabled"; Buildings.Controls.OBC.CDL.Logical.Or staCooTow if not have_airCoo "Tower stage change status: true=stage cooling tower"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booRep( final nout=nChi) if have_WSE and not have_airCoo "Waterside economizer status"; Buildings.Controls.OBC.CDL.Reals.Switch desConWatPumSpeSwi if not have_fixSpeConWatPum and not have_airCoo "Design condenser water pump speed"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator desConPumSpe( final nout=nChi) if not have_fixSpeConWatPum and not have_airCoo "Replicate design condenser water pump speed"; Buildings.Controls.OBC.CDL.Reals.MultiMax mulMax1( final nin=nChi) if not have_fixSpeConWatPum and not have_airCoo and need_heaPreCon "Condenser water pump speed"; Buildings.Controls.OBC.CDL.Reals.Switch chiMinFloSet "Chiller water minimum flow setpoint"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator inUpPro( final nout=nChi) "In chiller stage up process"; Buildings.Controls.OBC.CDL.Logical.Switch chiComSta[nChi] "Chiller commanded status"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1[nChiWatPum]( final k=chiPumLeaLag) if have_heaChiWatPum "Chilled water pump lead and lag index"; Buildings.Controls.OBC.CDL.Logical.Latch chiStaUp "In chiller stage up process"; Buildings.Controls.OBC.CDL.Logical.Pre pre2 if not have_airCoo "Stage cooling tower"; Buildings.Controls.OBC.CDL.Logical.Switch chiHeaCon[nChi] if not have_airCoo "Chiller head control enabling status"; Buildings.Controls.OBC.CDL.Integers.Switch conWatPumNum if not have_airCoo "Total number of enablded condenser water pump"; Buildings.Controls.OBC.CDL.Logical.Switch chiIsoVal[nChi] "Chiller isolation valve position setpoint"; Buildings.Controls.OBC.CDL.Reals.Switch chiDem if have_priOnl or use_loadShed "Chiller demand"; Buildings.Controls.OBC.CDL.Logical.Switch relDem if have_priOnl or use_loadShed "Release chiller demand limit"; Buildings.Controls.OBC.CDL.Logical.Pre preChaPro "Stage changing process status from previous step"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea3[nChi] if not have_airCoo "Boolean to real"; Buildings.Controls.OBC.CDL.Reals.Multiply pro4[nChi] if not have_airCoo "Head pressure control valve position"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant fulOpeVal[nChi]( final k=fill(1, nChi)) if not have_WSE and not have_fixSpeConWatPum and not have_airCoo and need_heaPreCon "Full open head pressure control valve"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.PlantEnable.EnableDevices enaDev( final nChiWatPum=nChiWatPum, final nConWatPum=nConWatPum, final have_airCoo=have_airCoo) "Enable devices when plant is enabled"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.PlantEnable.DisableChillers disChi( final have_airCoo=have_airCoo, final have_WSE=have_WSE, final nChi=nChi, final nChiWatPum=nChiWatPum, final nConWatPum=nConWatPum, final nTowCel=nTowCel, final have_fixSpeConWatPum=have_fixSpeConWatPum, final chiIsoValTyp=chiIsoValTyp) "Disable devices when plant is disabled"; Buildings.Controls.OBC.CDL.Logical.And celCom[nTowCel] if not have_airCoo "False: disable tower cell"; Buildings.Controls.OBC.CDL.Logical.Switch logSwi[nTowCel] if have_towInlIsoVal and not have_airCoo "Tower cell isolation valve position setpoint"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1[nTowCel]( final k=fill(0, nTowCel)) if not have_airCoo "Constant zero"; Buildings.Controls.OBC.CDL.Reals.Switch swi1 if not have_airCoo "Tower cell fan speed setpoint"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.IdentifyStage ideSta( final nSta=nSta, final nChi=nChi, final staMat=staMat) "Identify stage index"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator booScaRep3( final nout=nTowCel) if not have_airCoo "Replicate boolean input"; Buildings.Controls.OBC.CDL.Psychrometrics.WetBulb_TDryBulPhi wetBul if have_WSE and not have_airCoo "Wet bulb temperature"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator supTem( final nout=nChi) "Chiller water supply setpoint temperature"; protected final parameter Real Cp( final quantity="SpecificHeatCapacity") = 4198 "Water specific heat capacity"; final parameter Real rho( final quantity="Density") = 1000 "Water density"; final parameter Integer chiPumLeaLag[nChiWatPum]={i for i in 1:nChiWatPum} "Chiller water pump lead and lag index, {1,2,...,n}, with first one as lead pump"; final parameter Integer conPumLeaLag[nConWatPum]={i for i in 1:nConWatPum} "Condenser water pump lead and lag index, {1,2,...,n}, with first one as lead pump"; final parameter Boolean anyVsdCen = sum({ if chiTyp[i]==Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.ChillersAndStages.VariableSpeedCentrifugal then 1 else 0 for i in 1:nChi}) > 0 "Plant contains at least one variable speed centrifugal chiller"; final parameter Boolean have_serChi = not have_parChi "true = series chillers plant; false = parallel chillers plant"; final parameter Real TChiWatSupMin_Lowest( final unit="K", final quantity="ThermodynamicTemperature", displayUnit="degC")=min(TChiWatSupMin) "Minimum chilled water supply temperature. This is the lowest minimum chilled water supply temperature of chillers in the plant"; final parameter Real desCap(unit="W")=sum(chiDesCap) "Plant design capacity"; Buildings.Controls.OBC.CDL.Integers.LessEqual enaConWatPum[nConWatPum] if not have_airCoo "Check if a condenser water pump should be enabled"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conPum[nConWatPum]( final k=conPumLeaLag) if not have_airCoo "Condenser water pumps lead lag order"; Buildings.Controls.OBC.CDL.Routing.IntegerScalarReplicator intScaRep( final nout=nConWatPum) if not have_airCoo "Duplicate to total number of condenser water pump"; Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Generic.ChillerLifts chiLif( final nChi=nChi, final minChiLif=dTChiMinLif, final maxChiLif=dTChiMaxLif) "Average lifts of the enabled chillers"; Buildings.Controls.OBC.CDL.Reals.Subtract sub "Temperature difference"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(final k=rho*Cp) "Find product of the inputs"; Buildings.Controls.OBC.CDL.Reals.Multiply chiLoa "Total chiller load"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant chiAva[nChi]( final k=fill(true, nChi)) "True: chiller is available"; Buildings.Controls.OBC.CDL.Logical.Pre pre[nChi] if not have_airCoo "Chiller head control enabling status"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(final k=1) if not need_heaPreCon and (not have_fixSpeConWatPum and not have_airCoo) "Dummy block"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[nChi] if not need_heaPreCon and not have_airCoo "Dummy block"; Buildings.Controls.OBC.CDL.Logical.Latch lat "Enabled plant"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea1 "Boolean to real"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator reaScaRep(final nout=nChi) "Duplicate real input"; Buildings.Controls.OBC.CDL.Reals.Multiply chiIso[nChi] if have_modPosChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating "Chilled water isolation valve"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(final k=false) "False constant"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con2[nTowCel]( final k=fill(false,nTowCel)) if have_towInlIsoVal and not have_airCoo "Constant false"; Buildings.Controls.OBC.CDL.Logical.And chiEnaPla[nChi] "Chiller enabled"; Buildings.Controls.OBC.CDL.Routing.BooleanScalarReplicator plaSta( final nout=nChi) "Plant staus"; Buildings.Controls.OBC.CDL.Reals.Switch chiIsoValPos[nChi] if chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating "Chilled water isolation valve position"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai3[nChi]( final k=fill(1, nChi)) if not (have_modPosChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.Modulating) "Dummy block"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con3( final k=not (have_modPosChiVal and chiIsoValTyp == Buildings.Controls.OBC.ASHRAE.G36.Plants.Chillers.Types.Actuator.TwoPosition)) "Not have position feedback when it is the 2-position valve"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="It cannot have position feedback when it is the 2-position valve.") "Generate warning"; Buildings.Controls.OBC.CDL.Logical.Pre chiEna[nChi] "Chiller enabling status"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt( final k=nChi) "Number of chillers"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes1( final message="The number of columns of the chiller staging matrix should equal the number of chillers.") "Warning when the chiller staging matrix size is incorrect"; Buildings.Controls.OBC.CDL.Integers.Equal intEqu "Check the columns of the chiller staging matrix"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt2( final k=size(staMat, 2)) "Columns of the chiller staging matrix"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt3( final k=nPlaSta) "Number of plant stages"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes2( final message="The number of rows of the condenser water pump staging matrix should equal the number of plant stages.") "Warning when the rows of the condenser water pump staging matrix is incorrect"; Buildings.Controls.OBC.CDL.Integers.Equal intEqu1 "Check the rows of the condenser water pump staging matrix"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt4( final k=size(conWatPumStaMat, 1)) "Rows of the condenser water pump staging matrix"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt5( final k=nConWatPum) "Number of condenser water pumps"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes3( final message="The number of columns of the condenser water pump staging matrix should equal the number of condenser water pumps.") "Warning when the columns of the condenser water pump staging matrix is incorrect"; Buildings.Controls.OBC.CDL.Integers.Equal intEqu2 "Check the columns of the condenser water pump staging matrix"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt6( final k=size(conWatPumStaMat, 2)) "Columns of the condenser water pump staging matrix"; Buildings.Controls.OBC.CDL.Logical.Or inStaPro "In staging up or down process"; Buildings.Controls.OBC.CDL.Logical.FallingEdge endStaPro "Staging process is end"; equation connect(staSetCon.uPla, plaEna.yPla); connect(TChiWatRetDow, wseSta.TChiWatRetDow); connect(chiWatSupSet.TChiWatSupSet, staSetCon.TChiWatSupSet); connect(TChiWatSup, staSetCon.TChiWatSup); connect(VChiWat_flow, minBypValCon.VChiWat_flow); connect(staSetCon.TWsePre, wseSta.TWsePre); connect(VChiWat_flow, staSetCon.VChiWat_flow); connect(TChiWatSupResReq, chiWatPlaRes.TChiWatSupResReq); connect(chiWatPlaRes.yChiWatPlaRes, chiWatSupSet.uChiWatPlaRes); connect(wseSta.y, staSetCon.uWseSta); connect(wseSta.y, towCon.uWse); connect(plaEna.yPla, towCon.uPla); connect(wetBul.TWetBul, staSetCon.TOutWet); connect(staSetCon.ySta, upProCon.uStaSet); connect(staSetCon.ySta, dowProCon.uStaSet); connect(staSetCon.yChiSet, upProCon.uChiSet); connect(staSetCon.yChiSet, dowProCon.uChiSet); connect(upProCon.yStaPro, chaProUpDown.u1); connect(dowProCon.yStaPro, chaProUpDown.u2); connect(towCon.yMakUp, yMakUp); connect(mulOr.y, minBypValCon.uChiWatPum); connect(uChiWatPum, mulOr.u); connect(staSetCon.yOpeParLoaRatMin, dowProCon.yOpeParLoaRatMin); connect(wseSta.y, upProCon.uWSE); connect(wseSta.y, dowProCon.uWSE); connect(dowProCon.VChiWat_flow, VChiWat_flow); connect(VChiWat_flow, chiWatPumCon.VChiWat_flow); connect(dpChiWat_remote, chiWatPumCon.dpChiWat_remote); connect(TChiWatSup, towCon.TChiWatSup); connect(chiWatSupSet.TChiWatSupSet, towCon.TChiWatSupSet); connect(minBypValCon.yValPos, yMinValPosSet); connect(staSetCon.ySta, towCon.uChiStaSet); connect(TConWatSup, towCon.TConWatSup); connect(watLev, towCon.watLev); connect(uTowSta, towCon.uTowSta); connect(wseSta.yTunPar, staSetCon.uTunPar); connect(TChiWatRetUp, wseSta.TChiWatRet); connect(upProCon.yTowStaUp, staCooTow.u1); connect(dowProCon.yTowStaDow, staCooTow.u2); connect(TOut, plaEna.TOut); connect(VChiWat_flow, upProCon.VChiWat_flow); connect(wseSta.y, booRep.u); connect(booRep.y, heaPreCon.uWSE); connect(upProCon.yDesConWatPumSpe, desConWatPumSpeSwi.u1); connect(dowProCon.yDesConWatPumSpe, desConWatPumSpeSwi.u3); connect(desConPumSpe.y, heaPreCon.desConWatPumSpe); connect(heaPreCon.uHeaPreCon, uHeaPreCon); connect(heaPreCon.yMaxTowSpeSet, towCon.uMaxSpeSet); connect(heaPreCon.yConWatPumSpeSet, mulMax1.u); connect(upProCon.yChiWatMinFloSet, chiMinFloSet.u1); connect(dowProCon.yChiWatMinFloSet, chiMinFloSet.u3); connect(chiMinFloSet.y, minBypValCon.VChiWatSet_flow); connect(inUpPro.y, chiComSta.u2); connect(upProCon.yChi, chiComSta.u1); connect(dowProCon.yChi, chiComSta.u3); connect(staSetCon.yCapReq, towCon.reqPlaCap); connect(chiStaUp.y, chiMinFloSet.u2); connect(upProCon.yStaPro, chiStaUp.u); connect(dowProCon.yStaPro, chiStaUp.clr); connect(VChiWat_flow, wseSta.VChiWat_flow); connect(pre2.y, towCon.uTowStaCha); connect(staCooTow.y, pre2.u); connect(chiStaUp.y, desConWatPumSpeSwi.u2); connect(chiStaUp.y,inUpPro. u); connect(upProCon.yChiHeaCon, chiHeaCon.u1); connect(inUpPro.y, chiHeaCon.u2); connect(dowProCon.yChiHeaCon, chiHeaCon.u3); connect(chiStaUp.y, conWatPumNum.u2); connect(upProCon.yConWatPumNum, conWatPumNum.u1); connect(dowProCon.yConWatPumNum, conWatPumNum.u3); connect(chiMinFloSet.y, yChiWatMinFloSet); connect(inUpPro.y, chiIsoVal.u2); connect(upProCon.yChiDem, chiDem.u1); connect(dowProCon.yChiDem, chiDem.u3); connect(chiDem.y, yChiDem); connect(desConWatPumSpeSwi.y, desConPumSpe.u); connect(dowProCon.yReaDemLim, relDem.u3); connect(upProCon.yStaPro, relDem.u1); connect(chiStaUp.y, relDem.u2); connect(relDem.y, yReaChiDemLim); connect(dpChiWat_local, chiWatPumCon.dpChiWat_local); connect(dpChiWat_local, staSetCon.dpChiWat_local); connect(dpChiWat_remote, staSetCon.dpChiWat_remote); connect(chaProUpDown.y, preChaPro.u); connect(preChaPro.y, chiWatPlaRes.chaPro); connect(preChaPro.y, staSetCon.chaPro); connect(chiHeaCon.y, booToRea3.u); connect(booToRea3.y, pro4.u1); connect(heaPreCon.yHeaPreConVal, pro4.u2); connect(fulOpeVal.y, pro4.u2); connect(plaEna.chiPlaReq, chiPlaReq); connect(staSetCon.yIni, wseSta.uIni); connect(plaEna.yPla, wseSta.uPla); connect(dpChiWat, wseSta.dpChiWat); connect(uEcoPum, wseSta.uPum); connect(TEntHex, wseSta.TEntHex); connect(plaEna.yPla, enaDev.uPla); connect(staSetCon.yIni, enaDev.uIni); connect(staSetCon.ySta, enaDev.uChiSta); connect(uConWatPum, enaDev.uConWatPum); connect(uChiWatPum, enaDev.uChiWatPum); connect(plaEna.yPla, chiWatPumCon.uPla); connect(enaDev.yLeaTowCel, towCon.uEnaPla); connect(wseSta.yRetVal,yWseRetVal); connect(wseSta.yPumOn, yWsePumOn); connect(wseSta.yPumSpe, yWsePumSpe); connect(uChiWatReq, disChi.uChiWatReq); connect(pro4.y, disChi.uConWatIsoVal); connect(disChi.yConWatIsoVal,yConWatIsoVal); connect(disChi.yChiWatPumSpe, yChiPumSpe); connect(disChi.yConWatPumSpe, yConWatPumSpe); connect(towCon.yTowSta, celCom.u1); connect(celCom.y, yTowCel); connect(logSwi.y, yTowCelIsoVal); connect(swi1.y, yTowFanSpe); connect(towCon.ySpeSet, swi1.u1); connect(ideSta.ySta, staSetCon.uSta); connect(ideSta.ySta, towCon.uChiSta); connect(ideSta.ySta, dowProCon.uChiSta); connect(ideSta.ySta, upProCon.uChiSta); connect(staSetCon.ySta, wseSta.uChiSta); connect(chaProUpDown.y, disChi.chaPro); connect(disChi.yTowCel, booScaRep3.u); connect(booScaRep3.y, celCom.u2); connect(booScaRep3.y, logSwi.u2); connect(wseSta.y, disChi.uWSE); connect(wseSta.y, chiWatPumCon.uWse); connect(staSetCon.yChiSet, upProCon.uChiConIsoVal); connect(staSetCon.yChiSet, dowProCon.uChiConIsoVal); connect(wetBul.TWetBul, wseSta.TOutWet); connect(TOut, wetBul.TDryBul); connect(phi, wetBul.phi); connect(conInt1.y, chiWatPumCon.uPumLeaLag); connect(uChiWatPum, chiWatPumCon.uChiWatPum); connect(disChi.y1ChiWatIsoVal, wseSta.u1ChiIsoVal); connect(uConWatReq, disChi.uConWatReq); connect(chaProUpDown.y, wseSta.uStaPro); connect(chiWatSupSet.TChiWatSupSet, supTem.u); connect(supTem.y, TChiWatSupSet); connect(wseSta.yConWatIsoVal, yEcoConWatIsoVal); connect(wseSta.y1ChiWatBypVal, y1WseChiWatBypVal); connect(chiHeaCon.y, disChi.u1ConWatIsoVal); connect(disChi.y1ConWatIsoVal, y1ConWatIsoVal); connect(plaEna.uPlaSchEna, uPlaSchEna); connect(conWatPumNum.y, intScaRep.u); connect(conPum.y, enaConWatPum.u1); connect(intScaRep.y, enaConWatPum.u2); connect(enaConWatPum.y, disChi.uConWatPum); connect(disChi.yConWatPum, yConWatPum); connect(uChi, chiLif.uChi); connect(chiLif.yLifMax, staSetCon.uLifMax); connect(chiLif.yLifMin, staSetCon.uLifMin); connect(TChiWatSup, sub.u2); connect(VChiWat_flow, gai.u); connect(sub.y, chiLoa.u1); connect(gai.y, chiLoa.u2); connect(chiLoa.y, towCon.uChiLoa); connect(chiLoa.y, upProCon.uChiLoa); connect(chiLoa.y, dowProCon.uChiLoa); connect(TConWatTowRet, towCon.TConWatRet); connect(TConWatRet, heaPreCon.TConWatRet); connect(chiStaUp.y, chiDem.u2); connect(towCon.ySpeSet, wseSta.uTowFanSpeMax); connect(con1[1].y, swi1.u3); connect(booScaRep3.y[1], swi1.u2); connect(TConWatTowRet, staSetCon.TConWatRet); connect(towCon.ySpeSet, staSetCon.uTowFanSpeMax); connect(chiAva.y, staSetCon.uChiAva); connect(chiHeaCon.y, pre.u); connect(pre.y, upProCon.uChiHeaCon); connect(pre.y, dowProCon.uChiHeaCon); connect(chiWatPumCon.yPumSpe, disChi.uChiWatPumSpe); connect(chiWatPumCon.yChiWatPum, disChi.uChiWatPum); connect(disChi.yChiWatPum, yChiWatPum); connect(uConWatPum, towCon.uConWatPum); connect(mulMax1.y, disChi.uConWatPumSpe); connect(desConWatPumSpeSwi.y, gai2.u); connect(gai2.y, disChi.uConWatPumSpe); connect(booToRea.y, pro4.u2); connect(TChiWatSupChi, heaPreCon.TChiWatSup); connect(con.y, lat.clr); connect(lat.y, booToRea1.u); connect(booToRea1.y, reaScaRep.u); connect(reaScaRep.y, chiIso.u2); connect(chiIso.y, wseSta.uChiIsoVal); connect(u1TowInlIsoValOpe, towCon.u1InlIsoValOpe); connect(u1TowOutIsoValOpe, towCon.u1OutIsoValOpe); connect(u1TowInlIsoValClo, towCon.u1InlIsoValClo); connect(u1TowOutIsoValClo, towCon.u1OutIsoValClo); connect(con2.y, logSwi.u3); connect(towCon.y1IsoVal, logSwi.u1); connect(chiComSta.y, chiEnaPla.u1); connect(chiEnaPla.y, yChi); connect(plaEna.yPla, plaSta.u); connect(plaSta.y, chiEnaPla.u2); connect(chiEnaPla.y, disChi.uChi); connect(plaEna.yPla, dowProCon.uPla); connect(plaEna.yPla, upProCon.uPla); connect(disChi.y1ChiWatIsoVal, chiWatPumCon.u1ChiWatIsoVal); connect(u1ChiWatIsoValOpe, upProCon.u1ChiWatIsoValOpe); connect(u1ChiWatIsoValOpe, dowProCon.u1ChiWatIsoValOpe); connect(u1ChiWatIsoValClo, upProCon.u1ChiWatIsoValClo); connect(u1ChiWatIsoValClo, dowProCon.u1ChiWatIsoValClo); connect(dowProCon.y1ChiWatIsoVal, chiIsoVal.u3); connect(upProCon.y1ChiWatIsoVal, chiIsoVal.u1); connect(chiIsoVal.y, disChi.u1ChiWatIsoVal); connect(disChi.y1ChiWatIsoVal, y1ChiWatIsoVal); connect(dpChiWatSet_local, staSetCon.dpChiWatSet_local); connect(dpChiWatSet_local, chiWatPumCon.dpChiWatSet_local); connect(chiWatSupSet.dpChiWatSet, dpChiWatSet); connect(chiWatSupSet.dpChiWatSet, chiWatPumCon.dpChiWatSet_remote); connect(chiWatSupSet.dpChiWatSet, staSetCon.dpChiWatSet_remote); connect(inUpPro.y, chiIsoValPos.u2); connect(upProCon.yChiWatIsoVal, chiIsoValPos.u1); connect(dowProCon.yChiWatIsoVal, chiIsoValPos.u3); connect(chiIsoValPos.y, disChi.uChiWatIsoVal); connect(disChi.yChiWatIsoVal, yChiWatIsoVal); connect(uChiWatIsoVal, chiIso.u1); connect(gai3.y, chiIso.u1); connect(dowProCon.yChiWatIsoVal, gai3.u); connect(con3.y, assMes.u); connect(disChi.yChiWatPum, chiWatPlaRes.uChiWatPum); connect(chiEnaPla.y, chiEna.u); connect(chiEna.y, upProCon.uChi); connect(chiEna.y, dowProCon.uChi); connect(chiEna.y, towCon.uChi); connect(chiEna.y, ideSta.uChi); connect(conInt.y, intEqu.u1); connect(intEqu.y, assMes1.u); connect(conInt2.y, intEqu.u2); connect(conInt3.y, intEqu1.u1); connect(intEqu1.y, assMes2.u); connect(conInt4.y, intEqu1.u2); connect(conInt5.y, intEqu2.u1); connect(intEqu2.y, assMes3.u); connect(conInt6.y, intEqu2.u2); connect(dowProCon.yStaPro, inStaPro.u2); connect(upProCon.yStaPro, inStaPro.u1); connect(inStaPro.y, endStaPro.u); connect(endStaPro.y, dowProCon.uEndPro); connect(endStaPro.y, upProCon.uEndPro); connect(chiEna.y, upProCon.uChiWatReq); connect(chiEna.y, dowProCon.uChiWatReq); connect(chiEna.y, upProCon.uConWatReq); connect(chiEna.y, dowProCon.uConWatReq); connect(TChiWatEntChi, sub.u1); connect(TChiWatEntChi, staSetCon.TChiWatRet); connect(pre.y, booToRea.u); connect(pre.y, heaPreCon.uChiHeaCon); connect(enaDev.yEnaPlaPro, upProCon.uEnaPla); connect(enaDev.yChiWatIsoVal, lat.u); end Controller;