Buildings.Examples.Tutorial.CDL.BaseClasses

Package that contains the model of the HVAC system and the building load

Information

This package contains base classes that are used to construct the models in Buildings.Examples.Tutorial.CDL.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Examples.Tutorial.CDL.BaseClasses.PartialOpenLoop PartialOpenLoop Partial model with open loop system

Buildings.Examples.Tutorial.CDL.BaseClasses.PartialOpenLoop Buildings.Examples.Tutorial.CDL.BaseClasses.PartialOpenLoop

Partial model with open loop system

Buildings.Examples.Tutorial.CDL.BaseClasses.PartialOpenLoop

Information

This partial model implements the HVAC system model and a simple room, which is here modeled as a first order response. (More detailed room models are available in Buildings.ThermalZones, but for this tutorial it suffices to use this room model.) The control inputs are not connected as these will be connected in the tutorials that extend this model.

For instructions of how to build this model, see Buildings.Examples.Tutorial.Boiler

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

Parameters

TypeNameDefaultDescription
replaceable package MediumABuildings.Media.AirMedium model for air
replaceable package MediumWBuildings.Media.WaterMedium model for water
HeatFlowRateQ_flow_nominal20000Nominal heat flow rate of radiator [W]
TemperatureTRadSup_nominal273.15 + 50Radiator nominal supply water temperature [K]
TemperatureTRadRet_nominal273.15 + 40Radiator nominal return water temperature [K]
MassFlowRatemRad_flow_nominalQ_flow_nominal/4200/(TRadSup...Radiator nominal mass flow rate [kg/s]
TemperatureTBoiSup_nominal273.15 + 70Boiler nominal supply water temperature [K]
TemperatureTBoiRet_min273.15 + 60Boiler minimum return water temperature [K]
MassFlowRatemBoi_flow_nominalQ_flow_nominal/4200/(TBoiSup...Boiler nominal mass flow rate [kg/s]
MassFlowRatemRadVal_flow_nominalQ_flow_nominal/4200/(TBoiSup...Radiator nominal mass flow rate [kg/s]
VolumeV6*10*3Room volume [m3]
MassFlowRatemA_flow_nominalV*1.2*6/3600Nominal mass flow rate [kg/s]
HeatFlowRateQRooInt_flow4000Internal heat gains of the room [W]

Connectors

TypeNameDescription
replaceable package MediumAMedium model for air
replaceable package MediumWMedium model for water
BusweaBusWeather data bus

Modelica definition

partial model PartialOpenLoop "Partial model with open loop system" extends Modelica.Icons.Example; replaceable package MediumA = Buildings.Media.Air "Medium model for air"; replaceable package MediumW = Buildings.Media.Water "Medium model for water"; parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal=20000 "Nominal heat flow rate of radiator"; parameter Modelica.Units.SI.Temperature TRadSup_nominal=273.15 + 50 "Radiator nominal supply water temperature"; parameter Modelica.Units.SI.Temperature TRadRet_nominal=273.15 + 40 "Radiator nominal return water temperature"; parameter Modelica.Units.SI.MassFlowRate mRad_flow_nominal=Q_flow_nominal/ 4200/(TRadSup_nominal - TRadRet_nominal) "Radiator nominal mass flow rate"; parameter Modelica.Units.SI.Temperature TBoiSup_nominal=273.15 + 70 "Boiler nominal supply water temperature"; parameter Modelica.Units.SI.Temperature TBoiRet_min=273.15 + 60 "Boiler minimum return water temperature"; parameter Modelica.Units.SI.MassFlowRate mBoi_flow_nominal=Q_flow_nominal/ 4200/(TBoiSup_nominal - TBoiRet_min) "Boiler nominal mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mRadVal_flow_nominal=Q_flow_nominal/ 4200/(TBoiSup_nominal - TRadRet_nominal) "Radiator nominal mass flow rate"; Buildings.Fluid.MixingVolumes.MixingVolume vol( redeclare package Medium = MediumA, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mA_flow_nominal, V=V) "Room air volume"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(G=20000/30) "Thermal conductance with the ambient"; parameter Modelica.Units.SI.Volume V=6*10*3 "Room volume"; parameter Modelica.Units.SI.MassFlowRate mA_flow_nominal=V*1.2*6/3600 "Nominal mass flow rate"; parameter Modelica.Units.SI.HeatFlowRate QRooInt_flow=4000 "Internal heat gains of the room"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHea "Prescribed heat flow"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCap(C=2*V*1.2*1006) "Heat capacity for furniture and walls"; Buildings.Controls.OBC.CDL.Reals.Sources.TimeTable timTab( extrapolation=Buildings.Controls.OBC.CDL.Types.Extrapolation.Periodic, smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments, table=[-6, 0; 8, QRooInt_flow; 18, 0], timeScale=3600) "Time table for internal heat gain"; Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal=Q_flow_nominal, T_a_nominal=TRadSup_nominal, T_b_nominal=TRadRet_nominal) "Radiator"; Buildings.Fluid.Sensors.TemperatureTwoPort temSup(redeclare package Medium = MediumW, m_flow_nominal=mRad_flow_nominal) "Supply water temperature"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temRoo( T(displayUnit="degC")) "Room temperature"; Buildings.Fluid.Movers.FlowControlled_m_flow pumRad( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mRad_flow_nominal, nominalValuesDefineDefaultPressureCurve=true) "Pump for radiator"; Buildings.Fluid.FixedResistances.Junction mix( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mRadVal_flow_nominal,-mRad_flow_nominal,mRad_flow_nominal - mRadVal_flow_nominal}, dp_nominal={100,-8000,6750}) "Mixer between valve and radiators"; Buildings.Fluid.FixedResistances.Junction spl( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mBoi_flow_nominal,-mRadVal_flow_nominal,-mBoi_flow_nominal}, dp_nominal={200,-200,-50}) "Splitter of boiler loop bypass"; Buildings.Fluid.FixedResistances.Junction spl2( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, dp_nominal={0,0,0}, m_flow_nominal={mRad_flow_nominal,-mRadVal_flow_nominal,-mRad_flow_nominal + mRadVal_flow_nominal}) "Flow splitter in return from radiator"; Buildings.Fluid.FixedResistances.Junction mix2( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, dp_nominal={0,-200,0}, m_flow_nominal={mRadVal_flow_nominal,-mBoi_flow_nominal,mBoi_flow_nominal}) "Mixer"; Buildings.Fluid.FixedResistances.Junction spl4( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mRadVal_flow_nominal*{1,-1,-1}, dp_nominal=200*{1,-1,-1}) "Splitter for radiator loop valve bypass"; Buildings.Fluid.Movers.FlowControlled_m_flow pumBoi( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mBoi_flow_nominal, nominalValuesDefineDefaultPressureCurve=true) "Pump for boiler"; Buildings.Fluid.Boilers.BoilerPolynomial boi( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mBoi_flow_nominal, dp_nominal=2000, Q_flow_nominal=Q_flow_nominal, fue=Buildings.Fluid.Data.Fuels.HeatingOilLowerHeatingValue()) "Boiler"; Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valRad( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mRadVal_flow_nominal, l={0.01,0.01}, dpValve_nominal=6000) "Three-way valve for radiator loop"; Buildings.Fluid.Sources.Boundary_pT preSou(redeclare package Medium = MediumW, nPorts=1) "Source for pressure and to account for thermal expansion of water"; Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear valBoi( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=mBoi_flow_nominal, l={0.01,0.01}, dpValve_nominal=6000) "Three-way valve for boiler"; Buildings.Fluid.Sensors.TemperatureTwoPort temRet( redeclare package Medium = MediumW, m_flow_nominal=mBoi_flow_nominal) "Return water temperature"; Buildings.Fluid.FixedResistances.Junction spl1( redeclare package Medium = MediumW, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mBoi_flow_nominal,-mBoi_flow_nominal,-mBoi_flow_nominal}, dp_nominal={0,0,-200}) "Splitter"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTOut "Outdoor temperature sensor"; 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.Sources.PrescribedTemperature TOut "Outside temperature"; equation connect(theCon.port_b, vol.heatPort); connect(preHea.port, vol.heatPort); connect(heaCap.port, vol.heatPort); connect(timTab.y[1], preHea.Q_flow); connect(temSup.port_b, rad.port_a); connect(temRoo.port, vol.heatPort); connect(rad.heatPortCon, vol.heatPort); connect(rad.heatPortRad, vol.heatPort); connect(pumRad.port_b, temSup.port_a); connect(boi.port_b, pumBoi.port_a); connect(pumBoi.port_b, spl1.port_1); connect(spl1.port_2, spl.port_1); connect(spl.port_2, valRad.port_1); connect(valRad.port_2, mix.port_1); connect(spl1.port_3, valBoi.port_3); connect(valBoi.port_2, temRet.port_a); connect(temRet.port_b, boi.port_a); connect(boi.port_a, preSou.ports[1]); connect(mix2.port_2, valBoi.port_1); connect(spl4.port_2, mix2.port_1); connect(spl2.port_2, spl4.port_1); connect(valRad.port_3, spl4.port_3); connect(spl.port_3, mix2.port_3); connect(mix.port_3, spl2.port_3); connect(mix.port_2, pumRad.port_a); connect(rad.port_b, spl2.port_1); connect(weaDat.weaBus, weaBus); connect(weaBus.TDryBul, TOut.T); connect(TOut.port, theCon.port_a); connect(TOut.port, senTOut.port); end PartialOpenLoop;