modelSystem7

7th part of the system model, which implements the on/off control using a state machine

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

Information

This part of the system model changes the implementation of the control in Buildings.Examples.Tutorial.Boiler.System6 to use a state machine to switch the pumps and the boiler on and off. State machines provide an alternate way to implement discrete event, reactive and hybrid systems. The state machine that is implemented in this model is shown in the figure below.

image

In the figure above, the ovals depict states, and the arrows are transitions between the states. The transitions fire when the conditions are true.

Implementation

This model was built as follows:

  1. First, we copied the model Buildings.Examples.Tutorial.Boiler.System6 and called it Buildings.Examples.Tutorial.Boiler.System7.

  2. We implemented the state machine using blocks from the library Modelica.StateGraph. How to use these blocks is explained in Modelica.StateGraph.UsersGuide.

    The figure below shows the state machine. The square icons are states, and the black bars are transitions. The initial state is indicated by the double frame. The transitions are enabled when their input signal is true. The numbers to the right of the transition indicate the delay in seconds. If a delay is present, the input needs to be true during the entire duration of the delay for a transition to fire. The active state is rendered green. Some states have a Boolean output signal that is used to switch components such as the pumps and the boiler on or off.

    image

    In our implementation, the state allOff is the initial state, indicated by its double frame. The transition T1 is used to switch the pumps on. Once the pumpsOn state is active, there are two alternate paths. Either transition T2 may fire, which would switch the boiler on, or T4 may fire, which would return to the allOff state. Hence, the boiler can only be on when the pumps are on. From the state boilerOn, the only next step can be to transition to the state pumpsOn. Note that the transitions T3 and T4 only fire when their input is true for the entire duration of 10 seconds. Hence, the pumps and the boiler must run for at least 10 seconds before they can be switched off.

When simulating the model for 2 days, or 172800 seconds, the response shown below should be seen.

image image

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.HeatFlowRateQ_flow_nominal20000Nominal heat flow rate of radiator
Modelica.Units.SI.TemperatureTRadSup_nominal273.15 + 50Radiator nominal supply water temperature
Modelica.Units.SI.TemperatureTRadRet_nominal273.15 + 40Radiator nominal return water temperature
Modelica.Units.SI.MassFlowRatemRad_flow_nominalQ_flow_nominal/4200/(TRadSup_nominal - TRadRet_nominal)Radiator nominal mass flow rate
Modelica.Units.SI.TemperatureTBoiSup_nominal273.15 + 70Boiler nominal supply water temperature
Modelica.Units.SI.TemperatureTBoiRet_min273.15 + 60Boiler minimum return water temperature
Modelica.Units.SI.MassFlowRatemBoi_flow_nominalQ_flow_nominal/4200/(TBoiSup_nominal - TBoiRet_min)Boiler nominal mass flow rate
Modelica.Units.SI.MassFlowRatemRadVal_flow_nominalQ_flow_nominal/4200/(TBoiSup_nominal - TRadRet_nominal)Radiator nominal mass flow rate
Modelica.Units.SI.VolumeV6*10*3Room volume
Modelica.Units.SI.MassFlowRatemA_flow_nominalV*1.2*6/3600Nominal mass flow rate
Modelica.Units.SI.HeatFlowRateQRooInt_flow4000Internal heat gains of the room

Connectors

TypeNameDefaultDescription
BoundaryConditions.WeatherData.BusweaBus

Components

TypeNameDefaultDescription
Buildings.Fluid.MixingVolumes.MixingVolumevol
Modelica.Thermal.HeatTransfer.Components.ThermalConductortheConThermal conductance with the ambient
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlowpreHeaPrescribed heat flow
Modelica.Thermal.HeatTransfer.Components.HeatCapacitorheaCapHeat capacity for furniture and walls
Buildings.Controls.OBC.CDL.Reals.Sources.TimeTabletimTabTime table for internal heat gain
Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2radRadiator
Buildings.Fluid.Sensors.TemperatureTwoPorttemSupSupply water temperature
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensortemRooRoom temperature
Buildings.Fluid.Movers.FlowControlled_m_flowpumRadPump for radiator
Buildings.Fluid.FixedResistances.JunctionmixMixer between valve and radiators
Buildings.Fluid.FixedResistances.JunctionsplSplitter of boiler loop bypass
Buildings.Fluid.FixedResistances.Junctionspl2
Buildings.Fluid.FixedResistances.Junctionmix2Mixer
Buildings.Fluid.FixedResistances.Junctionspl4Splitter for radiator loop valve bypass
Buildings.Fluid.Movers.FlowControlled_m_flowpumBoiPump for boiler
Buildings.Fluid.Boilers.BoilerPolynomialboiBoiler
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearvalRadThree-way valve for radiator loop
Buildings.Fluid.Sources.Boundary_pTpreSouSource for pressure and to account for thermal expansion of water
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearvalBoiThree-way valve for boiler
Buildings.Fluid.Sensors.TemperatureTwoPorttemRetReturn water temperature
Buildings.Fluid.FixedResistances.Junctionspl1Splitter
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensorsenTOutOutdoor temperature sensor
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaRad1Boiler pump signal
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaRad2Boiler on/off signal
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaRadRadiator pump signal
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTSetBoiRetTemperature setpoint for boiler return
Buildings.Controls.OBC.CDL.Reals.PIDconPIDBoiController for valve in boiler loop
Buildings.Controls.OBC.CDL.Reals.PIDconPIDRadController for valve in radiator loop
Buildings.Controls.OBC.CDL.Reals.LineTSetSupSetpoint for supply water temperature
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTSupMinMinimum heating supply temperature
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTSupMaxMaximum heating supply temperature
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTRooMinMinimum room air temperature
BoundaryConditions.WeatherData.ReaderTMY3weaDatWeather data reader
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperatureTOutOutside temperature
Modelica.StateGraph.StateGraphRootstateGraphRootRoot of the state graph
Modelica.StateGraph.AlternativealternativeSplit for alternative execution paths
Modelica.StateGraph.InitialStepWithSignalallOffSystem off
Modelica.StateGraph.TransitionWithSignalT1Transition to switch pumps on
Modelica.StateGraph.StepWithSignalboilerOnBoiler is on
Modelica.StateGraph.TransitionWithSignalT2Transition to boiler on
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdgreThrBoiThreshold for boiler control
Modelica.StateGraph.TransitionWithSignalT3Transition to switch boiler off
Modelica.StateGraph.TransitionWithSignalT4Transition to all off
Modelica.StateGraph.SteppumpsOnPumps are on
Buildings.Controls.OBC.CDL.Reals.LessThresholdlessThreshold
Buildings.Controls.OBC.CDL.Reals.LessThresholdlessThreshold1
Buildings.Controls.OBC.CDL.Logical.Andand3
Buildings.Controls.OBC.CDL.Reals.LessThresholdlessThreshold2Threshold for boiler control
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdgreThrTRooThreshold for room temperature
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdgreThrTROutThreshold for room temperature
Controls.OBC.CDL.Logical.Oror1Switch off system if outside is sufficiently warm, or room is sufficiently warm
Buildings.Controls.OBC.CDL.Logical.Notnot1Negate output of hysteresis

Contents

NameDescription
MediumA
MediumWMedium model

Revisions

  • April 9, 2024, by Hongxiang Fu:
    Specified nominalValuesDefineDefaultPressureCurve=true in the mover component to suppress a warning. This is for #3819.
  • February 15, 2022, by Michael Wetter:
    Changed block downstream of greThrTRoo from and to or block. This ensures that the system is off when the outdoor air or room air is sufficiently warm.
  • March 6, 2017, by Michael Wetter:
    Added missing density to computation of air mass flow rate.
    This is for #673.
  • April 6, 2016, by Michael Wetter:
    Replaced Modelica_StateGraph2 with Modelica.StateGraph. This is for issue 504.
  • July 2, 2015, by Michael Wetter:
    Changed control input for conPIDBoi and set reverseActing=false to address issue #436.
  • December 22, 2014 by Michael Wetter:
    Removed Modelica.Fluid.System to address issue #311.
  • March 1, 2013, by Michael Wetter:
    Added nominal pressure drop for valves as this parameter no longer has a default value.
  • April 13, 2012, by Michael Wetter:
    Removed first order filter at boiler pump input.
  • January 27, 2012, by Michael Wetter:
    First implementation.