modelTwoRoomsWithStorage

Model of a hydronic heating system with energy storage

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

Information

This example demonstrates the implementation of a building that has the following properties:

There are two rooms. (For simplicity, we only modeled two rooms, but more could be added.) Each room is modeled using a dynamic model for the heat transfer through the opaque constructions. The room roo1 has a south- and west-facing window, the room roo2 has a south- and east-facing window. The rooms are modeled as if they were in an intermediate floor, with the same temperature above and below the room. The rooms share one common wall. The north facing wall is modeled as a partition wall, i.e., both surfaces have the same boundary conditions. Weather data are used from Chicago.

There is a hydronic heating system with a boiler, a storage tank and a radiator with a thermostatic valve in each room. The supply water temperature setpoint is reset based on the outside temperature. A three-way-valve mixes the water from the tank with the water from the radiator return. The pump has a variable frequency drive that controls the pump head.

A finite state machine is used to switch the boiler and its pump on and off. The boiler and pump are switched on when the temperature at the top of the tank is less then 1 Kelvin above the setpoint temperature for the supply water temperature of the radiator loop. The boiler and pump are switched off when the temperature at the bottom of the tank reaches 55 degree Celsius. The state transition of the finite state machine is such that first the pump of the boiler is switched on. Ten seconds later, the boiler will be switched on. When the tank reaches its temperature, the boiler is switched off, and ten seconds later, the pump will be switched off.

The building has a controlled fresh air supply. A heat recovery ventilator is used to preheat the outside air. Each room has a model for the leakage of the facade. If supply and exhaust air are unbalanced, then the difference in air supply will flow through this leakage model.

The hydronic heating system is connected to an expansion vessel. Some medium models for water compute the density as a function of temperature, while others assume a constant density. If the density is modeled as a function of temperature, then the water volume will increase when heated, and the expansion vessel will accumulate the added volume. As the water cools, this volume will flow from the expansion vessel into the hydronic heating system. If the medium model assumes the density to be constant, then the expansion vessel provides a reference pressure for the hydronic heating system.

The cooling of the two rooms is controlled using the temperature of roo1. The set point for mechanical cooling is 25 degree Celsius, with a proportional band of 1 Kelvin.

If the room air temperature is above 22 degree Celsius, the free cooling is enabled by opening the bypass damper of the heat recovery. Free cooling is only allowed if the outside air temperature is above 16 degree Celsius and 1 Kelvin below the room air temperature.

The cooling control is implemented in the model Buildings.Examples.HydronicHeating.TwoRoomsWithStorage.CoolingControl.

Parameters

TypeNameDefaultDescription
IntegernRoo2Number of rooms
Modelica.Units.SI.VolumeVRoo4*6*3Volume of one room
Modelica.Units.SI.PowerQ_flow_nominal2200Nominal power of heating plant
RealscaFacRad1.5Scaling factor to scale the power (and mass flow rate) of the radiator loop
Modelica.Units.SI.TemperatureTSup_nominal273.15 + 50 + 5Nominal supply temperature for radiators
Modelica.Units.SI.TemperatureTRet_nominal273.15 + 40 + 5Nominal return temperature for radiators
Modelica.Units.SI.TemperaturedTRad_nominalTSup_nominal - TRet_nominalNominal temperature difference for radiator loop
Modelica.Units.SI.TemperaturedTBoi_nominal20Nominal temperature difference for boiler loop
Modelica.Units.SI.MassFlowRatemRad_flow_nominalscaFacRad*Q_flow_nominal/dTRad_nominal/4200Nominal mass flow rate of radiator loop
Modelica.Units.SI.MassFlowRatemBoi_flow_nominalscaFacRad*Q_flow_nominal/dTBoi_nominal/4200Nominal mass flow rate of boiler loop
Modelica.Units.SI.PressureDifferencedpPip_nominal10000Pressure difference of pipe (without valve)
Modelica.Units.SI.PressureDifferencedpVal_nominal6000Pressure difference of valve
Modelica.Units.SI.PressureDifferencedpRoo_nominal6000Pressure difference of flow leg that serves a room
Modelica.Units.SI.PressureDifferencedpThrWayVal_nominal6000Pressure difference of three-way valve
Modelica.Units.SI.PressureDifferencedp_nominaldpPip_nominal + dpVal_nominal + dpRoo_nominal + dpThrWayVal_nominalPressure difference of loop
HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200matLayExtConstruction material for exterior walls
HeatTransfer.Data.OpaqueConstructions.Brick120matLayParConstruction material for partition walls
HeatTransfer.Data.OpaqueConstructions.GenericmatLayFloConstruction material for floor
HeatTransfer.Data.GlazingSystems.DoubleClearAir13ClearglaSysData record for the glazing system

Connectors

TypeNameDefaultDescription
Buildings.BoundaryConditions.WeatherData.BusweaBusBus with weather data

Components

TypeNameDefaultDescription
Buildings.Fluid.Movers.SpeedControlled_ypumBoiPump for boiler circuit
Buildings.Fluid.Movers.Preconfigured.SpeedControlled_ypumRadPump that serves the radiators
ThermalZones.Detailed.MixedAirroo1Room model
ThermalZones.Detailed.MixedAirroo2Room model
Buildings.Fluid.Boilers.BoilerPolynomialboiBoiler
Buildings.HeatTransfer.Sources.FixedTemperatureTAmbAmbient temperature in boiler room
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensorTRoo2
Controls.OBC.CDL.Reals.PIDWithResetconPumController for pump
Buildings.Fluid.Sensors.RelativePressuredpSen
Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentageval2Radiator valve
Controls.OBC.CDL.Reals.PIDconRoo2Controller for room temperature
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensorTRoo1
Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentageval1Radiator valve
Controls.OBC.CDL.Reals.PIDconRoo1Controller for room temperature
Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2rad1Radiator
Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2rad2Radiator
Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinearthrWayValThree-way valve
Controls.OBC.CDL.Reals.PIDWithResetconValController for pump
Buildings.Fluid.Storage.StratifiedEnhancedtanStorage tank
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensortanTemBotTank temperature
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensortanTemTopTank temperature
Buildings.Controls.OBC.CDL.Reals.GreaterThresholdgreThrCheck for temperature at the bottom of the tank
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaPumSignal converter for pump
Buildings.Controls.OBC.CDL.Reals.GreaterlesThrCheck for temperature at the top of the tank
Buildings.Fluid.Sensors.TemperatureTwoPorttemSup
Buildings.Fluid.Sensors.TemperatureTwoPorttemRet
Buildings.Controls.SetPoints.SupplyReturnTemperatureResetheaCha
Controls.SetPoints.OccupancyScheduleoccSch1Occupancy schedule
Buildings.Controls.OBC.CDL.Reals.Switchswitch1
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantzerOutputs zero
Controls.SetPoints.OccupancyScheduleoccSch2Occupancy schedule
Buildings.Controls.OBC.CDL.Reals.Switchswitch2
Controls.SetPoints.OccupancyScheduleoccSchOccupancy schedule
Buildings.Controls.OBC.CDL.Reals.SwitchswiSwitch to select set point
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTRooNigRoom temperature set point at night
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTRooSet
Controls.OBC.CDL.Reals.MultiMaxmulMaxMaximum radiator valve position
Controls.OBC.CDL.Reals.HysteresishysPumHysteresis for pump
Buildings.BoundaryConditions.WeatherData.ReaderTMY3weaDatFile reader that reads weather data
Buildings.Fluid.Sources.OutsideoutOutside air conditions
Buildings.Fluid.FixedResistances.PressureDropdpFac4Pressure drop at facade
HeatTransfer.Conduction.MultiLayerparWalPartition wall between the two rooms
Buildings.Fluid.FixedResistances.PressureDropdpFac1Pressure drop at facade
Buildings.Fluid.HeatExchangers.ConstantEffectivenesshexHeat recovery
Buildings.Fluid.Movers.FlowControlled_m_flowfanSupSupply air fan
Buildings.Controls.OBC.CDL.Reals.Sources.Constantm_flow_outOutside air mass flow rate
Buildings.Fluid.Movers.FlowControlled_m_flowfanRetReturn air fan
Airflow.Multizone.Orificelea1Leakage of facade of room
Airflow.Multizone.Orificelea2Leakage of facade of room
Modelica.Blocks.MathBoolean.OrpumOnSigSignal for pump being on
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaBoiSignal converter for boiler
Modelica.Blocks.Math.MatrixGaingai1Gain to convert from occupancy (per person) to radiant, convective and latent heat in [W/m2]
Modelica.Blocks.Math.MatrixGaingai2Gain to convert from occupancy (per person) to radiant, convective and latent heat in [W/m2]
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantdTThrThreshold to switch boiler off
Buildings.Controls.OBC.CDL.Reals.Subtractsub1
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTRooOffLow room temperature set point to switch heating off
Buildings.Controls.OBC.CDL.Reals.Switchswi1Switch to select set point
Modelica.Blocks.Logical.OnOffControlleronOffOn/off switch
Buildings.Controls.OBC.CDL.Reals.Sources.ConstantTOutSwiOutside air temperature to switch heating on or off
Buildings.Fluid.Sources.Boundary_pTbouFixed boundary condition, needed to provide a pressure in the system
Controls.OBC.CDL.Reals.MultiplyByParametergainGain used to normalize pressure measurement signal
Buildings.Fluid.FixedResistances.JunctionsplValFlow splitter
Buildings.Fluid.FixedResistances.JunctionsplVal1Flow splitter
Buildings.Fluid.FixedResistances.JunctionsplVal2Flow splitter
CoolingControlcooConController for cooling
Buildings.Fluid.Actuators.Dampers.ExponentialdamSupBypSupply air damper that bypasses the heat recovery
Buildings.Fluid.HeatExchangers.SensibleCooler_TcooCoil for mechanical cooling
Modelica.Blocks.Logical.LessThresholdlesThrTOutOutput true if outdoor air is below heating cut-off limit
Buildings.Controls.OBC.CDL.Logical.Andand1Logical test to enable pump and subsequently the boiler
Buildings.Fluid.Actuators.Dampers.ExponentialdamHexSupply air damper that closes the heat recovery
Buildings.Fluid.Actuators.Dampers.ExponentialdamRetBypReturn air damper that bypasses the heat recovery
Modelica.StateGraph.InitialStepoffPump and furnace off
Modelica.StateGraph.TransitionWithSignalT1Transition to pump on
Modelica.StateGraph.StepWithSignalpumOnPump on
Modelica.StateGraph.TransitionT3Transition to boiler on
Modelica.StateGraph.StepWithSignalboiOnBoiler on
Modelica.StateGraph.TransitionWithSignalT2Transition that switches boiler off
Modelica.StateGraph.StepWithSignalpumOn2Pump on
Modelica.StateGraph.TransitionT4Transition to boiler on
Modelica.StateGraph.StateGraphRootstateGraphRootRoot of the state graph
Buildings.Controls.OBC.CDL.Conversions.BooleanToRealbooToReaConversion from boolean to real signal
Controls.OBC.CDL.Reals.Sources.Constantocc1Heat gain if occupied in room 1
Controls.OBC.CDL.Reals.Sources.Constantocc2Heat gain if occupied in room 2
Controls.OBC.CDL.Reals.MovingAverageaveTOutTime averaged outdoor air temperature
Fluid.FixedResistances.JunctionsplVal3Flow splitter
Fluid.FixedResistances.JunctionsplVal4Flow splitter

Contents

NameDescription
MediumAMedium model for air
MediumWMedium model
CoolingControlController for the free cooling and the mechanical cooling

Revisions

  • September 15, 2023, by Michael Wetter:
    Changed tank to tank with enhanced stratification, and added junctions at the tank inlet and outlet.
  • February 24, 2023, by Michael Wetter:
    Changed test to enable heating system which is now based on the outside air temperature, rather than the room air temperature, as the latter can fall below the threshold such as during window ventilation.
  • August 22, 2022, by Hongxiang Fu:
    Replaced pumRad with a preconfigured pump model. This is for issue #2668.
  • June 9, 2022, by Michael Wetter:
    Corrected outdoor temperature in instance TOutSwi at which system switches on and off.
    This is for issue 3059.
  • September 21, 2021, by Michael Wetter:
    Updated controls to use blocks from the CDL package. Replaced PID controller with CDL version.
    This is for issue 2638.
  • September 16, 2021, by Michael Wetter:
    Removed assignment of parameter lat as this is now obtained from the weather data reader.
    This is for IBPSA, #1477.
  • March 4, 2021, by David Blum:
    Changed dpVal_nominal to 6 kPa. This is for issue 2378.
  • April 6, 2016, by Michael Wetter:
    Replaced Modelica_StateGraph2 with Modelica.StateGraph. This is for issue 504.
  • March 1, 2016, by Michael Wetter:
    Removed parameter dynamicBalance. This is for #484.
  • January 22, 2016, by Michael Wetter:
    Corrected type declaration of pressure difference. This is for #404.
  • September 24, 2015 by Michael Wetter:
    Set default temperature for medium to avoid conflicting start values for alias variables of the temperature of the building and the ambient air. This is for issue 426.
  • January 12, 2015 by Michael Wetter:
    Made media instances replaceable. This was done to simplify the numerical benchmarks.
  • December 22, 2014 by Michael Wetter:
    Removed Modelica.Fluid.System to address issue #311.
  • October 15, 2013, by Michael Wetter:
    Added free cooling and mechanical cooling.
  • October 14, 2013, by Michael Wetter:
    Corrected wrong pump head for radiator and for boiler pump.
  • March 1, 2013, by Michael Wetter:
    Removed assignment of Kv_SI because this is now a protected parameter.
  • December 6, 2011, by Michael Wetter:
    Added internal heat gains, which were set to zero in the previous version.
  • January 30, 2009, by Michael Wetter:
    First implementation.