Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups

Package of sequences in zone group level

Information

This package contains generic sequences in zone groups, according to ASHRAE G36 section 5.4.

Package Content

Name Description
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.GroupStatus GroupStatus Block that outputs the zone group status
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.OperationMode OperationMode Block that outputs the operation mode
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneGroupSystem ZoneGroupSystem Compute the AHU operating mode from the group operating mode
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatus ZoneStatus Block that outputs zone temperature status
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatusDuplicator ZoneStatusDuplicator Duplicate zone status output
Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.Validation Validation Collection of validation models

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.GroupStatus Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.GroupStatus

Block that outputs the zone group status

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.GroupStatus

Information

This sequence sums up the zone level status calculation to find the outputs that are needed to define the zone group operation mode.

It requires following inputs from zone lelvel calculation:

The sequence gives following outputs for zone group level calculation:

Parameters

TypeNameDefaultDescription
IntegernBuiZon5Total number of zones in building
IntegernGroZonnBuiZonTotal number of zones in the group
BooleanzonGroMsk[nBuiZon]fill(true, nBuiZon)Boolean array mask of zones included in group
Advanced
RealuLow-0.1Low limit of the hysteresis for checking temperature difference [K]
RealuHigh0.1High limit of the hysteresis for checking temperature difference [K]

Connectors

TypeNameDescription
input BooleanInputzonOcc[nBuiZon]True when the zone is set to be occupied due to the override
input BooleanInputu1Occ[nBuiZon]True when the zone is occupied according to the occupancy schedule
input RealInputtNexOcc[nBuiZon]Time to next occupied period [s]
input RealInputuCooTim[nBuiZon]Cool down time [s]
input RealInputuWarTim[nBuiZon]Warm-up time [s]
input BooleanInputu1OccHeaHig[nBuiZon]True when the zone temperature is lower than the occupied heating setpoint
input BooleanInputu1HigOccCoo[nBuiZon]True when the zone temperature is higher than the occupied cooling setpoint
input BooleanInputu1UnoHeaHig[nBuiZon]True when the zone temperature is lower than the unoccupied heating setpoint
input RealInputTHeaSetOff[nBuiZon]Zone unoccupied heating setpoint [K]
input BooleanInputu1EndSetBac[nBuiZon]True when the zone could end the setback mode
input BooleanInputu1HigUnoCoo[nBuiZon]True when the zone temperature is higher than its unoccupied cooling setpoint
input RealInputTCooSetOff[nBuiZon]Zone unoccupied cooling setpoint [K]
input BooleanInputu1EndSetUp[nBuiZon]True when the zone could end the setup mode
input RealInputTZon[nBuiZon]Zone temperature [K]
input BooleanInputu1Win[nBuiZon]True when the window is open, false when the window is close or the zone does not have window status sensor
output BooleanOutputuGroOccTrue when the zone group is in occupied mode
output RealOutputnexOccTime to next occupied period [s]
output RealOutputyCooTimCool down time [s]
output RealOutputyWarTimWarm-up time [s]
output BooleanOutputyOccHeaHigTrue when there is zone with temperature being lower than the occupied heating setpoint
output BooleanOutputyHigOccCooTrue when there is zone with temperature being higher than the occupied cooling setpoint
output IntegerOutputyColZonTotal number of cold zones
output BooleanOutputySetBacRun setback mode
output BooleanOutputyEndSetBacTrue when the group should end setback mode
output IntegerOutputyHotZonTotal number of hot zones
output BooleanOutputySetUpRun setup mode
output BooleanOutputyEndSetUpTrue when the group should end setup mode
output RealOutputTZonMaxMaximum zone temperature in the zone group [K]
output RealOutputTZonMinMinimum zone temperature in the zone group [K]
output IntegerOutputyOpeWinTotal number of open windows

Modelica definition

block GroupStatus "Block that outputs the zone group status" parameter Integer nBuiZon( final min=1)=5 "Total number of zones in building"; parameter Integer nGroZon( final min=1)=nBuiZon "Total number of zones in the group"; parameter Boolean zonGroMsk[nBuiZon]=fill(true, nBuiZon) "Boolean array mask of zones included in group"; parameter Real uLow( final unit="K", final quantity="TemperatureDifference")=-0.1 "Low limit of the hysteresis for checking temperature difference"; parameter Real uHigh( final unit="K", final quantity="TemperatureDifference")=0.1 "High limit of the hysteresis for checking temperature difference"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput zonOcc[nBuiZon] "True when the zone is set to be occupied due to the override"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Occ[nBuiZon] "True when the zone is occupied according to the occupancy schedule"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc[nBuiZon]( final unit=fill("s", nBuiZon), final quantity=fill("Time", nBuiZon)) "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uCooTim[nBuiZon]( final unit=fill("s", nBuiZon), final quantity=fill("Time", nBuiZon)) "Cool down time"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uWarTim[nBuiZon]( final unit=fill("s", nBuiZon), final quantity=fill("Time", nBuiZon)) "Warm-up time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1OccHeaHig[nBuiZon] "True when the zone temperature is lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HigOccCoo[nBuiZon] "True when the zone temperature is higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1UnoHeaHig[nBuiZon] "True when the zone temperature is lower than the unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSetOff[nBuiZon]( final unit=fill("K", nBuiZon), displayUnit=fill("degC", nBuiZon), final quantity=fill("ThermodynamicTemperature", nBuiZon)) "Zone unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetBac[nBuiZon] "True when the zone could end the setback mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HigUnoCoo[nBuiZon] "True when the zone temperature is higher than its unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSetOff[nBuiZon]( final unit=fill("K", nBuiZon), displayUnit=fill("degC", nBuiZon), final quantity=fill("ThermodynamicTemperature", nBuiZon)) "Zone unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetUp[nBuiZon] "True when the zone could end the setup mode"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[nBuiZon]( final unit=fill("K", nBuiZon), displayUnit=fill("degC", nBuiZon), final quantity=fill("ThermodynamicTemperature", nBuiZon)) "Zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Win[nBuiZon] "True when the window is open, false when the window is close or the zone does not have window status sensor"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput uGroOcc "True when the zone group is in occupied mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput nexOcc( final quantity="Time", final unit="s") "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim( final unit="s", final quantity="Time") "Cool down time"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim( final unit="s", final quantity="Time") "Warm-up time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOccHeaHig "True when there is zone with temperature being lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigOccCoo "True when there is zone with temperature being higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yColZon "Total number of cold zones"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput ySetBac "Run setback mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetBac "True when the group should end setback mode"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yHotZon "Total number of hot zones"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput ySetUp "Run setup mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetUp "True when the group should end setup mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonMax( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Maximum zone temperature in the zone group"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TZonMin( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Minimum zone temperature in the zone group"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yOpeWin "Total number of open windows"; protected Buildings.Controls.OBC.CDL.Continuous.MultiMax cooDowTim( final nin=nGroZon) "Longest cooldown time"; Buildings.Controls.OBC.CDL.Continuous.MultiMax warUpTim( final nin=nGroZon) "Longest warm up time"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr( final nin=nGroZon) "Check if there is any zone that the zone temperature is lower than its occupied heating setpoint"; Buildings.Controls.OBC.CDL.Logical.MultiOr mulOr1( final nin=nGroZon) "Check if there is any zone that the zone temperature is higher than its occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.MultiMax maxTem( final nin=nGroZon) "Maximum zone temperature in the zone group"; Buildings.Controls.OBC.CDL.Continuous.MultiMin minTem( final nin=nGroZon) "Minimum zone temperature in the zone group"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt[nGroZon] "Convert boolean to integer"; Buildings.Controls.OBC.CDL.Integers.MultiSum totColZon( final nin=nGroZon) "Total number of cold zone"; Buildings.Controls.OBC.CDL.Logical.MultiAnd endSetBac( final nin=nGroZon) "Check if all zones have ended the setback mode"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt1[nGroZon] "Convert boolean to integer"; Buildings.Controls.OBC.CDL.Integers.MultiSum totHotZon( final nin=nGroZon) "Total number of hot zones"; Buildings.Controls.OBC.CDL.Logical.MultiAnd endSetUp( final nin=nGroZon) "Check if all zones have ended the setup mode"; Buildings.Controls.OBC.CDL.Continuous.MultiSum sumUnoHea( final nin=nGroZon) "Sum of all zones unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Subtract difUnoHea "Difference between unoccupied heating setpoint and zone temperature"; Buildings.Controls.OBC.CDL.Continuous.Divide div1 "Average difference"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant totZon( final k=nBuiZon) "Total number of zones"; Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea "Convert integer to real"; Buildings.Controls.OBC.CDL.Continuous.MultiSum sumUnoCoo( final nin=nGroZon) "Sum of all zones unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.MultiSum sumTem( final nin=nGroZon) "Sum of all zones temperature"; Buildings.Controls.OBC.CDL.Continuous.Subtract difUnoCoo "Difference between unoccupied cooling setpoint and zone temperature"; Buildings.Controls.OBC.CDL.Continuous.Divide div2 "Average difference"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the group should run in setback mode"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys1( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the group should run in setup mode"; Buildings.Controls.OBC.CDL.Continuous.MultiMin minToNexOcc( final nin=nGroZon) "Minimum time to next occupied period"; Buildings.Controls.OBC.CDL.Logical.MultiOr schOcc( final nin=nGroZon) "Check if the group should be in occupied mode according to the schedule"; Buildings.Controls.OBC.CDL.Logical.MultiOr oveRidOcc( final nin=nGroZon) "Check if the group should be in occupied mode according to the zone override"; Buildings.Controls.OBC.CDL.Logical.Or groOcc "Check if the group should be in occupied mode according to the schedule or the zone override"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt2[nGroZon] "Convert boolean to integer"; Buildings.Controls.OBC.CDL.Integers.MultiSum totOpeWin( final nin=nGroZon) "Total number of opening windows"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea( final realTrue=0, final realFalse=1) "When any zone becomes occpuied, output zero"; Buildings.Controls.OBC.CDL.Continuous.Multiply pro "When it is occupied, output zero"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter zonOccFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uOccFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter tNexOccFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter uCooTimFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter uWarTimFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uOccHeaHigFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uHigOccCooFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uUnoHeaHigFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter THeaSetOffFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uEndSetBacFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uHigUnoCooFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter TCooSetOffFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uEndSetUpFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.RealVectorFilter TZonFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorFilter uWinFil( final nin=nBuiZon, final nout=nGroZon, final msk=zonGroMsk) "Zone group filter"; equation connect(maxTem.y, TZonMax); connect(minTem.y, TZonMin); connect(cooDowTim.y, yCooTim); connect(warUpTim.y, yWarTim); connect(mulOr.y, yOccHeaHig); connect(mulOr1.y, yHigOccCoo); connect(totColZon.y, yColZon); connect(endSetBac.y, yEndSetBac); connect(totHotZon.y, yHotZon); connect(endSetUp.y, yEndSetUp); connect(booToInt.y, totColZon.u); connect(booToInt1.y, totHotZon.u); connect(totZon.y, intToRea.u); connect(sumTem.y, difUnoCoo.u1); connect(sumUnoHea.y, difUnoHea.u1); connect(intToRea.y, div1.u2); connect(intToRea.y, div2.u2); connect(difUnoHea.y, div1.u1); connect(difUnoCoo.y, div2.u1); connect(div1.y, hys.u); connect(hys.y, ySetBac); connect(div2.y, hys1.u); connect(hys1.y, ySetUp); connect(groOcc.y, uGroOcc); connect(oveRidOcc.y, groOcc.u1); connect(schOcc.y, groOcc.u2); connect(totOpeWin.y, yOpeWin); connect(booToInt2.y, totOpeWin.u); connect(schOcc.y, booToRea.u); connect(minToNexOcc.y, pro.u2); connect(booToRea.y, pro.u1); connect(pro.y, nexOcc); connect(sumTem.y, difUnoHea.u2); connect(sumUnoCoo.y, difUnoCoo.u2); connect(u1Occ, uOccFil.u); connect(uWarTim, uWarTimFil.u); connect(u1Win, uWinFil.u); connect(zonOcc, zonOccFil.u); connect(zonOccFil.y, oveRidOcc.u); connect(uOccFil.y, schOcc.u); connect(tNexOccFil.y, minToNexOcc.u); connect(tNexOcc, tNexOccFil.u); connect(uCooTim, uCooTimFil.u); connect(uCooTimFil.y, cooDowTim.u); connect(uWarTimFil.y, warUpTim.u); connect(u1OccHeaHig, uOccHeaHigFil.u); connect(uOccHeaHigFil.y, mulOr.u); connect(u1HigOccCoo, uHigOccCooFil.u); connect(uHigOccCooFil.y, mulOr1.u); connect(u1UnoHeaHig, uUnoHeaHigFil.u); connect(uUnoHeaHigFil.y, booToInt.u); connect(THeaSetOff, THeaSetOffFil.u); connect(THeaSetOffFil.y, sumUnoHea.u); connect(u1EndSetBac, uEndSetBacFil.u); connect(uEndSetBacFil.y, endSetBac.u); connect(u1HigUnoCoo, uHigUnoCooFil.u); connect(uHigUnoCooFil.y, booToInt1.u); connect(TCooSetOff, TCooSetOffFil.u); connect(TCooSetOffFil.y, sumUnoCoo.u); connect(u1EndSetUp, uEndSetUpFil.u); connect(uEndSetUpFil.y, endSetUp.u); connect(TZon, TZonFil.u); connect(TZonFil.y, maxTem.u); connect(uWinFil.y, booToInt2.u); connect(TZonFil.y, sumTem.u); connect(TZonFil.y, minTem.u); end GroupStatus;

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.OperationMode Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.OperationMode

Block that outputs the operation mode

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.OperationMode

Information

This block outputs VAV system operating mode. It is implemented according to ASHRAE guideline G36, section 5.4.3, section 5.4.4, section 5.4.5 and section 5.4.6.

Note that, from the user's point of view, schedules can be a set for individual zones, or they can be set for an entire zone group, depending on how the user interface is implemented. From the point of view of the BAS, individual zone schedules are superimposed to create a zone-group schedule, which then drives system behavior.

  1. All zones in each zone group shall be in the same zone-group operating mode. If one zone in a zone group is placed in any zone-group operating mode other than unoccupied mode (due to override, sequence logic, or scheduled occupancy), all zones in that group shall enter that mode.
  2. A zone group may be in only one mode at a given time.

Each zone group shall have the operating modes shown below.

Occupied Mode

A zone group is in the occupied mode when occupancy input u1Occ is true. This input shall be retrieved from other sequences that specifies occupancy variation and time remaining to the next occupied period tNexOcc. A zone group could be in the occupied mode when any of the following is true:

Warm-up Mode

Warm-up mode shall start based on the zone with the longest calculated warm-up time maxWarUpTim requirement, but no earlier than 3 hours (preWarCooTim) before the start of the scheduled occupied period, and shall end at the scheduled occupied start time. Zones where the window switch indicates that a window is open shall be ignored. Note that for each zone, the optimal warm-up time shall be obtained from an Optimal Start sequences, computed in a separate block. The figure below shows the sequence.

Image of warm-up mode definition

Cooldown Mode

Cooldown mode shall start based on the zone with the longest calculated cooldown time maxCooDowTim requirement, but no earlier than 3 hours (preWarCooTim) before the start of the scheduled occupied period, and shall end at the scheduled occupied start time. Zones where the window switch indicates that a window is open shall be ignored. Note that for each zone, the optimal cooldown time shall be obtained from an Optimal Start sequences, computed in a separate block.

Image of cool-down mode definition

Setback Mode

During unoccupied mode, if any 5 zones (or all zones, if fewer than 5) in the zone group fall below their unoccupied heating setpoints, or if the average zone temperature of the zone group falls below the average unoccupied heating setpoint (uSetBac becomes true), the zone group shall enter setback mode until all spaces in the zone group are 1 °C (2 °F) above their unoccupied setpoints (uEndSetBac becomes true).

Image of setback mode definition

Freeze Protection Setback Mode

During unoccupied Mode, if any single zone falls below 4 °C (40 °F), the zone group shall enter setback mode until all zones are above 7 °C (45 °F), and a Level 3 alarm shall be set.

Setup Mode

During unoccupied mode, if any 5 zones (or all zones, if fewer than 5) in the zone group rise above their unoccupied cooling setpoints, or if the average zone temperature of the zone group rises above the average unoccupied cooling setpoint (uSetUp becomes true), the zone group shall enter setup mode until all spaces in the zone group are 1 °C (2 °F) below their unoccupied setpoints. Zones where the window switch indicates that a window is open shall be ignored.

Image of setup mode definition

Unoccupied Mode

Unoccupied mode shall be active if the zone group is not in any other mode.

Parameters

TypeNameDefaultDescription
IntegernZon Number of zones
RealpreWarCooTim10800Maximum cool-down or warm-up time [s]
RealTZonFreProOn277.15Threshold temperature to activate the freeze protection mode [K]
RealTZonFreProOff280.15Threshold temperature to end the freeze protection mode [K]

Connectors

TypeNameDescription
input BooleanInputu1OccTrue: zone scheduled to be occupied
input RealInputtNexOccTime to next occupied period [s]
input RealInputmaxCooDowTimMaximum cool-down time among all the zones [s]
input BooleanInputu1HigOccCooTrue when there is zone with the temperature being higher than the occupied cooling setpoint
input RealInputmaxWarUpTimMaximum warm-up time among all the zones [s]
input BooleanInputu1OccHeaHigTrue when there is zone with the temperature being lower than the occupied heating setpoint
input IntegerInputuOpeWinTotal number of zones with opening window
input IntegerInputtotColZonTotal number of cold zone
input BooleanInputu1SetBacTrue when the average zone temperature falls below the average unoccupied heating setpoint
input BooleanInputu1EndSetBacTrue when the setback mode could end
input RealInputTZonMinMinimum zone temperature [K]
input IntegerInputtotHotZonTotal number of hot zone
input BooleanInputu1SetUpTrue when the average zone temperature rises above the average unoccupied cooling setpoint
input BooleanInputu1EndSetUpTrue when the setup mode could end
output IntegerOutputyOpeModOperation mode

Modelica definition

block OperationMode "Block that outputs the operation mode" parameter Integer nZon(min=1) "Number of zones"; parameter Real preWarCooTim( final unit="s", final quantity="Time") = 10800 "Maximum cool-down or warm-up time"; parameter Real TZonFreProOn( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature")=277.15 "Threshold temperature to activate the freeze protection mode"; parameter Real TZonFreProOff( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature")=280.15 "Threshold temperature to end the freeze protection mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Occ "True: zone scheduled to be occupied"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc( final unit="s", final quantity="Time") "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput maxCooDowTim( final unit="s", final quantity="Time") "Maximum cool-down time among all the zones"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HigOccCoo "True when there is zone with the temperature being higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput maxWarUpTim( final unit="s", final quantity="Time") "Maximum warm-up time among all the zones"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1OccHeaHig "True when there is zone with the temperature being lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeWin "Total number of zones with opening window"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput totColZon "Total number of cold zone"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SetBac "True when the average zone temperature falls below the average unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetBac "True when the setback mode could end"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZonMin( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Minimum zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput totHotZon "Total number of hot zone"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1SetUp "True when the average zone temperature rises above the average unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetUp "True when the setup mode could end"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yOpeMod "Operation mode"; protected Buildings.Controls.OBC.CDL.Continuous.Sources.Constant occModInd( final k=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.occupied) "Occupied mode "; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant unoPerInd( final k=0) "Index to indicate unoccupied period"; Buildings.Controls.OBC.CDL.Continuous.Switch corCooDowTim "Corrected cool down period"; Buildings.Controls.OBC.CDL.Continuous.Switch corWarUpTim "Corrected warm-up period"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr( final t=4) "Check if the number of cold zones is not less than than 5"; Buildings.Controls.OBC.CDL.Logical.Latch lat "If all zone temperature are higher than unoccupied heating setpoint by a given limit, then the setback mode should be off"; Buildings.Controls.OBC.CDL.Logical.Latch lat1 "If all zone temperature are higher than threshold temperature of ending freeze protection, then freeze protection setback mode should be off"; Buildings.Controls.OBC.CDL.Logical.Latch lat2 "If all zone temperature are lower than unoccupied cooling setpoint by a given limit, then the setup mode should be off"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2( final pre_y_start=true, final uHigh=0, final uLow=-60) "Hysteresis that outputs if the maximum cool-down time is more than the allowed cool-down time"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys3( final pre_y_start=true, final uHigh=0, final uLow=-60) "Hysteresis that outputs if the maximum warm-up time is more than allowed warm-up time"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub5 "Calculate differential between time-to-next-occupancy and the cool-down time"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4( final pre_y_start=false, final uHigh=0, final uLow=-60) "Hysteresis to check if the cooldown mode could be activated"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys5( final pre_y_start=false, final uHigh=0, final uLow=-60) "Hysteresis to activate the warm-up model"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub6 "Calculate differential between time-to-next-occupancy and the warm-up time"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys9( final pre_y_start=false, final uLow=-0.1, final uHigh=0.1) "Hysteresis that outputs if any zone temperature is lower than freeze protection threshold temperature"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys10( final pre_y_start=false, final uLow=-0.1, final uHigh=0.1) "Hysteresis that outputs if all zone temperature are higher than threshold temperature of ending freeze protection"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant maxWarCooTime( final k=preWarCooTim) "Allowed maximum warm-up or cool-down time"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr2( final t=4) "Check if the number of hot zones is not less than than 5"; Buildings.Controls.OBC.CDL.Integers.Add addInt "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Integers.Add addInt1 "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Integers.Add addInt2 "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Integers.Add addInt3 "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Integers.Add addInt4 "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Integers.Add addInt5 "Sum of two integer inputs"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger occMod "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger freProSetBacMod "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger setUpMod "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Logical.Edge edg "Get the moment when the warm up time starts "; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol( final trueHoldDuration=preWarCooTim) "Hold the start time true signal"; Buildings.Controls.OBC.CDL.Logical.Edge edg1 "Get the moment when cool down time starts"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol1( final trueHoldDuration=preWarCooTim) "Hold the start time true signal"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea1( final realTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.warmUp) "Convert Boolean to Integer number"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea( final realTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.coolDown) "Convert Boolean to Integer number"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger booToInt3( final integerTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.unoccupied) "Convert Boolean to Integer "; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea6( final realTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.setUp) "Convert Boolean to Real "; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea4( final realTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.freezeProtection) "Convert Boolean to Real "; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea3( final realTrue=Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes.setBack) "Convert Boolean to Real "; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="Level 3 alarm: freeze protection setback") "Generate alarm message"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Logical not"; Buildings.Controls.OBC.CDL.Logical.And and1 "Warm-up period"; Buildings.Controls.OBC.CDL.Logical.And and2 "Get the start of the cool-down time"; Buildings.Controls.OBC.CDL.Logical.Or or1 "Check if the number of cold zone is more than 5 or all zones are cold"; Buildings.Controls.OBC.CDL.Logical.Or3 or3 "Check if it is in occupied, cooldown, or warm-up mode"; Buildings.Controls.OBC.CDL.Logical.Or or4 "Check if the number of hot zone is more than 5 or all zones are hot"; Buildings.Controls.OBC.CDL.Logical.Or3 or5 "Check if it is in Setback, Setback_freezeProtection, or Setup mode"; Buildings.Controls.OBC.CDL.Logical.Or or6 "Check if it is in any of the 6 modes except unoccupied mode"; Buildings.Controls.OBC.CDL.Continuous.Switch swi "Switch between occupied mode index and unoccupied period index"; Buildings.Controls.OBC.CDL.Continuous.Switch swi3 "If the Cool-down, warm-up, or Occupied mode is on, then setback mode should not be activated."; Buildings.Controls.OBC.CDL.Continuous.Switch swi4 "If the Cool-down, warm-up, or Occupied mode is on, then freeze protection setback mode should not be activated."; Buildings.Controls.OBC.CDL.Continuous.Switch swi5 "If the Cool-down, warm-up, or Occupied mode is on, then setup mode should not be activated."; Buildings.Controls.OBC.CDL.Logical.Not not5 "Logical not"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold notOcc( final t=1) "Check if the operation mode is other than occupied mode"; Buildings.Controls.OBC.CDL.Logical.And and3 "True if window open during modes other than occupied mode"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Logical not"; Buildings.Controls.OBC.CDL.Utilities.Assert winOpe( final message="Level 4 alarm: window open during modes other than occupied mode") "Generate alarm message when window open during modes other than occupied mode"; Buildings.Controls.OBC.CDL.Continuous.Switch swi1 "If occupied mode is on, then cool down mode should not be activated"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod1 "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Continuous.Switch swi2 "If occupied mode is on, then warm-up mode should not be activated."; Buildings.Controls.OBC.CDL.Conversions.RealToInteger setBacMod2 "Convert Real number to Integer number"; Buildings.Controls.OBC.CDL.Logical.And and4 "Cool-down period"; Buildings.Controls.OBC.CDL.Logical.And and5 "Get the start of the warm-up time"; Buildings.Controls.OBC.CDL.Integers.Sources.Constant totZon( final k=nZon) "Total number of zones"; Buildings.Controls.OBC.CDL.Integers.Equal allCol "Check if all zones are cold zone"; Buildings.Controls.OBC.CDL.Integers.Equal allHot "Check if all zones are hot zone"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant actFreProTem( final k=TZonFreProOn) "Threshold temperature to activate the freeze protection mode"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant endFreProTem( final k=TZonFreProOff) "Threshold temperature to end the freeze protection mode"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub2 "Calculate differential between minimum zone temperature and freeze protection threshold temperature"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub1 "Calculate differential between maximum zone temperature and threshold temperature of ending freeze protection"; Buildings.Controls.OBC.CDL.Logical.Or or2 "Enough cold zone or the low average zone temperature"; Buildings.Controls.OBC.CDL.Logical.Or or7 "Enough hot zone or the high average zone temperature"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub3 "Calculate the difference between maximum cool down time and the allowed maximum cool down time"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub4 "Calculate the differential between maximum warm-up time and the allowed maximum warm-up time"; Buildings.Controls.OBC.CDL.Logical.Edge endSetBac "End setback mode when the input becomes true"; Buildings.Controls.OBC.CDL.Logical.Edge endSetUp "End setup mode when the input becomes true"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr1( final t=1) "Check if there is any zone with opening window"; Buildings.Controls.OBC.CDL.Integers.Add addInt6 "Total cold zone and zones with opening window"; Buildings.Controls.OBC.CDL.Integers.Add addInt7 "Total hot zone and zones with opening window"; equation connect(swi.y, occMod.u); connect(occModInd.y, swi.u1); connect(unoPerInd.y, swi.u3); connect(intGreThr.y, or1.u1); connect(lat.y, booToRea3.u); connect(unoPerInd.y, swi3.u1); connect(or3.y, swi3.u2); connect(lat1.y, booToRea4.u); connect(or3.y, swi4.u2); connect(unoPerInd.y, swi4.u1); connect(lat2.y, booToRea6.u); connect(or3.y, swi5.u2); connect(unoPerInd.y, swi5.u1); connect(swi3.y, setBacMod.u); connect(swi4.y, freProSetBacMod.u); connect(swi5.y, setUpMod.u); connect(or5.y, or6.u1); connect(or6.y, not2.u); connect(not2.y,booToInt3. u); connect(and1.y,booToRea1. u); connect(and1.y, or3.u1); connect(u1Occ, swi.u2); connect(u1Occ, or3.u3); connect(hys2.y, corCooDowTim.u2); connect(hys3.y, corWarUpTim.u2); connect(sub5.y, hys4.u); connect(sub6.y, hys5.u); connect(hys9.y, lat1.u); connect(hys10.y, lat1.clr); connect(maxWarCooTime.y, corCooDowTim.u3); connect(maxWarCooTime.y, corWarUpTim.u3); connect(booToRea3.y, swi3.u3); connect(booToRea4.y, swi4.u3); connect(booToRea6.y, swi5.u3); connect(lat1.y, not5.u); connect(not5.y, assMes.u); connect(maxCooDowTim, corCooDowTim.u1); connect(maxWarUpTim, corWarUpTim.u1); connect(totColZon, intGreThr.u); connect(totHotZon, intGreThr2.u); connect(intGreThr2.y, or4.u1); connect(setBacMod.y, addInt2.u1); connect(freProSetBacMod.y, addInt2.u2); connect(setUpMod.y, addInt3.u2); connect(addInt2.y, addInt3.u1); connect(addInt3.y, addInt4.u1); connect(booToInt3.y, addInt4.u2); connect(addInt5.y, yOpeMod); connect(notOcc.y, and3.u2); connect(and3.y, not1.u); connect(addInt5.y, notOcc.u); connect(not1.y, winOpe.u); connect(booToRea.y, swi1.u3); connect(u1Occ, swi1.u2); connect(swi1.y, setBacMod1.u); connect(setBacMod1.y, addInt.u1); connect(addInt.y, addInt1.u2); connect(occMod.y, addInt1.u1); connect(addInt1.y, addInt5.u1); connect(addInt4.y, addInt5.u2); connect(booToRea1.y, swi2.u3); connect(unoPerInd.y, swi1.u1); connect(unoPerInd.y, swi2.u1); connect(swi2.y, setBacMod2.u); connect(setBacMod2.y, addInt.u2); connect(and4.y, booToRea.u); connect(and4.y, or3.u2); connect(hys4.y, and2.u1); connect(u1OccHeaHig, and5.u2); connect(hys5.y, and5.u1); connect(truFalHol1.u, edg.y); connect(and5.y, edg.u); connect(and2.y, edg1.u); connect(edg1.y, truFalHol.u); connect(lat2.y, or5.u1); connect(lat1.y, or5.u2); connect(lat.y, or5.u3); connect(or3.y, or6.u2); connect(allCol.y, or1.u2); connect(allHot.y, or4.u2); connect(totZon.y, allCol.u2); connect(totZon.y, allHot.u2); connect(sub2.y, hys9.u); connect(sub1.y, hys10.u); connect(TZonMin, sub1.u1); connect(endFreProTem.y, sub1.u2); connect(or1.y, or2.u1); connect(or2.y, lat.u); connect(u1SetBac, or2.u2); connect(or4.y, or7.u1); connect(or7.y, lat2.u); connect(u1SetUp, or7.u2); connect(u1Occ, swi2.u2); connect(truFalHol.y, and4.u2); connect(hys4.y, and4.u1); connect(truFalHol1.y, and1.u2); connect(hys5.y, and1.u1); connect(u1HigOccCoo, and2.u2); connect(maxWarCooTime.y, sub4.u1); connect(maxWarUpTim, sub4.u2); connect(sub3.y, hys2.u); connect(sub4.y, hys3.u); connect(u1EndSetBac, endSetBac.u); connect(endSetBac.y, lat.clr); connect(u1EndSetUp, endSetUp.u); connect(endSetUp.y, lat2.clr); connect(uOpeWin, intGreThr1.u); connect(intGreThr1.y, and3.u1); connect(totColZon, addInt6.u2); connect(uOpeWin, addInt6.u1); connect(addInt6.y, allCol.u1); connect(totHotZon, addInt7.u2); connect(uOpeWin, addInt7.u1); connect(addInt7.y, allHot.u1); connect(maxWarCooTime.y, sub3.u1); connect(maxCooDowTim, sub3.u2); connect(tNexOcc, sub5.u2); connect(corCooDowTim.y, sub5.u1); connect(corWarUpTim.y, sub6.u1); connect(tNexOcc, sub6.u2); connect(actFreProTem.y, sub2.u1); connect(TZonMin, sub2.u2); end OperationMode;

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneGroupSystem Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneGroupSystem

Compute the AHU operating mode from the group operating mode

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneGroupSystem

Information

This sequence specifies the operation mode of a AHU system, which may serve multiple zone group. It is implemented according to Section 5.15.1 of ASHRAE Guideline G36, May 2020.

When zone group served by an air-handling system are in different modes, the following hierarchy applies (highest one sets AHU mode):

  1. Occupied mode
  2. Cooldown mode
  3. Setup mode
  4. Warm-up mode
  5. Setback mode
  6. Freeze protection setback mode
  7. Unoccupied mode

See the operation mode enumeration in Buildings.Controls.OBC.ASHRAE.G36.Types.OperationModes for the detailed description.

Parameters

TypeNameDefaultDescription
IntegernGro Total number of groups

Connectors

TypeNameDescription
input IntegerInputuOpeMod[nGro]Groups operation mode
output IntegerOutputyAhuOpeModOperation mode for AHU operation

Modelica definition

block ZoneGroupSystem "Compute the AHU operating mode from the group operating mode" parameter Integer nGro "Total number of groups"; Buildings.Controls.OBC.CDL.Interfaces.IntegerInput uOpeMod[nGro] "Groups operation mode"; Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea[nGro] "Convert integer to real"; Buildings.Controls.OBC.CDL.Continuous.MultiMin mulMin(nin=nGro) "Find the highest priotity operating mode"; Buildings.Controls.OBC.CDL.Conversions.RealToInteger ahuMod "Air handling operating mode"; Buildings.Controls.OBC.CDL.Interfaces.IntegerOutput yAhuOpeMod "Operation mode for AHU operation"; equation connect(intToRea.y, mulMin.u); connect(mulMin.y, ahuMod.u); connect(ahuMod.y, yAhuOpeMod); connect(uOpeMod, intToRea.u); end ZoneGroupSystem;

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatus Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatus

Block that outputs zone temperature status

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatus

Information

This block outputs single zone status. It includes outputs as following:

Parameters

TypeNameDefaultDescription
RealbouLim1Threshold of temperature difference for indicating the end of setback or setup mode [K]
Booleanhave_winSenfalseCheck if the zone has window status sensor
Advanced
RealuLow-0.1Low limit of the hysteresis for checking temperature difference [K]
RealuHigh0.1High limit of the hysteresis for checking temperature difference [K]

Connectors

TypeNameDescription
input RealInputcooDowTimCool-down time retrieved from optimal cool-down block [s]
input RealInputwarUpTimWarm-up time retrieved from optimal warm-up block [s]
input BooleanInputu1WinWindow status: true=open, false=close
input RealInputTZonSingle zone temperature [K]
input RealInputTOccHeaSetOccupied heating setpoint [K]
input RealInputTOccCooSetOccupied cooling setpoint [K]
input RealInputTUnoHeaSetUnoccupied heating setpoint [K]
input RealInputTUnoCooSetUnoccupied cooling setpoint [K]
output RealOutputyCooTimCool-down time [s]
output RealOutputyWarTimWarm-up time [s]
output BooleanOutputyOccHeaHigTrue when the zone temperature is lower than the occupied heating setpoint
output BooleanOutputyHigOccCooTrue when the zone temperature is higher than the occupied cooling setpoint
output BooleanOutputyUnoHeaHigTrue when the zone temperature is lower than the unoccupied heating setpoint
output BooleanOutputyEndSetBacTrue when the zone could end setback mode
output BooleanOutputyHigUnoCooTrue when the zone temperature is higher than the unoccupied cooling setpoint
output BooleanOutputyEndSetUpTrue when the zone could end setup mode

Modelica definition

block ZoneStatus "Block that outputs zone temperature status" parameter Real bouLim( final unit="K", displayUnit="K", final quantity="TemperatureDifference", final min=0.5) = 1 "Threshold of temperature difference for indicating the end of setback or setup mode"; parameter Boolean have_winSen=false "Check if the zone has window status sensor"; parameter Real uLow( final unit="K", final quantity="TemperatureDifference")=-0.1 "Low limit of the hysteresis for checking temperature difference"; parameter Real uHigh( final unit="K", final quantity="TemperatureDifference")=0.1 "High limit of the hysteresis for checking temperature difference"; Buildings.Controls.OBC.CDL.Interfaces.RealInput cooDowTim( final unit="s", final quantity="Time") "Cool-down time retrieved from optimal cool-down block"; Buildings.Controls.OBC.CDL.Interfaces.RealInput warUpTim( final unit="s", final quantity="Time") "Warm-up time retrieved from optimal warm-up block"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Win if have_winSen "Window status: true=open, false=close"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Single zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TOccHeaSet( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TOccCooSet( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TUnoHeaSet( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TUnoCooSet( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim( final unit="s", final quantity="Time") "Cool-down time"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim( final unit="s", final quantity="Time") "Warm-up time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yOccHeaHig "True when the zone temperature is lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigOccCoo "True when the zone temperature is higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yUnoHeaHig "True when the zone temperature is lower than the unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetBac "True when the zone could end setback mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yHigUnoCoo "True when the zone temperature is higher than the unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yEndSetUp "True when the zone could end setup mode"; protected Buildings.Controls.OBC.CDL.Continuous.Multiply pro "Decide if the cool down time of one zone should be ignored: if window is open, then output zero, otherwise, output cool-down time from optimal cool-down block"; Buildings.Controls.OBC.CDL.Continuous.Multiply pro1 "Decide if the warm-up time of one zone should be ignored: if window is open, then output zero, otherwise, output warm-up time from optimal warm-up block"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub "Calculate difference between zone temperature and the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the system should run in warm-up mode"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub1 "Calculate difference between zone temperature and the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys1( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the system should run in cool-down mode"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub2 "Calculate zone temperature difference to unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys2( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the zone temperature is lower than unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub5 "Calculate zone temperature difference to unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys5( final uLow=uLow, final uHigh=uHigh) "Hysteresis that outputs if the zone temperature is higher than unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Logical not"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea "Convert Boolean to Real number"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con( final k=false) if not have_winSen "Constant false"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub3 "Calculate zone temperature difference to unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys3( final uLow=0, final uHigh=bouLim) "Hysteresis that outputs if the zone temperature is higher than its unoccupied heating setpoint by a given limit"; Buildings.Controls.OBC.CDL.Continuous.Subtract sub4 "Calculate zone temperature difference to unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys4( final uLow=0, final uHigh=bouLim) "Hysteresis that outputs if the zone temperature is lower than its unoccupied cooling setpoint by a given limit"; Buildings.Controls.OBC.CDL.Logical.And and2 "When window is open, it should output false"; Buildings.Controls.OBC.CDL.Logical.And and1 "When window is open, it should output false"; Buildings.Controls.OBC.CDL.Logical.And and3 "When window is open, it should output false"; Buildings.Controls.OBC.CDL.Logical.Or or2 "When window is open, it should output true"; Buildings.Controls.OBC.CDL.Logical.And and5 "When window is open, it should output false"; Buildings.Controls.OBC.CDL.Logical.Or or1 "When window is open, it should output true"; equation connect(cooDowTim, pro.u1); connect(warUpTim, pro1.u1); connect(booToRea.y, pro.u2); connect(booToRea.y, pro1.u2); connect(sub.y, hys.u); connect(sub1.y, hys1.u); connect(u1Win, not1.u); connect(sub2.y, hys2.u); connect(sub5.y, hys5.u); connect(not1.y, booToRea.u); connect(pro.y, yCooTim); connect(pro1.y, yWarTim); connect(con.y, not1.u); connect(TZon, sub.u2); connect(sub3.y, hys3.u); connect(sub4.y, hys4.u); connect(TZon, sub2.u2); connect(TZon, sub3.u1); connect(and2.y, yOccHeaHig); connect(hys.y, and2.u1); connect(hys1.y, and1.u1); connect(hys2.y, and3.u1); connect(hys3.y, or2.u1); connect(hys5.y, and5.u1); connect(hys4.y, or1.u1); connect(not1.y, and2.u2); connect(not1.y, and1.u2); connect(and1.y, yHigOccCoo); connect(and3.y, yUnoHeaHig); connect(or2.y, yEndSetBac); connect(and5.y, yHigUnoCoo); connect(or1.y, yEndSetUp); connect(u1Win, or2.u2); connect(u1Win, or1.u2); connect(con.y, or2.u2); connect(con.y, or1.u2); connect(not1.y, and3.u2); connect(not1.y, and5.u2); connect(TZon, sub1.u1); connect(TZon, sub5.u1); connect(TZon, sub4.u2); connect(TOccHeaSet, sub.u1); connect(TOccCooSet, sub1.u2); connect(TUnoHeaSet, sub2.u1); connect(TUnoHeaSet, sub3.u2); connect(TUnoCooSet, sub5.u2); connect(TUnoCooSet, sub4.u1); end ZoneStatus;

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatusDuplicator Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatusDuplicator

Duplicate zone status output

Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.ZoneStatusDuplicator

Information

This block duplicates the signals of nZon by converting the input vector-valued signals of dimension nZon to a matrix-valued output of dimension [nZonGro, nZon].

This block prevent the use of for loops in the connectors between zones and zone groups by connecting all the zones to each Buildings.Controls.OBC.ASHRAE.G36.ZoneGroups.GroupStatus.

Parameters

TypeNameDefaultDescription
IntegernZon1Number of zones in input
IntegernZonGro1Number of groups in output

Connectors

TypeNameDescription
input BooleanInputzonOcc[nZon]True when the zone is set to be occupied due to the override
input BooleanInputu1Occ[nZon]True when the zone is occupied according to the occupancy schedule
input RealInputtNexOcc[nZon]Time to next occupied period [s]
input RealInputuCooTim[nZon]Cool down time [s]
input RealInputuWarTim[nZon]Warm-up time [s]
input BooleanInputu1OccHeaHig[nZon]True when the zone temperature is lower than the occupied heating setpoint
input BooleanInputu1HigOccCoo[nZon]True when the zone temperature is higher than the occupied cooling setpoint
input BooleanInputu1UnoHeaHig[nZon]True when the zone temperature is lower than the unoccupied heating setpoint
input RealInputTHeaSetOff[nZon]Zone unoccupied heating setpoint [K]
input BooleanInputu1EndSetBac[nZon]True when the zone could end the setback mode
input BooleanInputu1HigUnoCoo[nZon]True when the zone temperature is higher than its unoccupied cooling setpoint
input RealInputTCooSetOff[nZon]Zone unoccupied cooling setpoint [K]
input BooleanInputu1EndSetUp[nZon]True when the zone could end the setup mode
input RealInputTZon[nZon]Zone temperature [K]
input BooleanInputu1Win[nZon]True when the window is open, false when the window is close or the zone does not have window status sensor
output BooleanOutputy1ZonOcc[nZonGro, nZon]True when the zone is set to be occupied due to the override
output BooleanOutputy1Occ[nZonGro, nZon]True when the zone is occupied according to the occupancy schedule
output RealOutputytNexOcc[nZonGro, nZon]Time to next occupied period [s]
output RealOutputyCooTim[nZonGro, nZon]Cool down time [s]
output RealOutputyWarTim[nZonGro, nZon]Warm-up time [s]
output BooleanOutputy1OccHeaHig[nZonGro, nZon]True when the zone temperature is lower than the occupied heating setpoint
output BooleanOutputy1HigOccCoo[nZonGro, nZon]True when the zone temperature is higher than the occupied cooling setpoint
output BooleanOutputy1UnoHeaHig[nZonGro, nZon]True when the zone temperature is lower than the unoccupied heating setpoint
output RealOutputyTHeaSetOff[nZonGro, nZon]Zone unoccupied heating setpoint [K]
output BooleanOutputy1EndSetBac[nZonGro, nZon]True when the zone could end the setback mode
output BooleanOutputy1HigUnoCoo[nZonGro, nZon]True when the zone temperature is higher than its unoccupied cooling setpoint
output RealOutputyTCooSetOff[nZonGro, nZon]Zone unoccupied cooling setpoint [K]
output BooleanOutputy1EndSetUp[nZonGro, nZon]True when the zone could end the setup mode
output RealOutputyTZon[nZonGro, nZon]Zone temperature [K]
output BooleanOutputy1Win[nZonGro, nZon]True when the window is open, false when the window is close or the zone does not have window status sensor

Modelica definition

block ZoneStatusDuplicator "Duplicate zone status output" parameter Integer nZon(final min=1)=1 "Number of zones in input"; parameter Integer nZonGro(final min=1)=1 "Number of groups in output"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput zonOcc[nZon] "True when the zone is set to be occupied due to the override"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Occ[nZon] "True when the zone is occupied according to the occupancy schedule"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tNexOcc[nZon]( final unit=fill("s", nZon), final quantity=fill("Time", nZon)) "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uCooTim[nZon]( final unit=fill("s", nZon), final quantity=fill("Time", nZon)) "Cool down time"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uWarTim[nZon]( final unit=fill("s", nZon), final quantity=fill("Time", nZon)) "Warm-up time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1OccHeaHig[nZon] "True when the zone temperature is lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HigOccCoo[nZon] "True when the zone temperature is higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1UnoHeaHig[nZon] "True when the zone temperature is lower than the unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaSetOff[nZon]( final unit=fill("K", nZon), displayUnit=fill("degC", nZon), final quantity=fill("ThermodynamicTemperature", nZon)) "Zone unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetBac[nZon] "True when the zone could end the setback mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1HigUnoCoo[nZon] "True when the zone temperature is higher than its unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TCooSetOff[nZon]( final unit=fill("K", nZon), displayUnit=fill("degC", nZon), final quantity=fill("ThermodynamicTemperature", nZon)) "Zone unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1EndSetUp[nZon] "True when the zone could end the setup mode"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TZon[nZon]( final unit=fill("K", nZon), displayUnit=fill("degC", nZon), final quantity=fill("ThermodynamicTemperature", nZon)) "Zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u1Win[nZon] "True when the window is open, false when the window is close or the zone does not have window status sensor"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1ZonOcc[nZonGro,nZon] "True when the zone is set to be occupied due to the override"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Occ[nZonGro,nZon] "True when the zone is occupied according to the occupancy schedule"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput ytNexOcc[nZonGro, nZon]( final unit=fill("s", nZonGro, nZon), final quantity=fill("Time", nZonGro, nZon)) "Time to next occupied period"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCooTim[nZonGro,nZon]( final unit=fill("s", nZonGro, nZon), final quantity=fill("Time", nZonGro, nZon)) "Cool down time"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yWarTim[nZonGro,nZon]( final unit=fill("s", nZonGro, nZon), final quantity=fill("Time", nZonGro, nZon)) "Warm-up time"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1OccHeaHig[nZonGro,nZon] "True when the zone temperature is lower than the occupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HigOccCoo[nZonGro,nZon] "True when the zone temperature is higher than the occupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1UnoHeaHig[nZonGro,nZon] "True when the zone temperature is lower than the unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTHeaSetOff[nZonGro, nZon]( final unit=fill("K", nZonGro, nZon), displayUnit=fill("degC", nZonGro, nZon), final quantity=fill("ThermodynamicTemperature", nZonGro, nZon)) "Zone unoccupied heating setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1EndSetBac[nZonGro,nZon] "True when the zone could end the setback mode"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1HigUnoCoo[nZonGro,nZon] "True when the zone temperature is higher than its unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTCooSetOff[nZonGro, nZon]( final unit=fill("K", nZonGro, nZon), displayUnit=fill("degC", nZonGro, nZon), final quantity=fill("ThermodynamicTemperature", nZonGro, nZon)) "Zone unoccupied cooling setpoint"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1EndSetUp[nZonGro,nZon] "True when the zone could end the setup mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yTZon[nZonGro, nZon]( final unit=fill("K", nZonGro, nZon), displayUnit=fill("degC", nZonGro, nZon), final quantity=fill("ThermodynamicTemperature", nZonGro, nZon)) "Zone temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y1Win[nZonGro,nZon] "True when the window is open, false when the window is close or the zone does not have window status sensor"; protected Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator zonOccDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uOccDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator tNexOccDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator uCooTimDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator uWarTimDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uOccHeaHigDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uHigOccCooDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uUnoHeaHigDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator THeaSetOffDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uEndSetBacDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uHigUnoCooDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator TCooSetOffDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uEndSetUpDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.RealVectorReplicator TZonDup( final nin=nZon, final nout=nZonGro) "Duplicator"; Buildings.Controls.OBC.CDL.Routing.BooleanVectorReplicator uWinDup( final nin=nZon, final nout=nZonGro) "Duplicator"; equation connect(zonOcc, zonOccDup.u); connect(u1Occ, uOccDup.u); connect(tNexOcc, tNexOccDup.u); connect(uCooTim, uCooTimDup.u); connect(uWarTim, uWarTimDup.u); connect(u1OccHeaHig, uOccHeaHigDup.u); connect(u1HigOccCoo, uHigOccCooDup.u); connect(u1UnoHeaHig, uUnoHeaHigDup.u); connect(THeaSetOff, THeaSetOffDup.u); connect(u1EndSetBac, uEndSetBacDup.u); connect(u1HigUnoCoo, uHigUnoCooDup.u); connect(TCooSetOff, TCooSetOffDup.u); connect(u1EndSetUp, uEndSetUpDup.u); connect(TZon, TZonDup.u); connect(u1Win, uWinDup.u); connect(zonOccDup.y, y1ZonOcc); connect(uOccDup.y, y1Occ); connect(ytNexOcc, tNexOccDup.y); connect(yCooTim, uCooTimDup.y); connect(uWarTimDup.y, yWarTim); connect(uOccHeaHigDup.y, y1OccHeaHig); connect(uHigOccCooDup.y, y1HigOccCoo); connect(uUnoHeaHigDup.y, y1UnoHeaHig); connect(THeaSetOffDup.y, yTHeaSetOff); connect(uEndSetBacDup.y, y1EndSetBac); connect(uHigUnoCooDup.y, y1HigUnoCoo); connect(TCooSetOffDup.y, yTCooSetOff); connect(uEndSetUpDup.y, y1EndSetUp); connect(TZonDup.y, yTZon); connect(uWinDup.y, y1Win); end ZoneStatusDuplicator;