Buildings.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples and tutorials with step-by-step instructions for how to build system models.

The examples illustrate the scope of the library. Smaller examples that typically only use models from a few packages can be found in the individual packages. For example, see Buildings.Airflow.Multizone.Examples for examples of multizone airflow and contaminant transport models, or Buildings.Fluid.HeatExchangers.Examples for examples of heat exchanger models.

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

Package Content

Name Description
Buildings.Examples.Tutorial Tutorial Tutorial with step by step instructions for how to build system models
Buildings.Examples.SimpleHouse SimpleHouse Illustrative example of a simple heating, ventilation and room model
Buildings.Examples.ChillerPlant ChillerPlant Chiller plant with water side economizer for data center
Buildings.Examples.DualFanDualDuct DualFanDualDuct Dual fan dual duct HVAC system with five thermal zones
Buildings.Examples.HydronicHeating HydronicHeating Hydronic heating system with storage, two rooms and thermostatic radiator valves
Buildings.Examples.ScalableBenchmarks ScalableBenchmarks  
Buildings.Examples.VAVCO2 VAVCO2 Variable air volume flow system of MIT building with continuous time control for static pressure reset
Buildings.Examples.VAVReheat VAVReheat Variable air volume flow system with terminal reheat and five thermal zones

Buildings.Examples.SimpleHouse Buildings.Examples.SimpleHouse

Illustrative example of a simple heating, ventilation and room model

Buildings.Examples.SimpleHouse

Information

This model contains a simple model of a house with a heating system, ventilation, and weather boundary conditions. It serves as a demonstration case of how the Buildings library can be used.

A step-by-step tutorial on how to build up this model can be found in Buildings.Examples.Tutorial.SimpleHouse. There are however some minor differences between this model and the models in the tutorial:

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

Parameters

TypeNameDefaultDescription
AreaAWall100Wall area [m2]
AreaAWin5Window area [m2]
RealgWin0.3Solar heat gain coefficient of window [1]
VolumeVZoneAWall*3Wall area [m3]
HeatFlowRateQHea_flow_nominal700Nominal capacity of heating system [W]
MassFlowRatemWat_flow_nominalQHea_flow_nominal/10/4200Nominal mass flow rate for water loop [kg/s]
MassFlowRatemAir_flow_nominalVZone*2*1.2/3600Nominal mass flow rate for air loop [kg/s]
PressureDifferencedpAir_nominal200Pressure drop at nominal mass flow rate for air loop [Pa]
BooleanallowFlowReversalfalse= false because flow will not reverse in these circuits

Connectors

TypeNameDescription
BusweaBusWeather data bus

Modelica definition

model SimpleHouse "Illustrative example of a simple heating, ventilation and room model" extends Modelica.Icons.Example; package MediumAir = Buildings.Media.Air; package MediumWater = Buildings.Media.Water; parameter Modelica.Units.SI.Area AWall=100 "Wall area"; parameter Modelica.Units.SI.Area AWin=5 "Window area"; parameter Real gWin(min=0, max=1, unit="1") = 0.3 "Solar heat gain coefficient of window"; parameter Modelica.Units.SI.Volume VZone=AWall*3 "Wall area"; parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal=700 "Nominal capacity of heating system"; parameter Modelica.Units.SI.MassFlowRate mWat_flow_nominal=QHea_flow_nominal/ 10/4200 "Nominal mass flow rate for water loop"; parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal=VZone*2*1.2/3600 "Nominal mass flow rate for air loop"; parameter Modelica.Units.SI.PressureDifference dpAir_nominal=200 "Pressure drop at nominal mass flow rate for air loop"; parameter Boolean allowFlowReversal=false "= false because flow will not reverse in these circuits"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor walCap( T(fixed=true), C=10*AWall*0.05*1000*1000) "Thermal mass of walls"; Fluid.MixingVolumes.MixingVolume zon( redeclare package Medium = MediumAir, V=VZone, nPorts=2, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mAir_flow_nominal, massDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial) "Very based zone air model"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor conRes(R=1/2/AWall) "Thermal resistance for convective heat transfer with h=2"; Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( redeclare package Medium = MediumWater, T_a_nominal=273.15 + 50, T_b_nominal=273.15 + 40, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=allowFlowReversal, Q_flow_nominal=QHea_flow_nominal) "Radiator"; Fluid.Sources.Boundary_pT bouAir( redeclare package Medium = MediumAir, nPorts=2, use_T_in=true) "Air boundary with constant temperature"; Fluid.Sources.Boundary_pT bouWat(redeclare package Medium = MediumWater, nPorts=1) "Pressure bound for water circuit"; BoundaryConditions.WeatherData.ReaderTMY3 weaDat( filNam=Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos")) "Weather data reader"; BoundaryConditions.WeatherData.Bus weaBus "Weather data bus"; Modelica.Thermal.HeatTransfer.Components.ThermalResistor walRes(R=0.25/AWall/ 0.04) "Thermal resistor for wall: 25 cm of rockwool"; Buildings.HeatTransfer.Sources.PrescribedTemperature TOut "Exterior temperature boundary condition"; Fluid.HeatExchangers.HeaterCooler_u heaWat( redeclare package Medium = MediumWater, m_flow_nominal=mWat_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, allowFlowReversal=allowFlowReversal, dp_nominal=5000, Q_flow_nominal=QHea_flow_nominal) "Heater for water circuit"; Fluid.Movers.FlowControlled_m_flow pum( redeclare package Medium = MediumWater, use_inputFilter=false, m_flow_nominal=mWat_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, allowFlowReversal=allowFlowReversal, nominalValuesDefineDefaultPressureCurve=true, inputType=Buildings.Fluid.Types.InputType.Stages, massFlowRates=mWat_flow_nominal*{1}) "Pump"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTemZonAir "Zone air temperature sensor"; Fluid.Actuators.Dampers.Exponential vavDam( redeclare package Medium = MediumAir, from_dp=true, m_flow_nominal=mAir_flow_nominal, dpDamper_nominal=10, dpFixed_nominal=dpAir_nominal - 10) "Damper"; Fluid.Movers.FlowControlled_dp fan( redeclare package Medium = MediumAir, dp_nominal=dpAir_nominal, use_inputFilter=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, nominalValuesDefineDefaultPressureCurve=true, m_flow_nominal=mAir_flow_nominal, show_T=true) "Constant head fan"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow win "Very simple window model"; Fluid.HeatExchangers.ConstantEffectiveness hexRec( redeclare package Medium1 = MediumAir, redeclare package Medium2 = MediumAir, dp1_nominal=0, dp2_nominal=0, m1_flow_nominal=mAir_flow_nominal, m2_flow_nominal=mAir_flow_nominal, eps=0.85) "Heat exchanger for heat recuperation"; Modelica.Blocks.Logical.Hysteresis hysRad(uLow=273.15 + 20, uHigh=273.15 + 22) "Hysteresis controller for radiator"; Modelica.Blocks.Logical.Not not1 "negation for enabling heating when temperatur is low"; Modelica.Blocks.Math.BooleanToReal booToRea "Boolean to real"; Modelica.Blocks.Sources.Constant con_dp(k=dpAir_nominal) "Pressure head"; Modelica.Blocks.Math.Gain gaiWin(k=AWin*gWin) "Gain for window solar transmittance and area as HGloHor is in W/m2"; Modelica.Blocks.Math.BooleanToInteger booToInt "Boolean to integer"; Controls.Continuous.LimPID conDam( controllerType=Modelica.Blocks.Types.SimpleController.P, yMin=0.25) "Controller for damper"; Modelica.Blocks.Sources.Constant TSetRoo(k=273.15 + 24) "Room temperature set point for air system"; Fluid.HeatExchangers.SensibleCooler_T cooAir( energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, allowFlowReversal=allowFlowReversal, m_flow_nominal=mAir_flow_nominal, dp_nominal=0, redeclare package Medium = MediumAir) "Cooling for supply air"; Modelica.Blocks.Sources.Constant TSupAirCoo(k=273.15 + 20) "Cooling setpoint for supply air"; equation connect(conRes.port_a, zon.heatPort); connect(weaDat.weaBus, weaBus); connect(walRes.port_b, walCap.port); connect(TOut.T, weaBus.TDryBul); connect(TOut.port, walRes.port_a); connect(heaWat.port_b, rad.port_a); connect(bouWat.ports[1], heaWat.port_a); connect(rad.port_b, pum.port_a); connect(senTemZonAir.port, zon.heatPort); connect(bouAir.ports[1], hexRec.port_b1); connect(rad.heatPortCon, zon.heatPort); connect(not1.y, booToRea.u); connect(not1.u, hysRad.y); connect(booToRea.y, heaWat.u); connect(heaWat.port_a, pum.port_b); connect(con_dp.y, fan.dp_in); connect(gaiWin.y, win.Q_flow); connect(gaiWin.u, weaBus.HGloHor); connect(booToInt.u, not1.y); connect(booToInt.y, pum.stage); connect(hexRec.port_b2, fan.port_a); connect(vavDam.port_b, zon.ports[1]); connect(senTemZonAir.T, hysRad.u); connect(senTemZonAir.T,conDam. u_s); connect(conDam.y, vavDam.y); connect(TSetRoo.y,conDam. u_m); connect(fan.port_b, cooAir.port_a); connect(cooAir.port_b, vavDam.port_a); connect(TSupAirCoo.y, cooAir.TSet); connect(bouAir.T_in, weaBus.TDryBul); connect(bouAir.ports[2], hexRec.port_a2); connect(hexRec.port_a1, zon.ports[2]); connect(conRes.port_b, walCap.port); connect(win.port, walCap.port); connect(rad.heatPortRad, walCap.port); end SimpleHouse;