Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples

Example models to test the components

Information

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.OperationModes OperationModes Test model for operation modes
Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.RoomVAV RoomVAV Test model for the room VAV controller
Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SupplyAirTemperature SupplyAirTemperature Validation of the supply air temperature control
Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SystemHysteresis SystemHysteresis Test model for the system hysteresis

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.OperationModes Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.OperationModes

Test model for operation modes

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.OperationModes

Information

This model tests the transition between the different modes of operation of the HVAC system.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Connectors

TypeNameDescription
ControlBuscontrolBus 

Modelica definition

model OperationModes "Test model for operation modes" extends Modelica.Icons.Example; Buildings.Examples.VAVReheat.BaseClasses.Controls.ModeSelector operationModes; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo; Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTem(T=273.15); Modelica.Thermal.HeatTransfer.Components.HeatCapacitor cap(C=20000, T(fixed= true)); Modelica.Thermal.HeatTransfer.Components.ThermalConductor con(G=1); Modelica.Blocks.Logical.Switch switch1; Modelica.Blocks.Sources.Constant on(k=200); Modelica.Blocks.Sources.Constant off(k=0); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temperatureSensor; Modelica.Blocks.Sources.RealExpression TRooSetHea( y=if mode.y == Integer(Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes.occupied) then 293.15 else 287.15); Modelica.Blocks.Sources.Constant TCoiHea(k=283.15) "Temperature after heating coil"; Buildings.Examples.VAVReheat.BaseClasses.Controls.ControlBus controlBus; Modelica.Blocks.Routing.IntegerPassThrough mode "Outputs the control mode"; Modelica.Blocks.Sources.BooleanExpression modSel( y=mode.y == Integer(Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes.unoccupiedNightSetBack) or mode.y == Integer(Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes.unoccupiedWarmUp)); Modelica.Blocks.Sources.Constant TOut(k=283.15) "Outside temperature"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temperatureSensor1; Modelica.Blocks.Sources.BooleanExpression modSel1( y=mode.y == Integer(Buildings.Examples.VAVReheat.BaseClasses.Controls.OperationModes.occupied)); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo1; Buildings.Controls.Continuous.LimPID PID(initType=Modelica.Blocks.Types.Init.InitialState); Modelica.Blocks.Logical.Switch switch2; Modelica.Blocks.Math.Gain gain(k=200); Buildings.Controls.SetPoints.OccupancySchedule occSch "Occupancy schedule"; equation connect(fixTem.port, con.port_a); connect(preHeaFlo.port, cap.port); connect(con.port_b, cap.port); connect(switch1.y, preHeaFlo.Q_flow); connect(on.y, switch1.u1); connect(off.y, switch1.u3); connect(cap.port, temperatureSensor.port); connect(controlBus, operationModes.cb); connect(temperatureSensor.T, controlBus.TRooMin); connect(TCoiHea.y, controlBus.TCoiHeaOut); connect(controlBus.controlMode, mode.u); connect(modSel.y, switch1.u2); connect(TOut.y, controlBus.TOut); connect(cap.port, temperatureSensor1.port); connect(temperatureSensor1.T, controlBus.TRooAve); connect(TRooSetHea.y, PID.u_s); connect(temperatureSensor.T, PID.u_m); connect(modSel1.y, switch2.u2); connect(off.y, switch2.u3); connect(preHeaFlo1.port, cap.port); connect(PID.y, switch2.u1); connect(gain.y, preHeaFlo1.Q_flow); connect(switch2.y, gain.u); connect(occSch.tNexOcc, controlBus.dTNexOcc); connect(TRooSetHea.y, controlBus.TRooSetHea); connect(occSch.occupied, controlBus.occupied); end OperationModes;

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.RoomVAV Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.RoomVAV

Test model for the room VAV controller

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.RoomVAV

Information

This model tests the VAV box contoller of transition from heating control to cooling control.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model RoomVAV "Test model for the room VAV controller" extends Modelica.Icons.Example; Buildings.Examples.VAVReheat.BaseClasses.Controls.RoomVAV vavBoxCon(ratVFloMin=0.15, ratVFloHea=0.3) "VAV terminal unit single maximum controller"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant heaSet(k=273.15 + 21) "Heating setpoint"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cooSet(k=273.15 + 22) "Cooling setpoint"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram( height=4, duration=3600, offset=-4) "Ramp source"; Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sin( amplitude=1, freqHz=1/3600, offset=273.15 + 23.5) "Sine source"; Buildings.Controls.OBC.CDL.Continuous.Add rooTem "Room temperature"; equation connect(rooTem.y, vavBoxCon.TRoo); connect(cooSet.y, vavBoxCon.TRooCooSet); connect(heaSet.y, vavBoxCon.TRooHeaSet); connect(sin.y, rooTem.u2); connect(ram.y, rooTem.u1); end RoomVAV;

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SupplyAirTemperature Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SupplyAirTemperature

Validation of the supply air temperature control

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SupplyAirTemperature

Information

This model validates the supply air temperature control, as implemented in Buildings.Examples.VAVReheat.BaseClasses.Controls.SupplyAirTemperature

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SupplyAirTemperature "Validation of the supply air temperature control" extends Modelica.Icons.Example; Buildings.Examples.VAVReheat.BaseClasses.Controls.SupplyAirTemperature conTSup(k=0.1, Ti= 60) "Controller"; Buildings.Controls.OBC.CDL.Logical.Sources.Pulse uEna(period=2800) "Enable signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TSupSet( y(final unit="K", displayUnit="degC"), k=13 + 273.15) "Set point"; Buildings.Controls.OBC.CDL.Continuous.Sources.Sine TSup( phase=3.1415926535898, y(final unit="K", displayUnit="degC"), amplitude=5, freqHz=2/3600, offset=13 + 273.15) "Measurement"; equation connect(TSupSet.y, conTSup.TSupSet); connect(uEna.y, conTSup.uEna); connect(TSup.y, conTSup.TSup); end SupplyAirTemperature;

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SystemHysteresis Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SystemHysteresis

Test model for the system hysteresis

Buildings.Examples.VAVReheat.BaseClasses.Controls.Examples.SystemHysteresis

Information

This model tests Buildings.Examples.VAVReheat.BaseClasses.Controls.SystemHysteresis.

In one test, there is repeated on/off, while in the other test, there is only one switch to on. Note that sys1 has a high frequency input, but the pump signal stays on to avoid short cycling.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SystemHysteresis "Test model for the system hysteresis" extends Modelica.Icons.Example; Buildings.Examples.VAVReheat.BaseClasses.Controls.SystemHysteresis sysHys; Buildings.Examples.VAVReheat.BaseClasses.Controls.SystemHysteresis sysHys1; Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse pul(width=1/60, period=3600) "Pulse source"; Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse pul1(width=1/10, period( displayUnit="min") = 60) "Pulse source"; protected Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul( final width=0.5, final period(displayUnit="h") = 10800, final shift=0) "Boolean pulse"; equation connect(pul.y, sysHys.u); connect(pul1.y, sysHys1.u); connect(booPul.y, sysHys.sysOn); connect(booPul.y, sysHys1.sysOn); end SystemHysteresis;