modelTwoRoomsWithStorage
Extends from Modelica.Icons.Example.
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
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nRoo | 2 | Number of rooms |
| Modelica.Units.SI.Volume | VRoo | 4*6*3 | Volume of one room |
| Modelica.Units.SI.Power | Q_flow_nominal | 2200 | Nominal power of heating plant |
| Real | scaFacRad | 1.5 | Scaling factor to scale the power (and mass flow rate) of the radiator loop |
| Modelica.Units.SI.Temperature | TSup_nominal | 273.15 + 50 + 5 | Nominal supply temperature for radiators |
| Modelica.Units.SI.Temperature | TRet_nominal | 273.15 + 40 + 5 | Nominal return temperature for radiators |
| Modelica.Units.SI.Temperature | dTRad_nominal | TSup_nominal - TRet_nominal | Nominal temperature difference for radiator loop |
| Modelica.Units.SI.Temperature | dTBoi_nominal | 20 | Nominal temperature difference for boiler loop |
| Modelica.Units.SI.MassFlowRate | mRad_flow_nominal | scaFacRad*Q_flow_nominal/dTRad_nominal/4200 | Nominal mass flow rate of radiator loop |
| Modelica.Units.SI.MassFlowRate | mBoi_flow_nominal | scaFacRad*Q_flow_nominal/dTBoi_nominal/4200 | Nominal mass flow rate of boiler loop |
| Modelica.Units.SI.PressureDifference | dpPip_nominal | 10000 | Pressure difference of pipe (without valve) |
| Modelica.Units.SI.PressureDifference | dpVal_nominal | 6000 | Pressure difference of valve |
| Modelica.Units.SI.PressureDifference | dpRoo_nominal | 6000 | Pressure difference of flow leg that serves a room |
| Modelica.Units.SI.PressureDifference | dpThrWayVal_nominal | 6000 | Pressure difference of three-way valve |
| Modelica.Units.SI.PressureDifference | dp_nominal | dpPip_nominal + dpVal_nominal + dpRoo_nominal + dpThrWayVal_nominal | Pressure difference of loop |
| HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200 | matLayExt | Construction material for exterior walls | |
| HeatTransfer.Data.OpaqueConstructions.Brick120 | matLayPar | Construction material for partition walls | |
| HeatTransfer.Data.OpaqueConstructions.Generic | matLayFlo | Construction material for floor | |
| HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear | glaSys | Data record for the glazing system |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Fluid.Movers.SpeedControlled_y | pumBoi | Pump for boiler circuit | |
| Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y | pumRad | Pump that serves the radiators | |
| ThermalZones.Detailed.MixedAir | roo1 | Room model | |
| ThermalZones.Detailed.MixedAir | roo2 | Room model | |
| Buildings.Fluid.Boilers.BoilerPolynomial | boi | Boiler | |
| Buildings.HeatTransfer.Sources.FixedTemperature | TAmb | Ambient temperature in boiler room | |
| Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor | TRoo2 | ||
| Controls.OBC.CDL.Reals.PIDWithReset | conPum | Controller for pump | |
| Buildings.Fluid.Sensors.RelativePressure | dpSen | ||
| Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage | val2 | Radiator valve | |
| Controls.OBC.CDL.Reals.PID | conRoo2 | Controller for room temperature | |
| Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor | TRoo1 | ||
| Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage | val1 | Radiator valve | |
| Controls.OBC.CDL.Reals.PID | conRoo1 | Controller for room temperature | |
| Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 | rad1 | Radiator | |
| Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 | rad2 | Radiator | |
| Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear | thrWayVal | Three-way valve | |
| Controls.OBC.CDL.Reals.PIDWithReset | conVal | Controller for pump | |
| Buildings.Fluid.Storage.StratifiedEnhanced | tan | Storage tank | |
| Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor | tanTemBot | Tank temperature | |
| Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor | tanTemTop | Tank temperature | |
| Buildings.Controls.OBC.CDL.Reals.GreaterThreshold | greThr | Check for temperature at the bottom of the tank | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | booToReaPum | Signal converter for pump | |
| Buildings.Controls.OBC.CDL.Reals.Greater | lesThr | Check for temperature at the top of the tank | |
| Buildings.Fluid.Sensors.TemperatureTwoPort | temSup | ||
| Buildings.Fluid.Sensors.TemperatureTwoPort | temRet | ||
| Buildings.Controls.SetPoints.SupplyReturnTemperatureReset | heaCha | ||
| Controls.SetPoints.OccupancySchedule | occSch1 | Occupancy schedule | |
| Buildings.Controls.OBC.CDL.Reals.Switch | switch1 | ||
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | zer | Outputs zero | |
| Controls.SetPoints.OccupancySchedule | occSch2 | Occupancy schedule | |
| Buildings.Controls.OBC.CDL.Reals.Switch | switch2 | ||
| Controls.SetPoints.OccupancySchedule | occSch | Occupancy schedule | |
| Buildings.Controls.OBC.CDL.Reals.Switch | swi | Switch to select set point | |
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | TRooNig | Room temperature set point at night | |
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | TRooSet | ||
| Controls.OBC.CDL.Reals.MultiMax | mulMax | Maximum radiator valve position | |
| Controls.OBC.CDL.Reals.Hysteresis | hysPum | Hysteresis for pump | |
| Buildings.BoundaryConditions.WeatherData.ReaderTMY3 | weaDat | File reader that reads weather data | |
| Buildings.BoundaryConditions.WeatherData.Bus | weaBus | Bus with weather data | |
| Buildings.Fluid.Sources.Outside | out | Outside air conditions | |
| Buildings.Fluid.FixedResistances.PressureDrop | dpFac4 | Pressure drop at facade | |
| HeatTransfer.Conduction.MultiLayer | parWal | Partition wall between the two rooms | |
| Buildings.Fluid.FixedResistances.PressureDrop | dpFac1 | Pressure drop at facade | |
| Buildings.Fluid.HeatExchangers.ConstantEffectiveness | hex | Heat recovery | |
| Buildings.Fluid.Movers.FlowControlled_m_flow | fanSup | Supply air fan | |
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | m_flow_out | Outside air mass flow rate | |
| Buildings.Fluid.Movers.FlowControlled_m_flow | fanRet | Return air fan | |
| Airflow.Multizone.Orifice | lea1 | Leakage of facade of room | |
| Airflow.Multizone.Orifice | lea2 | Leakage of facade of room | |
| Modelica.Blocks.MathBoolean.Or | pumOnSig | Signal for pump being on | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | booToReaBoi | Signal converter for boiler | |
| Modelica.Blocks.Math.MatrixGain | gai1 | Gain to convert from occupancy (per person) to radiant, convective and latent heat in [W/m2] | |
| Modelica.Blocks.Math.MatrixGain | gai2 | Gain to convert from occupancy (per person) to radiant, convective and latent heat in [W/m2] | |
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | dTThr | Threshold to switch boiler off | |
| Buildings.Controls.OBC.CDL.Reals.Subtract | sub1 | ||
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | TRooOff | Low room temperature set point to switch heating off | |
| Buildings.Controls.OBC.CDL.Reals.Switch | swi1 | Switch to select set point | |
| Modelica.Blocks.Logical.OnOffController | onOff | On/off switch | |
| Buildings.Controls.OBC.CDL.Reals.Sources.Constant | TOutSwi | Outside air temperature to switch heating on or off | |
| Buildings.Fluid.Sources.Boundary_pT | bou | Fixed boundary condition, needed to provide a pressure in the system | |
| Controls.OBC.CDL.Reals.MultiplyByParameter | gain | Gain used to normalize pressure measurement signal | |
| Buildings.Fluid.FixedResistances.Junction | splVal | Flow splitter | |
| Buildings.Fluid.FixedResistances.Junction | splVal1 | Flow splitter | |
| Buildings.Fluid.FixedResistances.Junction | splVal2 | Flow splitter | |
| CoolingControl | cooCon | Controller for cooling | |
| Buildings.Fluid.Actuators.Dampers.Exponential | damSupByp | Supply air damper that bypasses the heat recovery | |
| Buildings.Fluid.HeatExchangers.SensibleCooler_T | coo | Coil for mechanical cooling | |
| Modelica.Blocks.Logical.LessThreshold | lesThrTOut | Output true if outdoor air is below heating cut-off limit | |
| Buildings.Controls.OBC.CDL.Logical.And | and1 | Logical test to enable pump and subsequently the boiler | |
| Buildings.Fluid.Actuators.Dampers.Exponential | damHex | Supply air damper that closes the heat recovery | |
| Buildings.Fluid.Actuators.Dampers.Exponential | damRetByp | Return air damper that bypasses the heat recovery | |
| Modelica.StateGraph.InitialStep | off | Pump and furnace off | |
| Modelica.StateGraph.TransitionWithSignal | T1 | Transition to pump on | |
| Modelica.StateGraph.StepWithSignal | pumOn | Pump on | |
| Modelica.StateGraph.Transition | T3 | Transition to boiler on | |
| Modelica.StateGraph.StepWithSignal | boiOn | Boiler on | |
| Modelica.StateGraph.TransitionWithSignal | T2 | Transition that switches boiler off | |
| Modelica.StateGraph.StepWithSignal | pumOn2 | Pump on | |
| Modelica.StateGraph.Transition | T4 | Transition to boiler on | |
| Modelica.StateGraph.StateGraphRoot | stateGraphRoot | Root of the state graph | |
| Buildings.Controls.OBC.CDL.Conversions.BooleanToReal | booToRea | Conversion from boolean to real signal | |
| Controls.OBC.CDL.Reals.Sources.Constant | occ1 | Heat gain if occupied in room 1 | |
| Controls.OBC.CDL.Reals.Sources.Constant | occ2 | Heat gain if occupied in room 2 | |
| Controls.OBC.CDL.Reals.MovingAverage | aveTOut | Time averaged outdoor air temperature | |
| Fluid.FixedResistances.Junction | splVal3 | Flow splitter | |
| Fluid.FixedResistances.Junction | splVal4 | Flow splitter |
Contents
| Name | Description |
|---|---|
| MediumA | Medium model for air |
| MediumW | Medium model |
| CoolingControl | Controller 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:
ReplacedpumRadwith a preconfigured pump model. This is for issue #2668. -
June 9, 2022, by Michael Wetter:
Corrected outdoor temperature in instanceTOutSwiat 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 parameterlatas this is now obtained from the weather data reader.
This is for IBPSA, #1477. -
March 4, 2021, by David Blum:
ChangeddpVal_nominalto 6 kPa. This is for issue 2378. -
April 6, 2016, by Michael Wetter:
ReplacedModelica_StateGraph2withModelica.StateGraph. This is for issue 504. -
March 1, 2016, by Michael Wetter:
Removed parameterdynamicBalance. 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:
RemovedModelica.Fluid.Systemto 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 ofKv_SIbecause 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.