Package of subsequences for terminal unit with reheat
Information
This package contains subsequences for VAV terminal unit with reheat only unit.
They are created according to Section 5.6 of ASHRAE Guideline 36, May 2020.
Package Content
| Name | Description | 
|  ActiveAirFlow | Output the active airflow setpoint for VAV reheat terminal unit | 
|  Alarms | Generate alarms of terminal unit with reheat | 
|  DamperValves | Output signals for controlling VAV reheat box damper and valve position | 
|  Overrides | Software switches to override setpoints | 
|  SystemRequests | Output system requests for VAV terminal unit with reheat | 
|  Validation | Collection of validation models | 
Output the active airflow setpoint for VAV reheat terminal unit
 
Information
This sequence sets the active cooling and heating maximum and minimum setpoints
for VAV reheat terminal unit. The implementation is according to the Section 5.6.4
of ASHRAE Guideline 36, May 2020.
The setpoints shall vary depending on the mode of the zone group.
| Setpoint | Occupied | Cooldown | Setup | Warm-up | Setback | Unoccupied | 
|---|
| Cooling maximum ( VActCooMax_flow) | VCooMax_flow | VCooMax_flow | VCooMax_flow | 0 | 0 | 0 | 
| Cooling minimum ( VActCooMin_flow) | VOccMin_flow | 0 | 0 | 0 | 0 | 0 | 
| Minimum ( VActMin_flow) | VOccMin_flow | 0 | 0 | 0 | 0 | 0 | 
| Heating minimum ( VActHeaMin_flow) | max( VHeaMin_flow,VOccMin_flow) | VHeaMin_flow | 0 | VHeaMax_flow | VHeaMax_flow | 0 | 
| Heating maximum ( VActHeaMax_flow) | max( VHeaMax_flow,VOccMin_flow) | VHeaMax_flow | 0 | VCooMax_flow | VCooMax_flow | 0 | 
Parameters
| Type | Name | Default | Description | 
|---|
| Real | VCooMax_flow |  | Design zone cooling maximum airflow rate [m3/s] | 
| Real | VHeaMin_flow |  | Design zone heating minimum airflow rate, for the reheat box with water hot coil, it should be zero [m3/s] | 
| Real | VHeaMax_flow |  | Design zone heating maximum airflow rate [m3/s] | 
Connectors
| Type | Name | Description | 
|---|
| input IntegerInput | uOpeMod | Zone operation mode | 
| input RealInput | VOccMin_flow | Occupied minimum airflow setpoint [m3/s] | 
| output RealOutput | VActCooMax_flow | Active cooling maximum airflow setpoint [m3/s] | 
| output RealOutput | VActCooMin_flow | Active cooling minimum airflow setpoint [m3/s] | 
| output RealOutput | VActMin_flow | Active minimum airflow setpoint [m3/s] | 
| output RealOutput | VActHeaMin_flow | Active heating minimum airflow setpoint [m3/s] | 
| output RealOutput | VActHeaMax_flow | Active heating maximum airflow setpoint [m3/s] | 
Modelica definition
block ActiveAirFlow
  
  
parameter Real VCooMax_flow(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")
    ;
  
parameter Real VHeaMin_flow(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")
    ;
  
parameter Real VHeaMax_flow(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VOccMin_flow(
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VActCooMax_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VActCooMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VActMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VActHeaMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VActHeaMax_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
protected 
  Buildings.Controls.OBC.CDL.Integers.Sources.Constant occMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.occupied)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant cooDowMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.coolDown)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant setUpMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.setUp)
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or3
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal actCooMax(
    
final realTrue=VCooMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal occModInd(
    
final realTrue=1)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Multiply pro
    ;
  
Buildings.Controls.OBC.CDL.Reals.Max max1
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal heaMinFlo(
    
final realTrue=VHeaMin_flow)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal heaMaxFlo(
    
final realTrue=VHeaMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal cooMaxFlo(
    
final realTrue=VCooMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Max max2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Multiply pro1
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Multiply pro2
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal heaMaxFlo1(
    
final realTrue=VHeaMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add3
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add4
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant setBacMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.setBack)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant warUpMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.warmUp)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal ifOcc
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal ifCooDow
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal ifSetUp
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal ifWarUp
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal ifSetBac
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant heaMaxAir(
    
final k=VHeaMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant heaMinAir(
    
final k=VHeaMin_flow)
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or1
    ;
equation 
  connect(occMod.y, ifOcc.u1);
  
connect(cooDowMod.y, ifCooDow.u1);
  
connect(setUpMod.y, ifSetUp.u1);
  
connect(warUpMod.y, ifWarUp.u1);
  
connect(uOpeMod, ifOcc.u2);
  
connect(uOpeMod, ifCooDow.u2);
  
connect(uOpeMod, ifSetUp.u2);
  
connect(uOpeMod, ifWarUp.u2);
  
connect(uOpeMod, ifSetBac.u2);
  
connect(setBacMod.y, ifSetBac.u1);
  
connect(ifOcc.y, or3.u1);
  
connect(ifCooDow.y, or3.u2);
  
connect(ifOcc.y, occModInd.u);
  
connect(VOccMin_flow, pro.u2);
  
connect(occModInd.y, pro.u1);
  
connect(VOccMin_flow, max1.u1);
  
connect(heaMinAir.y, max1.u2);
  
connect(VOccMin_flow, max2.u1);
  
connect(heaMaxAir.y, max2.u2);
  
connect(max1.y, pro1.u2);
  
connect(occModInd.y, pro1.u1);
  
connect(ifCooDow.y, heaMinFlo.u);
  
connect(ifWarUp.y, or2.u1);
  
connect(or2.y, heaMaxFlo.u);
  
connect(ifSetBac.y, or2.u2);
  
connect(heaMinFlo.y, add2.u1);
  
connect(heaMaxFlo.y, add2.u2);
  
connect(pro1.y, add1.u1);
  
connect(add2.y, add1.u2);
  
connect(max2.y, pro2.u2);
  
connect(occModInd.y, pro2.u1);
  
connect(or2.y, cooMaxFlo.u);
  
connect(ifCooDow.y, heaMaxFlo1.u);
  
connect(heaMaxFlo1.y, add3.u2);
  
connect(cooMaxFlo.y, add3.u1);
  
connect(pro2.y, add4.u1);
  
connect(add3.y, add4.u2);
  
connect(actCooMax.y, VActCooMax_flow);
  
connect(pro.y, VActCooMin_flow);
  
connect(pro.y, VActMin_flow);
  
connect(add1.y, VActHeaMin_flow);
  
connect(add4.y, VActHeaMax_flow);
  
connect(or3.y, or1.u1);
  
connect(or1.y, actCooMax.u);
  
connect(ifSetUp.y, or1.u2);
end ActiveAirFlow;
 
Generate alarms of terminal unit with reheat
 
Information
This block outputs alarms of terminal unit with reheat. The implementation is according
to the Section 5.6.6 of ASHRAE Guideline 36, May 2020.
Low airflow
- 
If the zone is in occupied mode and after the AHU supply fan has been enabled for staTim,
if the measured airflowVDis_flowis less than 70% of setpointVActSet_flowfor 5 minutes (lowFloTim) while the setpoint
is greater than zero, generate a Level 3 alarm.
- 
If the zone is in occupied mode and after the AHU supply fan has been enabled for staTim,
if the measured airflowVDis_flowis less than 50% of setpointVActSet_flowfor 5 minutes (lowFloTim) while the setpoint
is greater than zero, generate a Level 2 alarm.
- 
If a zone has an importance multiplier (staPreMul) of 0 for its
static pressure reset Trim-Respond control loop, low airflow alarms shall be
suppressed for that zone.
Low-discharging air temperature
- 
If the zone is in occupied mode
and if heating hot-water plant is proven on (u1HotPla=true), and the
discharge temperature (TDis) is 8 °C (15 °F) less than the
setpoint (TDisSet) for 10 minuts (lowTemTim), generate a
Level 3 alarm.
- 
If the zone is in occupied mode
and if heating hot-water plant is proven on (u1HotPla=true), and the
discharge temperature (TDis) is 17 °C (30 °F) less than the
setpoint (TDisSet) for 10 minuts (lowTemTim), generate a
Level 2 alarm.
- 
If a zone has an importance multiplier (hotWatRes) of 0 for its
hot-water reset Trim-Respond control loop, low discharing air temperature alarms
shall be suppressed for that zone.
Airflow sensor calibration
If the fan serving the zone has been OFF (u1Fan=false) for 10 minutes
(fanOffTim), and airflow sensor reading VDis_flow
is above 10% of the cooling maximum airflow setpoint VCooMax_flow,
generate a Level 3 alarm.
Leaking damper
If the damper position (uDam) is 0% and airflow sensor reading
VDis_flow is above 10% of the cooling maximum airflow setpoint
VCooMax_flow for 10 minutes (leaFloTim) while the
fan serving the zone is proven on (u1Fan=true), generate a Level
4 alarm.
Leaking valve
If the valve position (uVal) is 0% for 15 minutes (valCloTim),
discharing air temperature TDis is above AHU supply temperature
TSup by 3 °C (5 °F), and the fan serving the zone is proven
on (u1Fan=true), gemerate a Level 4 alarm.
Parameters
| Type | Name | Default | Description | 
|---|
| HeatingCoil | heaCoi | Buildings.Controls.OBC.ASHRA... | Heating coil type | 
| Real | staPreMul |  | Importance multiplier for the zone static pressure reset control loop | 
| Real | hotWatRes |  | Importance multiplier for the hot water reset control loop | 
| Real | VCooMax_flow |  | Design zone cooling maximum airflow rate [m3/s] | 
| Real | lowFloTim | 300 | Threshold time to check low flow rate [s] | 
| Real | lowTemTim | 600 | Threshold time to check low discharge temperature [s] | 
| Real | fanOffTim | 600 | Threshold time to check fan off [s] | 
| Real | leaFloTim | 600 | Threshold time to check damper leaking airflow [s] | 
| Real | valCloTim | 900 | Threshold time to check valve leaking water flow [s] | 
| Advanced | 
| Real | floHys | 0.05 | Near zero flow rate, below which the flow rate or difference will be seen as zero [m3/s] | 
| Real | dTHys | 0.25 | Temperature difference hysteresis below which the temperature difference will be seen as zero [K] | 
| Real | damPosHys | 0.05 | Near zero damper position, below which the damper will be seen as closed [1] | 
| Real | valPosHys | 0.05 | Near zero valve position, below which the valve will be seen as closed [1] | 
| Real | staTim | 1800 | Delay triggering alarms after enabling AHU supply fan [s] | 
Connectors
| Type | Name | Description | 
|---|
| input RealInput | VDis_flow | Measured discharge airflow rate airflow rate [m3/s] | 
| input RealInput | VActSet_flow | Active airflow setpoint [m3/s] | 
| input BooleanInput | u1Fan | AHU supply fan status | 
| input IntegerInput | uOpeMod | Zone operation mode | 
| input RealInput | uDam | Damper position setpoint [1] | 
| input RealInput | uVal | Actual valve position [1] | 
| input RealInput | TSup | Air handler supply air temperature [K] | 
| input BooleanInput | u1HotPla | Hot water plant status | 
| input RealInput | TDis | Measured discharge air temperature [K] | 
| input RealInput | TDisSet | Discharge air temperature setpoint [K] | 
| output IntegerOutput | yLowFloAla | Low airflow alarms | 
| output IntegerOutput | yFloSenAla | Airflow sensor calibration alarm | 
| output IntegerOutput | yLeaDamAla | Leaking damper alarm | 
| output IntegerOutput | yLeaValAla | Leaking valve alarm | 
| output IntegerOutput | yLowTemAla | Low discharge air temperature alarms | 
Modelica definition
block Alarms 
  
parameter Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil heaCoi=Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
parameter Real staPreMul
    ;
  
parameter Real hotWatRes
    ;
  
parameter Real VCooMax_flow(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")
    ;
  
parameter Real lowFloTim(
    
final unit="s",
    
final quantity="Time")=300
    ;
  
parameter Real lowTemTim(
    
final unit="s",
    
final quantity="Time")=600
    ;
  
parameter Real fanOffTim(
    
final unit="s",
    
final quantity="Time")=600
    ;
  
parameter Real leaFloTim(
    
final unit="s",
    
final quantity="Time")=600
    ;
  
parameter Real valCloTim(
    
final unit="s",
    
final quantity="Time")=900
    ;
  
parameter Real floHys(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")=0.05
    ;
  
parameter Real dTHys(
    
final unit="K",
    
final quantity="TemperatureDifference")=0.25
    ;
  
parameter Real damPosHys(
    
final unit="1")=0.05
    ;
  
parameter Real valPosHys(
    
final unit="1")=0.05
    ;
  
parameter Real staTim(
    
final unit="s",
    
final quantity="Time")=1800
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActSet_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate") ;
  
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Fan
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uDam(
    
final min=0,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uVal(
    
final min=0,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSup(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HotPla 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDisSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature") 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yLowFloAla
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yFloSenAla
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yLeaDamAla
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yLeaValAla
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yLowTemAla
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(
    
final k=0.5)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Less les(
    
final h=floHys)
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel(
    
final delayTime=lowFloTim)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(t=floHys,
      
final h=0.5*floHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Greater gre(
    
final h=floHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
    
final k=0.7)
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel1(
    
final delayTime=lowFloTim)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and2
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and1
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch lowFloAla
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt(
    
final k=2)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt(
    
final integerTrue=3)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conInt1(
    
final k=staPreMul)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr1
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1
    ;
  
Buildings.Controls.OBC.CDL.Integers.Multiply proInt
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and4
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not1
    ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes(
    
final message="Warning: airflow is less than 50% of the setpoint.")
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and12
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not2
    ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes1(
    
final message="Warning: airflow is less than 70% of the setpoint.")
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant cooMaxFlo(
    
final k=VCooMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
    
final k=0.1)
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not3
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel2(
    
final delayTime=fanOffTim)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Greater gre1(
    
final h=floHys)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and5
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not4
    ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes2(
    
final message="Warning: airflow sensor should be calibrated.")
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2(
    
final integerTrue=3)
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel3(
    
final delayTime=leaFloTim)
    ;
  
Buildings.Controls.OBC.CDL.Reals.LessThreshold cloDam(
    
final t=damPosHys,
    
final h=0.5*damPosHys) ;
  
Buildings.Controls.OBC.CDL.Logical.And leaDamAla
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not5 ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes3(
    
final message="Warning: the damper is leaking.")
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3(
    
final integerTrue=4)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Less les1(
    
final h=dTHys) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(
    
final p=-17) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.Less les2(
    
final h=dTHys) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar1(
    
final p=-8) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel4(
    
final delayTime=lowTemTim) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel5(
    
final delayTime=lowTemTim) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and6 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and7 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not6 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes4(
    
final message="Warning: discharge air temperature is 17 degC less than the setpoint.")
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch lowTemAla 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt2(
    
final k=2) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and8 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt4(
    
final integerTrue=3) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and9 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not7 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes5(
    
final message="Warning: discharge air temperature is 8 degC less than the setpoint.")
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conInt3(
    
final k=hotWatRes) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr2
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt5
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Multiply proInt1 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel6(
    
final delayTime=valCloTim)
    ;
  
Buildings.Controls.OBC.CDL.Reals.LessThreshold cloVal(
    
final t=valPosHys,
    
final h=0.5*valPosHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar2(
    
final p=3)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Greater gre2(
    
final h=dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And leaValAla
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt6(
    
final integerTrue=4)
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not8 ;
  
Buildings.Controls.OBC.CDL.Utilities.Assert assMes6(
    
final message="Warning: the valve is leaking.")
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel7(
    
final delayTime=lowFloTim)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And fanHotPlaOn 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And  and10
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and11
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay fanIni(
    
final delayTime=staTim)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal isOcc
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant occMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.occupied)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and3
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and13
    ;
  
Buildings.Controls.OBC.CDL.Logical.And leaDamAla1
    ;
  
Buildings.Controls.OBC.CDL.Logical.And leaValAla1
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and14 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and15 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
equation 
  connect(VActSet_flow, gai.u);
  
connect(VDis_flow, les.u1);
  
connect(VActSet_flow, greThr.u);
  
connect(VActSet_flow, gai1.u);
  
connect(VDis_flow, gre.u2);
  
connect(gai1.y, gre.u1);
  
connect(truDel.y, and2.u1);
  
connect(truDel1.y, and1.u2);
  
connect(conInt.y, lowFloAla.u1);
  
connect(booToInt.y, lowFloAla.u3);
  
connect(conInt1.y, greThr1.u);
  
connect(greThr1.y, booToInt1.u);
  
connect(lowFloAla.y, proInt.u1);
  
connect(booToInt1.y, proInt.u2);
  
connect(not1.y, assMes.u);
  
connect(and2.y,and4. u1);
  
connect(greThr1.y,and4. u2);
  
connect(and1.y, and12.u1);
  
connect(greThr1.y, and12.u2);
  
connect(not2.y, assMes1.u);
  
connect(cooMaxFlo.y, gai2.u);
  
connect(u1Fan, not3.u);
  
connect(gai2.y, gre1.u2);
  
connect(gre1.y, and5.u1);
  
connect(not4.y, assMes2.u);
  
connect(booToInt2.y, yFloSenAla);
  
connect(proInt.y, yLowFloAla);
  
connect(uDam, cloDam.u);
  
connect(u1Fan, leaDamAla.u2);
  
connect(not5.y, assMes3.u);
  
connect(booToInt3.y, yLeaDamAla);
  
connect(VDis_flow, gre1.u1);
  
connect(TDis, les1.u1);
  
connect(TDisSet, addPar.u);
  
connect(addPar.y, les1.u2);
  
connect(TDis, les2.u1);
  
connect(TDisSet, addPar1.u);
  
connect(addPar1.y, les2.u2);
  
connect(les1.y, truDel4.u);
  
connect(les2.y, truDel5.u);
  
connect(truDel4.y, and6.u1);
  
connect(conInt2.y, lowTemAla.u1);
  
connect(not6.y, assMes4.u);
  
connect(truDel5.y, and8.u1);
  
connect(and8.y, and9.u1);
  
connect(booToInt4.y, lowTemAla.u3);
  
connect(not7.y, assMes5.u);
  
connect(conInt3.y, greThr2.u);
  
connect(greThr2.y, booToInt5.u);
  
connect(lowTemAla.y, proInt1.u1);
  
connect(booToInt5.y, proInt1.u2);
  
connect(greThr2.y, and7.u2);
  
connect(greThr2.y, and9.u2);
  
connect(proInt1.y, yLowTemAla);
  
connect(uVal, cloVal.u);
  
connect(TSup, addPar2.u);
  
connect(TDis, gre2.u1);
  
connect(addPar2.y, gre2.u2);
  
connect(not8.y, assMes6.u);
  
connect(booToInt6.y, yLeaValAla);
  
connect(greThr.y, truDel7.u);
  
connect(truDel7.y, and1.u1);
  
connect(truDel7.y, and2.u2);
  
connect(u1HotPla, fanHotPlaOn.u1);
  
connect(fanHotPlaOn.y, and6.u2);
  
connect(fanHotPlaOn.y, and8.u2);
  
connect(u1Fan, fanHotPlaOn.u2);
  
connect(gre1.y, leaDamAla.u1);
  
connect(not3.y, and5.u2);
  
connect(and5.y, truDel2.u);
  
connect(cloVal.y, leaValAla.u1);
  
connect(u1Fan, leaValAla.u2);
  
connect(les.y, and10.u1);
  
connect(and10.y, truDel.u);
  
connect(gre.y, and11.u1);
  
connect(and11.y, truDel1.u);
  
connect(u1Fan, fanIni.u);
  
connect(fanIni.y, and11.u2);
  
connect(fanIni.y, and10.u2);
  
connect(uOpeMod, isOcc.u1);
  
connect(occMod.y, isOcc.u2);
  
connect(and6.y, and7.u1);
  
connect(truDel3.y, booToInt3.u);
  
connect(truDel3.y, not5.u);
  
connect(truDel6.y, booToInt6.u);
  
connect(truDel6.y, not8.u);
  
connect(truDel2.y, booToInt2.u);
  
connect(truDel2.y, not4.u);
  
connect(gai.y, les.u2);
  
connect(and4.y, and13.u1);
  
connect(and12.y, and3.u1);
  
connect(and3.y, booToInt.u);
  
connect(and13.y, lowFloAla.u2);
  
connect(and13.y, not1.u);
  
connect(and3.y, not2.u);
  
connect(isOcc.y, and13.u2);
  
connect(isOcc.y, and3.u2);
  
connect(leaDamAla.y, leaDamAla1.u1);
  
connect(leaDamAla1.y, truDel3.u);
  
connect(leaValAla.y, leaValAla1.u1);
  
connect(leaValAla1.y, truDel6.u);
  
connect(cloDam.y, leaDamAla1.u2);
  
connect(gre2.y, leaValAla1.u2);
  
connect(and7.y, and15.u1);
  
connect(and9.y, and14.u1);
  
connect(and14.y, booToInt4.u);
  
connect(and15.y, lowTemAla.u2);
  
connect(isOcc.y, and15.u2);
  
connect(isOcc.y, and14.u2);
  
connect(and15.y, not6.u);
  
connect(and14.y, not7.u);
end Alarms;
 
Output signals for controlling VAV reheat box damper and valve position
 
Information
This sequence sets the damper and valve position for VAV reheat terminal unit.
The implementation is according to Section 5.6.5 of ASHRAE Guideline 36, May 2020. The
calculation is done following the steps below.
- 
When the zone state is cooling (uCoo > 0), then the cooling loop outputuCooshall be mapped to the airflow
setpoint from the cooling minimumVActCooMin_flowto the cooling maximumVActCooMax_flowairflow setpoints. The heating coil is disabled (yVal=0)
unless the discharge air temperatureTDisis below the minimum
setpoint (10 °C).
- 
If supply air temperature TSupfrom the AHU is greater than
room temperatureTZon, cooling supply airflow setpoint shall be
no higher than the minimum.
 
- 
When the zone state is Deadband (uCoo=0anduHea=0), then
the active airflow setpoint shall be the minimum airflow setpointVActMin_flow.
The heating coil is disabled unless the discharge air temperature is below the minimum
setpoint (10 °C).
- 
When the zone state is Heating (uHea > 0), then the heating loop shall
maintain space temperature at the heating setpoint as follows:
- 
From 0% to 50%, the heating loop output uHeashall reset the
discharge temperature setpoint from current AHU SAT setpointTSupSetto a maximum ofdTDisZonSetMaxabove space temperature setpoint. The airflow
setpoint shall be the heating minimumVActHeaMin_flow.
- 
From 50% to 100%, if the discharge air temperature TDisis
greater than room temperature plus 3 Kelvin, the heating loop outputuHeashall reset the airflow setpoint from the heating minimum airflow setpointVActHeaMin_flowto the heating maximum airflow setpointVActHeaMax_flow.
- 
The heating coil shall be modulated to maintain the discharge temperature at setpoint.
 
- 
The VAV damper shall be modulated by a control loop to maintain the measured
airflow at the active setpoint.
- 
In occupied mode, the heating coil shall be modulated a discharge temperature
no lower than 10 °C (50 °F).
The sequences of controlling damper and valve position for VAV reheat terminal
unit are described in the following figure below.
 
As specified in Section 5.6.7 of ASHRAE Guideline 36, the airflow setpoint could be
override by providing software switches that interlock to a system-level point to:
- 
when oveFloSetequals to 1, force the zone airflow setpointVSet_flowto zero,
- 
when oveFloSetequals to 2, force the zone airflow setpointVSet_flowto zone cooling maximum airflow rateVCooMax_flow,
- 
when oveFloSetequals to 3, force the zone airflow setpointVSet_flowto zone minimum airflow setpointVMin_flow.
- 
when oveFloSetequals to 4, force the zone airflow setpointVSet_flowto zone heating maximum airflow setpointVHeaMax_flow.
Parameters
| Type | Name | Default | Description | 
|---|
| Real | dTDisZonSetMax | 11 | Zone maximum discharge air temperature above heating setpoint [K] | 
| Real | TDisMin | 283.15 | Lowest discharge air temperature [K] | 
| Real | VMin_flow |  | Design zone minimum airflow setpoint [m3/s] | 
| Real | VCooMax_flow |  | Design zone cooling maximum airflow rate [m3/s] | 
| Real | VHeaMax_flow |  | Design zone heating maximum airflow rate [m3/s] | 
| Valve | 
| SimpleController | controllerTypeVal | Buildings.Controls.OBC.CDL.T... | Type of controller | 
| Real | kVal | 0.5 | Gain of controller for valve control [1/K] | 
| Real | TiVal | 300 | Time constant of integrator block for valve control [s] | 
| Real | TdVal | 0.1 | Time constant of derivative block for valve control [s] | 
| Damper | 
| SimpleController | controllerTypeDam | Buildings.Controls.OBC.CDL.T... | Type of controller | 
| Real | kDam | 0.5 | Gain of controller for damper control [1] | 
| Real | TiDam | 300 | Time constant of integrator block for damper control [s] | 
| Real | TdDam | 0.1 | Time constant of derivative block for damper control [s] | 
| Advanced | 
| Real | dTHys | 0.25 | Temperature difference hysteresis below which the temperature difference will be seen as zero [K] | 
| Real | looHys | 0.01 | Loop output hysteresis below which the output will be seen as zero [1] | 
| Real | iniDam | 0.01 | Initial damper position when the damper control is enabled [1] | 
Connectors
| Type | Name | Description | 
|---|
| input IntegerInput | oveFloSet | Index of overriding flow setpoint, 1: set to zero; 2: set to cooling maximum; 3: set to minimum flow; 4: set to heating maximum | 
| input RealInput | VDis_flow | Measured primary discharge airflow rate [m3/s] | 
| input RealInput | VActCooMin_flow | Active cooling minimum airflow rate [m3/s] | 
| input RealInput | uCoo | Cooling control signal [1] | 
| input RealInput | VActCooMax_flow | Active cooling maximum airflow rate [m3/s] | 
| input RealInput | TSup | Temperature of the air supplied from central air handler [K] | 
| input RealInput | VActMin_flow | Active minimum airflow rate [m3/s] | 
| input BooleanInput | u1Fan | AHU supply fan status | 
| input RealInput | TDis | Measured discharge air temperature [K] | 
| input RealInput | TSupSet | Supply air temperature setpoint from central air handler [K] | 
| input RealInput | THeaSet | Zone heating setpoint temperature [K] | 
| input RealInput | uHea | Heating control signal [1] | 
| input RealInput | TZon | Measured zone temperature [K] | 
| input RealInput | VActHeaMin_flow | Active heating minimum airflow rate [m3/s] | 
| input RealInput | VActHeaMax_flow | Active heating maximum airflow rate [m3/s] | 
| input IntegerInput | uOpeMod | Zone operation mode | 
| output RealOutput | VSet_flow | Commanded discharge airflow setpoint [m3/s] | 
| output RealOutput | yDam | VAV damper commanded position [1] | 
| output RealOutput | yVal | Reheater valve commanded position [1] | 
| output RealOutput | TDisSet | Discharge airflow setpoint temperature [K] | 
Modelica definition
block DamperValves
  
  
parameter Real dTDisZonSetMax(unit="K")=11
    ;
  
parameter Real TDisMin(
    unit="K",
    displayUnit="degC")=283.15
    ;
  
parameter Real VMin_flow(unit="m3/s")
    ;
  
parameter Real VCooMax_flow(unit="m3/s")
    ;
  
parameter Real VHeaMax_flow(unit="m3/s")
    ;
  
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeVal=
    Buildings.Controls.OBC.CDL.Types.SimpleController.PI
    ;
  
parameter Real kVal(unit="1/K")=0.5
    ;
  
parameter Real TiVal(unit="s")=300
    ;
  
parameter Real TdVal(unit="s")=0.1
    ;
  
parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeDam=
    Buildings.Controls.OBC.CDL.Types.SimpleController.PI
    ;
  
parameter Real kDam(unit="1")=0.5
    ;
  
parameter Real TiDam(unit="s")=300
    ;
  
parameter Real TdDam(unit="s")=0.1
    ;
  
parameter Real dTHys(unit="K")=0.25
    ;
  
parameter Real looHys(unit="1")=0.01
    ;
  
parameter Real iniDam(unit="1")=0.01
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput oveFloSet
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActCooMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uCoo(
    
final min=0,
    
final max=1,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActCooMax_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSup(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Fan
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uHea(
    
final min=0,
    
final max=1,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActHeaMin_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VActHeaMax_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput VSet_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate") ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yDam(
    
final min=0,
    
final max=1,
    
final unit="1") ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal(
    
final min=0,
    
final max=1,
    
final unit="1") ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput TDisSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
protected 
  Buildings.Controls.OBC.CDL.Logical.And and4 ;
  
Buildings.Controls.OBC.CDL.Reals.Line lin
    ;
  
Buildings.Controls.OBC.CDL.Reals.PIDWithReset conDam(
    
final controllerType=controllerTypeDam,
    
final k=kDam,
    
final Ti=TiDam,
    
final Td=TdDam,
    
final yMax=1,
    
final yMin=0,
    
final y_reset=iniDam)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi5
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not1
    ;
  
Buildings.Controls.OBC.CDL.Logical.Not not2
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Line lin3
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Greater gre(
    
final h=dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Line conTDisHeaSet
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi3
    ;
  
Buildings.Controls.OBC.CDL.Reals.PIDWithReset conVal(
    
final controllerType=controllerTypeVal,
    
final k=kVal,
    
final Ti=TiVal,
    
final Td=TdVal,
    
final yMax=1,
    
final yMin=0,
    u_s(
final unit="K", displayUnit="degC"),
    u_m(
final unit="K", displayUnit="degC"))
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conZer(
    
final k=0) ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conOne(
    
final k=1) ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr1(
    
final t=looHys,
    
final h=0.5*looHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(
    
final t=dTHys,
    
final h=0.5*dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Subtract sub2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch watValPosUno ;
  
Buildings.Controls.OBC.CDL.Reals.Switch damPosUno ;
  
Buildings.Controls.OBC.CDL.Reals.Divide VDis_flowNor
    ;
  
Buildings.Controls.OBC.CDL.Reals.Divide VDisSet_flowNor
    ;
  
Buildings.Controls.OBC.CDL.Reals.LessThreshold lowMin(
    
final t=TDisMin,
    
final h=dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conZer2(
    
final k=0)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr2(
    
final t=looHys,
    
final h=0.8*looHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conHal1(
    
final k=0.5)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conOne2(
    
final k=1)
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar1(
    
final p=3)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conHal(
    
final k=0.5)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant conZer3(
    
final k=0)
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(
    
final p=dTDisZonSetMax)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant lowDisAirTem(
    
final k=TDisMin)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi4
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant occMod(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.occupied)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal isOcc
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant  unOcc(
    
final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.unoccupied)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal isUno
    ;
  
Buildings.Controls.OBC.CDL.Reals.Max max1
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt(
final k=1)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal forZerFlo
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal forCooMax
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt1(
final k=2)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal forMinFlo
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt2(
final k=3)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal zerFlo(
    
final realTrue=0)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal cooMax(
    
final realTrue=VCooMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal minFlo(
    
final realTrue=VMin_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi6
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or3
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt5(
    
final k=4)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal forMinFlo1
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal heaMax(
    
final realTrue=VHeaMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add4
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant cooMax1(
    
final k=VCooMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Sources.Constant heaMax1(
    
final k=VHeaMax_flow)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Max max2 ;
  
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol(
    
final trueHoldDuration=600,
    
final falseHoldDuration=0)
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1(
    
final trueHoldDuration=600,
    
final falseHoldDuration=0)
    ;
  
Buildings.Controls.OBC.CDL.Logical.Or or4
    ;
equation 
  connect(uCoo, lin.u);
  
connect(conZer.y, lin.x1);
  
connect(VActCooMin_flow, lin.f1);
  
connect(conOne.y, lin.x2);
  
connect(VActCooMax_flow, lin.f2);
  
connect(uCoo, greThr1.u);
  
connect(and4.y, swi5.u2);
  
connect(lin.y, swi5.u3);
  
connect(swi5.y, swi.u1);
  
connect(TSup, sub2.u1);
  
connect(TZon, sub2.u2);
  
connect(sub2.y, greThr.u);
  
connect(greThr.y, and4.u2);
  
connect(watValPosUno.y,yVal);
  
connect(conDam.y, damPosUno.u3);
  
connect(damPosUno.y, yDam);
  
connect(VDis_flow, VDis_flowNor.u1);
  
connect(VDis_flowNor.y, conDam.u_m);
  
connect(VDisSet_flowNor.y, conDam.u_s);
  
connect(VActMin_flow, swi5.u1);
  
connect(TDis, lowMin.u);
  
connect(uHea, greThr2.u);
  
connect(not1.y, and2.u1);
  
connect(not2.y, and2.u2);
  
connect(and2.y, swi1.u2);
  
connect(VActMin_flow, swi1.u1);
  
connect(conHal1.y, lin3.x1);
  
connect(VActHeaMin_flow, lin3.f1);
  
connect(conOne2.y, lin3.x2);
  
connect(VActHeaMax_flow, lin3.f2);
  
connect(uHea, lin3.u);
  
connect(TZon, addPar1.u);
  
connect(TDis, gre.u1);
  
connect(addPar1.y, gre.u2);
  
connect(gre.y, swi2.u2);
  
connect(VActHeaMin_flow, swi2.u3);
  
connect(lin3.y, swi2.u1);
  
connect(swi2.y, swi1.u3);
  
connect(swi1.y, swi.u3);
  
connect(THeaSet, addPar.u);
  
connect(conZer3.y, conTDisHeaSet.x1);
  
connect(conHal.y, conTDisHeaSet.x2);
  
connect(TSupSet, conTDisHeaSet.f1);
  
connect(addPar.y, conTDisHeaSet.f2);
  
connect(uHea, conTDisHeaSet.u);
  
connect(conTDisHeaSet.y, swi3.u1);
  
connect(swi3.y, conVal.u_s);
  
connect(TDis, conVal.u_m);
  
connect(or2.y, conVal.trigger);
  
connect(or2.y, swi4.u2);
  
connect(conVal.y, swi4.u1);
  
connect(conZer2.y, swi4.u3);
  
connect(conZer2.y, watValPosUno.u1);
  
connect(swi4.y, watValPosUno.u3);
  
connect(uOpeMod, isOcc.u2);
  
connect(occMod.y, isOcc.u1);
  
connect(lowMin.y, and1.u1);
  
connect(isOcc.y, and1.u2);
  
connect(and1.y, or2.u1);
  
connect(swi3.y, TDisSet);
  
connect(unOcc.y, isUno.u1);
  
connect(uOpeMod, isUno.u2);
  
connect(conZer2.y, damPosUno.u1);
  
connect(isUno.y, damPosUno.u2);
  
connect(isUno.y, watValPosUno.u2);
  
connect(TSupSet, max1.u1);
  
connect(lowDisAirTem.y, max1.u2);
  
connect(oveFloSet,forZerFlo. u1);
  
connect(conInt.y,forZerFlo. u2);
  
connect(oveFloSet,forCooMax. u1);
  
connect(conInt1.y,forCooMax. u2);
  
connect(oveFloSet,forMinFlo. u1);
  
connect(conInt2.y,forMinFlo. u2);
  
connect(forZerFlo.y,zerFlo. u);
  
connect(forCooMax.y,cooMax. u);
  
connect(forMinFlo.y,minFlo. u);
  
connect(zerFlo.y,add1. u1);
  
connect(forZerFlo.y,or3. u1);
  
connect(forCooMax.y,or3. u2);
  
connect(add1.y, swi6.u1);
  
connect(oveFloSet,forMinFlo1. u1);
  
connect(conInt5.y,forMinFlo1. u2);
  
connect(forMinFlo1.y,heaMax. u);
  
connect(minFlo.y,add4. u1);
  
connect(heaMax.y,add4. u2);
  
connect(forMinFlo1.y,or1. u2);
  
connect(or1.y, swi6.u2);
  
connect(add2.y, add1.u2);
  
connect(add4.y, add2.u2);
  
connect(cooMax.y, add2.u1);
  
connect(swi.y, swi6.u3);
  
connect(swi6.y, VDisSet_flowNor.u1);
  
connect(swi6.y, VSet_flow);
  
connect(cooMax1.y, max2.u1);
  
connect(heaMax1.y, max2.u2);
  
connect(max2.y, VDisSet_flowNor.u2);
  
connect(max2.y, VDis_flowNor.u2);
  
connect(greThr2.y, truFalHol.u);
  
connect(greThr1.y, truFalHol1.u);
  
connect(truFalHol1.y, not1.u);
  
connect(truFalHol1.y, and4.u1);
  
connect(truFalHol1.y, swi.u2);
  
connect(truFalHol.y, not2.u);
  
connect(truFalHol.y, or2.u2);
  
connect(truFalHol.y, swi3.u2);
  
connect(u1Fan, conDam.trigger);
  
connect(max1.y, swi3.u3);
  
connect(forMinFlo.y, or4.u2);
  
connect(or3.y, or4.u1);
  
connect(or4.y, or1.u1);
end DamperValves;
 
Software switches to override setpoints
 
Information
This block considers the overrides to the setpoints for terminal unit with reheat.
The implementation is according to the Section 5.6.7 of ASHRAE Guideline 36,
May 2020.
Provide software switches that interlock to a system-level point to:
- 
when oveDamPosequals to 1, force the damper to full closed by settingyDamto 0,
- 
when oveDamPosequals to 2, force the damper to full open by settingyDamto 1.
- 
when uHeaOffequals totrue, force the heating valve to
full closed by settingyValto 0.
Connectors
| Type | Name | Description | 
|---|
| input IntegerInput | oveDamPos | Index of overriding damper position, 1: set to close; 2: set to open | 
| input RealInput | uDam | Damper commanded position [1] | 
| input BooleanInput | uHeaOff | Override heating valve position, true: close heating valve | 
| input RealInput | uVal | Heating valve commanded position [1] | 
| output RealOutput | yDam | Damper commanded position, after considering override [1] | 
| output RealOutput | yVal | Heating valve commanded position, after considering override [1] | 
Modelica definition
block Overrides 
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput oveDamPos
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uDam(
    
final min=0,
    
final unit="1") ;
  
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHeaOff
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uVal(
    
final min=0,
    
final unit="1") ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yDam(
    
final min=0,
    
final unit="1") ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal(
    
final min=0,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt3(
    
final k=1)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal intEqu3
    ;
  
Buildings.Controls.OBC.CDL.Integers.Equal intEqu4
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant conInt4(
    
final k=2)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal cloDam(
    
final realTrue=0)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal opeDam(
    
final realTrue=1)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Add add3 ;
  
Buildings.Controls.OBC.CDL.Logical.Or or2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Switch swi1
    ;
  
Buildings.Controls.OBC.CDL.Reals.Multiply pro
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(
    
final realTrue=0,
    
final realFalse=1)
    ;
equation 
  connect(conInt3.y, intEqu3.u2);
  
connect(conInt4.y,intEqu4. u2);
  
connect(oveDamPos, intEqu3.u1);
  
connect(oveDamPos, intEqu4.u1);
  
connect(intEqu3.y, cloDam.u);
  
connect(intEqu4.y, opeDam.u);
  
connect(cloDam.y, add3.u1);
  
connect(opeDam.y, add3.u2);
  
connect(intEqu3.y, or2.u1);
  
connect(intEqu4.y, or2.u2);
  
connect(add3.y, swi1.u1);
  
connect(or2.y, swi1.u2);
  
connect(uDam, swi1.u3);
  
connect(swi1.y, yDam);
  
connect(uHeaOff, booToRea.u);
  
connect(booToRea.y, pro.u1);
  
connect(uVal, pro.u2);
  
connect(pro.y,yVal);
end Overrides;
 
Output system requests for VAV terminal unit with reheat
 
Information
This sequence outputs the system reset requests for terminal unit with reheat. The
implementation is according to the Section 5.6.8 of ASHRAE Guideline 36, May 2020. 
Cooling SAT reset requests yZonTemResReq
- 
If the zone temperature TZonexceeds the zone cooling setpointTCooSetby 3 °C (5 °F)) for 2 minutes and after suppression
period (uAftSup=true) due to setpoint change per G36 Part 5.1.20,
send 3 requests (yZonTemResReq=3).
- 
Else if the zone temperature TZonexceeds the zone cooling setpointTCooSetby 2 °C (3 °F) for 2 minutes and after suppression
period (uAftSup=true) due to setpoint change per G36 Part 5.1.20,
send 2 requests (yZonTemResReq=2).
- 
Else if the cooling loop uCoois greater than 95%, send 1 request
(yZonTemResReq=1) untiluCoois less than 85%.
- 
Else if uCoois less than 95%, send 0 request (yZonTemResReq=0).
Static pressure reset requests yZonPreResReq
- 
If the measured airflow VDis_flowis less than 50% of setpointVSet_flowwhile the setpoint is greater than zero and the damper positionuDamis greater than 95% for 1 minute, send 3 requests (yZonPreResReq=3).
- 
Else if the measured airflow VDis_flowis less than 70% of setpointVSet_flowwhile the setpoint is greater than zero and the damper positionuDamis greater than 95% for 1 minute, send 2 requests (yZonPreResReq=2).
- 
Else if the damper position uDamis greater than 95%, send 1 request
(yZonPreResReq=1) untiluDamis less than 85%.
- 
Else if the damper position uDamis less than 95%, send 0 request
(yZonPreResReq=0).
If there is a hot-water coil, hot-water reset requests
yHeaValResReq
- 
If the discharging air temperature TDisis 17 °C (30 °F)thrTDis_1less than the setpointTDisSetfor 5 minutes, send 3 requests.
- 
Else ff the discharging air temperature TDisis 8 °C (15 °F)thrTDis_1less than the setpointTDisSetfor 5 minutes, send 2 requests.
- 
Else if the hot water valve position uValis greater than 95%, send 1
request until the hot water valve position is less than 85%.
- 
Else if the hot water valve position uValis less than 95%, send 0 request.
If there is a hot-water coil and heating hot-water plant, heating hot-water
plant reqeusts. Send the heating hot-water plant that serves the zone a heating
hot-water plant request as follows:
- 
If the hot water valve position uValis greater than 95%, send 1
request until the hot water valve position is less than 10%.
- 
If the hot water valve position uValis less than 95%, send 0 requests.
Parameters
| Type | Name | Default | Description | 
|---|
| HeatingCoil | heaCoi | Buildings.Controls.OBC.ASHRA... | Heating coil type | 
| Real | thrTemDif | 3 | Threshold difference between zone temperature and cooling setpoint for generating 3 cooling SAT reset requests [K] | 
| Real | twoTemDif | 2 | Threshold difference between zone temperature and cooling setpoint for generating 2 cooling SAT reset requests [K] | 
| Real | thrTDis_1 | 17 | Threshold difference between discharge air temperature and its setpoint for generating 3 hot water reset requests [K] | 
| Real | thrTDis_2 | 8 | Threshold difference between discharge air temperature and its setpoint for generating 2 hot water reset requests [K] | 
| Duration times | 
| Real | durTimTem | 120 | Duration time of zone temperature exceeds setpoint [s] | 
| Real | durTimFlo | 60 | Duration time of airflow rate less than setpoint [s] | 
| Real | durTimDisAir | 300 | Duration time of discharge air temperature less than setpoint [s] | 
| Advanced | 
| Real | dTHys | 0.25 | Near zero temperature difference, below which the difference will be seen as zero [K] | 
| Real | floHys |  | Near zero flow rate, below which the flow rate or difference will be seen as zero [m3/s] | 
| Real | looHys |  | Loop output hysteresis below which the output will be seen as zero [1] | 
| Real | damPosHys |  | Near zero damper position, below which the damper will be seen as closed [1] | 
| Real | valPosHys |  | Near zero valve position, below which the valve will be seen as closed [1] | 
| Real | samplePeriod | 120 | Sample period of component, set to the same value as the trim and respond that process yPreSetReq [s] | 
Connectors
| Type | Name | Description | 
|---|
| input BooleanInput | uAftSup | After suppression period due to the setpoint change | 
| input RealInput | TCooSet | Zone cooling setpoint temperature [K] | 
| input RealInput | TZon | Zone temperature [K] | 
| input RealInput | uCoo | Cooling loop signal [1] | 
| input RealInput | VSet_flow | Discharge airflow rate setpoint [m3/s] | 
| input RealInput | VDis_flow | Measured discharge airflow rate [m3/s] | 
| input RealInput | uDam | Damper position setpoint [1] | 
| input RealInput | TDisSet | Discharge airflow setpoint temperature for heating [K] | 
| input RealInput | TDis | Measured discharge airflow temperature [K] | 
| input RealInput | uVal | Hot water valve position setpoint [1] | 
| output IntegerOutput | yZonTemResReq | Zone cooling supply air temperature reset request | 
| output IntegerOutput | yZonPreResReq | Zone static pressure reset requests | 
| output IntegerOutput | yHeaValResReq | Hot water reset requests | 
| output IntegerOutput | yHotWatPlaReq | Request to heating hot-water plant | 
Modelica definition
block SystemRequests 
  
parameter Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil heaCoi=Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
parameter Real thrTemDif(
    
final unit="K",
    
final quantity="TemperatureDifference")=3
    ;
  
parameter Real twoTemDif(
    
final unit="K",
    
final quantity="TemperatureDifference")=2
    ;
  
parameter Real thrTDis_1(
    
final unit="K",
    
final quantity="TemperatureDifference")=17
    ;
  
parameter Real thrTDis_2(
    
final unit="K",
    
final quantity="TemperatureDifference")=8
    ;
  
parameter Real durTimTem(
    
final unit="s",
    
final quantity="Time")=120
    ;
  
parameter Real durTimFlo(
    
final unit="s",
    
final quantity="Time")=60
    ;
  
parameter Real durTimDisAir(
    
final unit="s",
    
final quantity="Time")=300
    ;
  
parameter Real dTHys(
    
final unit="K",
    
final quantity="TemperatureDifference")=0.25
    ;
  
parameter Real floHys(
    
final quantity="VolumeFlowRate",
    
final unit="m3/s")
    ;
  
parameter Real looHys(unit="1")
    ;
  
parameter Real damPosHys(
    
final unit="1")
    ;
  
parameter Real valPosHys(
    
final unit="1")
    ;
  
parameter Real samplePeriod(
    
final unit="s",
    
final quantity="Time")=120
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uAftSup
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uCoo(
    
final min=0,
    
final max=1,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VSet_flow(
    
final min=0,
    
final unit="m3/s",
    quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis_flow(
    
final min=0,
    
final unit="m3/s",
    
final quantity="VolumeFlowRate")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uDam(
    
final min=0,
    
final max=1,
    
final unit="1")
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDisSet(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature") 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis(
    
final unit="K",
    
final displayUnit="degC",
    
final quantity="ThermodynamicTemperature") 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.RealInput uVal(
    
final min=0,
    
final max=1,
    
final unit="1") 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonTemResReq
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonPreResReq
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yHeaValResReq 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yHotWatPlaReq 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
protected 
  Buildings.Controls.OBC.CDL.Reals.Less les(
    
final h=dTHys) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.Less les1(
    
final h=dTHys) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr1(
    
final t=thrTemDif,
    
final h=dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr2(
    
final t=twoTemDif,
    
final h=dTHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr3(
    
final t=0.95,
    
final h=damPosHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr(
    
final t=0.95, 
final h=looHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr4(
    
final t=floHys,
    
final h=0.5*floHys)
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1
    ;
  
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(
    
final k=0.5)
    ;
  
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(
    
final k=0.7)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Subtract sub2
    ;
  
Buildings.Controls.OBC.CDL.Reals.Subtract sub3
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and1
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and2
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and3
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and4
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant thrCooResReq(
    
final k=3)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant twoCooResReq(
    
final k=2) ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant thrPreResReq(
    
final k=3)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant twoPreResReq(
    
final k=2)
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch intSwi
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch intSwi1
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch swi4
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch swi5
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim1(
    
final delayTime=durTimTem) ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim2(
    
final delayTime=durTimTem) ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim3(
    
final delayTime=durTimFlo) ;
  
Buildings.Controls.OBC.CDL.Reals.Greater greEqu(
    
final h=floHys)
    ;
  
Buildings.Controls.OBC.CDL.Reals.Greater greEqu1(
    
final h=floHys)
    ;
  
Buildings.Controls.OBC.CDL.Logical.And and5
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(
    
final p=thrTDis_1) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.AddParameter addPar1(
    
final p=thrTDis_2) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant thrHeaResReq(
    
final k=3) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Sources.Constant twoHeaResReq(
    
final k=2) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch intSwi2
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Integers.Switch intSwi3
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim4(
    
final delayTime=durTimDisAir) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Logical.TrueDelay tim5(
    
final delayTime=durTimDisAir) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr5(
    
final t=0.95,
    
final h=valPosHys) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr6(
    
final t=0.95,
    
final h=0.85) 
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3
    
if heaCoi==Buildings.Controls.OBC.ASHRAE.G36.Types.HeatingCoil.WaterBased
    ;
  
Buildings.Controls.OBC.CDL.Discrete.Sampler sampler(
    
final samplePeriod=samplePeriod)
    ;
  
Buildings.Controls.OBC.CDL.Discrete.Sampler sampler1(
    
final samplePeriod=samplePeriod)
    ;
  
Buildings.Controls.OBC.CDL.Discrete.Sampler sampler2(
    
final samplePeriod=samplePeriod)
    ;
  
Buildings.Controls.OBC.CDL.Discrete.Sampler sampler3(
    
final samplePeriod=samplePeriod)
    ;
equation 
  connect(sub2.y, greThr1.u);
  
connect(and2.y, intSwi.u2);
  
connect(sub3.y, greThr2.u);
  
connect(and1.y, intSwi1.u2);
  
connect(and3.y, swi4.u2);
  
connect(and4.y, swi5.u2);
  
connect(greThr2.y, tim2.u);
  
connect(tim2.y, and1.u2);
  
connect(greThr1.y, tim1.u);
  
connect(tim1.y, and2.u2);
  
connect(greEqu.u1, gai1.y);
  
connect(greEqu.y, and3.u2);
  
connect(gai2.y, greEqu1.u1);
  
connect(greEqu1.y, and4.u2);
  
connect(uAftSup, and2.u1);
  
connect(uAftSup, and1.u1);
  
connect(thrCooResReq.y, intSwi.u1);
  
connect(twoCooResReq.y, intSwi1.u1);
  
connect(intSwi1.y, intSwi.u3);
  
connect(intSwi.y, yZonTemResReq);
  
connect(greThr.y, booToInt.u);
  
connect(booToInt.y, intSwi1.u3);
  
connect(greThr3.y, tim3.u);
  
connect(greThr4.y, and5.u1);
  
connect(tim3.y, and5.u2);
  
connect(and5.y, and3.u1);
  
connect(and5.y, and4.u1);
  
connect(greThr3.y, booToInt1.u);
  
connect(booToInt1.y, swi5.u3);
  
connect(twoPreResReq.y, swi5.u1);
  
connect(thrPreResReq.y, swi4.u1);
  
connect(swi5.y, swi4.u3);
  
connect(swi4.y, yZonPreResReq);
  
connect(TDis,addPar. u);
  
connect(TDis,addPar1. u);
  
connect(tim5.y, intSwi3.u2);
  
connect(tim4.y, intSwi2.u2);
  
connect(addPar.y, les.u1);
  
connect(TDisSet, les.u2);
  
connect(les.y, tim4.u);
  
connect(TDisSet, les1.u2);
  
connect(addPar1.y, les1.u1);
  
connect(les1.y, tim5.u);
  
connect(yHeaValResReq, intSwi2.y);
  
connect(thrHeaResReq.y, intSwi2.u1);
  
connect(twoHeaResReq.y, intSwi3.u1);
  
connect(intSwi3.y, intSwi2.u3);
  
connect(uVal, greThr5.u);
  
connect(greThr5.y, booToInt2.u);
  
connect(booToInt2.y, intSwi3.u3);
  
connect(uVal, greThr6.u);
  
connect(greThr6.y, booToInt3.u);
  
connect(booToInt3.y, yHotWatPlaReq);
  
connect(TCooSet, sub2.u2);
  
connect(TCooSet, sub3.u2);
  
connect(TZon, sub2.u1);
  
connect(TZon, sub3.u1);
  
connect(uCoo, sampler.u);
  
connect(sampler.y, greThr.u);
  
connect(uDam, sampler1.u);
  
connect(sampler1.y, greThr3.u);
  
connect(VDis_flow, sampler2.u);
  
connect(sampler2.y, greEqu.u2);
  
connect(sampler2.y, greEqu1.u2);
  
connect(VSet_flow, sampler3.u);
  
connect(sampler3.y, greThr4.u);
  
connect(sampler3.y, gai1.u);
  
connect(sampler3.y, gai2.u);
end SystemRequests;