Buildings.Fluid.HeatExchangers

Package with heat exchanger models

Information

This package contains models for heat exchangers with and without humidity condensation.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.HeatExchangers.ConstantEffectiveness ConstantEffectiveness Heat exchanger with constant effectiveness
Buildings.Fluid.HeatExchangers.DryCoilCounterFlow DryCoilCounterFlow Counterflow coil with discretization along the flow paths and without humidity condensation
Buildings.Fluid.HeatExchangers.DryCoilDiscretized DryCoilDiscretized Coil with discretization along the flow paths and no humidity condensation
Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU DryCoilEffectivenessNTU Heat exchanger with effectiveness - NTU relation and no moisture condensation
Buildings.Fluid.HeatExchangers.EvaporatorCondenser EvaporatorCondenser Evaporator or condenser with refrigerant experiencing constant temperature phase change
Buildings.Fluid.HeatExchangers.HeaterCooler_u HeaterCooler_u Heater or cooler with prescribed heat flow rate
Buildings.Fluid.HeatExchangers.Heater_T Heater_T Heater with prescribed outlet temperature
Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU PlateHeatExchangerEffectivenessNTU Plate heat exchanger with effectiveness - NTU relation and no moisture condensation
Buildings.Fluid.HeatExchangers.PrescribedOutlet PrescribedOutlet Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions
Buildings.Fluid.HeatExchangers.SensibleCooler_T SensibleCooler_T Sensible cooling device with prescribed outlet temperature
Buildings.Fluid.HeatExchangers.WetCoilCounterFlow WetCoilCounterFlow Counterflow coil with discretization along the flow paths and humidity condensation
Buildings.Fluid.HeatExchangers.WetCoilDiscretized WetCoilDiscretized Coil with discretization along the flow paths and humidity condensation
Buildings.Fluid.HeatExchangers.WetCoilEffectivenessNTU WetCoilEffectivenessNTU Heat exchanger with effectiveness - NTU relation and with moisture condensation
Buildings.Fluid.HeatExchangers.ActiveBeams ActiveBeams Package with active beams
Buildings.Fluid.HeatExchangers.CoolingTowers CoolingTowers Package with cooling tower models
Buildings.Fluid.HeatExchangers.DXCoils DXCoils DX(Direct Expansion) cooling coil models
Buildings.Fluid.HeatExchangers.RadiantSlabs RadiantSlabs Package with radiant slab models
Buildings.Fluid.HeatExchangers.Radiators Radiators Package with radiators models for hydronic space heating systems
Buildings.Fluid.HeatExchangers.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluid.HeatExchangers.Validation Validation Collection of models that validate the heat exchanger models
Buildings.Fluid.HeatExchangers.BaseClasses BaseClasses Package with base classes for Buildings.Fluid.HeatExchangers

Buildings.Fluid.HeatExchangers.ConstantEffectiveness Buildings.Fluid.HeatExchangers.ConstantEffectiveness

Heat exchanger with constant effectiveness

Buildings.Fluid.HeatExchangers.ConstantEffectiveness

Information

Model for a heat exchanger with constant effectiveness.

This model transfers heat in the amount of

Q = Qmax ε,

where ε is a constant effectiveness and Qmax is the maximum heat that can be transferred.

For a heat and moisture exchanger, use Buildings.Fluid.MassExchangers.ConstantEffectiveness instead of this model.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness (Partial model to implement heat exchangers based on effectiveness model).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
BooleansensibleOnly1trueSet to true if sensible exchange only for medium 1
BooleansensibleOnly2trueSet to true if sensible exchange only for medium 2
Efficiencyeps0.8Heat exchanger effectiveness [1]
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Custom Parameters
HeatFlowRateQ1_floweps*QMax_flowHeat transferred into the medium 1 [W]
MassFlowRatemWat1_flow0Moisture mass flow rate added to the medium 1 [kg/s]
HeatFlowRateQ2_flow-Q1_flowHeat transferred into the medium 2 [W]
MassFlowRatemWat2_flow0Moisture mass flow rate added to the medium 2 [kg/s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model ConstantEffectiveness "Heat exchanger with constant effectiveness" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness( sensibleOnly1 = true, sensibleOnly2 = true, final prescribedHeatFlowRate1=true, final prescribedHeatFlowRate2=true, Q1_flow = eps * QMax_flow, Q2_flow = -Q1_flow, mWat1_flow = 0, mWat2_flow = 0); parameter Modelica.SIunits.Efficiency eps(max=1) = 0.8 "Heat exchanger effectiveness"; end ConstantEffectiveness;

Buildings.Fluid.HeatExchangers.DryCoilCounterFlow Buildings.Fluid.HeatExchangers.DryCoilCounterFlow

Counterflow coil with discretization along the flow paths and without humidity condensation

Buildings.Fluid.HeatExchangers.DryCoilCounterFlow

Information

Model of a discretized coil without water vapor condensation. The coil consists of two flow paths which are, at the design flow direction, in opposite direction to model a counterflow heat exchanger. The flow paths are discretized into nEle elements. Each element is modeled by an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible. Each element has a state variable for the metal.

The convective heat transfer coefficients can, for each fluid individually, be computed as a function of the flow rate and/or the temperature, or assigned to a constant. This computation is done using an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil.

To model humidity condensation, use the model Buildings.Fluid.HeatExchangers.WetCoilCounterFlow instead of this model, as this model computes only sensible heat transfer.

Implementation

At very small flow rates, which may be caused when the fan is off but there is wind pressure on the building that entrains outside air through the HVAC system, large temperature differences could occur if diffusion were neglected. This model therefore approximates a small diffusion between the elements to have more uniform medium temperatures if the flow is near zero. The approximation is done using the heat conductors heaCon1 and heaCon2. As this is a rough approximation, neighboring elements are connected through these heat conduction elements, ignoring the actual geometrical configuration. Also, radiation between the coil surfaces on the air side is not modelled explicitly, but rather may be considered as approximated by these heat conductors.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute heat capacity [W/K]
Realr_nominal2/3Ratio between air-side and water-side convective heat transfer coefficient
Timetau110Time constant at nominal flow for medium 1 [s]
Timetau22Time constant at nominal flow for medium 2 [s]
Timetau_m5Time constant of metal at nominal UA value [s]
Geometry
IntegernEle4Number of pipe segments used for discretization
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
BooleancomputeFlowResistance1false=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
BooleancomputeFlowResistance2false=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
Heat transfer
BooleanwaterSideFlowDependenttrueSet to false to make water-side hA independent of mass flow rate
BooleanairSideFlowDependenttrueSet to false to make air-side hA independent of mass flow rate
BooleanwaterSideTemperatureDependentfalseSet to false to make water-side hA independent of temperature
BooleanairSideTemperatureDependentfalseSet to false to make air-side hA independent of temperature
Experimental
ThermalConductanceGDif1E-2*UA_nominal/(nEle - 1)Thermal conductance to approximate diffusion (which improves model at near-zero flow rates [W/K]

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model DryCoilCounterFlow "Counterflow coil with discretization along the flow paths and without humidity condensation" extends Buildings.Fluid.Interfaces.PartialFourPortInterface(show_T=false); extends Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters( final computeFlowResistance1=false, final computeFlowResistance2=false, from_dp1=false, from_dp2=false); parameter Modelica.SIunits.ThermalConductance UA_nominal(min=0) "Thermal conductance at nominal flow, used to compute heat capacity"; parameter Real r_nominal=2/3 "Ratio between air-side and water-side convective heat transfer coefficient"; parameter Integer nEle(min=1) = 4 "Number of pipe segments used for discretization"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Formulation of energy balance"; parameter Modelica.SIunits.Time tau1=10 "Time constant at nominal flow for medium 1"; parameter Modelica.SIunits.Time tau2=2 "Time constant at nominal flow for medium 2"; parameter Modelica.SIunits.Time tau_m=5 "Time constant of metal at nominal UA value"; parameter Boolean waterSideFlowDependent=true "Set to false to make water-side hA independent of mass flow rate"; parameter Boolean airSideFlowDependent=true "Set to false to make air-side hA independent of mass flow rate"; parameter Boolean waterSideTemperatureDependent=false "Set to false to make water-side hA independent of temperature"; parameter Boolean airSideTemperatureDependent=false "Set to false to make air-side hA independent of temperature"; parameter Modelica.SIunits.ThermalConductance GDif = 1E-2*UA_nominal/(nEle - 1) "Thermal conductance to approximate diffusion (which improves model at near-zero flow rates"; Modelica.SIunits.HeatFlowRate Q1_flow = sum(ele[i].Q1_flow for i in 1:nEle) "Heat transferred from solid into medium 1"; Modelica.SIunits.HeatFlowRate Q2_flow = sum(ele[i].Q2_flow for i in 1:nEle) "Heat transferred from solid into medium 2"; Modelica.SIunits.Temperature T1[nEle] = ele[:].vol1.T "Water temperature"; Modelica.SIunits.Temperature T2[nEle] = ele[:].vol2.T "Air temperature"; Modelica.SIunits.Temperature T_m[nEle] = ele[:].con1.solid.T "Metal temperature"; BaseClasses.HADryCoil hA( final UA_nominal=UA_nominal, final m_flow_nominal_a=m2_flow_nominal, final m_flow_nominal_w=m1_flow_nominal, final waterSideTemperatureDependent=waterSideTemperatureDependent, final waterSideFlowDependent=waterSideFlowDependent, final airSideTemperatureDependent=airSideTemperatureDependent, final airSideFlowDependent=airSideFlowDependent, r_nominal=r_nominal) "Model for convective heat transfer coefficient"; protected final parameter Boolean use_temSen_1= waterSideTemperatureDependent and allowFlowReversal1 and (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) "Flag, set to true if the temperature sensor 1 is used"; final parameter Boolean use_temSen_2= airSideTemperatureDependent and allowFlowReversal2 and (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) "Flag, set to true if the temperature sensor 2 is used"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen_1( redeclare package Medium = Medium1, allowFlowReversal=allowFlowReversal1, m_flow_nominal=m1_flow_nominal, tau=if use_temSen_1 then 1 else 0) "Temperature sensor, used to obtain temperature for convective heat transfer calculation"; Buildings.Fluid.Sensors.MassFlowRate masFloSen_1( redeclare package Medium = Medium1) "Mass flow rate sensor"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen_2( redeclare package Medium = Medium2, final allowFlowReversal=allowFlowReversal2, m_flow_nominal=m2_flow_nominal, tau=if use_temSen_2 then 1 else 0) "Temperature sensor, used to obtain temperature for convective heat transfer calculation"; Buildings.Fluid.Sensors.MassFlowRate masFloSen_2( redeclare package Medium = Medium2) "Mass flow rate sensor"; Modelica.Blocks.Math.Gain gai_1(k=1/nEle) "Gain medium-side 1 to take discretization into account"; Modelica.Blocks.Math.Gain gai_2(k=1/nEle) "Gain medium-side 2 to take discretization into account"; replaceable model HexElement = BaseClasses.HexElementSensible "Model for a heat exchanger element"; HexElement ele[nEle]( redeclare each package Medium1 = Medium1, redeclare each package Medium2 = Medium2, each allowFlowReversal1=allowFlowReversal1, each allowFlowReversal2=allowFlowReversal2, each tau1=tau1/nEle, each m1_flow_nominal=m1_flow_nominal, each tau2=tau2, each m2_flow_nominal=m2_flow_nominal, each tau_m=tau_m/nEle, each UA_nominal=UA_nominal/nEle, each energyDynamics=energyDynamics, initialize_p1 = {(i == 1 and (not Medium1.singleState)) for i in 1:nEle}, initialize_p2 = {(i == 1 and (not Medium2.singleState)) for i in 1:nEle}, each deltaM1=deltaM1, each deltaM2=deltaM2, each from_dp1=from_dp1, each from_dp2=from_dp2, dp1_nominal={if i == 1 then dp1_nominal else 0 for i in 1:nEle}, dp2_nominal={if i == nEle then dp2_nominal else 0 for i in 1:nEle}) "Heat exchanger element"; Modelica.Blocks.Routing.Replicator rep1(nout=nEle) "Signal replicator"; Modelica.Blocks.Routing.Replicator rep2(nout=nEle) "Signal replicator"; Modelica.Blocks.Sources.RealExpression THA1( y=if waterSideTemperatureDependent then if allowFlowReversal1 then if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then temSen_1.T else ele[1].vol1.T else Medium1.temperature( state=Medium1.setState_phX(p=port_a1.p, h=inStream(port_a1.h_outflow), X=inStream(port_a1.Xi_outflow))) else Medium1.T_default) "Temperature used for convective heat transfer calculation for medium 1 (water-side)"; Modelica.Blocks.Sources.RealExpression THA2( y=if airSideTemperatureDependent then if allowFlowReversal1 then if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then temSen_2.T else ele[nEle].vol2.T else Medium2.temperature( state=Medium2.setState_phX(p=port_a2.p, h=inStream(port_a2.h_outflow), X=inStream(port_a2.Xi_outflow))) else Medium2.T_default) "Temperature used for convective heat transfer calculation for medium 2 (air-side)"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon1[nEle-1](each final G=GDif) "Thermal connector to approximate diffusion in medium 1"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon2[nEle-1](each final G=GDif) "Thermal connector to approximate diffusion in medium 2"; initial equation assert(UA_nominal > 0, "Parameter UA_nominal is negative. Check heat exchanger parameters."); equation connect(masFloSen_1.m_flow, hA.m1_flow); connect(port_a2, masFloSen_2.port_a); connect(masFloSen_2.port_b, temSen_2.port_a); connect(masFloSen_2.m_flow, hA.m2_flow); connect(hA.hA_1, gai_1.u); connect(hA.hA_2, gai_2.u); connect(port_a1, masFloSen_1.port_a); connect(masFloSen_1.port_b, temSen_1.port_a); connect(ele[nEle].port_b1, port_b1); connect(ele[1].port_b2, port_b2); for i in 1:nEle - 1 loop connect(ele[i].port_b1, ele[i + 1].port_a1); connect(ele[i].port_a2, ele[i + 1].port_b2); connect(theCon1[i].port_a, ele[i].heaPor1); connect(theCon1[i].port_b, ele[i+1].heaPor1); connect(theCon2[i].port_a, ele[i].heaPor2); connect(theCon2[i].port_b, ele[i+1].heaPor2); end for; connect(gai_1.y, rep1.u); connect(rep1.y, ele.Gc_1); connect(gai_2.y, rep2.u); connect(rep2.y, ele.Gc_2); connect(THA1.y, hA.T_1); connect(THA2.y, hA.T_2); connect(temSen_1.port_b, ele[1].port_a1); connect(temSen_2.port_b, ele[nEle].port_a2); end DryCoilCounterFlow;

Buildings.Fluid.HeatExchangers.DryCoilDiscretized Buildings.Fluid.HeatExchangers.DryCoilDiscretized

Coil with discretization along the flow paths and no humidity condensation

Buildings.Fluid.HeatExchangers.DryCoilDiscretized

Information

Model of a discretized coil with no water vapor condensation. The coil consists of nReg registers that are perpendicular to the air flow path. Each register consists of nPipPar parallel pipes, and each pipe can be divided into nPipSeg pipe segments along the pipe length. Thus, the smallest element of the coil consists of a pipe segment. Each pipe segment is modeled by an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible. Each element has a state variable for the metal.

If the parameter energyDynamics is different from Modelica.Fluid.Types.Dynamics.SteadyState, then a mixing volume of length dl is added to the duct connection. This can help reducing the dimension of the nonlinear system of equations.

The convective heat transfer coefficients can, for each fluid individually, be computed as a function of the flow rate and/or the temperature, or assigned to a constant. This computation is done using an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil.

In this model, the water (or liquid) flow path needs to be connected to port_a1 and port_b1, and the air flow path need to be connected to the other two ports.

To model humidity condensation, use the model Buildings.Fluid.HeatExchangers.WetCoilDiscretized instead of this model, as this model computes only sensible heat transfer.

Implementation

At very small flow rates, which may be caused when the fan is off but there is wind pressure on the building that entrains outside air through the HVAC system, large temperature differences could occur if diffusion were neglected. This model therefore approximates a small diffusion between the elements to have more uniform medium temperatures if the flow is near zero. The approximation is done using the heat conductors heaCon1 and heaCon2. As this is a rough approximation, neighboring elements are connected through these heat conduction elements, ignoring the actual geometrical configuration. Also, radiation between the coil surfaces on the air side is not modelled explicitly, but rather may be considered as approximated by these heat conductors.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute heat capacity [W/K]
Timetau120Time constant at nominal flow for medium 1 [s]
Timetau210Time constant at nominal flow for medium 2 [s]
Timetau_m20Time constant of metal at nominal UA value [s]
Geometry
IntegernReg2Number of registers
IntegernPipPar3Number of parallel pipes in each register
IntegernPipSeg4Number of pipe segments per register used for discretization
Lengthdh10.025Hydraulic diameter for a single pipe [m]
Lengthdh21Hydraulic diameter for duct [m]
Initialization
MassFlowRatemStart_flow_a1m1_flow_nominalGuess value for mass flow rate at port_a1 [kg/s]
MassFlowRatemStart_flow_a2m2_flow_nominalGuess value for mass flow rate at port_a2 [kg/s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Booleanuse_dh1falseSet to true to specify hydraulic diameter for pipe pressure drop
Booleanuse_dh2falseSet to true to specify hydraulic diameter for duct pressure drop)
RealReC_14000Reynolds number where transition to turbulent starts inside pipes
RealReC_24000Reynolds number where transition to turbulent starts inside ducts
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
BooleancomputeFlowResistance1true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
BooleancomputeFlowResistance2true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
Heat transfer
BooleanwaterSideFlowDependentfalseSet to false to make water-side hA independent of mass flow rate
BooleanairSideFlowDependentfalseSet to false to make air-side hA independent of mass flow rate
BooleanwaterSideTemperatureDependentfalseSet to false to make water-side hA independent of temperature

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model DryCoilDiscretized "Coil with discretization along the flow paths and no humidity condensation" extends Buildings.Fluid.Interfaces.PartialFourPortInterface(show_T=false); extends Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters( final computeFlowResistance1=true, final computeFlowResistance2=true, from_dp1 = false, from_dp2 = false); constant Boolean initialize_p1 = not Medium1.singleState "Set to true to initialize the pressure of volume 1"; constant Boolean initialize_p2 = not Medium2.singleState "Set to true to initialize the pressure of volume 2"; constant Boolean airSideTemperatureDependent = false "Set to false to make air-side hA independent of temperature"; parameter Modelica.SIunits.ThermalConductance UA_nominal(min=0) "Thermal conductance at nominal flow, used to compute heat capacity"; parameter Integer nReg(min=2)=2 "Number of registers"; parameter Integer nPipPar(min=1) = 3 "Number of parallel pipes in each register"; parameter Integer nPipSeg(min=1) = 4 "Number of pipe segments per register used for discretization"; parameter Boolean use_dh1 = false "Set to true to specify hydraulic diameter for pipe pressure drop"; parameter Boolean use_dh2 = false "Set to true to specify hydraulic diameter for duct pressure drop)"; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Formulation of energy balance"; parameter Modelica.SIunits.Length dh1=0.025 "Hydraulic diameter for a single pipe"; parameter Real ReC_1=4000 "Reynolds number where transition to turbulent starts inside pipes"; parameter Real ReC_2=4000 "Reynolds number where transition to turbulent starts inside ducts"; parameter Modelica.SIunits.Length dh2=1 "Hydraulic diameter for duct"; parameter Modelica.SIunits.Time tau1=20 "Time constant at nominal flow for medium 1"; parameter Modelica.SIunits.Time tau2=10 "Time constant at nominal flow for medium 2"; parameter Modelica.SIunits.Time tau_m=20 "Time constant of metal at nominal UA value"; parameter Boolean waterSideFlowDependent = false "Set to false to make water-side hA independent of mass flow rate"; parameter Boolean airSideFlowDependent = false "Set to false to make air-side hA independent of mass flow rate"; parameter Boolean waterSideTemperatureDependent = false "Set to false to make water-side hA independent of temperature"; parameter Modelica.SIunits.MassFlowRate mStart_flow_a1=m1_flow_nominal "Guess value for mass flow rate at port_a1"; parameter Modelica.SIunits.MassFlowRate mStart_flow_a2=m2_flow_nominal "Guess value for mass flow rate at port_a2"; Modelica.SIunits.HeatFlowRate Q1_flow = sum(hexReg[i].Q1_flow for i in 1:nReg) "Heat transferred from solid into medium 1"; Modelica.SIunits.HeatFlowRate Q2_flow = sum(hexReg[i].Q2_flow for i in 1:nReg) "Heat transferred from solid into medium 2"; Buildings.Fluid.HeatExchangers.BaseClasses.CoilRegister hexReg[nReg]( redeclare each package Medium1 = Medium1, redeclare each package Medium2 = Medium2, each final allowFlowReversal1=allowFlowReversal1, each final allowFlowReversal2=allowFlowReversal2, each final nPipPar=nPipPar, each final nPipSeg=nPipSeg, each final m1_flow_nominal=m1_flow_nominal/nPipPar, each final m2_flow_nominal=m1_flow_nominal/nPipPar/nPipSeg, each tau1=tau1, each tau2=tau2, each tau_m=tau_m, each final energyDynamics=energyDynamics, initialize_p1 = {(i == 1 and (not Medium1.singleState)) for i in 1:nReg}, initialize_p2 = {(i == 1 and (not Medium2.singleState)) for i in 1:nReg}, each from_dp1=from_dp1, each linearizeFlowResistance1=linearizeFlowResistance1, each deltaM1=deltaM1, each from_dp2=from_dp2, each linearizeFlowResistance2=linearizeFlowResistance2, each deltaM2=deltaM2, each dp1_nominal=0, each dp2_nominal=0, each final UA_nominal=UA_nominal/nReg) "Heat exchanger register"; Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFixedResistance pipMan_a( redeclare package Medium = Medium1, final nPipPar=nPipPar, final m_flow_nominal=m1_flow_nominal, final dp_nominal=dp1_nominal, final dh=dh1, final ReC=ReC_1, final mStart_flow_a=mStart_flow_a1, final linearized=linearizeFlowResistance1, final use_dh=use_dh1, final deltaM=deltaM1, final from_dp=from_dp1, final allowFlowReversal=allowFlowReversal1) "Pipe manifold at port a"; Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldNoResistance pipMan_b( redeclare package Medium = Medium1, final nPipPar=nPipPar, final mStart_flow_a=-mStart_flow_a1, final allowFlowReversal=allowFlowReversal1) "Pipe manifold at port b"; Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldNoResistance ducMan_b( redeclare package Medium = Medium2, final nPipPar=nPipPar, final nPipSeg=nPipSeg, final mStart_flow_a=-mStart_flow_a2, final allowFlowReversal=allowFlowReversal2) "Duct manifold at port b"; Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFixedResistance ducMan_a( redeclare package Medium = Medium2, final nPipPar = nPipPar, final nPipSeg = nPipSeg, final m_flow_nominal=m2_flow_nominal, final dp_nominal=dp2_nominal, final dh=dh2, final ReC=ReC_2, final mStart_flow_a=mStart_flow_a2, final linearized=linearizeFlowResistance2, final use_dh=use_dh2, final deltaM=deltaM2, final from_dp=from_dp2, final allowFlowReversal=allowFlowReversal2) "Duct manifold at port a"; BaseClasses.HADryCoil hA( final UA_nominal=UA_nominal, final m_flow_nominal_a=m2_flow_nominal, final m_flow_nominal_w=m1_flow_nominal, final waterSideTemperatureDependent=waterSideTemperatureDependent, final waterSideFlowDependent=waterSideFlowDependent, final airSideTemperatureDependent=airSideTemperatureDependent, final airSideFlowDependent=airSideFlowDependent) "Model for convective heat transfer coefficient"; protected constant Boolean allowCondensation = false "Set to false to compute sensible heat transfer only"; final parameter Boolean use_temSen_1= waterSideTemperatureDependent and allowFlowReversal1 and (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) "Flag, set to true if the temperature sensor 1 is used"; final parameter Boolean use_temSen_2= airSideTemperatureDependent and allowFlowReversal2 and (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) "Flag, set to true if the temperature sensor 2 is used"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen_1( redeclare package Medium = Medium1, allowFlowReversal=allowFlowReversal1, m_flow_nominal=m1_flow_nominal, tau=if use_temSen_1 then 1 else 0) "Temperature sensor, used to obtain temperature for convective heat transfer calculation"; Buildings.Fluid.Sensors.MassFlowRate masFloSen_1( redeclare package Medium = Medium1) "Mass flow rate sensor"; Buildings.Fluid.Sensors.TemperatureTwoPort temSen_2( redeclare package Medium = Medium2, final allowFlowReversal=allowFlowReversal2, m_flow_nominal=m2_flow_nominal, tau=if use_temSen_2 then 1 else 0) "Temperature sensor, used to obtain temperature for convective heat transfer calculation"; Buildings.Fluid.Sensors.MassFlowRate masFloSen_2( redeclare package Medium = Medium2) "Mass flow rate sensor"; BaseClasses.CoilHeader hea1[div(nReg,2)]( redeclare each final package Medium = Medium1, each final nPipPar = nPipPar, each final mStart_flow_a=mStart_flow_a1, each allowFlowReversal=allowFlowReversal1) if nReg > 1 "Pipe header to redirect flow into next register"; BaseClasses.CoilHeader hea2[div(nReg,2)-1]( redeclare each final package Medium = Medium1, each final nPipPar = nPipPar, each final mStart_flow_a=mStart_flow_a1, each allowFlowReversal=allowFlowReversal1) if nReg > 2 "Pipe header to redirect flow into next register"; Modelica.Blocks.Math.Gain gai_1(k=1/nReg) "Gain medium-side 1 to take discretization into account"; Modelica.Blocks.Math.Gain gai_2(k=1/nReg) "Gain medium-side 2 to take discretization into account"; Modelica.Blocks.Sources.RealExpression THA1( y=if waterSideTemperatureDependent then if allowFlowReversal1 then if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then temSen_1.T else hexReg[1].ele[1,1].vol1.T else Medium1.temperature( state=Medium1.setState_phX(p=port_a1.p, h=inStream(port_a1.h_outflow), X=inStream(port_a1.Xi_outflow))) else Medium1.T_default) "Temperature used for convective heat transfer calculation for medium 1 (water-side)"; Modelica.Blocks.Sources.RealExpression THA2( y=if airSideTemperatureDependent then if allowFlowReversal1 then if energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState then temSen_2.T else hexReg[1].ele[1,1].vol2.T else Medium2.temperature( state=Medium2.setState_phX(p=port_a2.p, h=inStream(port_a2.h_outflow), X=inStream(port_a2.Xi_outflow))) else Medium2.T_default) "Temperature used for convective heat transfer calculation for medium 2 (air-side)"; parameter Modelica.SIunits.ThermalConductance GDif1 = 1E-2*UA_nominal/(nPipPar*max(1, nPipSeg-1)*nReg) "Thermal conductance to approximate diffusion (which improves model at near-zero flow rates)"; parameter Modelica.SIunits.ThermalConductance GDif2 = 1E-2*UA_nominal/(nPipPar*nPipSeg*max(1, nReg-1)) "Thermal conductance to approximate diffusion (which improves model at near-zero flow rates)"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon1[nReg, nPipPar, nPipSeg-1]( each final G=GDif1) "Thermal connector between the pipe segements to approximate diffusion in water (diffusion through the header is neglected)"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon2[nReg-1, nPipPar, nPipSeg]( each final G=GDif2) "Thermal connector to approximate diffusion in air"; initial equation assert(UA_nominal>0, "Parameter UA_nominal is negative. Check heat exchanger parameters."); equation // air stream connections for i in 2:nReg loop connect(hexReg[i].port_a2, hexReg[i-1].port_b2); end for; connect(ducMan_a.port_b, hexReg[1].port_a2); connect(hexReg[nReg].port_b2, ducMan_b.port_b); connect(pipMan_a.port_b, hexReg[1].port_a1); connect(hexReg[nReg].port_a1, pipMan_b.port_b); connect(pipMan_b.port_a, port_b1); connect(ducMan_b.port_a, port_b2); for i in 1:2:nReg loop // header after first hex register connect(hexReg[i].port_b1, hea1[div((i+1),2)].port_a); connect(hea1[div((i+1),2)].port_b, hexReg[i+1].port_b1); end for; // header after 2nd hex register for i in 2:2:(nReg-1) loop connect(hexReg[i].port_a1, hea2[div(i,2)].port_a); connect(hea2[div(i,2)].port_b, hexReg[i+1].port_a1); end for; connect(masFloSen_1.m_flow, hA.m1_flow); connect(port_a2, masFloSen_2.port_a); connect(masFloSen_2.port_b, temSen_2.port_a); connect(temSen_2.port_b, ducMan_a.port_a); connect(masFloSen_2.m_flow, hA.m2_flow); connect(hA.hA_1, gai_1.u); connect(hA.hA_2, gai_2.u); for i in 1:nReg loop connect(gai_1.y, hexReg[i].Gc_1); connect(gai_2.y, hexReg[i].Gc_2); end for; connect(port_a1, masFloSen_1.port_a); connect(masFloSen_1.port_b, temSen_1.port_a); connect(temSen_1.port_b, pipMan_a.port_a); connect(THA1.y, hA.T_1); connect(THA2.y, hA.T_2); // Heat diffusion approximation inside pipes for iReg in 1:nReg loop for iPipPar in 1:nPipPar loop for iPipSeg in 1:nPipSeg-1 loop connect(hexReg[iReg].heaPor1[iPipPar,iPipSeg], theCon1[iReg, iPipPar,iPipSeg].port_a); connect(theCon1[iReg, iPipPar,iPipSeg].port_b, hexReg[iReg].heaPor1[iPipPar,iPipSeg+1]); end for; end for; end for; // Heat diffusion approximation along air path for iReg in 1:nReg-1 loop for iPipPar in 1:nPipPar loop for iPipSeg in 1:nPipSeg loop connect(hexReg[iReg].heaPor2[iPipPar, iPipSeg], theCon2[iReg, iPipPar, iPipSeg].port_a); connect(theCon2[iReg, iPipPar, iPipSeg].port_b, hexReg[iReg+1].heaPor2[iPipPar, iPipSeg]); end for; end for; end for; end DryCoilDiscretized;

Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU

Heat exchanger with effectiveness - NTU relation and no moisture condensation

Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU

Information

Model of a coil without humidity condensation. This model transfers heat in the amount of

Q̇ = Q̇max ε
ε = f(NTU, Z, flowRegime),

where max is the maximum heat that can be transferred, ε is the heat transfer effectiveness, NTU is the Number of Transfer Units, Z is the ratio of minimum to maximum capacity flow rate and flowRegime is the heat exchanger flow regime. such as parallel flow, cross flow or counter flow.

The flow regimes depend on the heat exchanger configuration. All configurations defined in Buildings.Fluid.Types.HeatExchangerConfiguration are supported.

The convective heat transfer coefficients scale proportional to (ṁ/ṁ0)n, where is the mass flow rate, 0 is the nominal mass flow rate, and n=0.8 on the air-side and n=0.85 on the water side.

For a heat and moisture exchanger, use Buildings.Fluid.MassExchangers.ConstantEffectiveness.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU (Partial model for heat exchanger with effectiveness - NTU relation and no moisture condensation).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
HeatExchangerConfigurationconfiguration Heat exchanger configuration
Realr_nominal2/3Ratio between air-side and water-side convective heat transfer (hA-value) at nominal condition
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Nominal thermal performance
Booleanuse_Q_flow_nominaltrueSet to true to specify Q_flow_nominal and temperatures, or to false to specify effectiveness
HeatFlowRateQ_flow_nominal Nominal heat flow rate (positive for heat transfer from 1 to 2) [W]
TemperatureT_a1_nominal Nominal temperature at port a1 [K]
TemperatureT_a2_nominal Nominal temperature at port a2 [K]
Realeps_nominal Nominal heat transfer effectiveness
Custom Parameters
ThermalConductanceUA1/(1/hA.hA_1 + 1/hA.hA_2)UA value [W/K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model DryCoilEffectivenessNTU "Heat exchanger with effectiveness - NTU relation and no moisture condensation" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU( UA = 1/(1/hA.hA_1 + 1/hA.hA_2)); parameter Real r_nominal( min=0, max=1) = 2/3 "Ratio between air-side and water-side convective heat transfer (hA-value) at nominal condition"; Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil hA( final r_nominal=r_nominal, final UA_nominal=UA_nominal, final m_flow_nominal_w=m1_flow_nominal, final m_flow_nominal_a=m2_flow_nominal, waterSideTemperatureDependent=false, airSideTemperatureDependent=false) "Model for convective heat transfer coefficient"; equation // Convective heat transfer coefficient hA.m1_flow = m1_flow; hA.m2_flow = m2_flow; hA.T_1 = T_in1; hA.T_2 = T_in2; end DryCoilEffectivenessNTU;

Buildings.Fluid.HeatExchangers.EvaporatorCondenser Buildings.Fluid.HeatExchangers.EvaporatorCondenser

Evaporator or condenser with refrigerant experiencing constant temperature phase change

Buildings.Fluid.HeatExchangers.EvaporatorCondenser

Information

Model for a constant temperature evaporator or condenser based on a ε-NTU heat exchanger model.

The heat exchanger effectiveness is calculated from the number of transfer units (NTU):

ε = 1 - exp(UA ⁄ (ṁ cp))

Optionally, this model can have a flow resistance. If no flow resistance is requested, set dp_nominal=0.

Limitations

This model does not consider any superheating or supercooling on the refrigerant side. The refrigerant is considered to exchange heat at a constant temperature throughout the heat exchanger.

Extends from Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger (Partial model transporting one fluid stream with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
ThermalConductanceUA Thermal conductance of heat exchanger [W/K]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
ThermalConductanceUA_smallUA/10Small thermal conductance for regularisation of heat transfer [W/K]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputQ_flowHeat added to the fluid [W]
output RealOutputTMedium temperature [K]
HeatPort_aport_refTemperature and heat flow from the refrigerant

Modelica definition

model EvaporatorCondenser "Evaporator or condenser with refrigerant experiencing constant temperature phase change" extends Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger(redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol(final prescribedHeatFlowRate=false)); parameter Modelica.SIunits.ThermalConductance UA "Thermal conductance of heat exchanger"; parameter Modelica.SIunits.ThermalConductance UA_small=UA/10 "Small thermal conductance for regularisation of heat transfer "; Modelica.Blocks.Interfaces.RealOutput Q_flow(unit="W") "Heat added to the fluid"; Modelica.Blocks.Interfaces.RealOutput T(unit="K") "Medium temperature"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a port_ref "Temperature and heat flow from the refrigerant"; Modelica.SIunits.Efficiency NTU = UA / (Buildings.Utilities.Math.Functions.smoothMax(abs(port_a.m_flow),m_flow_small,m_flow_small)*cp_default) "Number of transfer units of heat exchanger"; Modelica.SIunits.Efficiency eps= Buildings.Utilities.Math.Functions.smoothMin( Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_ntuZ( NTU, 0, Integer(Buildings.Fluid.Types.HeatExchangerFlowRegime.ConstantTemperaturePhaseChange)), 0.999, 1.0e-4) "Effectiveness of heat exchanger"; Modelica.Blocks.Sources.RealExpression UAeff( final y=Buildings.Utilities.Math.Functions.smoothMax( x1=UA, x2=eps*cp_default*abs(port_a.m_flow)/(1 - eps), deltaX=UA_small)) "Effective heat transfer coefficient"; protected parameter Modelica.SIunits.SpecificHeatCapacity cp_default= Medium.specificHeatCapacityCp(sta_default) "Density, used to compute fluid volume"; Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFlo "Heat flow sensor"; Modelica.Thermal.HeatTransfer.Components.Convection con "Convective heat transfer"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTem "Temperature sensor"; equation connect(heaFlo.port_b, vol.heatPort); connect(heaFlo.Q_flow, Q_flow); connect(port_ref, con.solid); connect(con.fluid, heaFlo.port_a); connect(UAeff.y, con.Gc); connect(senTem.port, vol.heatPort); connect(senTem.T, T); end EvaporatorCondenser;

Buildings.Fluid.HeatExchangers.HeaterCooler_u Buildings.Fluid.HeatExchangers.HeaterCooler_u

Heater or cooler with prescribed heat flow rate

Buildings.Fluid.HeatExchangers.HeaterCooler_u

Information

Model for an ideal heater or cooler with prescribed heat flow rate to the medium.

This model adds heat in the amount of Q_flow = u Q_flow_nominal to the medium. The input signal u and the nominal heat flow rate Q_flow_nominal can be positive or negative. A positive value of Q_flow means heating, and negative means cooling.

The outlet conditions at port_a are not affected by this model, other than for a possible pressure difference due to flow friction.

Optionally, this model can have a flow resistance. Set dp_nominal = 0 to disable the flow friction calculation.

For a model that uses as an input the fluid temperature leaving at port_b, use Buildings.Fluid.HeatExchangers.PrescribedOutlet

Limitations

This model does not affect the humidity of the air. Therefore, if used to cool air below the dew point temperature, the water mass fraction will not change.

Validation

The model has been validated against the analytical solution in the example Buildings.Fluid.HeatExchangers.Validation.HeaterCooler_u.

Extends from Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger (Partial model transporting one fluid stream with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
HeatFlowRateQ_flow_nominal Heat flow rate at u=1, positive for heating [W]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputuControl input [1]
output RealOutputQ_flowHeat added to the fluid [W]

Modelica definition

model HeaterCooler_u "Heater or cooler with prescribed heat flow rate" extends Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger( redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol( final prescribedHeatFlowRate=true)); parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal "Heat flow rate at u=1, positive for heating"; Modelica.Blocks.Interfaces.RealInput u(unit="1") "Control input"; Modelica.Blocks.Interfaces.RealOutput Q_flow(unit="W") "Heat added to the fluid"; protected Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHea( final alpha=0) "Prescribed heat flow"; Modelica.Blocks.Math.Gain gai(k=Q_flow_nominal) "Gain"; equation connect(u, gai.u); connect(gai.y, preHea.Q_flow); connect(preHea.port, vol.heatPort); connect(gai.y, Q_flow); end HeaterCooler_u;

Buildings.Fluid.HeatExchangers.Heater_T Buildings.Fluid.HeatExchangers.Heater_T

Heater with prescribed outlet temperature

Buildings.Fluid.HeatExchangers.Heater_T

Information

Model for an ideal heater that controls its outlet temperature to a prescribed outlet temperature.

This model forces the outlet temperature at port_b to be no lower than the temperature of the input signal TSet, subject to optional limits on the capacity. By default, the model has unlimited heating capacity.

The output signal Q_flow is the heat added to the medium if the mass flow rate is from port_a to port_b. If the flow is reversed, then Q_flow=0.

The outlet conditions at port_a are not affected by this model, other than for a possible pressure difference due to flow friction.

If the parameter energyDynamics is different from Modelica.Fluid.Types.Dynamics.SteadyState, the component models the dynamic response using a first order differential equation. The time constant of the component is equal to the parameter tau. This time constant is adjusted based on the mass flow rate using

τeff = τ |ṁ| ⁄ ṁnom

where τeff is the effective time constant for the given mass flow rate and τ is the time constant at the nominal mass flow rate nom. This type of dynamics is equal to the dynamics that a completely mixed control volume would have.

Optionally, this model can have a flow resistance. Set dp_nominal = 0 to disable the flow friction calculation.

For a similar model that is a sensible cooling device, use Buildings.Fluid.HeatExchangers.SensibleCooler_T. For a model that uses a control signal u ∈ [0, 1] and multiplies this with the nominal heating or cooling power, use Buildings.Fluid.HeatExchangers.HeaterCooler_u

Limitations

If the flow is from port_b to port_a, then the enthalpy of the medium is not affected by this model.

Validation

The model has been validated against the analytical solution in the examples Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet and Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet_dynamic.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet (Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
HeatFlowRateQMax_flowModelica.Constants.infMaximum heat flow rate for heating (positive) [W]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Timetau10Time constant at nominal flow rate (used if energyDynamics or massDynamics not equal Modelica.Fluid.Types.Dynamics.SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
TemperatureT_startMedium.T_defaultStart value of temperature [K]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputTSetSet point temperature of the fluid that leaves port_b [K]
output RealOutputQ_flowHeat flow rate added to the fluid (if flow is from port_a to port_b) [W]

Modelica definition

model Heater_T "Heater with prescribed outlet temperature" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet( outCon( final QMin_flow = 0, final QMax_flow = QMax_flow, final mWatMax_flow = 0, final mWatMin_flow = 0, final use_TSet = true, final use_X_wSet = false, final energyDynamics = energyDynamics, final massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, final T_start=T_start, final X_start=Medium.X_default)); parameter Modelica.SIunits.HeatFlowRate QMax_flow(min=0) = Modelica.Constants.inf "Maximum heat flow rate for heating (positive)"; parameter Modelica.SIunits.Temperature T_start=Medium.T_default "Start value of temperature"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; Modelica.Blocks.Interfaces.RealInput TSet( unit="K", displayUnit="degC") "Set point temperature of the fluid that leaves port_b"; Modelica.Blocks.Interfaces.RealOutput Q_flow(unit="W") "Heat flow rate added to the fluid (if flow is from port_a to port_b)"; equation connect(TSet, outCon.TSet); connect(outCon.Q_flow, Q_flow); end Heater_T;

Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU

Plate heat exchanger with effectiveness - NTU relation and no moisture condensation

Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU

Information

Model of a plate heat exchanger without humidity condensation. This model transfers heat in the amount of

Q̇ = Q̇max ε
ε = f(NTU, Z, flowRegime),

where max is the maximum heat that can be transferred, ε is the heat transfer effectiveness, NTU is the Number of Transfer Units, Z is the ratio of minimum to maximum capacity flow rate and flowRegime is the heat exchanger flow regime. such as parallel flow, cross flow or counter flow.

The flow regimes depend on the heat exchanger configuration. All configurations defined in Buildings.Fluid.Types.HeatExchangerConfiguration are supported.

The convective heat transfer coefficients scale proportional to (ṁ/ṁ0)n, where is the mass flow rate, 0 is the nominal mass flow rate, and n=0.8 for both streams.

For a plate exchanger, use Buildings.Fluid.HeatExchangers.PlateHeatExchangerEffectivenessNTU.

For a heat and moisture exchanger, use Buildings.Fluid.MassExchangers.ConstantEffectiveness.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU (Partial model for heat exchanger with effectiveness - NTU relation and no moisture condensation).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
HeatExchangerConfigurationconfiguration Heat exchanger configuration
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Nominal thermal performance
Booleanuse_Q_flow_nominaltrueSet to true to specify Q_flow_nominal and temperatures, or to false to specify effectiveness
HeatFlowRateQ_flow_nominal Nominal heat flow rate (positive for heat transfer from 1 to 2) [W]
TemperatureT_a1_nominal Nominal temperature at port a1 [K]
TemperatureT_a2_nominal Nominal temperature at port a2 [K]
Realeps_nominal Nominal heat transfer effectiveness
Custom Parameters
ThermalConductanceUA1/(1/hA1 + 1/hA2)UA value [W/K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model PlateHeatExchangerEffectivenessNTU "Plate heat exchanger with effectiveness - NTU relation and no moisture condensation" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU( UA = 1/(1/hA1 + 1/hA2)); protected parameter Modelica.SIunits.ThermalConductance hA1_nominal(min=0)=2*UA_nominal "Nominal convective heat transfer coefficient for medium 1"; parameter Modelica.SIunits.ThermalConductance hA2_nominal(min=0)=2*UA_nominal "Nominal convective heat transfer coefficient for medium 2"; parameter Real n1(min=0, max=1)=0.8 "Exponent for convective heat transfer coefficient, h1~m1_flow^n1"; parameter Real n2(min=0, max=1)=0.8 "Exponent for convective heat transfer coefficient, h2~m2_flow^n2"; Modelica.SIunits.ThermalConductance hA1 "Convective heat transfer coefficient for medium 1"; Modelica.SIunits.ThermalConductance hA2 "Convective heat transfer coefficient for medium 2"; equation // Convective heat transfer coefficients hA1 = hA1_nominal * Buildings.Utilities.Math.Functions.regNonZeroPower( x = m1_flow/m1_flow_nominal, n = n1, delta = 0.1); hA2 = hA2_nominal * Buildings.Utilities.Math.Functions.regNonZeroPower( x = m2_flow/m2_flow_nominal, n = n2, delta = 0.1); end PlateHeatExchangerEffectivenessNTU;

Buildings.Fluid.HeatExchangers.PrescribedOutlet Buildings.Fluid.HeatExchangers.PrescribedOutlet

Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions

Buildings.Fluid.HeatExchangers.PrescribedOutlet

Information

Model that allows specifying the temperature and mass fraction of the fluid that leaves the model from port_b.

This model forces the outlet temperature at port_b to be equal to the temperature of the input signal TSet, subject to optional limits on the heating or cooling capacity QMax_flow ≥ 0 and QMin_flow ≤ 0. Similarly than for the temperature, this model also forces the outlet water mass fraction at port_b to be no lower than the input signal X_wSet, subject to optional limits on the maximum water vapor mass flow rate that is added, as described by the parameter mWatMax_flow. By default, the model has unlimited capacity, but control of temperature and humidity can be subject to capacity limits, or be disabled.

The output signal Q_flow is the heat added (for heating) or subtracted (for cooling) to the medium if the flow rate is from port_a to port_b. If the flow is reversed, then Q_flow=0.

The outlet conditions at port_a are not affected by this model.

If the parameter energyDynamics is not equal to Modelica.Fluid.Types.Dynamics.SteadyState, the component models the dynamic response using a first order differential equation. The time constant of the component is equal to the parameter tau. This time constant is adjusted based on the mass flow rate using

τeff = τ |ṁ| ⁄ ṁnom

where τeff is the effective time constant for the given mass flow rate and τ is the time constant at the nominal mass flow rate nom. This type of dynamics is equal to the dynamics that a completely mixed control volume would have.

Optionally, this model can have a flow resistance. If no flow resistance is requested, set dp_nominal=0.

For a model that uses a control signal u ∈ [0, 1] and multiplies this with the nominal heating or cooling power, use Buildings.Fluid.HeatExchangers.HeaterCooler_u

Limitations

This model only adds or removes heat or water vapor for the flow from port_a to port_b. The enthalpy of the reverse flow is not affected by this model.

If this model is used to cool air below the dew point temperature, the water mass fraction will not change.

Note that for use_TSet = false, the enthalpy of the leaving fluid will not be changed, even if moisture is added. The enthalpy added (or removed) by the change in humidity is neglected. To properly account for change in enthalpy due to humidification, use instead Buildings.Fluid.Humidifiers.SprayAirWasher_X.

Validation

The model has been validated against the analytical solution in the examples Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet and Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet_dynamic.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet (Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
HeatFlowRateQMax_flowModelica.Constants.infMaximum heat flow rate for heating (positive) [W]
HeatFlowRateQMin_flow-Modelica.Constants.infMaximum heat flow rate for cooling (negative) [W]
MassFlowRatemWatMax_flowModelica.Constants.infMaximum water mass flow rate addition (positive) [kg/s]
MassFlowRatemWatMin_flow-Modelica.Constants.infMaximum water mass flow rate removal (negative) [kg/s]
Booleanuse_TSettrueSet to false to disable temperature set point
Booleanuse_X_wSettrueSet to false to disable water vapor set point
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Timetau10Time constant at nominal flow rate (used if energyDynamics or massDynamics not equal Modelica.Fluid.Types.Dynamics.SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Initialization
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [1]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputTSetSet point temperature of the fluid that leaves port_b [K]
input RealInputX_wSetSet point for water vapor mass fraction of the fluid that leaves port_b [1]
output RealOutputQ_flowHeat flow rate added to the fluid (if flow is from port_a to port_b) [W]
output RealOutputmWat_flowWater vapor mass flow rate added to the fluid (if flow is from port_a to port_b) [kg/s]

Modelica definition

model PrescribedOutlet "Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet( outCon( final T_start=T_start, final X_start=X_start, final use_TSet = use_TSet, final use_X_wSet = use_X_wSet, final QMax_flow = QMax_flow, final QMin_flow = QMin_flow, final mWatMax_flow = mWatMax_flow, final mWatMin_flow = mWatMin_flow, final energyDynamics = energyDynamics, final massDynamics = massDynamics)); parameter Modelica.SIunits.HeatFlowRate QMax_flow(min=0) = Modelica.Constants.inf "Maximum heat flow rate for heating (positive)"; parameter Modelica.SIunits.HeatFlowRate QMin_flow(max=0) = -Modelica.Constants.inf "Maximum heat flow rate for cooling (negative)"; parameter Modelica.SIunits.MassFlowRate mWatMax_flow(min=0) = Modelica.Constants.inf "Maximum water mass flow rate addition (positive)"; parameter Modelica.SIunits.MassFlowRate mWatMin_flow(max=0) = -Modelica.Constants.inf "Maximum water mass flow rate removal (negative)"; parameter Modelica.SIunits.Temperature T_start = Medium.T_default "Start value of temperature"; parameter Modelica.SIunits.MassFraction X_start[Medium.nX] = Medium.X_default "Start value of mass fractions m_i/m"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Modelica.Fluid.Types.Dynamics massDynamics = energyDynamics "Type of mass balance: dynamic (3 initialization options) or steady state"; parameter Boolean use_TSet = true "Set to false to disable temperature set point"; parameter Boolean use_X_wSet = true "Set to false to disable water vapor set point"; Modelica.Blocks.Interfaces.RealInput TSet( unit="K", displayUnit="degC") if use_TSet "Set point temperature of the fluid that leaves port_b"; Modelica.Blocks.Interfaces.RealInput X_wSet(unit="1") if use_X_wSet "Set point for water vapor mass fraction of the fluid that leaves port_b"; Modelica.Blocks.Interfaces.RealOutput Q_flow(unit="W") "Heat flow rate added to the fluid (if flow is from port_a to port_b)"; Modelica.Blocks.Interfaces.RealOutput mWat_flow(unit="kg/s") "Water vapor mass flow rate added to the fluid (if flow is from port_a to port_b)"; equation connect(outCon.X_wSet, X_wSet); connect(outCon.mWat_flow, mWat_flow); connect(outCon.TSet, TSet); connect(outCon.Q_flow, Q_flow); end PrescribedOutlet;

Buildings.Fluid.HeatExchangers.SensibleCooler_T Buildings.Fluid.HeatExchangers.SensibleCooler_T

Sensible cooling device with prescribed outlet temperature

Buildings.Fluid.HeatExchangers.SensibleCooler_T

Information

Model for an ideal sensible-only cooler that controls its outlet temperature to a prescribed outlet temperature.

This model forces the outlet temperature at port_b to be no higher than the temperature of the input signal TSet, subject to optional limits on the capacity. By default, the model has unlimited cooling capacity.

The output signal Q_flow ≤ 0 is the heat added to the medium if the mass flow rate is from port_a to port_b. If the flow is reversed, then Q_flow=0.

The outlet conditions at port_a are not affected by this model, other than for a possible pressure difference due to flow friction.

If the parameter energyDynamics is different from Modelica.Fluid.Types.Dynamics.SteadyState, the component models the dynamic response using a first order differential equation. The time constant of the component is equal to the parameter tau. This time constant is adjusted based on the mass flow rate using

τeff = τ |ṁ| ⁄ ṁnom

where τeff is the effective time constant for the given mass flow rate and τ is the time constant at the nominal mass flow rate nom. This type of dynamics is equal to the dynamics that a completely mixed control volume would have.

Optionally, this model can have a flow resistance. Set dp_nominal = 0 to disable the flow friction calculation.

For a similar model that is a heater, use Buildings.Fluid.HeatExchangers.Heater_T. For a model that uses a control signal u ∈ [0, 1] and multiplies this with the nominal heating or cooling power, use Buildings.Fluid.HeatExchangers.HeaterCooler_u.

Limitations

If the flow is from port_b to port_a, then the enthalpy of the medium is not affected by this model.

This model does not affect the humidity of the air. Therefore, if used to cool air below the dew point temperature, the water mass fraction will not change.

Validation

The model has been validated against the analytical solution in the examples Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet and Buildings.Fluid.HeatExchangers.Validation.PrescribedOutlet_dynamic.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet (Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
HeatFlowRateQMin_flow-Modelica.Constants.infMaximum heat flow rate for cooling (negative) [W]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal Pressure difference [Pa]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Timetau10Time constant at nominal flow rate (used if energyDynamics or massDynamics not equal Modelica.Fluid.Types.Dynamics.SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
TemperatureT_startMedium.T_defaultStart value of temperature [K]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputTSetSet point temperature of the fluid that leaves port_b [K]
output RealOutputQ_flowHeat flow rate added to the fluid (if flow is from port_a to port_b) [W]

Modelica definition

model SensibleCooler_T "Sensible cooling device with prescribed outlet temperature" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet( outCon( final QMin_flow = QMin_flow, final QMax_flow = 0, final mWatMax_flow = 0, final mWatMin_flow = 0, final use_TSet = true, final use_X_wSet = false, final energyDynamics = energyDynamics, final massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, final T_start=T_start, final X_start=Medium.X_default)); parameter Modelica.SIunits.HeatFlowRate QMin_flow(max=0) = -Modelica.Constants.inf "Maximum heat flow rate for cooling (negative)"; parameter Modelica.SIunits.Temperature T_start=Medium.T_default "Start value of temperature"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; Modelica.Blocks.Interfaces.RealInput TSet( unit="K", displayUnit="degC") "Set point temperature of the fluid that leaves port_b"; Modelica.Blocks.Interfaces.RealOutput Q_flow(unit="W") "Heat flow rate added to the fluid (if flow is from port_a to port_b)"; equation connect(TSet, outCon.TSet); connect(outCon.Q_flow, Q_flow); end SensibleCooler_T;

Buildings.Fluid.HeatExchangers.WetCoilCounterFlow Buildings.Fluid.HeatExchangers.WetCoilCounterFlow

Counterflow coil with discretization along the flow paths and humidity condensation

Buildings.Fluid.HeatExchangers.WetCoilCounterFlow

Information

Model of a discretized coil with water vapor condensation. The coil consists of two flow paths which are, at the design flow direction, in opposite direction to model a counterflow heat exchanger. The flow paths are discretized into nEle elements. Each element is modeled by an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent. Each element has a state variable for the metal.

The convective heat transfer coefficients can, for each fluid individually, be computed as a function of the flow rate and/or the temperature, or assigned to a constant. This computation is done using an instance of Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil.

In this model, the water (or liquid) flow path needs to be connected to port_a1 and port_b1, and the air flow path needs to be connected to the other two ports.

The mass transfer from the fluid 2 to the metal is computed using a similarity law between heat and mass transfer, as implemented by the model Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange.

This model can only be used with medium models that implement the function enthalpyOfLiquid and that contain an integer variable Water whose value is the element number where the water vapor is stored in the species concentration vector. Examples for such media are Buildings.Media.Air and Modelica.Media.Air.MoistAir.

To model this coil for conditions without humidity condensation, use the model Buildings.Fluid.HeatExchangers.DryCoilCounterFlow instead of this model.

Extends from Buildings.Fluid.HeatExchangers.DryCoilCounterFlow (Counterflow coil with discretization along the flow paths and without humidity condensation).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute heat capacity [W/K]
Realr_nominal2/3Ratio between air-side and water-side convective heat transfer coefficient
Timetau110Time constant at nominal flow for medium 1 [s]
Timetau22Time constant at nominal flow for medium 2 [s]
Timetau_m5Time constant of metal at nominal UA value [s]
Geometry
IntegernEle4Number of pipe segments used for discretization
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
Heat transfer
BooleanwaterSideFlowDependenttrueSet to false to make water-side hA independent of mass flow rate
BooleanairSideFlowDependenttrueSet to false to make air-side hA independent of mass flow rate
BooleanwaterSideTemperatureDependentfalseSet to false to make water-side hA independent of temperature
BooleanairSideTemperatureDependentfalseSet to false to make air-side hA independent of temperature
Experimental
ThermalConductanceGDif1E-2*UA_nominal/(nEle - 1)Thermal conductance to approximate diffusion (which improves model at near-zero flow rates [W/K]

Connectors

TypeNameDescription
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model WetCoilCounterFlow "Counterflow coil with discretization along the flow paths and humidity condensation" extends Buildings.Fluid.HeatExchangers.DryCoilCounterFlow( redeclare replaceable package Medium2 = Modelica.Media.Interfaces.PartialCondensingGases, redeclare model HexElement = Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent(simplify_mWat_flow=simplify_mWat_flow)); constant Boolean simplify_mWat_flow = true "Set to true to cause port_a.m_flow + port_b.m_flow = 0 even if mWat_flow is non-zero. Used only if Medium.nX > 1"; Modelica.SIunits.HeatFlowRate QSen2_flow = Q2_flow - QLat2_flow "Sensible heat input into air stream (negative if air is cooled)"; Modelica.SIunits.HeatFlowRate QLat2_flow= Buildings.Utilities.Psychrometrics.Constants.h_fg * mWat_flow "Latent heat input into air (negative if air is dehumidified)"; Real SHR( min=0, max=1, unit="1") = QSen2_flow / noEvent(if (Q2_flow > 1E-6 or Q2_flow < -1E-6) then Q2_flow else 1) "Sensible to total heat ratio"; Modelica.SIunits.MassFlowRate mWat_flow = sum(ele[i].vol2.mWat_flow for i in 1:nEle) "Water flow rate"; end WetCoilCounterFlow;

Buildings.Fluid.HeatExchangers.WetCoilDiscretized Buildings.Fluid.HeatExchangers.WetCoilDiscretized

Coil with discretization along the flow paths and humidity condensation

Buildings.Fluid.HeatExchangers.WetCoilDiscretized

Information

Model of a discretized coil with humidity condensation. This model is identical to Buildings.Fluid.HeatExchangers.DryCoilDiscretized but in addition, the mass transfer from fluid 2 to the metal is computed. The mass transfer is computed using a similarity law between heat and mass transfer, as implemented by the model Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange. See this model for details.

This model can only be used with medium models that implement the function enthalpyOfLiquid and that contain an integer variable Water whose value is the element number where the water vapor is stored in the species concentration vector. Examples for such media are Buildings.Media.Air and Modelica.Media.Air.MoistAir.

Extends from DryCoilDiscretized (Coil with discretization along the flow paths and no humidity condensation).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute heat capacity [W/K]
Timetau120Time constant at nominal flow for medium 1 [s]
Timetau210Time constant at nominal flow for medium 2 [s]
Timetau_m20Time constant of metal at nominal UA value [s]
Geometry
IntegernReg2Number of registers
IntegernPipPar3Number of parallel pipes in each register
IntegernPipSeg4Number of pipe segments per register used for discretization
Lengthdh10.025Hydraulic diameter for a single pipe [m]
Lengthdh21Hydraulic diameter for duct [m]
Initialization
MassFlowRatemStart_flow_a1m1_flow_nominalGuess value for mass flow rate at port_a1 [kg/s]
MassFlowRatemStart_flow_a2m2_flow_nominalGuess value for mass flow rate at port_a2 [kg/s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Booleanuse_dh1falseSet to true to specify hydraulic diameter for pipe pressure drop
Booleanuse_dh2falseSet to true to specify hydraulic diameter for duct pressure drop)
RealReC_14000Reynolds number where transition to turbulent starts inside pipes
RealReC_24000Reynolds number where transition to turbulent starts inside ducts
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Formulation of energy balance
Heat transfer
BooleanwaterSideFlowDependentfalseSet to false to make water-side hA independent of mass flow rate
BooleanairSideFlowDependentfalseSet to false to make air-side hA independent of mass flow rate
BooleanwaterSideTemperatureDependentfalseSet to false to make water-side hA independent of temperature

Connectors

TypeNameDescription
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model WetCoilDiscretized "Coil with discretization along the flow paths and humidity condensation" // When replacing the volume, the Medium is constrained so that the enthalpyOfLiquid // function is known. Otherwise, checkModel(...) will fail extends DryCoilDiscretized( redeclare replaceable package Medium2 = Modelica.Media.Interfaces.PartialCondensingGases, hexReg( redeclare final Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent ele[nPipPar, nPipSeg]), temSen_1(m_flow_nominal=m1_flow_nominal), temSen_2(m_flow_nominal=m2_flow_nominal)); Modelica.SIunits.HeatFlowRate QSen2_flow = Q2_flow - QLat2_flow "Sensible heat input into air stream (negative if air is cooled)"; Modelica.SIunits.HeatFlowRate QLat2_flow= Buildings.Utilities.Psychrometrics.Constants.h_fg * mWat_flow "Latent heat input into air (negative if air is dehumidified)"; Real SHR( min=0, max=1, unit="1") = QSen2_flow / noEvent(if (Q2_flow > 1E-6 or Q2_flow < -1E-6) then Q2_flow else 1) "Sensible to total heat ratio"; Modelica.SIunits.MassFlowRate mWat_flow = sum(hexReg[:].ele[:,:].vol2.mWat_flow) "Water flow rate"; end WetCoilDiscretized;

Buildings.Fluid.HeatExchangers.WetCoilEffectivenessNTU Buildings.Fluid.HeatExchangers.WetCoilEffectivenessNTU

Heat exchanger with effectiveness - NTU relation and with moisture condensation

Buildings.Fluid.HeatExchangers.WetCoilEffectivenessNTU

Information

This model describes a cooling coil applicable for fully-dry, partially-wet, and fully-wet regimes. The model is developed for counter flow heat exchangers but is also applicable for the cross-flow configuration, although in the latter case it is recommended to have more than four tube rows (Elmahdy and Mitalas, 1977 and Braun, 1988). The model can also be used for a heat exchanger which acts as both heating coil (for some period of time) and cooling coil (for the others). However, it is not recommended to use this model for heating coil only or for cooling coil with no water condensation because for these situations, Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU computes faster.

Main equations

The coil model consists of two-equation sets, one for the fully-dry mode and the other for the fully-wet mode. For the fully-dry mode, the ε-NTU approach (Elmahdy and Mitalas, 1977) is used. For the fully-wet mode, equations from Braun (1988) and Mitchell and Braun (2012a and b), which are essentially the extension of the ε-NTU approach to simultaneous sensible and latent heat transfer, are utilized. The equation sets are switched depending on the switching criteria described below that determines the right mode based on a coil surface temperature and dew-point temperature for the air at the inlet of the coil. The transition regime between the two modes, which represents the partially-wet and partially-dry coil, is approximated by employing a fuzzy modeling approach, so-called Takagi-Sugeno fuzzy modeling (Takagi and Sugeno, 1985), which provides a continuously differentiable model that can cover all fully-dry, partially-wet, and fully-wet regimes.

The switching rules are:

For more detailed descriptions of the fully-wet coil model and the fuzzy modeling approach, see Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilWetRegime. and Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime.

Assumptions and limitations

This model contains the following assumptions and limitations:

Medium 2 must be air due to the use of various psychrometric functions.

When parameterizing this model with rated conditions (with the parameter use_UA_nominal set to false), those should correspond to a fully-dry or a fully-wet coil regime, because the model uncertainty yielded by partially-wet rated conditions has not been assessed yet.

The model uses steady-state physics. That is, no dynamics associated with water and coil materials are considered.

The Lewis number, which relates the mass transfer coefficient to the heat transfer coefficient, is assumed to be 1.

The model is not suitable for a cross-flow heat exchanger of which the number of passes is less than four.

Validation

Validation results can be found in Buildings.Fluid.HeatExchangers.Validation.WetCoilEffectivenessNTU.

References

Braun, James E. 1988. "Methodologies for the Design and Control of Central Cooling Plants". PhD Thesis. University of Wisconsin - Madison. Available online.

Mitchell, John W., and James E. Braun. 2012a. Principles of heating, ventilation, and air conditioning in buildings. Hoboken, N.J.: Wiley.

Mitchell, John W., and James E. Braun. 2012b. "Supplementary Material Chapter 2: Heat Exchangers for Cooling Applications". Excerpt from Principles of heating, ventilation, and air conditioning in buildings. Hoboken, N.J.: Wiley. Available online.

Elmahdy, A.H. and Mitalas, G.P. 1977. "A Simple Model for Cooling and Dehumidifying Coils for Use In Calculating Energy Requirements for Buildings". ASHRAE Transactions. Vol.83. Part 2. pp. 103-117.

Takagi, T. and Sugeno, M., 1985. Fuzzy identification of systems and its applications to modeling and control.  IEEE transactions on systems, man, and cybernetics, (1), pp.116-132.

Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
HeatExchangerConfigurationconfigurationcon.CounterFlowHeat exchanger configuration
Realr_nominal2/3Ratio between air-side and water-side convective heat transfer coefficient
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
Nominal thermal performance
Booleanuse_Q_flow_nominalfalseSet to true to specify Q_flow_nominal and inlet conditions, or to false to specify UA_nominal
HeatFlowRateQ_flow_nominal Nominal heat flow rate (positive for heat transfer from 1 to 2) [W]
TemperatureT_a1_nominal Water inlet temperature at a rated condition [K]
TemperatureT_a2_nominal Air inlet temperature at a rated condition [K]
MassFractionw_a2_nominal Humidity ratio of inlet air at a rated condition (in kg/kg dry air) [1]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute heat capacity [W/K]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
BooleancomputeFlowResistance1true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
BooleancomputeFlowResistance2true=true, compute flow resistance. Set to false to assume no friction
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state

Connectors

TypeNameDescription
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model WetCoilEffectivenessNTU "Heat exchanger with effectiveness - NTU relation and with moisture condensation" extends Buildings.Fluid.Interfaces.PartialFourPortInterface( redeclare replaceable package Medium2 = Buildings.Media.Air); extends Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters( final computeFlowResistance1=true, final computeFlowResistance2=true); import con = Buildings.Fluid.Types.HeatExchangerConfiguration; import flo = Buildings.Fluid.Types.HeatExchangerFlowRegime; parameter Buildings.Fluid.Types.HeatExchangerConfiguration configuration= con.CounterFlow "Heat exchanger configuration"; parameter Real r_nominal=2/3 "Ratio between air-side and water-side convective heat transfer coefficient"; parameter Boolean use_Q_flow_nominal = false "Set to true to specify Q_flow_nominal and inlet conditions, or to false to specify UA_nominal"; parameter Modelica.SIunits.HeatFlowRate Q_flow_nominal( fixed=use_Q_flow_nominal) "Nominal heat flow rate (positive for heat transfer from 1 to 2)"; parameter Modelica.SIunits.Temperature T_a1_nominal( fixed=use_Q_flow_nominal) "Water inlet temperature at a rated condition"; parameter Modelica.SIunits.Temperature T_a2_nominal( fixed=use_Q_flow_nominal) "Air inlet temperature at a rated condition"; parameter Modelica.SIunits.MassFraction w_a2_nominal( start=0.01, fixed=use_Q_flow_nominal) "Humidity ratio of inlet air at a rated condition (in kg/kg dry air)"; parameter Modelica.SIunits.ThermalConductance UA_nominal( fixed=not use_Q_flow_nominal, min=0, start=1/(1/10+1/20)) "Thermal conductance at nominal flow, used to compute heat capacity"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.SteadyState "Type of energy balance: dynamic (3 initialization options) or steady state"; parameter Modelica.Fluid.Types.Dynamics massDynamics=energyDynamics "Type of mass balance: dynamic (3 initialization options) or steady state"; Modelica.SIunits.HeatFlowRate Q1_flow = -dryWetCalcs.QTot_flow "Heat input into water stream (positive if air is cooled)"; Modelica.SIunits.HeatFlowRate Q2_flow = dryWetCalcs.QTot_flow "Total heat input into air stream (negative if air is cooled)"; Modelica.SIunits.HeatFlowRate QSen2_flow = dryWetCalcs.QSen_flow "Sensible heat input into air stream (negative if air is cooled)"; Modelica.SIunits.HeatFlowRate QLat2_flow= Buildings.Utilities.Psychrometrics.Constants.h_fg * mWat_flow "Latent heat input into air (negative if air is dehumidified)"; Real SHR( min=0, max=1, unit="1") = QSen2_flow / noEvent(if (Q2_flow > 1E-6 or Q2_flow < -1E-6) then Q2_flow else 1) "Sensible to total heat ratio"; Modelica.SIunits.MassFlowRate mWat_flow = dryWetCalcs.mCon_flow "Water flow rate of condensate removed from the air stream"; Real dryFra(final unit="1", min=0, max=1) = dryWetCalcs.dryFra "Dry fraction, 0.3 means condensation occurs at 30% heat exchange length from air inlet"; protected final parameter Modelica.SIunits.MassFraction X_w_a2_nominal= w_a2_nominal / (1+w_a2_nominal) "Water mass fraction of inlet air at a rated condition (in kg/kg total air)"; parameter Boolean waterSideFlowDependent=true "Set to false to make water-side hA independent of mass flow rate"; parameter Boolean airSideFlowDependent=true "Set to false to make air-side hA independent of mass flow rate"; parameter Boolean waterSideTemperatureDependent=false "Set to false to make water-side hA independent of temperature"; parameter Boolean airSideTemperatureDependent=false "Set to false to make air-side hA independent of temperature"; Real delta=1E-2 "Parameter for normalization"; Real delta1=1E-1 "Parameter for normalization"; Real fac1 = Buildings.Utilities.Math.Functions.smoothMin( (1/delta * m1_flow/m1_flow_nominal)^2,1,delta1); Real fac2 = Buildings.Utilities.Math.Functions.smoothMin( (1/delta * m2_flow/m2_flow_nominal)^2,1,delta1); Real Qfac = fac1*fac2; Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilUARated UAFroRated( final use_Q_flow_nominal=use_Q_flow_nominal, final QTot_flow=Q_flow_nominal, final UA=UA_nominal, final r_nominal=r_nominal, final TAirIn=T_a2_nominal, final X_wAirIn=X_w_a2_nominal, final TWatIn=T_a1_nominal, final mAir_flow=m2_flow_nominal, final mWat_flow=m1_flow_nominal) "Model that computes UA_nominal"; Buildings.Fluid.HeatExchangers.HeaterCooler_u heaCoo( redeclare final package Medium = Medium1, final dp_nominal = dp1_nominal, final m_flow_nominal = m1_flow_nominal, final energyDynamics = energyDynamics, final massDynamics = massDynamics, final Q_flow_nominal=-1, u(final unit="W")) "Heat exchange with water stream"; Buildings.Fluid.Humidifiers.Humidifier_u heaCooHum_u( redeclare final package Medium = Medium2, final mWat_flow_nominal = 1, final dp_nominal = dp2_nominal, final m_flow_nominal = m2_flow_nominal, final energyDynamics = energyDynamics, final massDynamics = massDynamics, u(final unit="kg/s")) "Heat and moisture exchange with air stream"; Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil hA( final UA_nominal = UA_nominal, final m_flow_nominal_a = m2_flow_nominal, final m_flow_nominal_w = m1_flow_nominal, final waterSideTemperatureDependent = waterSideTemperatureDependent, final waterSideFlowDependent = waterSideFlowDependent, final airSideTemperatureDependent = airSideTemperatureDependent, final airSideFlowDependent = airSideFlowDependent, r_nominal = r_nominal) "Model for convective heat transfer coefficient"; Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime dryWetCalcs( final cfg=flowRegime, final mWat_flow_nominal=m1_flow_nominal, final mAir_flow_nominal=m2_flow_nominal, Qfac=Qfac) "Dry/wet calculations block"; Modelica.Blocks.Sources.RealExpression cp_a1Exp( final y=Medium1.specificHeatCapacityCp(state_a1_inflow)) "Expression for cp of air"; Modelica.Blocks.Sources.RealExpression XWat_a2Exp( final y = if allowFlowReversal2 then fra_a2 * state_a2_inflow.X[nWat] + fra_b2 * state_b2_inflow.X[nWat] else state_a2_inflow.X[nWat]) "Expression for XWat"; Modelica.Blocks.Sources.RealExpression p_a2Exp( final y = port_a2.p) "Pressure at port a2"; Modelica.Blocks.Sources.RealExpression h_a2Exp( final y = if allowFlowReversal2 then fra_a2 * Medium2.specificEnthalpy(state_a2_inflow) + fra_b2 * Medium2.specificEnthalpy(state_b2_inflow) else Medium2.specificEnthalpy(state_a2_inflow)) "Specific enthalpy at port a2"; Modelica.Blocks.Sources.RealExpression cp_a2Exp(final y= Medium2.specificHeatCapacityCp(state_a2_inflow)) "Specific heat capacity at port a2"; Modelica.Blocks.Sources.RealExpression TIn_a1Exp( final y = if allowFlowReversal1 then fra_a1 * Medium1.temperature(state_a1_inflow) + fra_b1 * Medium1.temperature(state_b1_inflow) else Medium1.temperature(state_a1_inflow)) "Temperature at port a1"; Modelica.Blocks.Sources.RealExpression TIn_a2Exp( final y = if allowFlowReversal2 then fra_a2 * Medium2.temperature(state_a2_inflow) + fra_b2 * Medium2.temperature(state_b2_inflow) else Medium2.temperature(state_a2_inflow)) "Temperature at port a2"; Modelica.Blocks.Sources.RealExpression m_flow_a1Exp( final y=Buildings.Utilities.Math.Functions.regNonZeroPower( x=port_a1.m_flow,n=1,delta=delta*m1_flow_nominal)) "Absolute value of mass flow rate on water side"; Modelica.Blocks.Sources.RealExpression m_flow_a2Exp( final y=Buildings.Utilities.Math.Functions.regNonZeroPower( x=port_a2.m_flow,n=1,delta=delta*m2_flow_nominal)) "Absolute value of mass flow rate on air side"; final parameter Integer nWat= Buildings.Fluid.HeatExchangers.BaseClasses.determineWaterIndex( Medium2.substanceNames) "Index of water"; parameter flo flowRegime_nominal(fixed=false) "Heat exchanger flow regime at nominal flow rates"; flo flowRegime(fixed=false, start=flowRegime_nominal) "Heat exchanger flow regime"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHea "Prescribed heat flow"; Real fra_a1(min=0, max=1) = if allowFlowReversal1 then Modelica.Fluid.Utilities.regStep( m1_flow, 1, 0, m1_flow_small) else 1 "Fraction of incoming state taken from port a2 (used to avoid excessive calls to regStep)"; Real fra_b1(min=0, max=1) = if allowFlowReversal1 then 1-fra_a1 else 0 "Fraction of incoming state taken from port b2 (used to avoid excessive calls to regStep)"; Real fra_a2(min=0, max=1) = if allowFlowReversal2 then Modelica.Fluid.Utilities.regStep( m2_flow, 1, 0, m2_flow_small) else 1 "Fraction of incoming state taken from port a2 (used to avoid excessive calls to regStep)"; Real fra_b2(min=0, max=1) = if allowFlowReversal2 then 1-fra_a2 else 0 "Fraction of incoming state taken from port b2 (used to avoid excessive calls to regStep)"; Modelica.SIunits.ThermalConductance C1_flow = abs(m1_flow)* ( if allowFlowReversal1 then fra_a1 * Medium1.specificHeatCapacityCp(state_a1_inflow) + fra_b1 * Medium1.specificHeatCapacityCp(state_b1_inflow) else Medium1.specificHeatCapacityCp(state_a1_inflow)) "Heat capacity flow rate medium 1"; Modelica.SIunits.ThermalConductance C2_flow = abs(m2_flow)* ( if allowFlowReversal2 then fra_a2 * Medium2.specificHeatCapacityCp(state_a2_inflow) + fra_b2 * Medium2.specificHeatCapacityCp(state_b2_inflow) else Medium2.specificHeatCapacityCp(state_a2_inflow)) "Heat capacity flow rate medium 2"; parameter Modelica.SIunits.SpecificHeatCapacity cp1_nominal(fixed=false) "Specific heat capacity of medium 1 at nominal condition"; parameter Modelica.SIunits.SpecificHeatCapacity cp2_nominal(fixed=false) "Specific heat capacity of medium 2 at nominal condition"; parameter Modelica.SIunits.ThermalConductance C1_flow_nominal(fixed=false) "Nominal capacity flow rate of Medium 1"; parameter Modelica.SIunits.ThermalConductance C2_flow_nominal(fixed=false) "Nominal capacity flow rate of Medium 2"; final parameter Medium1.ThermodynamicState sta1_default = Medium1.setState_phX( h=Medium1.h_default, p=Medium1.p_default, X=Medium1.X_default[1:Medium1.nXi]) "Default state for medium 1"; final parameter Medium2.ThermodynamicState sta2_default = Medium2.setState_phX( h=Medium2.h_default, p=Medium2.p_default, X=Medium2.X_default[1:Medium2.nXi]) "Default state for medium 2"; initial equation cp1_nominal = Medium1.specificHeatCapacityCp(sta1_default); cp2_nominal = Medium2.specificHeatCapacityCp(sta2_default); C1_flow_nominal = m1_flow_nominal*cp1_nominal; C2_flow_nominal = m2_flow_nominal*cp2_nominal; if (configuration == con.CrossFlowStream1MixedStream2Unmixed) then flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then flo.CrossFlowCMinMixedCMaxUnmixed else flo.CrossFlowCMinUnmixedCMaxMixed; elseif (configuration == con.CrossFlowStream1UnmixedStream2Mixed) then flowRegime_nominal = if (C1_flow_nominal < C2_flow_nominal) then flo.CrossFlowCMinUnmixedCMaxMixed else flo.CrossFlowCMinMixedCMaxUnmixed; elseif (configuration == con.ParallelFlow) then flowRegime_nominal = flo.ParallelFlow; elseif (configuration == con.CounterFlow) then flowRegime_nominal = flo.CounterFlow; elseif (configuration == con.CrossFlowUnmixed) then flowRegime_nominal = flo.CrossFlowUnmixed; else // Invalid flow regime. Assign a value to flowRegime_nominal, and stop with an assert flowRegime_nominal = flo.CrossFlowUnmixed; assert(configuration >= con.ParallelFlow and configuration <= con.CrossFlowStream1UnmixedStream2Mixed, "Invalid heat exchanger configuration."); end if; equation // Assign the flow regime for the given heat exchanger configuration and // mass flow rates if (configuration == con.ParallelFlow) then flowRegime = if (C1_flow*C2_flow >= 0) then flo.ParallelFlow else flo.CounterFlow; elseif (configuration == con.CounterFlow) then flowRegime = if (C1_flow*C2_flow >= 0) then flo.CounterFlow else flo.ParallelFlow; elseif (configuration == con.CrossFlowUnmixed) then flowRegime = flo.CrossFlowUnmixed; elseif (configuration == con.CrossFlowStream1MixedStream2Unmixed) then flowRegime = if (C1_flow < C2_flow) then flo.CrossFlowCMinMixedCMaxUnmixed else flo.CrossFlowCMinUnmixedCMaxMixed; else // have ( configuration == con.CrossFlowStream1UnmixedStream2Mixed) flowRegime = if (C1_flow < C2_flow) then flo.CrossFlowCMinUnmixedCMaxMixed else flo.CrossFlowCMinMixedCMaxUnmixed; end if; connect(heaCoo.port_b, port_b1); connect(heaCooHum_u.port_b, port_b2); connect(hA.hA_1, dryWetCalcs.UAWat); connect(hA.hA_2, dryWetCalcs.UAAir); connect(cp_a1Exp.y, dryWetCalcs.cpWat); connect(XWat_a2Exp.y, dryWetCalcs.X_wAirIn); connect(p_a2Exp.y, dryWetCalcs.pAir); connect(h_a2Exp.y, dryWetCalcs.hAirIn); connect(cp_a2Exp.y, dryWetCalcs.cpAir); connect(TIn_a1Exp.y, hA.T_1); connect(TIn_a1Exp.y, dryWetCalcs.TWatIn); connect(TIn_a2Exp.y, hA.T_2); connect(TIn_a2Exp.y, dryWetCalcs.TAirIn); connect(m_flow_a1Exp.y, hA.m1_flow); connect(m_flow_a1Exp.y, dryWetCalcs.mWat_flow); connect(port_a1, heaCoo.port_a); connect(m_flow_a2Exp.y, hA.m2_flow); connect(m_flow_a2Exp.y, dryWetCalcs.mAir_flow); connect(port_a2, heaCooHum_u.port_a); connect(preHea.port, heaCooHum_u.heatPort); connect(dryWetCalcs.QTot_flow, heaCoo.u); connect(dryWetCalcs.mCon_flow, heaCooHum_u.u); connect(preHea.Q_flow, dryWetCalcs.QTot_flow); end WetCoilEffectivenessNTU;

Buildings.Fluid.HeatExchangers.DryCoilCounterFlow.HexElement Buildings.Fluid.HeatExchangers.DryCoilCounterFlow.HexElement

Model for a heat exchanger element

Buildings.Fluid.HeatExchangers.DryCoilCounterFlow.HexElement

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
HeatCapacityC2*UA_nominal*tau_mHeat capacity of metal (= cp*m) [J/K]
Nominal condition
MassFlowRatem1_flow_nominal Nominal mass flow rate [kg/s]
MassFlowRatem2_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute time constant [W/K]
Timetau_m60Time constant of metal at nominal UA value [s]
Assumptions
BooleanallowFlowReversal1true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
Advanced
MassFlowRatem1_flow_small1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
MassFlowRatem2_flow_small1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Booleaninitialize_p1not Medium1.singleStateSet to true to initialize the pressure of volume 1
Booleaninitialize_p2not Medium2.singleStateSet to true to initialize the pressure of volume 2
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Medium 1
Booleanfrom_dp1false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance1false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM10.1Fraction of nominal flow rate where flow transitions to laminar
Medium 2
Booleanfrom_dp2false= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistance2false= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM20.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau130Time constant at nominal flow [s]
Timetau230Time constant at nominal flow [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Initialization
Medium 1
AbsolutePressurep1_startMedium1.p_defaultStart value of pressure [Pa]
TemperatureT1_startMedium1.T_defaultStart value of temperature [K]
MassFractionX1_start[Medium1.nX]Medium1.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC1_start[Medium1.nC]fill(0, Medium1.nC)Start value of trace substances
ExtraPropertyC1_nominal[Medium1.nC]fill(1E-2, Medium1.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Medium 2
AbsolutePressurep2_startMedium2.p_defaultStart value of pressure [Pa]
TemperatureT2_startMedium2.T_defaultStart value of temperature [K]
MassFractionX2_start[Medium2.nX]Medium2.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC2_start[Medium2.nC]fill(0, Medium2.nC)Start value of trace substances
ExtraPropertyC2_nominal[Medium2.nC]fill(1E-2, Medium2.nC)Nominal value of trace substances. (Set to typical order of magnitude.)

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input RealInputGc_1Signal representing the convective thermal conductance medium 1 in [W/K]
input RealInputGc_2Signal representing the convective thermal conductance medium 2 in [W/K]
HeatPort_aheaPor1Heat port for heat exchange with the control volume 1
HeatPort_aheaPor2Heat port for heat exchange with the control volume 2

Modelica definition

replaceable model HexElement = BaseClasses.HexElementSensible "Model for a heat exchanger element";