Buildings.Fluid.HeatExchangers.Examples.BaseClasses

Package with base classes for Buildings.Fluid.HeatExchangers.Examples

Information

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

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

Package Content

Name Description
Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow EffectivenessNTUMassFlow Partial model of epsilon-NTU coil that tests variable mass flow rates
Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater Heater Base class for example model for the heater and cooler
Buildings.Fluid.HeatExchangers.Examples.BaseClasses.WetCoilDiscretized WetCoilDiscretized Model that demonstrates use of a finite volume model of a heat exchanger with condensation

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow

Partial model of epsilon-NTU coil that tests variable mass flow rates

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow

Parameters

TypeNameDefaultDescription
TemperatureT_a1_nominal5 + 273.15Nominal water inlet temperature [K]
TemperatureT_b1_nominal10 + 273.15Nominal water outlet temperature [K]
TemperatureT_a2_nominal30 + 273.15Nominal air inlet temperature [K]
TemperatureT_b2_nominal15 + 273.15Nominal air outlet temperature [K]
HeatFlowRateQ_flow_nominalm1_flow_nominal*4200*(T_a1_n...Nominal heat transfer [W]
MassFlowRatem1_flow_nominal0.1Nominal mass flow rate medium 1 [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate medium 2 [kg/s]

Modelica definition

partial model EffectivenessNTUMassFlow "Partial model of epsilon-NTU coil that tests variable mass flow rates" package Medium1 = Buildings.Media.Water "Medium model for water"; package Medium2 = Buildings.Media.Air "Medium model for air"; parameter Modelica.SIunits.Temperature T_a1_nominal=5 + 273.15 "Nominal water inlet temperature"; parameter Modelica.SIunits.Temperature T_b1_nominal=10 + 273.15 "Nominal water outlet temperature"; parameter Modelica.SIunits.Temperature T_a2_nominal=30 + 273.15 "Nominal air inlet temperature"; parameter Modelica.SIunits.Temperature T_b2_nominal=15 + 273.15 "Nominal air outlet temperature"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = m1_flow_nominal*4200*(T_a1_nominal-T_b1_nominal) "Nominal heat transfer"; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=0.1 "Nominal mass flow rate medium 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=m1_flow_nominal*4200/ 1000*(T_a1_nominal - T_b1_nominal)/(T_b2_nominal - T_a2_nominal) "Nominal mass flow rate medium 2"; Sources.MassFlowSource_T sin_2( redeclare package Medium = Medium2, T=T_a2_nominal, use_m_flow_in=true) "Sink for air"; Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, T=T_a2_nominal, X={0.02,1 - 0.02}, use_T_in=true, use_X_in=true) "Source for air"; Sources.MassFlowSource_T sin_1( redeclare package Medium = Medium1, T=T_a1_nominal, use_m_flow_in=true) "Sink for water"; Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, use_T_in=false, T=T_a1_nominal) "Source for water"; Modelica.Blocks.Sources.Constant relHum(k=0.8) "Relative humidity"; Buildings.Utilities.Psychrometrics.X_pTphi x_pTphi(use_p_in=false); Modelica.Blocks.Sources.Constant temSou_2(k=T_a2_nominal) "Temperature boundary condition"; Modelica.Blocks.Math.Gain mWat_flow(k=-m1_flow_nominal) "Water mass flow rate"; Modelica.Blocks.Sources.TimeTable mWatGai( table=[0,1; 0.1,1; 0.2,0.01; 0.3,0.01], timeScale=3600) "Gain for water mass flow rate"; Modelica.Blocks.Sources.TimeTable mAirGai( table=[0,1; 0.5,1; 0.6,-1; 0.7,0; 1,0], timeScale=3600) "Gain for air mass flow rate"; Modelica.Blocks.Math.Gain mAir_flow(k=-m2_flow_nominal) "Air mass flow rate"; equation connect(x_pTphi.X, sou_2.X_in); connect(relHum.y, x_pTphi.phi); connect(temSou_2.y, x_pTphi.T); connect(temSou_2.y, sou_2.T_in); connect(mWatGai.y, mWat_flow.u); connect(mWat_flow.y, sin_1.m_flow_in); connect(mAirGai.y, mAir_flow.u); connect(mAir_flow.y, sin_2.m_flow_in); end EffectivenessNTUMassFlow;

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater

Base class for example model for the heater and cooler

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.Heater

Information

This partial model is used to construct the models Buildings.Fluid.HeatExchangers.Examples.AirHeater_T and Buildings.Fluid.HeatExchangers.Examples.AirHeater_u and the similar models Buildings.Fluid.HeatExchangers.Examples.WaterHeater_T and Buildings.Fluid.HeatExchangers.Examples.WaterHeater_u. It consists of a volume with heat loss to the ambient, a fan, a set point for the temperature of the volume and a PI controller.

The instance bou is required to set a reference pressure for system models in which the fluid is modelled as an incompressible fluid, and it also is required to account for a variation of density of the fluid.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model
VolumeV6*6*2.7Volume [m3]
MassFlowRatem_flow_nominalV*1.2*6/3600Nominal mass flow rate [kg/s]
HeatFlowRateQ_flow_nominal30*6*6Nominal heat loss of the room [W]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

partial model Heater "Base class for example model for the heater and cooler" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model"; parameter Modelica.SIunits.Volume V = 6*6*2.7 "Volume"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal = V*1.2*6/3600 "Nominal mass flow rate"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal = 30*6*6 "Nominal heat loss of the room"; Buildings.Fluid.MixingVolumes.MixingVolume vol( redeclare package Medium = Medium, V=V, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal=m_flow_nominal, mSenFac=2, nPorts=3); Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon( G=Q_flow_nominal/20) "Thermal conductance to the outside"; Buildings.HeatTransfer.Sources.PrescribedTemperature TBou "Fixed temperature boundary condition"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TVol "Sensor for volume temperature"; Buildings.Fluid.Movers.FlowControlled_m_flow mov( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, addPowerToMedium=false, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) "Fan or pump"; Modelica.Blocks.Sources.RealExpression TOut(y=273.15 + 16 - 5*cos(time/86400* 2*Modelica.Constants.pi)) "Outdoor temperature"; Modelica.Blocks.Sources.Pulse TSet( amplitude=4, period=86400, offset=273.15 + 16, startTime=7*3600) "Setpoint for room temperature"; Controls.Continuous.LimPID conPI( controllerType=Modelica.Blocks.Types.SimpleController.PI, k=1, yMax=1, yMin=0, Ti=120) "Controller"; Modelica.Blocks.Sources.Constant mFan_flow(k=m_flow_nominal) "Mass flow rate of the fan"; Sources.FixedBoundary bou(redeclare package Medium = Medium, nPorts=1) "Fixed pressure boundary condition, required to set a reference pressure"; Sensors.TemperatureTwoPort THeaOut(redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal) "Outlet temperature of the heater"; FixedResistances.PressureDrop res( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=100, linearized=true) "Flow resistance to decouple pressure state from boundary"; equation connect(theCon.port_a, TBou.port); connect(vol.heatPort, theCon.port_b); connect(vol.heatPort, TVol.port); connect(TOut.y, TBou.T); connect(TVol.T, conPI.u_m); connect(TSet.y, conPI.u_s); connect(mFan_flow.y,mov. m_flow_in); connect(THeaOut.port_b, vol.ports[1]); connect(vol.ports[2],mov. port_a); connect(res.port_b, bou.ports[1]); connect(res.port_a, vol.ports[3]); end Heater;

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.WetCoilDiscretized

Model that demonstrates use of a finite volume model of a heat exchanger with condensation

Buildings.Fluid.HeatExchangers.Examples.BaseClasses.WetCoilDiscretized

Information

This is the base model that is used to test the initialization of the coil model. There are three instances of the coil model, each having different settings for the initial conditions.

Parameters

TypeNameDefaultDescription
replaceable package Medium2Modelica.Media.Interfaces.Pa...Medium for air-side
TemperatureT_a1_nominal5 + 273.15Water inlet temperature [K]
TemperatureT_b1_nominal10 + 273.15Water outlet temperature [K]
TemperatureT_a2_nominal30 + 273.15Air inlet temperature [K]
TemperatureT_b2_nominal10 + 273.15Air inlet temperature [K]
MassFlowRatem1_flow_nominal5Nominal mass flow rate water-side [kg/s]
MassFlowRatem2_flow_nominalm1_flow_nominal*4200/1000*(T...Nominal mass flow rate air-side [kg/s]

Connectors

TypeNameDescription
replaceable package Medium2Medium for air-side

Modelica definition

partial model WetCoilDiscretized "Model that demonstrates use of a finite volume model of a heat exchanger with condensation" package Medium1 = Buildings.Media.Water "Medium for water-side"; replaceable package Medium2 = Modelica.Media.Interfaces.PartialMedium "Medium for air-side"; parameter Modelica.SIunits.Temperature T_a1_nominal = 5+273.15 "Water inlet temperature"; parameter Modelica.SIunits.Temperature T_b1_nominal = 10+273.15 "Water outlet temperature"; parameter Modelica.SIunits.Temperature T_a2_nominal = 30+273.15 "Air inlet temperature"; parameter Modelica.SIunits.Temperature T_b2_nominal = 10+273.15 "Air inlet temperature"; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal = 5 "Nominal mass flow rate water-side"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal= m1_flow_nominal*4200/1000*(T_a1_nominal-T_b1_nominal)/(T_b2_nominal-T_a2_nominal) "Nominal mass flow rate air-side"; Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexFixIni( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, nPipPar=1, nPipSeg=3, nReg=2, dp1_nominal(displayUnit="Pa") = 5000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal), energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, show_T=true) "Coil with fixed initial conditions"; Sources.MassFlowSource_T sin_2( redeclare package Medium = Medium2, nPorts=1, use_m_flow_in=true, T=303.15); Buildings.Fluid.Sources.Boundary_pT sou_2( redeclare package Medium = Medium2, nPorts=1, T=293.15); Modelica.Blocks.Sources.Ramp TWat( duration=60, height=15, offset=273.15 + 5, startTime=0) "Water temperature"; Sources.MassFlowSource_T sin_1( redeclare package Medium = Medium1, nPorts=1, use_m_flow_in=true, T=293.15); Buildings.Fluid.Sources.Boundary_pT sou_1( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteStaIni( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, nPipPar=1, nPipSeg=3, nReg=2, dp1_nominal(displayUnit="Pa") = 5000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyStateInitial, show_T=true) "Coil with fixed initial conditions"; Sources.MassFlowSource_T sin_3( redeclare package Medium = Medium2, nPorts=1, use_m_flow_in=true, T=303.15); Buildings.Fluid.Sources.Boundary_pT sou_3( redeclare package Medium = Medium2, nPorts=1, T=293.15); Sources.MassFlowSource_T sin_4( redeclare package Medium = Medium1, nPorts=1, use_m_flow_in=true, T=293.15); Buildings.Fluid.Sources.Boundary_pT sou_4( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Buildings.Fluid.HeatExchangers.WetCoilDiscretized hexSteSta( redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=m1_flow_nominal, m2_flow_nominal=m2_flow_nominal, dp2_nominal(displayUnit="Pa") = 200, nPipPar=1, nPipSeg=3, nReg=2, dp1_nominal(displayUnit="Pa") = 5000, UA_nominal=m1_flow_nominal*4200*(T_a1_nominal - T_b1_nominal)/ Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( T_a1_nominal, T_b1_nominal, T_a2_nominal, T_b2_nominal), energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, show_T=true) "Coil with fixed initial conditions"; Sources.MassFlowSource_T sin_5( redeclare package Medium = Medium2, nPorts=1, use_m_flow_in=true, T=303.15); Buildings.Fluid.Sources.Boundary_pT sou_5( redeclare package Medium = Medium2, nPorts=1, T=293.15); Sources.MassFlowSource_T sin_6( redeclare package Medium = Medium1, nPorts=1, use_m_flow_in=true, T=293.15); Buildings.Fluid.Sources.Boundary_pT sou_6( redeclare package Medium = Medium1, p=300000 + 5000, use_T_in=true, T=293.15, nPorts=1); Modelica.Blocks.Sources.Ramp m2_flow( duration=60, startTime=60, height=1.1*m2_flow_nominal, offset=-m2_flow_nominal) "Air mass flow rate"; Modelica.Blocks.Sources.Ramp m1_flow( duration=60, startTime=180, height=1.1*m1_flow_nominal, offset=-m1_flow_nominal) "Water mass flow rate"; Modelica.Blocks.Sources.Ramp m1_flow1( duration=60, startTime=180, height=1.1*m1_flow_nominal, offset=-m1_flow_nominal) "Water mass flow rate"; Modelica.Blocks.Sources.Ramp m1_flow2( duration=60, startTime=180, height=1.1*m1_flow_nominal, offset=-m1_flow_nominal) "Water mass flow rate"; equation connect(TWat.y, sou_1.T_in); connect(sou_1.ports[1], hexFixIni.port_a1); connect(sou_2.ports[1], hexFixIni.port_a2); connect(hexFixIni.port_b1, sin_1.ports[1]); connect(hexFixIni.port_b2, sin_2.ports[1]); connect(TWat.y,sou_4. T_in); connect(sou_4.ports[1], hexSteStaIni.port_a1); connect(sou_3.ports[1], hexSteStaIni.port_a2); connect(hexSteStaIni.port_b1, sin_4.ports[1]); connect(TWat.y,sou_6. T_in); connect(sou_6.ports[1], hexSteSta.port_a1); connect(sou_5.ports[1], hexSteSta.port_a2); connect(hexSteSta.port_b1, sin_6.ports[1]); connect(hexSteSta.port_b2, sin_5.ports[1]); connect(hexSteStaIni.port_b2, sin_3.ports[1]); connect(m2_flow.y, sin_2.m_flow_in); connect(m2_flow.y, sin_3.m_flow_in); connect(m2_flow.y, sin_5.m_flow_in); connect(m1_flow.y, sin_1.m_flow_in); connect(m1_flow1.y, sin_4.m_flow_in); connect(m1_flow2.y, sin_6.m_flow_in); end WetCoilDiscretized;