Buildings.Examples.VAVReheat.Controls.Examples
Example models to test the components
Information
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name | Description |
---|---|
OperationModes | Test model for operation modes |
RoomVAV | Test model for the room VAV controller |
Buildings.Examples.VAVReheat.Controls.Examples.OperationModes
Test model for operation modes
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
Type | Name | Description |
---|---|---|
ControlBus | controlBus |
Modelica definition
model OperationModes "Test model for operation modes"
extends Modelica.Icons.Example;
import ModelicaVAV = Buildings.Examples.VAVReheat;
ModelicaVAV.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(ModelicaVAV.Controls.OperationModes.occupied)
then 293.15 else 287.15);
Modelica.Blocks.Sources.Constant TCoiHea(k=283.15)
"Temperature after heating coil";
ModelicaVAV.Controls.ControlBus controlBus;
Modelica.Blocks.Routing.IntegerPassThrough mode "Outputs the control mode";
Modelica.Blocks.Sources.BooleanExpression modSel(
y=mode.y == Integer(ModelicaVAV.Controls.OperationModes.unoccupiedNightSetBack) or
mode.y == Integer(ModelicaVAV.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(ModelicaVAV.Controls.OperationModes.occupied));
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo1;
Buildings.Controls.Continuous.LimPID PID(initType=Modelica.Blocks.Types.InitPID.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.Controls.Examples.RoomVAV
Test model for the room VAV controller
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.Controls.RoomVAV vavBoxCon
"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;