Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat

Sequences for VAV reheat terminal unit

Information

This package contains sequences for VAV reheat terminal unit. They are created according to ASHRAE Guideline 36, Part 5.E.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves DamperValves Output signals for controlling VAV reheat box damper and valve position
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests SystemRequests Output system requests for VAV reheat terminal unit control
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SetPoints SetPoints Output setpoints for terminal unit control
Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.Validation Validation Collection of validation models

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves

Output signals for controlling VAV reheat box damper and valve position

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.DamperValves

Information

This sequence sets the damper and valve position for VAV reheat terminal unit. The implementation is according to ASHRAE Guideline 36 (G36), PART5.E.6. The calculation is done following the steps below.

  1. When the zone state is cooling (uCoo>0), then the cooling loop output uCoo shall be mapped to the airflow setpoint from the cooling minimum VActCooMin to the cooling maximum VActCooMax airflow setpoints. The hot water valve is closed (yHeaVal=0) unless the discharge air temperature TDis is below the minimum setpoint (10 °C).

  2. If supply air temperature TSup from the AHU is greater than room temperature TRoo, cooling supply airflow setpoint shall be no higher than the minimum.

  3. When the zone state is Deadband (uCoo=0 and uHea=0), then the active airflow setpoint shall be the minimum airflow setpoint VActMin. Hot water valve is closed unless the discharge air temperature is below the minimum setpoint (10 °C).

  4. When the zone state is Heating (uHea>0), then the heating loop shall maintain space temperature at the heating setpoint as follows:

    • From 0-50%, the heating loop output uHea shall reset the discharge temperature setpoint from current AHU SAT setpoint TSup to a maximum of dTDisMax above space temperature setpoint. The airflow setpoint shall be the heating minimum VActHeaMin.
    • From 50-100%, if the discharge air temperature TDis is greater than room temperature plus 2.8 Kelvin, the heating loop output uHea shall reset the airflow setpoint from the heating minimum airflow setpoint VActHeaMin to the heating maximum airflow setpoint VActHeaMax.
  5. The hot water valve (or modulating electric heating coil) shall be modulated to maintain the discharge temperature at setpoint.

  6. The VAV damper shall be modulated by a control loop to maintain the measured airflow at the active setpoint.

The sequences of controlling damper and valve position for VAV reheat terminal unit are described in the following figure below.

Image of damper and valve control for VAV reheat terminal unit

Parameters

TypeNameDefaultDescription
TemperatureDifferencedTDisMax11Zone maximum discharge air temperature above heating setpoint [K]
TemperatureTDisMin283.15Lowest discharge air temperature [K]
Valve
SimpleControllercontrollerTypeValBuildings.Controls.OBC.CDL.T...Type of controller
RealkVal0.5Gain of controller for valve control [1/K]
TimeTiVal300Time constant of integrator block for valve control [s]
TimeTdVal0.1Time constant of derivative block for valve control [s]
Damper
SimpleControllercontrollerTypeDamBuildings.Controls.OBC.CDL.T...Type of controller
RealkDam0.5Gain of controller for damper control [1]
TimeTiDam300Time constant of integrator block for damper control [s]
TimeTdDam0.1Time constant of derivative block for damper control [s]
VolumeFlowRateV_flow_nominal Nominal volume flow rate, used to normalize control error [m3/s]

Connectors

TypeNameDescription
input RealInputuHeaHeating control signal [1]
input RealInputuCooCooling control signal [1]
input RealInputVActCooMaxActive cooling maximum airflow rate [m3/s]
input RealInputVActCooMinActive cooling minimum airflow rate [m3/s]
input RealInputVActMinActive minimum airflow rate [m3/s]
input RealInputVActHeaMinActive heating minimum airflow rate [m3/s]
input RealInputVActHeaMaxActive heating maximum airflow rate [m3/s]
input RealInputVDisMeasured discharge airflow rate airflow rate [m3/s]
input RealInputTSupSupply air temperature from central air handler [K]
input RealInputTHeaSetZone heating setpoint temperature [K]
input RealInputTRooMeasured zone temperature [K]
input RealInputTDisMeasured discharge air temperature [K]
input IntegerInputuOpeModZone operation mode
output RealOutputyDamDamper position [1]
output RealOutputyHeaValReheater valve position [1]
output RealOutputVDisSetDischarge airflow setpoint [m3/s]
output RealOutputTDisSetDischarge airflow setpoint temperature for heating [K]

Modelica definition

block DamperValves "Output signals for controlling VAV reheat box damper and valve position" parameter Modelica.SIunits.TemperatureDifference dTDisMax=11 "Zone maximum discharge air temperature above heating setpoint"; parameter Modelica.SIunits.Temperature TDisMin=283.15 "Lowest discharge air temperature"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeVal =Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kVal(final unit="1/K") = 0.5 "Gain of controller for valve control"; parameter Modelica.SIunits.Time TiVal=300 "Time constant of integrator block for valve control"; parameter Modelica.SIunits.Time TdVal=0.1 "Time constant of derivative block for valve control"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerTypeDam =Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kDam(final unit="1") = 0.5 "Gain of controller for damper control"; parameter Modelica.SIunits.Time TiDam=300 "Time constant of integrator block for damper control"; parameter Modelica.SIunits.Time TdDam=0.1 "Time constant of derivative block for damper control"; parameter Modelica.SIunits.VolumeFlowRate V_flow_nominal(min=1E-10) "Nominal volume flow rate, used to normalize control error"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uHea( min=0, max=1, final unit="1") "Heating control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uCoo( min=0, max=1, final unit="1") "Cooling control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VActCooMax( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Active cooling maximum airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VActCooMin( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Active cooling minimum airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VActMin( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Active minimum airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VActHeaMin( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Active heating minimum airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VActHeaMax( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Active heating maximum airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Measured discharge airflow rate airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSup(final unit="K", quantity ="ThermodynamicTemperature") "Supply air temperature from central air handler"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSet(final unit="K", quantity="ThermodynamicTemperature") "Zone heating setpoint temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TRoo(final unit="K", quantity ="ThermodynamicTemperature") "Measured zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis(final unit="K", quantity ="ThermodynamicTemperature") "Measured discharge air temperature"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod "Zone operation mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yDam( min=0, max=1, final unit="1") "Damper position"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yHeaVal( min=0, max=1, final unit="1") "Reheater valve position"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput VDisSet( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Discharge airflow setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TDisSet(final unit="K", quantity="ThermodynamicTemperature") "Discharge airflow setpoint temperature for heating"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Logical not"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Logical not"; Buildings.Controls.OBC.CDL.Logical.Not not4 "Logical not"; Buildings.Controls.OBC.CDL.Logical.And and2 "Check if current zone state is deadband"; Buildings.Controls.OBC.CDL.Logical.And and4 "Logical and"; Buildings.Controls.OBC.CDL.Continuous.Line lin "Active airflow setpoint for cooling"; Buildings.Controls.OBC.CDL.Continuous.Line conTDisSet "Discharge air temperature for heating"; Buildings.Controls.OBC.CDL.Continuous.Line lin3 "Active airflow setpoint for heating"; Buildings.Controls.OBC.CDL.Continuous.LimPID 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"), reset=Buildings.Controls.OBC.CDL.Types.Reset.Parameter) "Hot water valve controller"; Buildings.Controls.OBC.CDL.Continuous.LimPID conDam( final controllerType=controllerTypeDam, final k=kDam, final Ti=TiDam, final Td=TdDam, final yMax=1, final yMin=0, final reset=Buildings.Controls.OBC.CDL.Types.Reset.Parameter, final y_reset=0) "Damper position controller"; Buildings.Controls.OBC.CDL.Logical.Switch swi "Output active cooling airflow according to cooling control signal"; Buildings.Controls.OBC.CDL.Logical.Switch swi1 "Output active airflow when it is in deadband state"; Buildings.Controls.OBC.CDL.Logical.Switch swi2 "Acitive heating airflow rate"; Buildings.Controls.OBC.CDL.Logical.Switch swi4 "Output active heating airflow according to heating control signal"; Buildings.Controls.OBC.CDL.Logical.Switch swi5 "Output active cooling airflow "; Buildings.Controls.OBC.CDL.Continuous.MultiSum mulSum(nin=3) "Active airflow setpoint"; protected Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer1(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer2(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer3(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer6(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conOne(final k=1) "Constant one"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conOne2(final k=1) "Constant real value"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conHal(final k=0.5) "Constant real value"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conHal1(final k=0.5) "Constant real value"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar(final p=dTDisMax, final k=1) "Maximum heating discharge temperature"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar1(final k=1, final p =2.8) "Zone temperature pluTSetZons 2.8 degC"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2(final uHigh=0.05, final uLow=0.01) "Check if cooling control signal is greater than zero"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys3(final uHigh=0.05, final uLow=0.01) "Check if heating control signal is greater than 0"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4(final uLow=TDisMin - 0.1, final uHigh=TDisMin + 0.1) "Check if discharge air temperature is greater than lowest discharge air temperature"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys6(final uLow=-0.1, final uHigh=0.1) "Check if supply air temperature is greater than room temperature"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys7(final uLow=-0.1, final uHigh=0.1) "Check if discharge air temperature is greater than room temperature plus 2.8 degC"; Buildings.Controls.OBC.CDL.Continuous.Add add1(final k2=-1) "Calculate temperature difference between discharge air and room plus 2.8 degC"; Buildings.Controls.OBC.CDL.Continuous.Add add2(final k2=-1) "Calculate temperature difference between AHU supply air and room "; CDL.Logical.TrueHoldWithReset truHol2(duration=600) "Check if the true input holds for certain time"; Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel3(delayTime=600) "Check if the true input holds for certain time"; Buildings.Controls.OBC.CDL.Logical.TrueDelay truDel4(delayTime=600) "Check if the true input holds for certain time"; CDL.Integers.Equal isUno "Output true if the operation mode is unoccupied"; CDL.Integers.Sources.Constant unOcc(k=Buildings.Controls.OBC.ASHRAE.G36_PR1.Types.OperationModes.unoccupied) "Constant signal for unoccupied mode"; CDL.Logical.Switch watValPosUno "Output hot water valve position"; CDL.Logical.Switch damPosUno "Output damper position"; CDL.Logical.Not not5 "Negation of input signal"; CDL.Continuous.Gain VDisSetNor(final k=1/V_flow_nominal) "Normalized setpoint for discharge volume flow rate"; CDL.Continuous.Gain VDisNor(final k=1/V_flow_nominal) "Normalized discharge volume flow rate"; CDL.Continuous.Sources.Constant lowDisAirTem(final k=TDisMin) "Lowest allowed discharge air temperature"; CDL.Logical.Switch swi6 "Output hot water valve position in case of low discharge air temperature"; CDL.Logical.Or or2; CDL.Logical.Not not3 "Logical not"; CDL.Logical.Switch swi3 "Output hot water valve position in case of low discharge air temperature"; CDL.Logical.Not not6 "Negation of input signal"; CDL.Logical.And and1; equation connect(uCoo, lin.u); connect(conZer.y, lin.x1); connect(VActCooMin, lin.f1); connect(conOne.y, lin.x2); connect(VActCooMax, lin.f2); connect(uCoo, hys2.u); connect(conZer1.y, swi.u3); connect(VActMin, swi1.u1); connect(and2.y, swi1.u2); connect(conZer2.y, swi1.u3); connect(uHea, hys3.u); connect(conZer3.y, conTDisSet.x1); connect(TSup, conTDisSet.f1); connect(uHea, conTDisSet.u); connect(conHal.y, conTDisSet.x2); connect(addPar.y, conTDisSet.f2); connect(THeaSet, addPar.u); connect(uHea, lin3.u); connect(conHal1.y, lin3.x1); connect(conOne2.y, lin3.x2); connect(VActHeaMax, lin3.f2); connect(VActHeaMin, lin3.f1); connect(TRoo, addPar1.u); connect(lin3.y, swi2.u1); connect(VActHeaMin, swi2.u3); connect(TDis, hys4.u); connect(swi2.y, swi4.u1); connect(conZer6.y, swi4.u3); connect(swi.y, mulSum.u[1]); connect(swi1.y, mulSum.u[2]); connect(swi4.y, mulSum.u[3]); connect(VActMin, swi5.u1); connect(and4.y, swi5.u2); connect(lin.y, swi5.u3); connect(swi5.y, swi.u1); connect(hys4.y, not4.u); connect(TSup, add2.u1); connect(TRoo, add2.u2); connect(add2.y, hys6.u); connect(hys6.y, and4.u2); connect(conTDisSet.y, add1.u1); connect(addPar1.y, add1.u2); connect(add1.y, hys7.u); connect(mulSum.y, VDisSet); connect(conTDisSet.y, TDisSet); connect(hys3.y, truHol2.u); connect(truHol2.y, swi4.u2); connect(hys2.y, truDel4.u); connect(truDel4.y, and4.u1); connect(truDel4.y, swi.u2); connect(truHol2.y, not2.u); connect(truDel4.y, not1.u); connect(not1.y, and2.u1); connect(not2.y, and2.u2); connect(conVal.u_m, TDis); connect(hys7.y, swi2.u2); connect(unOcc.y, isUno.u1); connect(isUno.u2, uOpeMod); connect(isUno.y, watValPosUno.u2); connect(conZer2.y, watValPosUno.u1); connect(watValPosUno.y, yHeaVal); connect(conZer2.y, damPosUno.u1); connect(conDam.y, damPosUno.u3); connect(damPosUno.y, yDam); connect(isUno.y, damPosUno.u2); connect(isUno.y, not5.u); connect(not5.y, conDam.trigger); connect(mulSum.y, VDisSetNor.u); connect(VDisSetNor.y, conDam.u_s); connect(VDis, VDisNor.u); connect(VDisNor.y, conDam.u_m); connect(truHol2.y, or2.u2); connect(truDel3.y, not3.u); connect(not3.y, or2.u1); connect(or2.y, swi6.u2); connect(conTDisSet.y, swi6.u1); connect(swi6.u3, lowDisAirTem.y); connect(swi3.y, watValPosUno.u3); connect(truHol2.y, not6.u); connect(not6.y, and1.u2); connect(and1.y, swi3.u2); connect(conVal.y, swi3.u3); connect(swi3.u1, conZer2.y); connect(not3.y, and1.u1); connect(not4.y, truDel3.u); connect(not5.y, conVal.trigger); connect(swi6.y, conVal.u_s); end DamperValves;

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests

Output system requests for VAV reheat terminal unit control

Buildings.Controls.OBC.ASHRAE.G36_PR1.TerminalUnits.Reheat.SystemRequests

Information

This sequence outputs the system reset requests, i.e.,

The calculations are according to ASHRAE Guideline 36 (G36), PART5.E.9, in the steps shown below.

a. Cooling SAT reset requests yZonTemResReq

  1. If the zone temperature TRoo exceeds the zone cooling setpoint TCooSet by 2.8 °C (5 °F)) for 2 minutes and after suppression period due to setpoint change per G36 Part 5.A.20, send 3 requests (yZonTemResReq=3).
  2. Else if the zone temperature TRoo exceeds the zone cooling setpoint TCooSet by 1.7 °C (3 °F) for 2 minutes and after suppression period due to setpoint change per G36 Part 5.A.20, send 2 requests (yZonTemResReq=3).
  3. Else if the cooling loop uCoo is greater than 95%, send 1 request (yZonTemResReq=1) until uCoo is less than 85%.
  4. Else if uCoo is less than 95%, send 0 request (yZonTemResReq=0).

b. Static pressure reset requests yZonPreResReq

  1. If the measured airflow VDis is less than 50% of setpoint VDisSet while it is greater than zero for 1 minute, send 3 requests (yZonPreResReq=3).
  2. Else if the measured airflow VDis is less than 70% of setpoint VDisSet while it is greater than zero for 1 minute, send 2 requests (yZonPreResReq=2).
  3. Else if the damper position uDam is greater than 95%, send 1 request (yZonPreResReq=1) until uDam is less than 85%.
  4. Else if uDam is less than 95%, send 0 request (yZonPreResReq=0).

c. If there is a hot water coil (have_heaWatCoi=true), hot water reset requests yHeaValResReq

  1. If the discharge air temperature TDis is 17 °C (30 °F) less than the setpoint TDisSet for 5 minutes, send 3 requests (yHeaValResReq=3).
  2. Else if the discharge air temperature TDis is 8.3 °C (15 °F) less than the setpoint TDisSet for 5 minutes, send 2 requests (yHeaValResReq=2).
  3. Else if the hot water valve position uHeaVal is greater than 95%, send 1 request (yHeaValResReq=1) until uHeaVal is less than 85%.
  4. Else if uHeaVal is less than 95%, send 0 request (yHeaValResReq=0).

d. If there is hot water coil (have_heaWatCoi=true) and a boiler plant (have_boiPla=true), send the boiler plant that serves the zone a boiler plant requests yHeaPlaReq as follows:

  1. If the hot water valve position uHeaVal is greater than 95%, send 1 request (yHeaPlaReq=1) until uHeaVal is less than 10%.
  2. Else if uHeaVal is less than 95%, send 0 request (yHeaPlaReq=0).

Implementation

Some input signals are time sampled, because the output that is generated from these inputs are used in the trim and respond logic, which is also time sampled. However, signals that use a delay are not sampled, as sampling were to change the dynamic response.

Parameters

TypeNameDefaultDescription
TimesamplePeriod120Sample period of component, set to the same value as the trim and respond that process yPreSetReq [s]
Booleanhave_heaWatCoi Flag, true if there is a hot water coil
Booleanhave_heaPla Flag, true if there is a boiler plant
TemperatureDifferencecooSetDif_12.8Limit value of difference between zone temperature and cooling setpoint for generating 3 cooling SAT reset requests [K]
TemperatureDifferencecooSetDif_21.7Limit value of difference between zone temperature and cooling setpoint for generating 2 cooling SAT reset requests [K]
TemperatureDifferencedisAirSetDif_117Limit value of difference between discharge air temperature and its setpoint for generating 3 hot water reset requests [K]
TemperatureDifferencedisAirSetDif_28.3Limit value of difference between discharge air temperature and its setpoint for generating 2 hot water reset requests [K]
Duration times
TimedurTimTem120Duration time of zone temperature exceeds setpoint [s]
TimedurTimFlo60Duration time of airflow rate less than setpoint [s]
TimedurTimDisAir300Duration time of discharge air temperature is less than setpoint [s]

Connectors

TypeNameDescription
input RealInputTRooZone temperature [K]
input RealInputTCooSetZone cooling setpoint temperature [K]
input RealInputuCooCooling loop signal [1]
input RealInputVDisMeasured discharge airflow rate [m3/s]
input RealInputVDisSetDischarge airflow rate setpoint [m3/s]
input RealInputuDamDamper position [1]
input RealInputTDisSetDischarge airflow setpoint temperature for heating [K]
input RealInputTDisMeasured discharge airflow temperature [K]
input RealInputuHeaValHeating valve position [1]
output IntegerOutputyZonPreResReqZone static pressure reset requests
output IntegerOutputyZonTemResReqZone cooling supply air temperature reset request
output IntegerOutputyHeaValResReqHot water reset requests
output IntegerOutputyHeaPlaReqHeating plant request

Modelica definition

block SystemRequests "Output system requests for VAV reheat terminal unit control" parameter Modelica.SIunits.Time samplePeriod=120 "Sample period of component, set to the same value as the trim and respond that process yPreSetReq"; parameter Boolean have_heaWatCoi "Flag, true if there is a hot water coil"; parameter Boolean have_heaPla "Flag, true if there is a boiler plant"; parameter Modelica.SIunits.TemperatureDifference cooSetDif_1=2.8 "Limit value of difference between zone temperature and cooling setpoint for generating 3 cooling SAT reset requests"; parameter Modelica.SIunits.TemperatureDifference cooSetDif_2=1.7 "Limit value of difference between zone temperature and cooling setpoint for generating 2 cooling SAT reset requests"; parameter Modelica.SIunits.TemperatureDifference disAirSetDif_1=17 "Limit value of difference between discharge air temperature and its setpoint for generating 3 hot water reset requests"; parameter Modelica.SIunits.TemperatureDifference disAirSetDif_2=8.3 "Limit value of difference between discharge air temperature and its setpoint for generating 2 hot water reset requests"; parameter Modelica.SIunits.Time durTimTem=120 "Duration time of zone temperature exceeds setpoint"; parameter Modelica.SIunits.Time durTimFlo=60 "Duration time of airflow rate less than setpoint"; parameter Modelica.SIunits.Time durTimDisAir=300 "Duration time of discharge air temperature is less than setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TRoo(final unit="K", quantity ="ThermodynamicTemperature") "Zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSet(final unit="K", quantity="ThermodynamicTemperature") "Zone cooling setpoint temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uCoo( min=0, max=1, final unit="1") "Cooling loop signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VDis( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Measured discharge airflow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput VDisSet( min=0, final unit="m3/s", quantity="VolumeFlowRate") "Discharge airflow rate setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uDam( min=0, max=1, final unit="1") "Damper position"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TDisSet(final unit="K", quantity="ThermodynamicTemperature") if have_heaWatCoi "Discharge airflow setpoint temperature for heating"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TDis(final unit="K", quantity ="ThermodynamicTemperature") if have_heaWatCoi "Measured discharge airflow temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uHeaVal( min=0, max=1, final unit="1") if have_heaWatCoi "Heating valve position"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonPreResReq "Zone static pressure reset requests"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yZonTemResReq "Zone cooling supply air temperature reset request"; CDL.Interfaces.IntegerOutput yHeaValResReq if have_heaWatCoi "Hot water reset requests"; CDL.Interfaces.IntegerOutput yHeaPlaReq if (have_heaWatCoi and have_heaPla) "Heating plant request"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys(final uLow=cooSetDif_1 - 0.1, final uHigh=cooSetDif_1 + 0.1) "Check if zone temperature is greater than cooling setpoint by cooSetDif_1"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys3(final uLow=cooSetDif_2 - 0.1, final uHigh=cooSetDif_2 + 0.1) "Check if zone temperature is greater than cooling setpoint by cooSetDif_2"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4(final uLow=0.85, final uHigh=0.95) "Check if damper position is greater than 0.95"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys5(final uLow=0.85, final uHigh=0.95) "Check if cooling loop signal is greater than 0.95"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys7(final uHigh=0.01, final uLow=0.005) "Check if discharge airflow setpoint is greater than 0"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys8(final uLow=-0.1, final uHigh=0.1) if have_heaWatCoi "Check if discharge air temperature is disAirSetDif_1 less than setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys9(final uLow=-0.1, final uHigh=0.1) if have_heaWatCoi "Check if discharge air temperature is disAirSetDif_2 less than setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys10(final uLow=0.85, final uHigh=0.95) if have_heaWatCoi "Check if valve position is greater than 0.95"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys11(final uHigh=0.95, final uLow=0.1) if (have_heaWatCoi and have_heaPla) "Check if valve position is greater than 0.95"; protected Buildings.Controls.OBC.CDL.Discrete.Sampler samTCooSet(final samplePeriod= samplePeriod) "Sample current cooling setpoint"; Buildings.Controls.OBC.CDL.Discrete.UnitDelay uniDel(final samplePeriod= samplePeriod) "Delay value to record input value"; Buildings.Controls.OBC.CDL.Continuous.Abs abs "Absolute change of the setpoint temperature"; Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler triSam "Sample the setpoint changed value when there is change"; Buildings.Controls.OBC.CDL.Logical.Edge edg "Instants when input becomes true"; Buildings.Controls.OBC.CDL.Logical.Latch lat "Maintains an on signal until conditions changes"; Buildings.Controls.OBC.CDL.Logical.Latch lat1 "Maintains an on signal until conditions changes"; Buildings.Controls.OBC.CDL.Logical.Timer tim "Calculate time"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqual gre "Check if the suppression time has passed"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqual gre1 "Check if current model time is greater than the sample period"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2(final uLow=0.05, final uHigh=0.15) "Check if there is setpoint change"; Buildings.Controls.OBC.CDL.Continuous.Min supTim "Suppression time"; Buildings.Controls.OBC.CDL.Continuous.Sources.ModelTime modTim "Time of the model"; Buildings.Controls.OBC.CDL.Continuous.Gain gai(k=(9/5)*(5*60)) "Convert change of degC to change of degF and find out suppression time (5 min/degF))"; Buildings.Controls.OBC.CDL.Continuous.Gain gai1(final k=0.5) "50% of setpoint"; Buildings.Controls.OBC.CDL.Continuous.Gain gai2(final k=0.7) "70% of setpoint"; Buildings.Controls.OBC.CDL.Continuous.Add add1(final k1=-1) "Calculate difference of previous and current setpoints"; Buildings.Controls.OBC.CDL.Continuous.Add add2(final k1=-1) "Calculate difference between zone temperature and cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Add add3(final k1=-1) "Calculate difference between zone temperature and cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Add add6(final k2=-1) if have_heaWatCoi "Calculate difference of discharge temperature (plus disAirSetDif_1) and its setpoint"; Buildings.Controls.OBC.CDL.Continuous.Add add7(final k2=-1) if have_heaWatCoi "Calculate difference of discharge temperature (plus disAirSetDif_2) and its setpoint"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar(final k=1, final p= disAirSetDif_1) if have_heaWatCoi "Discharge temperature plus disAirSetDif_1"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar1(final k=1, final p =disAirSetDif_2) if have_heaWatCoi "Discharge temperature plus disAirSetDif_2"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt "Convert real to integer value"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt1 "Convert real to integer value"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt2 if have_heaWatCoi "Convert real to integer value"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt3 if ( have_heaWatCoi and have_heaPla) "Convert real to integer value"; Buildings.Controls.OBC.CDL.Logical.And and1 "Logical and"; Buildings.Controls.OBC.CDL.Logical.And and2 "Logical and"; Buildings.Controls.OBC.CDL.Logical.And and3 "Logical and"; Buildings.Controls.OBC.CDL.Logical.And and4 "Logical and"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con(final k= samplePeriod) "Sample period time"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant conZer(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant thrCooResReq(final k=3) "Constant 3"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant twoCooResReq(final k=2) "Constant 2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant oneCooResReq(final k=1) "Constant 1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerCooReq(final k=0) "Constant 0"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant thrPreResReq(final k=3) "Constant 3"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant twoPreResReq(final k=2) "Constant 2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerPreResReq(final k=0) "Constant 0"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant onePreResReq(final k=1) "Constant 1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant thrHeaResReq(final k=3) if have_heaWatCoi "Constant 3"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant twoHeaResReq(final k=2) if have_heaWatCoi "Constant 2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant oneHeaResReq(final k=1) if have_heaWatCoi "Constant 1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerHeaResReq(final k=0) if have_heaWatCoi "Constant 0"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerBoiPlaReq(final k=0) if (have_heaWatCoi and have_heaPla) "Constant 0"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant oneBoiPlaReq(final k=1) if (have_heaWatCoi and have_heaPla) "Constant 1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant maxSupTim(k=1800) "Maximum suppression time 30 minutes"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con5(k=true) "Constant true"; Buildings.Controls.OBC.CDL.Logical.Switch swi "Use setpoint different value when half sample period time has passed"; Buildings.Controls.OBC.CDL.Logical.Switch swi1 "Output 3 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi2 "Output 2 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi3 "Output 0 or 1 request "; Buildings.Controls.OBC.CDL.Logical.Switch swi4 "Output 3 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi5 "Output 2 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi6 "Output 0 or 1 request "; Buildings.Controls.OBC.CDL.Logical.Switch swi7 if have_heaWatCoi "Output 3 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi8 if have_heaWatCoi "Output 2 or other request "; Buildings.Controls.OBC.CDL.Logical.Switch swi9 if have_heaWatCoi "Output 0 or 1 request "; Buildings.Controls.OBC.CDL.Logical.Switch swi10 if (have_heaWatCoi and have_heaPla) "Output 0 or 1 request "; Buildings.Controls.OBC.CDL.Logical.TrueHoldWithReset truHol(duration= samplePeriod); Buildings.Controls.OBC.CDL.Logical.LogicalSwitch logSwi "Logical switch"; Buildings.Controls.OBC.CDL.Logical.TrueDelay tim1(delayTime=durTimTem) "Check if it is more than durTimTem"; Buildings.Controls.OBC.CDL.Logical.TrueDelay tim2(delayTime=durTimTem) "Check if it is more than durTimTem"; Buildings.Controls.OBC.CDL.Logical.TrueDelay tim3(delayTime=durTimFlo) "Check if it is more than durTimFlo"; Buildings.Controls.OBC.CDL.Logical.TrueDelay tim4(delayTime=durTimDisAir) if have_heaWatCoi "Check if it is more than durTimDisAir"; Buildings.Controls.OBC.CDL.Logical.TrueDelay tim5(delayTime=durTimDisAir) if have_heaWatCoi "Check if it is more than durTimDisAir"; Buildings.Controls.OBC.CDL.Discrete.Sampler sampler(final samplePeriod= samplePeriod) "Sample input signal, as the output signal will go to the trim and respond which also samples at samplePeriod"; Buildings.Controls.OBC.CDL.Discrete.Sampler sampler1(final samplePeriod= samplePeriod) "Sample input signal, as the output signal will go to the trim and respond which also samples at samplePeriod"; Buildings.Controls.OBC.CDL.Discrete.Sampler sampler2(final samplePeriod= samplePeriod) "Sample input signal, as the output signal will go to the trim and respond which also samples at samplePeriod"; Buildings.Controls.OBC.CDL.Discrete.Sampler sampler4(final samplePeriod= samplePeriod) "Sample input signal, as the output signal will go to the trim and respond which also samples at samplePeriod"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqual greEqu "Check if discharge airflow is less than 50% of setpoint"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqual greEqu1 "Check if discharge airflow is less than 70% of setpoint"; equation connect(add2.y, hys.u); connect(TCooSet, samTCooSet.u); connect(samTCooSet.y, uniDel.u); connect(triSam.y, gai.u); connect(hys2.y, lat.u); connect(lat.y, tim.u); connect(tim.y, gre.u1); connect(edg.y, triSam.trigger); connect(lat.y, edg.u); connect(edg.y, lat1.u0); connect(modTim.y, gre1.u1); connect(con.y, gre1.u2); connect(uniDel.y, add1.u1); connect(samTCooSet.y, add1.u2); connect(gre1.y, swi.u2); connect(add1.y, swi.u1); connect(conZer.y, swi.u3); connect(swi.y, abs.u); connect(abs.y, triSam.u); connect(abs.y, hys2.u); connect(and2.y, swi1.u2); connect(thrCooResReq.y, swi1.u1); connect(add3.y, hys3.u); connect(twoCooResReq.y, swi2.u1); connect(swi2.y, swi1.u3); connect(and1.y, swi2.u2); connect(hys5.y, swi3.u2); connect(oneCooResReq.y, swi3.u1); connect(swi3.y, swi2.u3); connect(zerCooReq.y, swi3.u3); connect(swi1.y, reaToInt.u); connect(reaToInt.y, yZonTemResReq); connect(and3.y, swi4.u2); connect(thrPreResReq.y, swi4.u1); connect(and4.y, swi5.u2); connect(twoPreResReq.y, swi5.u1); connect(swi5.y, swi4.u3); connect(hys4.y, swi6.u2); connect(onePreResReq.y, swi6.u1); connect(zerPreResReq.y, swi6.u3); connect(swi6.y, swi5.u3); connect(swi4.y, reaToInt1.u); connect(reaToInt1.y, yZonPreResReq); connect(TDis, addPar.u); connect(addPar.y, add6.u2); connect(TDisSet, add6.u1); connect(add6.y, hys8.u); connect(addPar1.y, add7.u2); connect(add7.y, hys9.u); connect(hys9.y, tim5.u); connect(thrHeaResReq.y, swi7.u1); connect(twoHeaResReq.y, swi8.u1); connect(swi8.y, swi7.u3); connect(TDis, addPar1.u); connect(TDisSet, add7.u1); connect(uHeaVal, hys10.u); connect(hys10.y, swi9.u2); connect(oneHeaResReq.y, swi9.u1); connect(zerHeaResReq.y, swi9.u3); connect(swi9.y, swi8.u3); connect(swi7.y, reaToInt2.u); connect(reaToInt2.y, yHeaValResReq); connect(uHeaVal, hys11.u); connect(hys11.y, swi10.u2); connect(oneBoiPlaReq.y, swi10.u1); connect(zerBoiPlaReq.y, swi10.u3); connect(swi10.y, reaToInt3.u); connect(reaToInt3.y, yHeaPlaReq); connect(gre.y, truHol.u); connect(truHol.y, lat.u0); connect(gre.y, lat1.u); connect(lat.y, logSwi.u2); connect(con5.y, logSwi.u3); connect(lat1.y, logSwi.u1); connect(logSwi.y, and2.u1); connect(logSwi.y, and1.u1); connect(gai.y, supTim.u1); connect(maxSupTim.y, supTim.u2); connect(supTim.y, gre.u2); connect(tim5.y, swi8.u2); connect(hys8.y, tim4.u); connect(tim4.y, swi7.u2); connect(hys7.y, tim3.u); connect(tim3.y, and3.u1); connect(tim3.y, and4.u1); connect(hys3.y, tim2.u); connect(tim2.y, and1.u2); connect(hys.y, tim1.u); connect(tim1.y, and2.u2); connect(sampler.u, VDisSet); connect(sampler.y, gai1.u); connect(sampler.y, gai2.u); connect(sampler1.u, VDis); connect(uDam, sampler2.u); connect(sampler2.y, hys4.u); connect(uCoo, sampler4.u); connect(sampler4.y, hys5.u); connect(samTCooSet.y, add2.u1); connect(samTCooSet.y, add3.u1); connect(hys7.u, VDisSet); connect(add2.u2, TRoo); connect(add3.u2, TRoo); connect(greEqu.u1, gai1.y); connect(greEqu.u2, sampler1.y); connect(greEqu.y, and3.u2); connect(gai2.y, greEqu1.u1); connect(sampler1.y, greEqu1.u2); connect(greEqu1.y, and4.u2); end SystemRequests;