Buildings.Fluid.HeatExchangers.BaseClasses

Package with base classes for Buildings.Fluid.HeatExchangers

Information

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

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

Package Content

Name Description
Buildings.Fluid.HeatExchangers.BaseClasses.CoilHeader CoilHeader Header for a heat exchanger register
Buildings.Fluid.HeatExchangers.BaseClasses.CoilRegister CoilRegister Register for a heat exchanger
Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFixedResistance DuctManifoldFixedResistance Manifold for a heat exchanger air duct connection
Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFlowDistributor DuctManifoldFlowDistributor Manifold for duct inlet that distributes the mass flow rate equally
Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldNoResistance DuctManifoldNoResistance Duct manifold without resistance
Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside HACoilInside Calculates the hA value for water inside a coil
Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil HADryCoil Sensible convective heat transfer model for air to water coil
Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder HANaturalCylinder Calculates an hA value for natural convection around a cylinder
Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent HexElementLatent Element of a heat exchanger with humidity condensation of fluid 2
Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible HexElementSensible Element of a heat exchanger with no humidity condensation
Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange MassExchange Block to compute the latent heat transfer based on the Lewis number
Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctManifold PartialDuctManifold Partial manifold for heat exchanger duct connection
Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctPipeManifold PartialDuctPipeManifold Partial heat exchanger duct and pipe manifold
Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness PartialEffectiveness Partial model to implement heat exchangers based on effectiveness model
Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU PartialEffectivenessNTU Partial model for heat exchanger with effectiveness - NTU relation and no moisture condensation
Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement PartialHexElement Element of a heat exchanger 2
Buildings.Fluid.HeatExchangers.BaseClasses.PartialPipeManifold PartialPipeManifold Partial pipe manifold for a heat exchanger
Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet PartialPrescribedOutlet Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions
Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFixedResistance PipeManifoldFixedResistance Pipe manifold for a heat exchanger connection
Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFlowDistributor PipeManifoldFlowDistributor Manifold for heat exchanger register that distributes the mass flow rate equally
Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldNoResistance PipeManifoldNoResistance Manifold for heat exchanger register
Buildings.Fluid.HeatExchangers.BaseClasses.RayleighNumber RayleighNumber Calculates the Rayleigh number for a given fluid and characteristic length
Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryRegime WetCoilDryRegime Fully dry coil model
Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime WetCoilDryWetRegime Model implementing the switching algorithm of the TK-fuzzy model for cooling coil application
Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilUARated WetCoilUARated Model that calculates the UA-value from cooling coil data at rated conditions.
Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilWetRegime WetCoilWetRegime Fully wet coil model using esilon_C.mo function
Buildings.Fluid.HeatExchangers.BaseClasses.determineWaterIndex determineWaterIndex Determine the index of water in a 2-component medium model
Buildings.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater dynamicViscosityWater Returns the dynamic viscosity for water
Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_C epsilon_C Computes heat exchanger effectiveness for given capacity flow rates and heat exchanger flow regime
Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_ntuZ epsilon_ntuZ Computes heat exchanger effectiveness for given number of transfer units and heat exchanger flow regime
Buildings.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater isobaricExpansionCoefficientWater Returns the isobaric expansion coefficient for water
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd lmtd Log-mean temperature difference
Buildings.Fluid.HeatExchangers.BaseClasses.ntu_epsilonZ ntu_epsilonZ Computes number of transfer units for given heat exchanger effectiveness and heat exchanger flow regime
Buildings.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater prandtlNumberWater Returns the Prandtl number for water
Buildings.Fluid.HeatExchangers.BaseClasses.Examples Examples Collection of models that illustrate model use and test models

Buildings.Fluid.HeatExchangers.BaseClasses.CoilHeader Buildings.Fluid.HeatExchangers.BaseClasses.CoilHeader

Header for a heat exchanger register

Buildings.Fluid.HeatExchangers.BaseClasses.CoilHeader

Information

Header for a heat exchanger coil.

This model connects the flow between its ports without modeling flow friction. Currently, the ports are connected without redistributing the flow. In latter versions, the model may be changed to define different flow reroutings in the coil header.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
IntegernPipPar Number of parallel pipes in each register
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_a[nPipPar]Fluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model CoilHeader "Header for a heat exchanger register" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; parameter Integer nPipPar(min=1) "Number of parallel pipes in each register"; parameter Modelica.SIunits.MassFlowRate mStart_flow_a "Guess value for mass flow rate at port_a"; Modelica.Fluid.Interfaces.FluidPort_a port_a[nPipPar]( redeclare each final package Medium = Medium, each m_flow(start=mStart_flow_a/nPipPar, min=if allowFlowReversal then -Modelica.Constants.inf else 0)) "Fluid connector a for medium (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_b[nPipPar]( redeclare each final package Medium = Medium, each m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0)) "Fluid connector b for medium (positive design flow direction is from port_a to port_b)"; equation connect(port_a, port_b); end CoilHeader;

Buildings.Fluid.HeatExchangers.BaseClasses.CoilRegister Buildings.Fluid.HeatExchangers.BaseClasses.CoilRegister

Register for a heat exchanger

Buildings.Fluid.HeatExchangers.BaseClasses.CoilRegister

Information

Register of a heat exchanger with dynamics on the fluids and the solid. The register represents one array of pipes that are perpendicular to the air stream. The hA value for both fluids is an input. The driving force for the heat transfer is the temperature difference between the fluid volumes and the solid in each heat exchanger element.

Extends from Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).

Parameters

TypeNameDefaultDescription
replaceable package Medium1Modelica.Media.Interfaces.Pa...Medium 1 in the component
replaceable package Medium2Modelica.Media.Interfaces.Pa...Medium 2 in the component
IntegernPipPar2Number of parallel pipes in each register
IntegernPipSeg3Number of pipe segments per register used for discretization
HexElementSensibleele[nPipPar, nPipSeg]redeclare Buildings.Fluid.He...Element of a heat exchanger
Nominal condition
PressureDifferencedp1_nominal Pressure difference [Pa]
PressureDifferencedp2_nominal Pressure difference [Pa]
ThermalConductanceUA_nominal Thermal conductance at nominal flow, used to compute time constant [W/K]
MassFlowRatem1_flow_nominal Mass flow rate medim 1 [kg/s]
MassFlowRatem2_flow_nominal Mass flow rate medium 2 [kg/s]
Timetau120Time constant at nominal flow for medium 1 [s]
Timetau21Time constant at nominal flow for medium 2 [s]
Timetau_m60Time constant of metal at nominal UA value [s]
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
Advanced
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
Assumptions
BooleanallowFlowReversal1true= true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b)
BooleanallowFlowReversal2true= true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b)
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Default formulation of energy balances

Connectors

TypeNameDescription
replaceable package Medium1Medium 1 in the component
replaceable package Medium2Medium 2 in the component
FluidPort_aport_a1[nPipPar]Fluid connector a for medium 1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1[nPipPar]Fluid connector b for medium 1 (positive design flow direction is from port_a to port_b)
FluidPort_aport_a2[nPipPar, nPipSeg]Fluid connector a for medium 2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2[nPipPar, nPipSeg]Fluid connector b for medium 2 (positive design flow direction is from port_a to port_b)
HeatPort_aheaPor1[nPipPar, nPipSeg]Heat port for heat exchange with the control volume 1
HeatPort_aheaPor2[nPipPar, nPipSeg]Heat port for heat exchange with the control volume 2
input RealInputGc_2Signal representing the convective thermal conductance medium 2 in [W/K]
input RealInputGc_1Signal representing the convective thermal conductance medium 1 in [W/K]

Modelica definition

model CoilRegister "Register for a heat exchanger" import Modelica.Constants; extends Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters( final computeFlowResistance1=true, final computeFlowResistance2=true); replaceable package Medium1 = Modelica.Media.Interfaces.PartialMedium "Medium 1 in the component"; replaceable package Medium2 = Modelica.Media.Interfaces.PartialMedium "Medium 2 in the component"; parameter Boolean initialize_p1 = not Medium1.singleState "Set to true to initialize the pressure of volume 1"; parameter Boolean initialize_p2 = not Medium2.singleState "Set to true to initialize the pressure of volume 2"; parameter Integer nPipPar(min=1)=2 "Number of parallel pipes in each register"; parameter Integer nPipSeg(min=1)=3 "Number of pipe segments per register used for discretization"; final parameter Integer nEle = nPipPar * nPipSeg "Number of heat exchanger elements"; parameter Modelica.SIunits.ThermalConductance UA_nominal "Thermal conductance at nominal flow, used to compute time constant"; parameter Modelica.SIunits.MassFlowRate m1_flow_nominal "Mass flow rate medim 1"; parameter Modelica.SIunits.MassFlowRate m2_flow_nominal "Mass flow rate medium 2"; parameter Modelica.SIunits.Time tau1=20 "Time constant at nominal flow for medium 1"; parameter Modelica.SIunits.Time tau2=1 "Time constant at nominal flow for medium 2"; parameter Boolean allowFlowReversal1 = true "= true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b)"; parameter Boolean allowFlowReversal2 = true "= true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b)"; replaceable Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible ele[nPipPar, nPipSeg] constrainedby Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement( redeclare each package Medium1 = Medium1, redeclare each package Medium2 = Medium2, initialize_p1 = {{(i == 1 and j == 1 and initialize_p1) for i in 1:nPipSeg} for j in 1:nPipPar}, initialize_p2 = {{(i == 1 and j == 1 and initialize_p2) for i in 1:nPipSeg} for j in 1:nPipPar}, each allowFlowReversal1=allowFlowReversal1, each allowFlowReversal2=allowFlowReversal2, each tau1=tau1/nPipSeg, each m1_flow_nominal=m1_flow_nominal/nPipPar, each tau2=tau2, each m2_flow_nominal=m2_flow_nominal/nPipPar/nPipSeg, each tau_m=tau_m, each UA_nominal=UA_nominal/nPipPar/nPipSeg, each energyDynamics=energyDynamics, 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=dp1_nominal, each dp2_nominal=dp2_nominal) "Element of a heat exchanger"; Modelica.Fluid.Interfaces.FluidPort_a[nPipPar] port_a1( redeclare each package Medium = Medium1, each m_flow(start=0, min=if allowFlowReversal1 then -Constants.inf else 0)) "Fluid connector a for medium 1 (positive design flow direction is from port_a1 to port_b1)"; Modelica.Fluid.Interfaces.FluidPort_b[nPipPar] port_b1( redeclare each package Medium = Medium1, each m_flow(start=0, max=if allowFlowReversal1 then +Constants.inf else 0)) "Fluid connector b for medium 1 (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_a[nPipPar,nPipSeg] port_a2( redeclare each package Medium = Medium2, each m_flow(start=0, min=if allowFlowReversal2 then -Constants.inf else 0)) "Fluid connector a for medium 2 (positive design flow direction is from port_a2 to port_b2)"; Modelica.Fluid.Interfaces.FluidPort_b[nPipPar,nPipSeg] port_b2( redeclare each package Medium = Medium2, each m_flow(start=0, max=if allowFlowReversal2 then +Constants.inf else 0)) "Fluid connector b for medium 2 (positive design flow direction is from port_a to port_b)"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPor1[nPipPar, nPipSeg] "Heat port for heat exchange with the control volume 1"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPor2[nPipPar, nPipSeg] "Heat port for heat exchange with the control volume 2"; Modelica.SIunits.HeatFlowRate Q1_flow "Heat transferred from solid into medium 1"; Modelica.SIunits.HeatFlowRate Q2_flow "Heat transferred from solid into medium 2"; parameter Modelica.SIunits.Time tau_m=60 "Time constant of metal at nominal UA value"; parameter Modelica.Fluid.Types.Dynamics energyDynamics= Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Default formulation of energy balances"; Modelica.Blocks.Interfaces.RealInput Gc_2 "Signal representing the convective thermal conductance medium 2 in [W/K]"; Modelica.Blocks.Interfaces.RealInput Gc_1 "Signal representing the convective thermal conductance medium 1 in [W/K]"; protected 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"; equation // As OpenModelica does not support multiple iterators as of August 2014, we // use here two sum(.) functions Q1_flow = sum(sum(ele[i,j].Q1_flow for i in 1:nPipPar) for j in 1:nPipSeg); Q2_flow = sum(sum(ele[i,j].Q2_flow for i in 1:nPipPar) for j in 1:nPipSeg); for i in 1:nPipPar loop connect(ele[i,1].port_a1, port_a1[i]); connect(ele[i,nPipSeg].port_b1, port_b1[i]); for j in 1:nPipSeg-1 loop connect(ele[i,j].port_b1, ele[i,j+1].port_a1); end for; for j in 1:nPipSeg loop connect(ele[i,j].port_a2, port_a2[i,j]); connect(ele[i,j].port_b2, port_b2[i,j]); end for; end for; connect(Gc_1, gai_1.u); connect(Gc_2, gai_2.u); for i in 1:nPipPar loop for j in 1:nPipSeg loop connect(gai_1.y, ele[i,j].Gc_1); connect(gai_2.y, ele[i,j].Gc_2); end for; end for; connect(ele.heaPor1, heaPor1); connect(ele.heaPor2, heaPor2); end CoilRegister;

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFixedResistance Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFixedResistance

Manifold for a heat exchanger air duct connection

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFixedResistance

Information

Duct manifold with a fixed flow resistance.

This model is composed of a pressure drop calculation, and a flow distributor. The flow distributor distributes the mass flow rate equally to each instance of port_b, without having to compute a pressure drop in each flow leg.

Note: It is important that there is an equal pressure drop in each flow leg between this model, and the model that collects the flows. Otherwise, no solution may exist, and therefore the simulation may stop with an error.

Extends from PartialDuctManifold (Partial manifold for heat exchanger duct connection).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
IntegernPipSeg Number of pipe segments per register used for discretization
Booleanuse_dhfalseSet to true to specify hydraulic diameter
Lengthdh1Hydraulic diameter of duct [m]
RealReC4000Reynolds number where transition to turbulent starts
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Nominal Condition
MassFlowRatem_flow_nominal Mass flow rate at port_a [kg/s]
PressureDifferencedp_nominal Pressure drop [Pa]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar, nPipSeg]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model DuctManifoldFixedResistance "Manifold for a heat exchanger air duct connection" extends PartialDuctManifold; parameter Boolean use_dh = false "Set to true to specify hydraulic diameter"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Mass flow rate at port_a"; parameter Modelica.SIunits.PressureDifference dp_nominal(min=0, displayUnit="Pa") "Pressure drop"; parameter Modelica.SIunits.Length dh=1 "Hydraulic diameter of duct"; parameter Real ReC=4000 "Reynolds number where transition to turbulent starts"; parameter Boolean linearized = false "= true, use linear relation between m_flow and dp for any flow rate"; parameter Real deltaM(min=0) = 0.3 "Fraction of nominal mass flow rate where transition to turbulent occurs"; parameter Boolean from_dp = false "= true, use m_flow = f(dp) else dp = f(m_flow)"; Buildings.Fluid.FixedResistances.PressureDrop fixRes( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dp_nominal, from_dp=from_dp, deltaM=deltaM, linearized=linearized) "Fixed resistance for each duct"; protected DuctManifoldFlowDistributor floDis( redeclare package Medium = Medium, nPipPar=nPipPar, mStart_flow_a=mStart_flow_a, nPipSeg=nPipSeg, allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal) "Mass flow distributor to the individual segments of the coil"; equation connect(fixRes.port_a, port_a); connect(fixRes.port_b, floDis.port_a); connect(floDis.port_b, port_b); end DuctManifoldFixedResistance;

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFlowDistributor Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFlowDistributor

Manifold for duct inlet that distributes the mass flow rate equally

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldFlowDistributor

Information

This model distributes the mass flow rates equally between all instances of port_b.

The model connects the flows between the ports without modeling flow friction. The model is used in conjunction with a manifold that is added to the other side of the heat exchanger registers.

Note: It is important that there is an equal pressure drop in each flow leg between this model, and the model that collects the flows. Otherwise, no solution may exist. Hence, only use this model if you know what you are doing.

Extends from PartialDuctManifold (Partial manifold for heat exchanger duct connection).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
IntegernPipSeg Number of pipe segments per register used for discretization
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Nominal Condition
MassFlowRatem_flow_nominal Mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar, nPipSeg]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model DuctManifoldFlowDistributor "Manifold for duct inlet that distributes the mass flow rate equally" extends PartialDuctManifold; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Mass flow rate at port_a"; protected Sensors.MassFlowRate senMasFlo(redeclare final package Medium = Medium) "Mass flow rate sensor"; Modelica.Blocks.Math.Gain gain(final k=1/nPipPar/nPipSeg) "Gain for mass flow distribution to manifold"; Modelica.Blocks.Sources.Constant dpDis(final k=0) "Pressure drop of distribution"; Movers.BaseClasses.IdealSource sou0( redeclare final package Medium = Medium, allowFlowReversal=allowFlowReversal, m_flow_small=1E-4*abs(m_flow_nominal/nPipPar/nPipSeg), final control_m_flow=false, m_flow_start=mStart_flow_a/nPipPar/nPipSeg, final dp_start=0, final show_V_flow=false, final show_T=false) "Mass flow rate source with fixed dp"; Movers.BaseClasses.IdealSource sou1[nPipPar-1]( redeclare each final package Medium = Medium, each final allowFlowReversal=allowFlowReversal, each final m_flow_small=1E-4*abs(m_flow_nominal/nPipPar/nPipSeg), each final control_m_flow=true, each m_flow_start=mStart_flow_a/nPipPar/nPipSeg, each final show_V_flow=false, each final show_T=false) "Mass flow rate source with fixed m_flow"; Movers.BaseClasses.IdealSource sou2[nPipPar,nPipSeg-1]( redeclare each final package Medium = Medium, each final allowFlowReversal=allowFlowReversal, each final m_flow_small=1E-4*abs(m_flow_nominal/nPipPar/nPipSeg), each final control_m_flow=true, each m_flow_start=mStart_flow_a/nPipPar/nPipSeg, each final show_V_flow=false, each final show_T=false) "Mass flow rate source with fixed m_flow"; equation connect(port_a, senMasFlo.port_a); connect(senMasFlo.m_flow, gain.u); // Connect the model that imposes zero pressure drop in the manifold connect(senMasFlo.port_b, sou0.port_a); connect(sou0.port_b, port_b[1, 1]); connect(dpDis.y, sou0.dp_in); // Connect the models that impose the mass flow rates for i in 1:nPipPar-1 loop connect(senMasFlo.port_b, sou1[i].port_a); connect(sou1[i].port_b, port_b[i+1, 1]); connect(gain.y, sou1[i].m_flow_in); end for; for i in 1:nPipPar loop for j in 1:nPipSeg-1 loop connect(senMasFlo.port_b, sou2[i, j].port_a); connect(sou2[i, j].port_b, port_b[i, j+1]); connect(gain.y, sou2[i, j].m_flow_in); end for; end for; end DuctManifoldFlowDistributor;

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldNoResistance Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldNoResistance

Duct manifold without resistance

Buildings.Fluid.HeatExchangers.BaseClasses.DuctManifoldNoResistance

Information

Duct manifold without flow resistance.

This model connects the flows between the ports without modeling flow friction. The model is used in conjunction with a manifold which contains pressure drop elements and that is added to the other side of the heat exchanger registers.

Extends from PartialDuctManifold (Partial manifold for heat exchanger duct connection).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
IntegernPipSeg Number of pipe segments per register used for discretization
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar, nPipSeg]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model DuctManifoldNoResistance "Duct manifold without resistance" extends PartialDuctManifold; equation for i in 1:nPipPar loop for j in 1:nPipSeg loop connect(port_a, port_b[i, j]); end for; end for; end DuctManifoldNoResistance;

Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside

Calculates the hA value for water inside a coil

Buildings.Fluid.HeatExchangers.BaseClasses.HACoilInside

Information

Model for convective heat transfer coefficients inside a coil. Optionally, the convective heat transfer coefficient can be computed as a function of temperature and mass flow rate.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Realn0.85Water-side exponent for convective heat transfer coefficient, h proportional to m_flow^n
Nominal condition
MassFlowRatem_flow_nominal Water mass flow rate [kg/s]
ThermalConductancehA_nominal Convective heat transfer coefficient [W/K]
TemperatureT_nominalModelica.SIunits.Conversions...Nominal water temperature [K]
Advanced
Modeling detail
BooleanflowDependenttrueSet to false to make hA independent of mass flow rate
BooleantemperatureDependenttrueSet to false to make hA independent of temperature

Connectors

TypeNameDescription
input RealInputm_flowMass flow rate [kg/s]
input RealInputTTemperature [K]
output RealOutputhAInside convective heat transfer [W/K]

Modelica definition

model HACoilInside "Calculates the hA value for water inside a coil" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Water mass flow rate"; Modelica.Blocks.Interfaces.RealInput m_flow(unit="kg/s") "Mass flow rate"; Modelica.Blocks.Interfaces.RealInput T(unit="K") "Temperature"; Modelica.Blocks.Interfaces.RealOutput hA(unit="W/K") "Inside convective heat transfer"; parameter Modelica.SIunits.ThermalConductance hA_nominal(min=0) "Convective heat transfer coefficient"; parameter Real n(min=0, max=1)=0.85 "Water-side exponent for convective heat transfer coefficient, h proportional to m_flow^n"; parameter Modelica.SIunits.Temperature T_nominal= Modelica.SIunits.Conversions.from_degC(20) "Nominal water temperature"; parameter Boolean flowDependent=true "Set to false to make hA independent of mass flow rate"; parameter Boolean temperatureDependent = true "Set to false to make hA independent of temperature"; protected Real x(min=0) "Factor for temperature dependent variation of heat transfer coefficient"; parameter Real s(min=0, fixed=false) "Coefficient for temperature dependence of heat transfer coefficient"; Real fm "Fraction of actual to nominal mass flow rate"; initial equation s = if temperatureDependent then 0.014/(1+0.014*Modelica.SIunits.Conversions.to_degC(T_nominal)) else 1; equation fm = if flowDependent then m_flow / m_flow_nominal else 1; x = if temperatureDependent then 1 + s * (T-T_nominal) else 1; if flowDependent and temperatureDependent then hA = x * hA_nominal * Buildings.Utilities.Math.Functions.regNonZeroPower(fm, n, 0.1); elseif flowDependent then hA = hA_nominal * Buildings.Utilities.Math.Functions.regNonZeroPower(fm, n, 0.1); elseif temperatureDependent then hA = x * hA_nominal; else hA = hA_nominal; end if; end HACoilInside;

Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil

Sensible convective heat transfer model for air to water coil

Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil

Information

Model for sensible convective heat transfer coefficients for an air to water coil.

This model computes the convective heat transfer coefficient for an air to water coil. The parameters allow a user to enable or disable, individually for each medium, the mass flow and/or the temperature dependence of the convective heat transfer coefficients. For a detailed explanation of the equation, see the references below.

References

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Realn_w0.85Water-side exponent for convective heat transfer coefficient, h~m_flow^n
Realn_a0.8Air-side exponent for convective heat transfer coefficient, h~m_flow^n
Nominal condition
ThermalConductanceUA_nominal Thermal conductance at nominal flow [W/K]
MassFlowRatem_flow_nominal_w Water mass flow rate [kg/s]
MassFlowRatem_flow_nominal_a Air mass flow rate [kg/s]
Realr_nominal0.5Ratio between air-side and water-side convective heat transfer coefficient
ThermalConductancehA_nominal_wUA_nominal*(r_nominal + 1)/r...Water side convective heat transfer coefficient [W/K]
ThermalConductancehA_nominal_ar_nominal*hA_nominal_wAir side convective heat transfer coefficient, including fin resistance [W/K]
TemperatureT0_wModelica.SIunits.Conversions...Water temperature [K]
TemperatureT0_aModelica.SIunits.Conversions...Air temperature [K]
Advanced
Modeling detail
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
BooleanwaterSideTemperatureDependenttrueSet to false to make water-side hA independent of temperature
BooleanairSideTemperatureDependenttrueSet to false to make air-side hA independent of temperature

Connectors

TypeNameDescription
input RealInputm1_flowMass flow rate medium 1 [kg/s]
input RealInputm2_flowMass flow rate medium 2 [kg/s]
input RealInputT_1Temperature medium 1 [K]
input RealInputT_2Temperature medium 2 [K]
output RealOutputhA_1Convective heat transfer medium 1 [W/K]
output RealOutputhA_2Convective heat transfer medium 2 [W/K]

Modelica definition

model HADryCoil "Sensible convective heat transfer model for air to water coil" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.ThermalConductance UA_nominal(min=0) "Thermal conductance at nominal flow"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal_w "Water mass flow rate"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal_a "Air mass flow rate"; Modelica.Blocks.Interfaces.RealInput m1_flow(final unit="kg/s") "Mass flow rate medium 1"; Modelica.Blocks.Interfaces.RealInput m2_flow(final unit="kg/s") "Mass flow rate medium 2"; Modelica.Blocks.Interfaces.RealInput T_1(final unit="K") "Temperature medium 1"; Modelica.Blocks.Interfaces.RealInput T_2(final unit="K") "Temperature medium 2"; Modelica.Blocks.Interfaces.RealOutput hA_1(final unit="W/K") "Convective heat transfer medium 1"; Modelica.Blocks.Interfaces.RealOutput hA_2(final unit="W/K") "Convective heat transfer medium 2"; parameter Real r_nominal(min=0)=0.5 "Ratio between air-side and water-side convective heat transfer coefficient"; parameter Modelica.SIunits.ThermalConductance hA_nominal_w(min=0)=UA_nominal * (r_nominal+1)/r_nominal "Water side convective heat transfer coefficient"; parameter Modelica.SIunits.ThermalConductance hA_nominal_a(min=0)=r_nominal * hA_nominal_w "Air side convective heat transfer coefficient, including fin resistance"; parameter Real n_w(min=0, max=1)=0.85 "Water-side exponent for convective heat transfer coefficient, h~m_flow^n"; parameter Real n_a(min=0, max=1)=0.8 "Air-side exponent for convective heat transfer coefficient, h~m_flow^n"; parameter Modelica.SIunits.Temperature T0_w= Modelica.SIunits.Conversions.from_degC(20) "Water temperature"; parameter Modelica.SIunits.Temperature T0_a= Modelica.SIunits.Conversions.from_degC(20) "Air temperature"; 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 = true "Set to false to make water-side hA independent of temperature"; parameter Boolean airSideTemperatureDependent = true "Set to false to make air-side hA independent of temperature"; protected Real x_a(min=0) "Factor for air side temperature dependent variation of heat transfer coefficient"; Real x_w(min=0) "Factor for water side temperature dependent variation of heat transfer coefficient"; parameter Real s_w(min=0, fixed=false) "Coefficient for temperature dependence of water side heat transfer coefficient"; Real fm_w "Fraction of actual to nominal mass flow rate"; Real fm_a "Fraction of actual to nominal mass flow rate"; initial equation s_w = if waterSideTemperatureDependent then 0.014/(1+0.014*Modelica.SIunits.Conversions.to_degC(T0_w)) else 1; equation fm_w = if waterSideFlowDependent then m1_flow / m_flow_nominal_w else 1; fm_a = if airSideFlowDependent then m2_flow / m_flow_nominal_a else 1; x_w = if waterSideTemperatureDependent then 1 + s_w * (T_1-T0_w) else 1; x_a = if airSideTemperatureDependent then 1 + 7.8532E-4 * (T_2-T0_a) else 1; if waterSideFlowDependent then hA_1 = x_w * hA_nominal_w * Buildings.Utilities.Math.Functions.regNonZeroPower(fm_w, n_w, 0.1); else hA_1 = x_w * hA_nominal_w; end if; if airSideFlowDependent then hA_2 = x_a * hA_nominal_a * Buildings.Utilities.Math.Functions.regNonZeroPower(fm_a, n_a, 0.1); else hA_2 = x_a * hA_nominal_a; end if; end HADryCoil;

Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder

Calculates an hA value for natural convection around a cylinder

Buildings.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder

Information

This model calculates the convection coefficient h for natural convection from a cylinder submerged in fluid. h is calcualted using Eq 9.34 from Incropera and DeWitt (1996). Output of the block is the hA value.

The Nusselt number is computed as

NuD = (0.6 + (0.387 RaD(1/6))/(1+(0.559 Pr) (9/16))(8/27))2);

where NuD is the Nusselt number, RaD is the Rayleigh number and Pr is the Prandtl number.
This correclation is accurate for RaD less than 1012.

h is then calculated from the Nusselt number. The equation is

h = NuD k/D

where k is the thermal conductivity of the fluid and D is the diameter of the submerged cylinder.

References

Fundamentals of Heat and Mass Transfer (Fourth Edition), Frank Incropera and David DeWitt, John Wiley and Sons, 1996

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium inside the tank
DiameterChaLen Characteristic length of the cylinder [m]
Nominal condition
ThermalConductancehA_nominal Convective heat transfer coefficient [W/K]
TemperatureTFlu_nominal Fluid temperature at hA_nominal [K]
TemperatureTSur_nominal Surface temperature at hA_nominal [K]

Connectors

TypeNameDescription
replaceable package MediumMedium inside the tank
input RealInputTSurTemperature of the external surface of the heat exchanger [K]
input RealInputTFluTemperature of the fluid in the heat exchanger [K]
output RealOutputhAhA-value of the heat exchanger [W/K]

Modelica definition

model HANaturalCylinder "Calculates an hA value for natural convection around a cylinder" extends Modelica.Blocks.Icons.Block; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium inside the tank"; parameter Modelica.SIunits.Diameter ChaLen "Characteristic length of the cylinder"; parameter Modelica.SIunits.ThermalConductance hA_nominal(min=0) "Convective heat transfer coefficient"; parameter Modelica.SIunits.Temperature TFlu_nominal "Fluid temperature at hA_nominal"; parameter Modelica.SIunits.Temperature TSur_nominal "Surface temperature at hA_nominal"; Modelica.Blocks.Interfaces.RealInput TSur(unit = "K") "Temperature of the external surface of the heat exchanger"; Modelica.Blocks.Interfaces.RealInput TFlu(unit = "K") "Temperature of the fluid in the heat exchanger"; Modelica.Blocks.Interfaces.RealOutput hA(unit = "W/K") "hA-value of the heat exchanger"; Real h(unit="W/(m2.K)") "Convection coefficient"; protected parameter Real Gr_nominal(fixed=false) "Grashof number"; parameter Real B_nominal(unit="1/K", fixed=false) "isobaricExpansionCoefficient"; parameter Real nu_nominal(unit = "m2/s", fixed=false) "Kinematic viscosity of the medium"; parameter Modelica.SIunits.DynamicViscosity mu_nominal(fixed=false) "Dynamic viscosity of the medium"; parameter Modelica.SIunits.Density rho_nominal(fixed=false) "Density of the medium"; parameter Modelica.SIunits.ThermalConductivity k_nominal(fixed=false) "Thermal conductivity of the fluid"; parameter Real Ra_nominal(fixed=false) "Rayleigh number"; parameter Real Pr_nominal(fixed=false) "Prandlt number"; parameter Real Nusselt_nominal(fixed=false) "Nusselt number"; parameter Real h_nominal(unit="W/(m2.K)", fixed=false) "Convection coefficient"; parameter Modelica.SIunits.Area A(fixed=false) "Surface area, deduced from hA_nominal, fluid temperatures and characteristic length"; Modelica.SIunits.ThermalConductivity k "Thermal conductivity of the fluid"; Real Gr "Grashof number"; Real B(unit="1/K") "isobaricExpansionCoefficient"; Real nu(unit = "m2/s") "Kinematic viscosity of the medium"; Modelica.SIunits.DynamicViscosity mu "Dynamic viscosity of the medium"; Modelica.SIunits.Density rho "Density of the medium"; constant Modelica.SIunits.Acceleration g= Modelica.Constants.g_n "Acceleration due to gravity"; Medium.ThermodynamicState state "Thermodynamic state of the fluid around the cylinder"; Real Ra "Rayleigh number"; Real Pr "Prandlt number"; Real Nusselt "Nusselt number"; function nusselt input Modelica.SIunits.ThermalConductivity k "Thermal conductivity"; input Real Pr "Prandlt number"; input Real Ra "Rayleigh number"; output Real Nu(min=0) "Nusselt number"; protected Real num "Numerator"; Real den "Denominator"; algorithm num := (0.387*Buildings.Utilities.Math.Functions.smoothMax(Ra,1,0.1)^(1/6)); den := ((1+(0.559/Pr)^(9/16))^(8/27)); Nu := (0.6+num/den)^2; end nusselt; initial equation // Fluid properties mu_nominal = Buildings.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater( T = 0.5 * (TSur_nominal+TFlu_nominal)); rho_nominal = Medium.density( Medium.setState_pTX( p = Medium.p_default, T = 0.5*(TSur_nominal+TFlu_nominal), X = Medium.X_default)); Pr_nominal = Buildings.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater( T = 0.5*(TSur_nominal+TFlu_nominal)); B_nominal = Buildings.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater( T = 0.5*(TSur_nominal+TFlu_nominal)); nu_nominal = mu_nominal/rho_nominal; Gr_nominal = Modelica.Constants.g_n * B_nominal * (TSur_nominal - TFlu_nominal)*ChaLen^3/nu_nominal^2; Ra_nominal = Gr_nominal*Pr_nominal; // Convection coefficient k_nominal = Medium.thermalConductivity( Medium.setState_pTX( p = Medium.p_default, T = 0.5*(TFlu_nominal+TSur_nominal), X = Medium.X_default)); Nusselt_nominal = nusselt(k=k_nominal, Pr=Pr_nominal, Ra=Ra_nominal); h_nominal = Nusselt_nominal * k_nominal/ChaLen; A = hA_nominal / h_nominal; equation // Fluid properties state = Medium.setState_pTX( p = Medium.p_default, T = 0.5*(TSur+TFlu), X = Medium.X_default); mu = Buildings.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater( T = 0.5 * (TSur+TFlu)); rho = Medium.density(state); Pr = Buildings.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater( T = 0.5*(TSur+TFlu)); B = Buildings.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater( T = 0.5*(TSur+TFlu)); nu = mu/rho; Gr = Modelica.Constants.g_n * B * (TSur - TFlu)*ChaLen^3/nu^2; Ra = Gr*Pr; // Convection coefficient k = Medium.thermalConductivity(state); Nusselt = nusselt(k=k, Pr=Pr, Ra=Ra); h = Nusselt * k/ChaLen; hA = h*A; end HANaturalCylinder;

Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent

Element of a heat exchanger with humidity condensation of fluid 2

Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent

Information

Element of a heat exchanger with humidity condensation of fluid 2 and with dynamics of the fluids and the solid.

See Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement for a description of the physics of the sensible heat exchange. For the latent heat exchange, this model removes water vapor from the air stream, as computed by the instance masExc. This effectively moves water vapor molecules out of the air, and deposits them on the coil. Hence, the latent heat that is carried by these water vapor molecules is removed from the air stream, and added to the coil surface. This is done using the heat flow sources heaConVapAir and heaConVapWat.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement (Element of a heat exchanger 2).

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

model HexElementLatent "Element of a heat exchanger with humidity condensation of fluid 2" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement( redeclare final Buildings.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort vol1( final energyDynamics=energyDynamics, final massDynamics=energyDynamics, final initialize_p=initialize_p1, prescribedHeatFlowRate=false), redeclare final Buildings.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatMoisturePort vol2( final energyDynamics=energyDynamics, final massDynamics=energyDynamics, final initialize_p=initialize_p2, final simplify_mWat_flow=simplify_mWat_flow, prescribedHeatFlowRate=false)); 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"; MassExchange masExc( redeclare final package Medium=Medium2) "Model for mass exchange"; protected Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temSen( T(final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0)) "Temperature sensor of metal"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaConVapAir "Heat conductor for latent heat flow rate, accounting for latent heat removed with vapor"; Modelica.Blocks.Math.Product pro "Product to compute the latent heat flow rate"; Modelica.Blocks.Sources.RealExpression h_fg(final y=Buildings.Utilities.Psychrometrics.Constants.h_fg) "Enthalpy of vaporization"; Buildings.HeatTransfer.Sources.PrescribedHeatFlow heaConVapCoi "Heat conductor for latent heat flow rate, accounting for latent heat deposited with vapor on the coil"; Modelica.Blocks.Math.Gain gain(final k=-1); equation connect(temSen.T, masExc.TSur); connect(masExc.mWat_flow, vol2.mWat_flow); connect(vol2.X_w, masExc.XInf); connect(Gc_2, masExc.Gc); connect(temSen.port, con1.solid); connect(heaConVapAir.Q_flow, pro.y); connect(masExc.mWat_flow, pro.u2); connect(pro.u1, h_fg.y); connect(heaConVapAir.port, con2.fluid); connect(heaConVapCoi.port, con2.solid); connect(gain.y, heaConVapCoi.Q_flow); connect(pro.y, gain.u); end HexElementLatent;

Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible

Element of a heat exchanger with no humidity condensation

Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible

Information

Element of a heat exchanger with humidity condensation and with dynamics of the fluids and the solid.

See Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement for a description of the physics.

Extends from Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement (Element of a heat exchanger 2).

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

model HexElementSensible "Element of a heat exchanger with no humidity condensation" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement( redeclare final Buildings.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort vol1( final energyDynamics=energyDynamics, final massDynamics=energyDynamics, final initialize_p=initialize_p1, prescribedHeatFlowRate=false), redeclare final Buildings.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort vol2( final energyDynamics=energyDynamics, final massDynamics=energyDynamics, final initialize_p=initialize_p2, prescribedHeatFlowRate=false)); end HexElementSensible;

Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange

Block to compute the latent heat transfer based on the Lewis number

Buildings.Fluid.HeatExchangers.BaseClasses.MassExchange

Information

This model computes the mass transfer based on similarity laws between the convective sensible heat transfer coefficient and the mass transfer coefficient.

Using the Lewis number which is defined as the ratio between the heat and mass diffusion coefficients, one can obtain the ratio between convection heat transfer coefficient h in (W/(m^2*K)) and mass transfer coefficient hm in (m/s) as follows:

h ⁄ hm = ρ cp Le(1-n) ⁄ hm

where ρ is the mass density, cp is the specific heat capacity of the bulk medium and n is a coefficient from the boundary layer analysis, which is typically n=1/3. From this equation, we can compute the water vapor mass flow rate nA in (kg/s) as

nA = Gc ⁄ (cp Le(1-n)) (Xs - X),

where Gc is the sensible heat conductivity in (W/K) and Xs and X are the water vapor mass per unit volume in the boundary layer and in the bulk of the medium. In this model, Xs is the saturation water vapor pressure corresponding to the temperature Tsur which is an input.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Fluid medium model
RealLe1Lewis number (around 1 for water vapor in air)
Realn1/3Exponent in bondary layer ratio, delta/delta_t = Pr^n

Connectors

TypeNameDescription
replaceable package MediumFluid medium model
input RealInputXInfWater mass fraction of medium
input RealInputTSurSurface temperature [K]
output RealOutputmWat_flowWater flow rate [kg/s]
input RealInputGcSignal representing the convective (sensible) thermal conductance in [W/K]

Modelica definition

model MassExchange "Block to compute the latent heat transfer based on the Lewis number" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Fluid medium model"; Modelica.Blocks.Interfaces.RealInput XInf "Water mass fraction of medium"; Modelica.Blocks.Interfaces.RealInput TSur(final quantity="ThermodynamicTemperature", final unit = "K", displayUnit = "degC", min=0) "Surface temperature"; Modelica.Blocks.Interfaces.RealOutput mWat_flow(final unit = "kg/s") "Water flow rate"; Modelica.Blocks.Interfaces.RealInput Gc "Signal representing the convective (sensible) thermal conductance in [W/K]"; parameter Real Le = 1 "Lewis number (around 1 for water vapor in air)"; parameter Real n = 1/3 "Exponent in bondary layer ratio, delta/delta_t = Pr^n"; public Buildings.Utilities.Psychrometrics.X_pW humRatPre(use_p_in=false) "Model to convert water vapor pressure into humidity ratio"; Buildings.Utilities.Psychrometrics.pW_TDewPoi TDewPoi "Model to compute the water vapor pressure at the dew point"; Modelica.Blocks.Math.Gain gain(k=1/cpLe_default) "Constant to convert from heat transfer to mass transfer"; Modelica.Blocks.Math.Product mWat "Water flow rate"; Modelica.Blocks.Math.Min min; Modelica.Blocks.Sources.Constant zero(k=0) "Constant for zero"; Modelica.Blocks.Math.Add delX(k2=-1, k1=1) "Humidity difference"; protected parameter Medium.ThermodynamicState sta_default = Medium.setState_phX(h=Medium.h_default, p=Medium.p_default, X=Medium.X_default); parameter Modelica.SIunits.SpecificHeatCapacity cp_default=Medium.specificHeatCapacityCp(sta_default) "Density, used to compute fluid volume"; parameter Real cpLe_default(unit="J/(kg.K)") = cp_default * Le^(1-n); equation connect(TSur, TDewPoi.T); connect(TDewPoi.p_w, humRatPre.p_w); connect(Gc, gain.u); connect(gain.y, mWat.u2); connect(mWat.y, mWat_flow); connect(zero.y,min. u1); connect(delX.u2,XInf); connect(humRatPre.X_w, delX.u1); connect(delX.y, min.u2); connect(min.y, mWat.u1); end MassExchange;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctManifold Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctManifold

Partial manifold for heat exchanger duct connection

Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctManifold

Information

Partial duct manifold for a heat exchanger.

This model defines the duct connection to a heat exchanger. It is extended by other models that model the flow connection between the ports with and without flow friction.

Extends from PartialDuctPipeManifold (Partial heat exchanger duct and pipe manifold).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
IntegernPipSeg Number of pipe segments per register used for discretization
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar, nPipSeg]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

partial model PartialDuctManifold "Partial manifold for heat exchanger duct connection" extends PartialDuctPipeManifold; parameter Integer nPipSeg(min=1) "Number of pipe segments per register used for discretization"; Modelica.Fluid.Interfaces.FluidPort_b[nPipPar,nPipSeg] port_b( redeclare each package Medium = Medium, each m_flow(start=-mStart_flow_a/nPipSeg/nPipPar, max=if allowFlowReversal then +Modelica.Constants.inf else 0)) "Fluid connector b for medium (positive design flow direction is from port_a to port_b)"; end PartialDuctManifold;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctPipeManifold Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctPipeManifold

Partial heat exchanger duct and pipe manifold

Buildings.Fluid.HeatExchangers.BaseClasses.PartialDuctPipeManifold

Information

Partial heat exchanger manifold. This partial model defines ports and parameters that are used for air-side and water-side heat exchanger manifolds.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
IntegernPipPar Number of parallel pipes in each register
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)

Modelica definition

partial model PartialDuctPipeManifold "Partial heat exchanger duct and pipe manifold" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (port_a -> port_b)"; parameter Integer nPipPar(min=1) "Number of parallel pipes in each register"; // The parameter mStart_flow_a is used by PartialDuctManifold and // by PartialPipeManifold to set the start value of each port. // It is no longer used to set port_a.m_flow.start as the arithmetics is not // expanded by Dymola when checking for consistent start values, and hence // the translation will stop with an error in Dymola 2016 when using the pedantic // mode. parameter Modelica.SIunits.MassFlowRate mStart_flow_a "Guess value for mass flow rate at port_a"; Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare package Medium = Medium, m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0)) "Fluid connector a for medium (positive design flow direction is from port_a to port_b)"; end PartialDuctPipeManifold;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness

Partial model to implement heat exchangers based on effectiveness model

Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness

Information

Partial model to implement heat exchanger models.

Classes that extend this model need to implement heat and mass balance equations in a form like

  // transferred heat
  Q1_flow = eps * QMax_flow;
  // no heat loss to ambient
  0 = Q1_flow + Q2_flow;
  // no mass exchange
  mXi1_flow = zeros(Medium1.nXi);
  mXi2_flow = zeros(Medium2.nXi);

Thus, if medium 1 is heated in this device, then Q1_flow > 0 and QMax_flow > 0.

Extends from Fluid.Interfaces.StaticFourPortHeatMassExchanger (Partial model transporting two fluid streams between four ports without storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
BooleansensibleOnly1 Set to true if sensible exchange only for medium 1
BooleansensibleOnly2 Set to true if sensible exchange only for medium 2
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]
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

partial model PartialEffectiveness "Partial model to implement heat exchangers based on effectiveness model" extends Fluid.Interfaces.StaticFourPortHeatMassExchanger( prescribedHeatFlowRate1=true, prescribedHeatFlowRate2=true, show_T=false); Medium1.Temperature T_in1 = if allowFlowReversal1 then fra_a1 * Medium1.temperature(state_a1_inflow) + fra_b1 * Medium1.temperature(state_b1_inflow) else Medium1.temperature(state_a1_inflow) "Inlet temperature medium 1"; Medium2.Temperature T_in2 = if allowFlowReversal2 then fra_a2 * Medium2.temperature(state_a2_inflow) + fra_b2 * Medium2.temperature(state_b2_inflow) else Medium2.temperature(state_a2_inflow) "Inlet temperature medium 2"; 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"; Modelica.SIunits.ThermalConductance CMin_flow(min=0) = min(C1_flow, C2_flow) "Minimum heat capacity flow rate"; Modelica.SIunits.HeatFlowRate QMax_flow = CMin_flow*(T_in2 - T_in1) "Maximum heat flow rate into medium 1"; protected parameter Real delta=1E-3 "Parameter used for smoothing"; parameter Modelica.SIunits.SpecificHeatCapacity cp1_default(fixed=false) "Specific heat capacity of medium 1 at default medium state"; parameter Modelica.SIunits.SpecificHeatCapacity cp2_default(fixed=false) "Specific heat capacity of medium 2 at default medium state"; parameter Modelica.SIunits.ThermalConductance CMin_flow_small(fixed=false) "Small value for smoothing of minimum heat capacity flow rate"; 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 a1 (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 b1 (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)"; initial equation cp1_default = Medium1.specificHeatCapacityCp(Medium1.setState_pTX( Medium1.p_default, Medium1.T_default, Medium1.X_default)); cp2_default = Medium2.specificHeatCapacityCp(Medium2.setState_pTX( Medium2.p_default, Medium2.T_default, Medium2.X_default)); CMin_flow_small = min(m1_flow_small*cp1_default, m2_flow_small*cp2_default); end PartialEffectiveness;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU

Partial model for heat exchanger with effectiveness - NTU relation and no moisture condensation

Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU

Information

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

Q = Qmax ε
ε = f(NTU, Z, flowRegime),

where Qmax 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.

Models that extend from this partial model need to provide an assignment for UA.

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
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]
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]
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
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 PartialEffectivenessNTU "Partial model for heat exchanger with effectiveness - NTU relation and no moisture condensation" extends Buildings.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness( sensibleOnly1=true, sensibleOnly2=true, Q1_flow = eps*QMax_flow, Q2_flow = -Q1_flow, mWat1_flow = 0, mWat2_flow = 0); import con = Buildings.Fluid.Types.HeatExchangerConfiguration; import flo = Buildings.Fluid.Types.HeatExchangerFlowRegime; parameter con configuration "Heat exchanger configuration"; parameter Boolean use_Q_flow_nominal = true "Set to true to specify Q_flow_nominal and temperatures, or to false to specify effectiveness"; 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) "Nominal temperature at port a1"; parameter Modelica.SIunits.Temperature T_a2_nominal(fixed=use_Q_flow_nominal) "Nominal temperature at port a2"; parameter Real eps_nominal(fixed=not use_Q_flow_nominal) "Nominal heat transfer effectiveness"; input Modelica.SIunits.ThermalConductance UA "UA value"; Real eps(min=0, max=1) "Heat exchanger effectiveness"; // NTU has been removed as NTU goes to infinity as CMin goes to zero. // This quantity is not good for modeling. // Real NTU(min=0) "Number of transfer units"; final parameter Modelica.SIunits.ThermalConductance UA_nominal(fixed=false) "Nominal UA value"; final parameter Real NTU_nominal(min=0, fixed=false) "Nominal number of transfer units"; protected final parameter Medium1.ThermodynamicState sta1_default = Medium1.setState_pTX( T=Medium1.T_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_pTX( T=Medium1.T_default, p=Medium2.p_default, X=Medium2.X_default[1:Medium2.nXi]) "Default state for 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"; parameter Modelica.SIunits.ThermalConductance CMin_flow_nominal(fixed=false) "Minimal capacity flow rate at nominal condition"; parameter Modelica.SIunits.ThermalConductance CMax_flow_nominal(fixed=false) "Maximum capacity flow rate at nominal condition"; parameter Real Z_nominal( min=0, max=1, fixed=false) "Ratio of capacity flow rate at nominal condition"; parameter Modelica.SIunits.Temperature T_b1_nominal(fixed=false) "Nominal temperature at port b1"; parameter Modelica.SIunits.Temperature T_b2_nominal(fixed=false) "Nominal temperature at port b2"; 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"; initial equation assert(m1_flow_nominal > 0, "m1_flow_nominal must be positive, m1_flow_nominal = " + String( m1_flow_nominal)); assert(m2_flow_nominal > 0, "m2_flow_nominal must be positive, m2_flow_nominal = " + String( m2_flow_nominal)); cp1_nominal = Medium1.specificHeatCapacityCp(sta1_default); cp2_nominal = Medium2.specificHeatCapacityCp(sta2_default); // Heat transferred from fluid 1 to 2 at nominal condition C1_flow_nominal = m1_flow_nominal*cp1_nominal; C2_flow_nominal = m2_flow_nominal*cp2_nominal; CMin_flow_nominal = min(C1_flow_nominal, C2_flow_nominal); CMax_flow_nominal = max(C1_flow_nominal, C2_flow_nominal); Z_nominal = CMin_flow_nominal/CMax_flow_nominal; Q_flow_nominal = m1_flow_nominal*cp1_nominal*(T_a1_nominal - T_b1_nominal); if use_Q_flow_nominal then Q_flow_nominal = -m2_flow_nominal*cp2_nominal*(T_a2_nominal - T_b2_nominal); eps_nominal = abs(Q_flow_nominal/((T_a1_nominal - T_a2_nominal)* CMin_flow_nominal)); assert(Q_flow_nominal / (T_a1_nominal - T_a2_nominal) >= 0, "In " + getInstanceName() + ": Q_flow_nominal is defined with the wrong sign. " + "By convention, a positive value describes a heat flow from Medium1 to Medium2. " + "The parameter T_a1_nominal should then be larger than T_a2_nominal." + "Future version of this library might enforce this convention and throw an error.", level = AssertionLevel.warning); else T_a1_nominal = Medium1.T_default; T_a2_nominal = Medium2.T_default; T_b1_nominal = Medium1.T_default; T_b2_nominal = Medium2.T_default; end if; assert(eps_nominal > 0 and eps_nominal < 1, "eps_nominal out of bounds, eps_nominal = " + String(eps_nominal) + "\n To achieve the required heat transfer rate at epsilon=0.8, set |T_a1_nominal-T_a2_nominal| = " + String(abs(Q_flow_nominal/0.8/CMin_flow_nominal)) + "\n or increase flow rates. The current parameters result in " + "\n CMin_flow_nominal = " + String(CMin_flow_nominal) + "\n CMax_flow_nominal = " + String(CMax_flow_nominal)); // Assign the flow regime for the given heat exchanger configuration and capacity flow rates 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; // The equation sorter of Dymola 7.3 does not guarantee that the above assert is tested prior to the // function call on the next line. Thus, we add the test on eps_nominal to avoid an error in ntu_epsilonZ // for invalid input arguments NTU_nominal = if (eps_nominal > 0 and eps_nominal < 1) then Buildings.Fluid.HeatExchangers.BaseClasses.ntu_epsilonZ( eps=eps_nominal, Z=Z_nominal, flowRegime=Integer(flowRegime_nominal)) else 0; UA_nominal = NTU_nominal*CMin_flow_nominal; equation // Assign the flow regime for the given heat exchanger configuration and capacity 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; // Effectiveness eps = Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_C( UA=UA, C1_flow=C1_flow, C2_flow=C2_flow, flowRegime=Integer(flowRegime), CMin_flow_nominal=CMin_flow_nominal, CMax_flow_nominal=CMax_flow_nominal, delta=delta); end PartialEffectivenessNTU;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement

Element of a heat exchanger 2

Buildings.Fluid.HeatExchangers.BaseClasses.PartialHexElement

Information

Element of a heat exchanger with dynamics of the fluids and the solid. The hA value for both fluids is an input. The driving force for the heat transfer is the temperature difference between the fluid volumes and the solid.

The heat capacity C of the metal is assigned as follows. Suppose the metal temperature is governed by

C dT ⁄ dt = (hA)1 (T1 - T) + (hA)2 (T2 - T)

where hA are the convective heat transfer coefficients times heat transfer area that also take into account heat conduction in the heat exchanger fins and T1 and T2 are the medium temperatures. Assuming (hA)1=(hA)2, this equation can be rewritten as

C dT ⁄ dt = 2 (UA)0 ( (T1 - T) + (T2 - T) )

where (UA)0 is the UA value at nominal conditions. Hence we set the heat capacity of the metal to

C = 2 (UA)0 τm

where τm is the time constant that the metal of the heat exchanger has if the metal is approximated by a lumped thermal mass.

Note: This model is introduced to allow the instances Buildings.Fluid.HeatExchangers.BaseClasses.HexElementLatent and Buildings.Fluid.HeatExchangers.BaseClasses.HexElementSensible to redeclare the volume as final, thereby avoiding that a GUI displays the volume as a replaceable component.

Extends from Buildings.Fluid.Interfaces.FourPortHeatMassExchanger (Model transporting two fluid streams between four ports with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package Medium1PartialMediumMedium 1 in the component
replaceable package Medium2PartialMediumMedium 2 in the component
MixingVolumeHeatPortvol1redeclare Buildings.Fluid.Mi...Volume for fluid 1
MixingVolumevol2redeclare Buildings.Fluid.Mi...Volume for fluid 2
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

model PartialHexElement "Element of a heat exchanger 2" extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger; parameter Boolean initialize_p1 = not Medium1.singleState "Set to true to initialize the pressure of volume 1"; parameter Boolean initialize_p2 = not Medium2.singleState "Set to true to initialize the pressure of volume 2"; parameter Modelica.SIunits.ThermalConductance UA_nominal "Thermal conductance at nominal flow, used to compute time constant"; parameter Modelica.SIunits.Time tau_m(min=0) = 60 "Time constant of metal at nominal UA value"; parameter Modelica.SIunits.HeatCapacity C=2*UA_nominal*tau_m "Heat capacity of metal (= cp*m)"; Modelica.Blocks.Interfaces.RealInput Gc_1 "Signal representing the convective thermal conductance medium 1 in [W/K]"; Modelica.Blocks.Interfaces.RealInput Gc_2 "Signal representing the convective thermal conductance medium 2 in [W/K]"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor mas( C=C, T(stateSelect=StateSelect.always, fixed=(energyDynamics == Modelica.Fluid.Types.Dynamics.FixedInitial)), der_T( fixed=(energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyStateInitial))) if not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) "Mass of metal"; Modelica.Thermal.HeatTransfer.Components.Convection con1(dT(min=-200)) "Convection (and conduction) on fluid side 1"; Modelica.Thermal.HeatTransfer.Components.Convection con2(dT(min=-200)) "Convection (and conduction) on fluid side 2"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPor1 "Heat port for heat exchange with the control volume 1"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPor2 "Heat port for heat exchange with the control volume 2"; equation connect(Gc_1, con1.Gc); connect(Gc_2, con2.Gc); connect(con1.solid,mas. port); connect(con1.fluid, vol1.heatPort); connect(con2.fluid, vol2.heatPort); connect(con2.solid, con1.solid); connect(vol1.heatPort, heaPor1); connect(vol2.heatPort, heaPor2); end PartialHexElement;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialPipeManifold Buildings.Fluid.HeatExchangers.BaseClasses.PartialPipeManifold

Partial pipe manifold for a heat exchanger

Buildings.Fluid.HeatExchangers.BaseClasses.PartialPipeManifold

Information

Partial pipe manifold for a heat exchanger.

This model defines the pipe connection to a heat exchanger. It is extended by other models that model the flow connection between the ports with and without flow friction.

Extends from PartialDuctPipeManifold (Partial heat exchanger duct and pipe manifold).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

partial model PartialPipeManifold "Partial pipe manifold for a heat exchanger" extends PartialDuctPipeManifold; Modelica.Fluid.Interfaces.FluidPort_b[nPipPar] port_b( redeclare each package Medium = Medium, each m_flow(start=-mStart_flow_a/nPipPar, max=if allowFlowReversal then +Modelica.Constants.inf else 0)) "Fluid connector b for medium (positive design flow direction is from port_a to port_b)"; end PartialPipeManifold;

Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet

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

Buildings.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet

Information

Base class for model for an ideal heater, cooler, humidifier or dehumidifier with a prescribed outlet conditions.

Models that extend this model need to configure the instance outCon and connect its input signals, in they are enabled.

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

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
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
BooleancomputeFlowResistance(abs(dp_nominal) > Modelica....=true, compute flow resistance. Set to false to assume no friction
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]

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)

Modelica definition

partial model PartialPrescribedOutlet "Ideal heater, cooler, humidifier or dehumidifier with prescribed outlet conditions" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface; extends Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters( final computeFlowResistance=(abs(dp_nominal) > Modelica.Constants.eps)); constant Boolean homotopyInitialization = true "= true, use homotopy method"; parameter Modelica.SIunits.Time tau(min=0) = 10 "Time constant at nominal flow rate (used if energyDynamics or massDynamics not equal Modelica.Fluid.Types.Dynamics.SteadyState)"; protected Buildings.Fluid.FixedResistances.PressureDrop preDro( redeclare final package Medium = Medium, final m_flow_nominal=m_flow_nominal, final deltaM=deltaM, final allowFlowReversal=allowFlowReversal, final show_T=false, final from_dp=from_dp, final linearized=linearizeFlowResistance, final homotopyInitialization=homotopyInitialization, final dp_nominal=dp_nominal) "Flow resistance"; Buildings.Fluid.Interfaces.PrescribedOutlet outCon( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_small=m_flow_small, final show_T=false, final m_flow_nominal=m_flow_nominal, final tau=tau) "Model to set outlet conditions"; initial equation assert(homotopyInitialization, "In " + getInstanceName() + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", level = AssertionLevel.warning); equation connect(port_a, preDro.port_a); connect(preDro.port_b,outCon. port_a); connect(outCon.port_b, port_b); end PartialPrescribedOutlet;

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFixedResistance Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFixedResistance

Pipe manifold for a heat exchanger connection

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFixedResistance

Information

Pipe manifold with a fixed flow resistance.

This model is composed of a pressure drop calculation, and a flow distributor. The flow distributor distributes the mass flow rate equally to each instance of port_b, without having to compute a pressure drop in each flow leg.

Note: It is important that there is an equal pressure drop in each flow leg between this model, and the model that collects the flows. Otherwise, no solution may exist, and therefore the simulation may stop with an error.

Extends from PartialPipeManifold (Partial pipe manifold for a heat exchanger).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
Booleanuse_dhfalseSet to true to specify hydraulic diameter
Lengthdh0.025Hydraulic diameter for each pipe [m]
RealReC4000Reynolds number where transition to turbulent starts
RealdeltaM0.3Fraction of nominal mass flow rate where transition to turbulent occurs
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Nominal Condition
MassFlowRatem_flow_nominal Mass flow rate at port_a [kg/s]
PressureDifferencedp_nominal Pressure drop [Pa]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
Booleanlinearizedfalse= true, use linear relation between m_flow and dp for any flow rate
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model PipeManifoldFixedResistance "Pipe manifold for a heat exchanger connection" extends PartialPipeManifold; parameter Modelica.SIunits.MassFlowRate m_flow_nominal "Mass flow rate at port_a"; parameter Modelica.SIunits.PressureDifference dp_nominal(min=0, displayUnit="Pa") "Pressure drop"; parameter Boolean use_dh = false "Set to true to specify hydraulic diameter"; parameter Modelica.SIunits.Length dh=0.025 "Hydraulic diameter for each pipe"; parameter Real ReC=4000 "Reynolds number where transition to turbulent starts"; parameter Boolean linearized = false "= true, use linear relation between m_flow and dp for any flow rate"; parameter Real deltaM(min=0) = 0.3 "Fraction of nominal mass flow rate where transition to turbulent occurs"; parameter Boolean from_dp = false "= true, use m_flow = f(dp) else dp = f(m_flow)"; Buildings.Fluid.FixedResistances.PressureDrop fixRes( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=dp_nominal, from_dp=from_dp, deltaM=deltaM, linearized=linearized) "Fixed resistance for each duct"; protected PipeManifoldFlowDistributor floDis( redeclare package Medium = Medium, nPipPar=nPipPar, mStart_flow_a=mStart_flow_a, allowFlowReversal=allowFlowReversal) "Mass flow distributor to the individual pipes"; equation connect(fixRes.port_b, floDis.port_a); connect(floDis.port_b, port_b); connect(fixRes.port_a, port_a); end PipeManifoldFixedResistance;

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFlowDistributor Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFlowDistributor

Manifold for heat exchanger register that distributes the mass flow rate equally

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldFlowDistributor

Information

This model distributes the mass flow rates equally between all instances of port_b.

This model connects the flows between the ports without modeling flow friction. The model assigns an equal mass flow rate to each element of port_b. The model is used in conjunction with a manifold that is added to the other side of the heat exchanger registers.

Note: It is important that there is an equal pressure drop in each flow leg between this model, and the model that collects the flows. Otherwise, no solution may exist, and therefore the simulation may stop with an error.

Extends from PartialPipeManifold (Partial pipe manifold for a heat exchanger).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model PipeManifoldFlowDistributor "Manifold for heat exchanger register that distributes the mass flow rate equally" extends PartialPipeManifold; equation // mass and momentum balance port_b[1].m_flow = -port_a.m_flow/nPipPar; for i in 2:nPipPar loop port_b[i].m_flow = port_b[1].m_flow; end for; port_b[1].p = port_a.p; for i in 1:nPipPar loop inStream(port_a.h_outflow) = port_b[i].h_outflow; inStream(port_a.Xi_outflow) = port_b[i].Xi_outflow; inStream(port_a.C_outflow) = port_b[i].C_outflow; end for; port_a.h_outflow = sum(inStream(port_b[i].h_outflow) for i in 1:nPipPar)/nPipPar; port_a.Xi_outflow = sum(inStream(port_b[i].Xi_outflow) for i in 1:nPipPar)/nPipPar; port_a.C_outflow = sum(inStream(port_b[i].C_outflow) for i in 1:nPipPar)/nPipPar; end PipeManifoldFlowDistributor;

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldNoResistance Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldNoResistance

Manifold for heat exchanger register

Buildings.Fluid.HeatExchangers.BaseClasses.PipeManifoldNoResistance

Information

Pipe manifold without flow resistance.

This model connects the flows between the ports without modeling flow friction. The model is used in conjunction with a manifold which contains pressure drop elements and that is added to the other side of the heat exchanger registers.

Extends from PartialPipeManifold (Partial pipe manifold for a heat exchanger).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
IntegernPipPar Number of parallel pipes in each register
BooleanconnectAllPressurestrue 
Initialization
MassFlowRatemStart_flow_a Guess value for mass flow rate at port_a [kg/s]
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a for medium (positive design flow direction is from port_a to port_b)
FluidPort_bport_b[nPipPar]Fluid connector b for medium (positive design flow direction is from port_a to port_b)

Modelica definition

model PipeManifoldNoResistance "Manifold for heat exchanger register" extends PartialPipeManifold; parameter Boolean connectAllPressures=true; Modelica.Fluid.Fittings.MultiPort mulPor( redeclare package Medium = Medium, final nPorts_b=nPipPar); equation connect(port_a, mulPor.port_a); connect(mulPor.ports_b, port_b); end PipeManifoldNoResistance;

Buildings.Fluid.HeatExchangers.BaseClasses.RayleighNumber Buildings.Fluid.HeatExchangers.BaseClasses.RayleighNumber

Calculates the Rayleigh number for a given fluid and characteristic length

Buildings.Fluid.HeatExchangers.BaseClasses.RayleighNumber

Information

This model calculates the rayleigh number for a given fluid and characteristic length. It is calculated using Eq 9.25 in Incropera and DeWitt (1996). The equation is:

RaL = GrL Pr (g B (TS - TF) L3) /(ν*α)

where:
RaL is the Rayleigh number, GrL is the Grashof number, Pr is the Prandtl number, g is gravity, B is the isobaric expansion coefficient, TS is the temperature of the surface, TF is the temperature of the fluid, L is the characteristic length, ν is the kinematic viscosity and α is the thermal diffusivity.

This model is currently only used in natural convection calculations for water. As a result, the calculations reference functions to identify properties of water instead of a medium model.

References

Fundamentals of Heat and Mass Transfer (Fourth Edition), Frank Incropera and David DeWitt, John Wiley and Sons, 1996

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Fluid medium model
DiameterChaLen Characteristic length [m]

Connectors

TypeNameDescription
replaceable package MediumFluid medium model
input RealInputTSurSurface temperature of the HX [K]
output RealOutputRaRayleigh number
output RealOutputPrPrandlt number
input RealInputTFluTemperature of the surrounding fluid [K]

Modelica definition

model RayleighNumber "Calculates the Rayleigh number for a given fluid and characteristic length" extends Modelica.Blocks.Icons.Block; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Fluid medium model"; parameter Modelica.SIunits.Diameter ChaLen "Characteristic length"; Real Gr "Grashof number"; Real B(unit="1/K") "isobaricExpansionCoefficient"; Real nu(unit = "m2/s") "Kinematic viscosity of the medium"; Modelica.SIunits.DynamicViscosity mu "Dynamic viscosity of the medium"; Modelica.SIunits.Density rho "Density of the medium"; Modelica.Blocks.Interfaces.RealInput TSur(unit = "K") "Surface temperature of the HX"; Modelica.Blocks.Interfaces.RealOutput Ra "Rayleigh number"; Modelica.Blocks.Interfaces.RealOutput Pr "Prandlt number"; Modelica.Blocks.Interfaces.RealInput TFlu(unit="K") "Temperature of the surrounding fluid"; equation mu = Buildings.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater( T = 0.5 * (TSur+TFlu)); rho = Medium.density( Medium.setState_pTX( p = Medium.p_default, T = 0.5*(TSur+TFlu), X = Medium.X_default)); Pr = Buildings.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater( T = 0.5*(TSur+TFlu)); B = Buildings.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater( T = 0.5*(TSur+TFlu)); nu = mu/rho; Gr = Modelica.Constants.g_n * B * (TSur - TFlu)*ChaLen^3/nu^2; Ra = Gr*Pr; end RayleighNumber;

Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryRegime Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryRegime

Fully dry coil model

Information

This model implements the calculation for a 100% dry coil.

See Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU for documentation.

Parameters

TypeNameDefaultDescription
Realdelta1E-3Small value used for smoothing

Modelica definition

model WetCoilDryRegime "Fully dry coil model" // - water input Modelica.SIunits.ThermalConductance UAWat "UA for water side"; input Modelica.SIunits.MassFlowRate mWat_flow "Mass flow rate for water"; input Modelica.SIunits.MassFlowRate mWatNonZer_flow(min=Modelica.Constants.eps) "Mass flow rate for water, bounded away from zero"; input Modelica.SIunits.SpecificHeatCapacity cpWat "Specific heat capacity of water"; input Modelica.SIunits.Temperature TWatIn "Water temperature at inlet"; // -- air input Modelica.SIunits.ThermalConductance UAAir "UA for air side"; input Modelica.SIunits.MassFlowRate mAir_flow(min=Modelica.Constants.eps) "Mass flow rate of air"; input Modelica.SIunits.MassFlowRate mAirNonZer_flow(min=Modelica.Constants.eps) "Mass flow rate for air, bounded away from zero"; input Modelica.SIunits.SpecificHeatCapacity cpAir "Specific heat capacity of moist air at constant pressure"; input Modelica.SIunits.Temperature TAirIn "Temperature of air at inlet"; // -- misc. input Buildings.Fluid.Types.HeatExchangerFlowRegime cfg "The flow regime of the heat exchanger"; input Modelica.SIunits.MassFlowRate mAir_flow_nominal "Nominal mass flow rate for air"; input Modelica.SIunits.MassFlowRate mWat_flow_nominal "Nominal mass flow rate for water"; parameter Real delta = 1E-3 "Small value used for smoothing"; output Modelica.SIunits.HeatFlowRate QTot_flow "Heat transferred from water to air"; output Modelica.SIunits.Temperature TWatOut "Temperature of water at outlet"; output Modelica.SIunits.Temperature TAirOut "Temperature of air at the outlet"; output Real eps(min=0, max=1, unit="1") "Effectiveness for heat exchanger"; Modelica.SIunits.ThermalConductance CWat_flow=mWat_flow*cpWat "Capacitance rate of water"; Modelica.SIunits.ThermalConductance CAir_flow=mAir_flow*cpAir "Capacitance rate of air"; Modelica.SIunits.ThermalConductance CMin_flow_nominal= min(mAir_flow_nominal*cpAir,mWat_flow_nominal*cpWat) "Minimum capacity rate"; Modelica.SIunits.ThermalConductance CMax_flow_nominal= max(mAir_flow_nominal*cpAir,mWat_flow_nominal*cpWat) "Maximum capacity rate"; Modelica.SIunits.ThermalConductance CMin_flow= Buildings.Utilities.Math.Functions.smoothMin( x1=CAir_flow,x2=CWat_flow,deltaX=1E-3*(CMax_flow_nominal-CMin_flow_nominal)) "Minimum capacity rate"; Modelica.SIunits.ThermalConductance UA "Overall heat transfer coefficient"; output Modelica.SIunits.Temperature TSurAirOut "Surface Temperature at air outlet"; equation UA = 1/ (1 / UAAir + 1 / UAWat); eps=epsilon_C( UA=UA, C1_flow=CWat_flow, C2_flow=CAir_flow, flowRegime=Integer(cfg), CMin_flow_nominal= CMin_flow_nominal, CMax_flow_nominal=CMax_flow_nominal, delta= delta); QTot_flow = eps*CMin_flow*(TAirIn-TWatIn); TAirOut=TAirIn-QTot_flow/(mAirNonZer_flow*cpAir); TWatOut=TWatIn+QTot_flow/(mWatNonZer_flow*cpWat); (TAirOut-TSurAirOut)*UAAir=(TSurAirOut-TWatIn)*UAWat; end WetCoilDryRegime;

Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime

Model implementing the switching algorithm of the TK-fuzzy model for cooling coil application

Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryWetRegime

Information

This model implements the switching algorithm for the dry and wet regime.

The switching criteria for (counter-flow) cooling coil modes are as follows.

R1: If the coil surface temperature at the air inlet is lower than the dew-point temperature at the inlet to the coil, then the cooling coil surface is fully-wet.

R2: If the surface temperature at the air outlet section is higher than the dew-point temperature of the air at the inlet, then the cooling coil surface is fully-dry.

At each point of a simulation time step, the fuzzy-modeling approach determines the weights for R1 and R2 respectively (namely μFW and μFD) from the dew-point and coil surface temperatures.

It calculates total and sensible heat transfer rates according to the weights as follows.

totFDtot,FDFW Qtot,FW

senFDsen,FDFW Qsen,FW

The fuzzy-modeling ensures μFW + μFD = 1, μFW >=0 and μFD >=0, which means the fuzzy model outcomes of sen and tot are always convex combinations of heat transfer rates for fully-dry and fully-wet modes and therefore are always bounded by them.

The modeling approach also results in n-th order differentiable model depending on the selection of the underlying membership functions. This cooling coil model is once continuously differentiable at the mode switches.

Parameters

TypeNameDefaultDescription
Nominal condition
MassFlowRatemWat_flow_nominal Nominal mass flow rate for water [kg/s]
MassFlowRatemAir_flow_nominal Nominal mass flow rate for air [kg/s]

Connectors

TypeNameDescription
input RealInputUAWatProduct of heat transfer coefficient times area for water side [W/K]
input RealInputmWat_flowMass flow rate for water [kg/s]
input RealInputcpWatInlet water temperature [J/(kg.K)]
input RealInputTWatInInlet water temperature [K]
input RealInputUAAirProduct of heat transfer coefficient times area for air side [W/K]
input RealInputmAir_flowMass flow rate for air [kg/s]
input RealInputcpAirInlet specific heat capacity (at constant pressure) [J/(kg.K)]
input RealInputTAirInInlet air temperature [K]
input RealInputhAirInInlet air enthalpy [J/kg]
input RealInputpAirInlet air absolute pressure [Pa]
input RealInputX_wAirInMass fraction of water in inlet air (kg water/kg total air) [1]
output RealOutputQTot_flowTotal heat transfer from water into air, negative for cooling [W]
output RealOutputQSen_flowSensible heat transfer from water into air, negative for cooling [W]
output RealOutputmCon_flowMass flow of the condensate, negative for dehumidification [kg/s]

Modelica definition

model WetCoilDryWetRegime "Model implementing the switching algorithm of the TK-fuzzy model for cooling coil application" parameter Modelica.SIunits.MassFlowRate mWat_flow_nominal(min=0) "Nominal mass flow rate for water"; parameter Modelica.SIunits.MassFlowRate mAir_flow_nominal(min=0) "Nominal mass flow rate for air"; input Real Qfac(final unit="1") "a smoothing factor to prevent division-by-zero"; input Buildings.Fluid.Types.HeatExchangerFlowRegime cfg= Buildings.Fluid.Types.HeatExchangerFlowRegime.CounterFlow "heat exchanger configuration"; // -- Water Modelica.Blocks.Interfaces.RealInput UAWat( final quantity="ThermalConductance", final unit="W/K") "Product of heat transfer coefficient times area for water side"; Modelica.Blocks.Interfaces.RealInput mWat_flow( quantity="MassFlowRate", min = 0, final unit="kg/s") "Mass flow rate for water"; Modelica.Blocks.Interfaces.RealInput cpWat( final quantity="SpecificHeatCapacity", final unit="J/(kg.K)") "Inlet water temperature"; Modelica.Blocks.Interfaces.RealInput TWatIn( final quantity="ThermodynamicTemperature", final unit="K", min = 200, start = 288.15, nominal = 300, displayUnit="degC") "Inlet water temperature"; // -- Air Modelica.Blocks.Interfaces.RealInput UAAir( final quantity="ThermalConductance", final unit="W/K") "Product of heat transfer coefficient times area for air side"; Modelica.Blocks.Interfaces.RealInput mAir_flow( quantity="MassFlowRate", min = 0, final unit="kg/s") "Mass flow rate for air"; Modelica.Blocks.Interfaces.RealInput cpAir( final quantity="SpecificHeatCapacity", final unit="J/(kg.K)") "Inlet specific heat capacity (at constant pressure)"; Modelica.Blocks.Interfaces.RealInput TAirIn( final quantity="ThermodynamicTemperature", final unit="K", min = 200, start = 288.15, nominal = 300, displayUnit="degC") "Inlet air temperature"; Modelica.Blocks.Interfaces.RealInput hAirIn( final quantity="SpecificEnergy", final unit="J/kg") "Inlet air enthalpy"; Modelica.Blocks.Interfaces.RealInput pAir( final quantity="Pressure", final unit="Pa", displayUnit="bar", min=70000, nominal = 1e5) "Inlet air absolute pressure"; Modelica.Blocks.Interfaces.RealInput X_wAirIn( min=0, max=1, unit="1") "Mass fraction of water in inlet air (kg water/kg total air)"; Modelica.Blocks.Interfaces.RealOutput QTot_flow( final quantity="Power", final unit="W") "Total heat transfer from water into air, negative for cooling"; Modelica.Blocks.Interfaces.RealOutput QSen_flow( final quantity="Power", final unit="W") "Sensible heat transfer from water into air, negative for cooling"; Modelica.SIunits.HeatFlowRate QLat_flow "Latent heat transfer rate"; Modelica.Blocks.Interfaces.RealOutput mCon_flow( quantity="MassFlowRate", final unit="kg/s") "Mass flow of the condensate, negative for dehumidification"; Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilDryRegime fullyDry( final UAWat=UAWat, final mWat_flow=mWat_flow, final cpWat=cpWat, final TWatIn=TWatIn, final UAAir=UAAir, final mAir_flow=mAir_flow, final mWatNonZer_flow=mWatNonZer_flow, final mAirNonZer_flow=mAirNonZer_flow, final cpAir=cpAir, final TAirIn=TAirIn, final cfg=cfg, final mAir_flow_nominal=mAir_flow_nominal, final mWat_flow_nominal=mWat_flow_nominal) "Fully-dry coil model"; Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilWetRegime fullyWet( final UAWat=UAWat, final mWat_flow=mWat_flow, final cpWat=cpWat, final TWatIn=TWatIn, final UAAir=UAAir, final mAir_flow=mAir_flow, final mWatNonZer_flow=mWatNonZer_flow, final mAirNonZer_flow=mAirNonZer_flow, final cpAir=cpAir, final TAirIn=TAirIn, final cfg=cfg, final mAir_flow_nominal=mAir_flow_nominal, final mWat_flow_nominal=mWat_flow_nominal, final pAir=pAir, final X_wAirIn=X_wAirIn) "Fully-wet coil model"; Real dryFra(final unit="1", min=0, max=1) "Dry fraction, 0.3 means condensation occurs at 30% heat exchange length from air inlet"; protected Modelica.SIunits.MassFlowRate mAirNonZer_flow(min=Modelica.Constants.eps)= Buildings.Utilities.Math.Functions.smoothMax( x1=mAir_flow, x2=1E-3 *mAir_flow_nominal, deltaX=0.25E-3*mAir_flow_nominal) "Mass flow rate of air"; Modelica.SIunits.MassFlowRate mWatNonZer_flow(min=Modelica.Constants.eps)= Buildings.Utilities.Math.Functions.smoothMax( x1=mWat_flow, x2=1E-3 *mWat_flow_nominal, deltaX=0.25E-3*mWat_flow_nominal) "Mass flow rate of water"; Modelica.SIunits.Temperature TAirInDewPoi "Dew point temperature of incoming air"; Buildings.Utilities.Psychrometrics.pW_X pWIn( final X_w=X_wAirIn, final p_in=pAir); Buildings.Utilities.Psychrometrics.TDewPoi_pW TDewIn( final p_w=pWIn.p_w); //-- Values for fuzzy logics Real mu_FW(final unit="1", min=0, max=1), mu_FD(unit="1",min=0, max=1) "Membership functions for Fully-Wet and Fully-Dry conditions"; Real w_FW(final unit="1", min=0, max=1), w_FD(unit="1",min=0, max=1) "Normalized weight functions for Fully-Wet and Fully-Dry conditions"; equation TAirInDewPoi=TDewIn.T; mu_FW= Buildings.Utilities.Math.Functions.spliceFunction( pos=0,neg=1,x=fullyWet.TSurAirIn-TAirInDewPoi, deltax=Buildings.Utilities.Math.Functions.smoothMax(abs(fullyDry.TSurAirOut-fullyWet.TSurAirIn), 1e-2,1e-3)); //max(abs(fullyDry.TSurAirOut- fullyWet.TSurAirIn),1e-3)); mu_FD= Buildings.Utilities.Math.Functions.spliceFunction( pos=1,neg=0,x=fullyDry.TSurAirOut-TAirInDewPoi, deltax=Buildings.Utilities.Math.Functions.smoothMax(abs(fullyDry.TSurAirOut-fullyWet.TSurAirIn), 1e-2,1e-3)); //max(abs(fullyDry.TSurAirOut- fullyWet.TSurAirIn),1e-3)); w_FW=mu_FW/(mu_FW+mu_FD); w_FD=mu_FD/(mu_FW+mu_FD); QTot_flow= -(w_FW*fullyWet.QTot_flow+w_FD*fullyDry.QTot_flow)*Qfac; QSen_flow= -(w_FW*fullyWet.QSen_flow+w_FD*fullyDry.QTot_flow)*Qfac; dryFra= w_FD; QLat_flow=QTot_flow-QSen_flow; mCon_flow=QLat_flow/Buildings.Utilities.Psychrometrics.Constants.h_fg*Qfac; end WetCoilDryWetRegime;

Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilUARated Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilUARated

Model that calculates the UA-value from cooling coil data at rated conditions.

Information

This model calculates the overall heat transfer coefficient, i.e., UA-value, from cooling coil data at rated conditions.

The main limitation of the current implementation is that the rated conditions should correspond to a fully-dry or a fully-wet coil regime. The modeling uncertainty yielded by partially-wet rated conditions has not been assessed yet.

Parameters

TypeNameDefaultDescription
replaceable package MediumABuildings.Media.AirAir-side medium
replaceable package MediumWBuildings.Media.WaterWater-side medium
HeatFlowRateQTot_flow Nominal heat flow rate (positive for heat transfer from 1 to 2) [W]
TemperatureTAirIn Air inlet temperature at a rated condition [K]
MassFractionX_wAirIn Mass fraction of water in inlet air at a rated condition [1]
TemperatureTWatIn Water inlet temperature at a rated condition [K]
MassFlowRatemAir_flow Air mass flow rate at a rated condition [kg/s]
MassFlowRatemWat_flow Water mass flow rate at a rated condition [kg/s]
ThermalConductanceUA the overall heat transfer coefficient for a fully dry condition [W/K]
Realr_nominal Ratio between air-side and water-side convective heat transfer at nominal condition
Nominal thermal performance
Booleanuse_Q_flow_nominalfalseSet to true to specify Q_flow_nominal and inlet conditions, or to false to specify UA_nominal

Connectors

TypeNameDescription
replaceable package MediumAAir-side medium
replaceable package MediumWWater-side medium

Modelica definition

model WetCoilUARated "Model that calculates the UA-value from cooling coil data at rated conditions." replaceable package MediumA=Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Air-side medium"; replaceable package MediumW=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Water-side medium"; 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 QTot_flow "Nominal heat flow rate (positive for heat transfer from 1 to 2)"; parameter Modelica.SIunits.Temperature TAirIn "Air inlet temperature at a rated condition"; parameter Modelica.SIunits.MassFraction X_wAirIn "Mass fraction of water in inlet air at a rated condition"; parameter Modelica.SIunits.Temperature TWatIn "Water inlet temperature at a rated condition"; parameter Modelica.SIunits.MassFlowRate mAir_flow "Air mass flow rate at a rated condition"; parameter Modelica.SIunits.MassFlowRate mWat_flow "Water mass flow rate at a rated condition"; parameter Modelica.SIunits.ThermalConductance UA "the overall heat transfer coefficient for a fully dry condition"; parameter Real r_nominal(min=0, max=1) "Ratio between air-side and water-side convective heat transfer at nominal condition"; protected constant Modelica.SIunits.SpecificEnthalpy hfg= Buildings.Utilities.Psychrometrics.Constants.h_fg "Enthapy of vaporization of water"; constant Modelica.SIunits.SpecificEnthalpy hUnit=1 "Physical dimension of specific enthalpy used for a unit conversion"; constant Modelica.SIunits.Temperature TUnit=1 "Physical dimension of temperature used for a unit conversion"; constant Modelica.SIunits.SpecificHeatCapacity cpUnit=1 "Physical dimension of specific heat capacity used for a unit conversion"; parameter Modelica.SIunits.Temperature TAirOut(fixed=false) "Air outlet temperature at a rated condition"; parameter Modelica.SIunits.Temperature TWatOut= TWatIn - QTot_flow / cpWat / mWat_flow "Water outlet temperature at a rated condition"; parameter Modelica.SIunits.SpecificEnthalpy hAirIn = MediumA.specificEnthalpy_pTX( p=MediumA.p_default, T=TAirIn, X={X_wAirIn, 1-X_wAirIn}) "Enthalpy of incoming moist air at a rated condition"; parameter MediumA.ThermodynamicState staAir=MediumA.setState_phX( p=MediumA.p_default, h=hAirIn, X={X_wAirIn, 1-X_wAirIn}) "Inlet air thermodynamic state"; parameter Modelica.SIunits.SpecificHeatCapacity cpAir= MediumA.specificHeatCapacityCp(staAir) "Isobaric specific heat capacity of air"; parameter Modelica.SIunits.SpecificEnthalpy hAirOut= hAirIn + QTot_flow / mAir_flow "Enthalpy of outgoing moist air at a rated condition"; parameter Modelica.SIunits.SpecificEnthalpy hWatIn = MediumW.specificEnthalpy_pTX( p=MediumW.p_default, T=TWatIn, X=MediumW.X_default) "Enthalpy of incoming moist air at a rated condition"; parameter MediumW.ThermodynamicState staWat=MediumW.setState_phX( p=MediumW.p_default, h=hWatIn, X=MediumW.X_default) "Inlet water thermodynamic state"; parameter Modelica.SIunits.SpecificHeatCapacity cpWat= MediumW.specificHeatCapacityCp(staWat) "Isobaric specific heat capacity of water"; parameter Modelica.SIunits.SpecificHeatCapacity cpEff(fixed=false, min= 0) "Effective specific heat: change in saturated moist air enthalpy with respect to temperature along the saturation line between inlet and outlet water temperatures"; parameter Modelica.SIunits.SpecificEnthalpy LMED(fixed=false) "Log mean enthalpy difference"; parameter Modelica.SIunits.MassFlowRate UASta(fixed=false, min=0, start=1/(1/10+1/20)) "Overall heat transfer coefficient for enthalpy difference"; parameter Modelica.SIunits.ThermalConductance UAAir(min=0,start=10,fixed=false) "Air side convective heat transfer coefficient, including fin resistance"; parameter Modelica.SIunits.ThermalConductance UAWat(min=0,start=20,fixed=false) "Water side convective heat transfer coefficient"; parameter Boolean isFulDry(fixed=false) "Indicator of the fully-dry coil regime"; parameter Boolean isFulWet(fixed=false) "Indicator of the fully-wet coil regime"; parameter Modelica.SIunits.AbsolutePressure pSatTWatIn= Buildings.Utilities.Psychrometrics.Functions.saturationPressure(TWatIn) "Saturation pressure of water at the water inlet temperature"; parameter Modelica.SIunits.MassFraction X_wSatTWatIn= Buildings.Utilities.Psychrometrics.Functions.X_pSatpphi( pSat=pSatTWatIn, p=MediumA.p_default, phi=1) "Mass fraction of water in saturated moist air at the water inlet temperature"; parameter Modelica.SIunits.SpecificEnthalpy hSatTWatIn= Buildings.Media.Air.specificEnthalpy_pTX( p=MediumA.p_default, T=TWatIn, X={X_wSatTWatIn,1-X_wSatTWatIn}) "Enthalpy of saturated moist air at the water inlet temperature"; parameter Modelica.SIunits.AbsolutePressure pSatTWatOut= Buildings.Utilities.Psychrometrics.Functions.saturationPressure(TWatOut) "Saturation pressure of water at the water oulet temperature"; parameter Modelica.SIunits.MassFraction X_wSatTWatOut= Buildings.Utilities.Psychrometrics.Functions.X_pSatpphi( pSat=pSatTWatOut, p=MediumA.p_default, phi=1) "Mass fraction of water in saturated moist air at the water outlet temperature"; parameter Modelica.SIunits.SpecificEnthalpy hSatTWatOut= Buildings.Media.Air.specificEnthalpy_pTX( p=MediumA.p_default, T=TWatOut, X={X_wSatTWatOut,1-X_wSatTWatOut}) "Enthalpy of saturated moist air at the water oulet temperature"; initial equation isFulDry = if use_Q_flow_nominal then (X_wSatTWatIn >= X_wAirIn) else true; isFulWet = if use_Q_flow_nominal then (X_wSatTWatOut <= X_wAirIn) else true; assert( not use_Q_flow_nominal or hAirOut >= hSatTWatIn and hAirIn >= hSatTWatOut or hAirOut <= hSatTWatIn and hAirIn <= hSatTWatOut, "In " + getInstanceName() + ": The moist air enthalpy at the coil inlet or outlet is unrealistically low. " + "Check the rated conditions."); assert( isFulDry or isFulWet, "In " + getInstanceName() + ": The nominal conditions correspond to a partially-wet coil regime. " + "The modeling uncertainty under such conditions has not been assessed. " + "Rather specify nominal conditions in fully-dry or fully-wet regime.", level=AssertionLevel.warning); if use_Q_flow_nominal then if isFulDry then TAirOut = TAirIn + QTot_flow / mAir_flow / cpAir; LMED=Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( TWatIn, TWatOut, TAirIn, TAirOut) / TUnit * hUnit; QTot_flow=LMED*UASta; cpEff = 0; UA = UASta*cpUnit; else //fully wet // calculation of overall UAsta based on log mean enthalpy difference LMED=Buildings.Fluid.HeatExchangers.BaseClasses.lmtd( hSatTWatIn/hUnit*TUnit, hSatTWatOut/hUnit*TUnit, hAirIn/hUnit*TUnit, hAirOut/hUnit*TUnit) / TUnit * hUnit; QTot_flow=LMED*UASta; cpEff= (hSatTWatOut-hSatTWatIn)/(TWatOut-TWatIn); UASta = (UAAir/cpAir)/(1 + (cpEff*UAAir)/(cpAir*UAWat)); // Dummy value. TAirOut=MediumA.T_default; end if; else // Dummy values. TAirIn=MediumA.T_default; TAirOut=MediumA.T_default; X_wAirIn=MediumA.X_default[1]; TWatIn=MediumA.T_default; TWatOut=MediumA.T_default; hAirIn=MediumA.h_default; hAirOut=MediumA.h_default; LMED=hUnit; -QTot_flow=LMED*UASta; cpEff= 0; end if; UAWat = UAAir / r_nominal; UA = 1/ (1/UAAir + 1/UAWat); end WetCoilUARated;

Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilWetRegime Buildings.Fluid.HeatExchangers.BaseClasses.WetCoilWetRegime

Fully wet coil model using esilon_C.mo function

Information

This model implements the calculation for a 100% wet coil.

The 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 mathematical equations are analogous to that of the sensible heat exchanger. However, the key distinction is from that the heat transfer is driven by an enthalpy difference not by an temperature difference. This change in the driving potential results in re-defining capacitances and heat transfer coefficients accordinlgy.

The total heat transfer rate is expressed as

Qtot=ε* C*min (hair,in-hsat(Twat,in)),

where ε*=f(Cr*,NTU*) and f is the same ε-NTU relationships (depending on the heat exchanger configuration) for the sensible heat exchanger.

hair,in and hsat(Twat,in) are the specific enthalpies of the incoming moist air and saturated moist air at the water inlet temperature.

The capacitances of water and air streams are defined as

C*air=mair and C*wat=mwatcp,wat/csat,

where csat is an specific heat capacity, which indicates the sensitivity of the enthalpy of the staturated moist air w.r.t. the temperature, and is defined here as csat=(hsat(Twat,out)-hsat(Twat,in)) /(Twat,out-Twat,in).

The capacitance ratio and minimum capacitance are naturally defined as

Cr*=min(C*air,C*wat)/max(C*air,C*wat) and C*min=min(C*air,C*wat).


The number of transfer unit for the wet-coil is defined as NTU*=UA*/C*min, where

UA*=1/(1/(UAair/cp,air)+1/(UAwat/csat).

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.

Parameters

TypeNameDefaultDescription
Realdelta1E-3Small value used for smoothing
Realtau6*60Time constant for the state estimation: introduced to avoid the algebraic loop of the wet coil equations

Modelica definition

model WetCoilWetRegime "Fully wet coil model using esilon_C.mo function" constant Real cpEff0=2050 "Used for scaling"; constant Real cpWat0=4200 "Used for scaling"; parameter Real delta = 1E-3 "Small value used for smoothing"; constant Modelica.SIunits.SpecificHeatCapacity cpDum=1 "Dummy cp to eliminate the warning message of the unit mismatch when using the eps-NTU model for the wet coil"; constant Modelica.SIunits.TemperatureDifference dTWat=0.1; parameter Real tau=6*60 "Time constant for the state estimation: introduced to avoid the algebraic loop of the wet coil equations"; // - water input Modelica.SIunits.ThermalConductance UAWat "UA for water side"; input Modelica.SIunits.MassFlowRate mWat_flow "Mass flow rate for water"; input Modelica.SIunits.MassFlowRate mWatNonZer_flow "None-zero Mass flow rate for water"; input Modelica.SIunits.SpecificHeatCapacity cpWat "Specific heat capacity of water"; input Modelica.SIunits.Temperature TWatIn "Water temperature at inlet"; input Modelica.SIunits.MassFlowRate mWat_flow_nominal; // -- air input Modelica.SIunits.Pressure pAir "Pressure on air-side of coil"; input Modelica.SIunits.ThermalConductance UAAir "UA for air side"; input Modelica.SIunits.MassFlowRate mAir_flow "Mass flow rate of air"; input Modelica.SIunits.MassFlowRate mAirNonZer_flow "None-zero Mass flow rate for water"; input Modelica.SIunits.SpecificHeatCapacity cpAir "Specific heat capacity of moist air at constant pressure"; input Modelica.SIunits.Temperature TAirIn "Temperature of air at inlet"; input Modelica.SIunits.MassFraction X_wAirIn "Mass fraction of water in moist air at inlet"; input Buildings.Fluid.Types.HeatExchangerFlowRegime cfg "The configuration of the heat exchanger"; input Modelica.SIunits.MassFlowRate mAir_flow_nominal; Modelica.SIunits.SpecificEnthalpy hAirIn "Specific enthalpy of air at inlet conditions"; Buildings.Utilities.Psychrometrics.hSat_pTSat hSatWatInM(p=pAir,TSat=TWatIn) "Model to calculate saturated specific enthalpy of air at water inlet temperature"; Modelica.SIunits.SpecificEnthalpy hSatWatIn "Saturated specific enthalpy of air at water inlet temperature"; Buildings.Utilities.Psychrometrics.hSat_pTSat hSatWatIn_dT_M(p=pAir,TSat=TWatIn+dTWat) "Model to calculate derivative of saturated specific enthalpy of air at water inlet temperature"; Modelica.SIunits.SpecificHeatCapacity dhSatdTWatIn "Deriviative of saturated moist air enthalpy at water inlet temperature"; Real NonZerDelWatTem "Regularization water temperature difference betwee inlet and outlet"; Modelica.SIunits.SpecificEnthalpy hAirOut "Specific enthalpy of moist air at the air outlet"; Buildings.Utilities.Psychrometrics.hSat_pTSat hSatWatOutM(p=pAir,TSat=TWatOutEst) "Model to calculate saturated specific enthalpy of air at water outlet temperature"; Modelica.SIunits.SpecificEnthalpy hSatWatOut "Saturated specific enthalpy of air at water outlet temperature"; Modelica.SIunits.Temperature TSurEff "Effective surface temperature of the coil to split sensible and latent heat from total heat transfer rate"; Modelica.SIunits.SpecificEnthalpy hSatSurEff "Enthalpy of saturated moist air at the effective surface temperature"; Buildings.Utilities.Psychrometrics.hSat_pTSat hSatSurEffM(p=pAir,TSat=TSurEff) "An object to calculate the saturated enthalpy of moist air at the coil surface temperature"; Buildings.Utilities.Psychrometrics.hSat_pTSat hSatSurEffMinM(p=pAir,TSat=273.15+1) "An object to calculate a lower bound of the saturated enthalpy of moist air at the coil surface temperature"; Modelica.SIunits.SpecificHeatCapacity cpEff "Effective specific heat: change in enthalpy with respect to temperature along the saturation line at the local water temperature"; Modelica.SIunits.MassFlowRate UASta "Overall mass transfer coefficient for dry coil"; Real NTUAirSta(unit="1") "Number of transfer units for air-side only (NTU_a*)"; Real epsSta(start=0.66, unit="1") "Effectiveness for heat exchanger (e*)"; Modelica.SIunits.MassFlowRate CStaMin "Min of product of mass flow rates and specific heats; analogous to Cmin"; Modelica.SIunits.MassFlowRate CStaMin_flow_nominal= min( mAir_flow_nominal,mWat_flow_nominal*cpEff0/cpWat0) "Analogus to CMin_flow_nominal, only for a regularization"; Modelica.SIunits.MassFlowRate CStaMax_flow_nominal= max( mAir_flow_nominal,mWat_flow_nominal*cpEff0/cpWat0) "Analogus to CMax_flow_nominal, only for a regularization"; Modelica.SIunits.MassFlowRate deltaCStaMin=delta*min( mAir_flow_nominal,mWat_flow_nominal*cpEff0/cpWat0) "Min of product of mass flow rates and specific heats, analogous to Cmin"; Modelica.SIunits.Temperature TWatOutEst "State_estimation of Temperature of water at outlet"; output Modelica.SIunits.HeatFlowRate QTot_flow "Total heat flow from water to air stream"; output Modelica.SIunits.HeatFlowRate QSen_flow "Sensible heat flow from water to air stream"; output Modelica.SIunits.Temperature TWatOut "Temperature at the water outlet"; output Modelica.SIunits.Temperature TSurAirIn "Coil surface temperature at the air inlet"; output Modelica.SIunits.Temperature TAirOut "Temperature at the air outlet"; initial equation TWatOutEst=0.5*(TWatIn+ TAirIn); equation hAirIn=Buildings.Media.Air.specificEnthalpy_pTX(p=pAir,T=TAirIn,X={X_wAirIn,1-X_wAirIn}); hSatWatIn=hSatWatInM.hSat; dhSatdTWatIn=(hSatWatIn_dT_M.hSat-hSatWatInM.hSat)/dTWat; // dTWat is a parameter hSatWatOut= hSatWatOutM.hSat; NonZerDelWatTem=Buildings.Utilities.Math.Functions.regNonZeroPower(x=TWatOutEst-TWatIn,n=1,delta=0.1); cpEff = Buildings.Utilities.Math.Functions.smoothMax( (hSatWatOut - hSatWatIn)/NonZerDelWatTem, dhSatdTWatIn, cpEff0*delta); CStaMin=Buildings.Utilities.Math.Functions.smoothMin( mAir_flow, mWat_flow*cpWat/cpEff, deltaCStaMin/4); UASta = (UAAir/cpAir)/(1 + (cpEff*UAAir)/(cpAir*UAWat)); epsSta=epsilon_C( UA=UASta*cpDum, C1_flow=mWat_flow*cpWat/cpEff*cpDum, C2_flow=mAir_flow*cpDum, flowRegime=Integer(cfg), CMin_flow_nominal=CStaMin_flow_nominal*cpDum, CMax_flow_nominal=CStaMax_flow_nominal*cpDum, delta=delta); QTot_flow = epsSta*CStaMin*(hAirIn - hSatWatIn); QTot_flow = mAir_flow*(hAirIn- hAirOut); QTot_flow = mWat_flow*cpWat*(TWatOut-TWatIn); NTUAirSta = UAAir/(mAir_flow*cpAir); hSatSurEff = Buildings.Utilities.Math.Functions.smoothMax( x1 = hSatSurEffMinM.hSat, x2 = hAirIn +(hAirOut - hAirIn) / (1 - exp(-NTUAirSta)), deltaX = delta*1E4); // NTUAirSta is bounded as long as UAAir>0 due to the regularization of mAir_flow hSatSurEffM.hSat=hSatSurEff; TAirOut = TSurEff +(TAirIn - TSurEff)*exp(-NTUAirSta); QSen_flow= Buildings.Utilities.Math.Functions.smoothMin( x1 = mAir_flow*cpAir*(TAirIn-TAirOut), x2 = QTot_flow, deltaX = delta*mWatNonZer_flow*cpWat0*5); // the last term is only for regularization with DTWater=5oC (TAirIn-TSurAirIn)*UAAir=(TSurAirIn-TWatOut)*UAWat; der(TWatOutEst)=-1/tau*TWatOutEst+1/tau*TWatOut; end WetCoilWetRegime;

Buildings.Fluid.HeatExchangers.BaseClasses.determineWaterIndex

Determine the index of water in a 2-component medium model

Information

Given an array of strings representing substance names, this function returns the integer index of the substance named "water" (case-insensitive).

This function is useful to automate lookup up the index of water within a media so as to avoid hard-coding or guessing what the index will be. Typically, this function would be run once at initialization time.

Inputs

TypeNameDefaultDescription
StringsubstanceNames[:] Names of substances of media

Outputs

TypeNameDescription
IntegeridxWatIndex of water

Modelica definition

function determineWaterIndex "Determine the index of water in a 2-component medium model" input String[:] substanceNames "Names of substances of media"; output Integer idxWat "Index of water"; protected Boolean found(fixed=false) "Flag, used for error checking"; Integer N = size(substanceNames, 1) "Number of substances"; algorithm found:=false; idxWat := 1; for i in 1:N loop if Modelica.Utilities.Strings.isEqual( string1=substanceNames[i], string2="water", caseSensitive=false) then idxWat := i; found := true; end if; end for; assert(found, "Did not find medium species 'water' in the medium model. " + "Change medium model."); end determineWaterIndex;

Buildings.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater

Returns the dynamic viscosity for water

Information

This function is used to identify the dynamic viscosity of water at a given temperature. The function used is a fourth order polynomial fit to data from Incropera and Dewitt (1996).

References

Fundamentals of Heat and Mass Transfer (Fourth Edition), Frank Incropera and David P. Dewitt, John Wiley & Sons, 1996

Inputs

TypeNameDefaultDescription
TemperatureT Thermodynamic state record [K]

Outputs

TypeNameDescription
DynamicViscositymuDynamic viscosity [Pa.s]

Modelica definition

function dynamicViscosityWater "Returns the dynamic viscosity for water" input Modelica.SIunits.Temperature T "Thermodynamic state record"; output Modelica.SIunits.DynamicViscosity mu "Dynamic viscosity"; algorithm mu := ((2.86651*10^(-5))*T^4-0.039376307*T^3+20.32805026*T^2- 4680.303158*T+406389.0375)*10^(-6); //Equation is a fourth order polynomial fit to data from Fundamentals of //Heat and Mass Transfer (Fourth Edition), Frank Incropera & David DeWitt, //John Wiley & Sons, 1996 end dynamicViscosityWater;

Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_C

Computes heat exchanger effectiveness for given capacity flow rates and heat exchanger flow regime

Information

This function computes the heat exchanger effectiveness, the Number of Transfer Units, and the capacity flow ratio for given capacity flow rates.

The implementation allows for zero flow rate. As CMin_flow crosses delta*CMin_flow_nominal from above, the Number of Transfer Units and the heat exchanger effectiveness go to zero.

The different options for the flow regime are declared in Buildings.Fluid.Types.HeatExchangerFlowRegime.

Inputs

TypeNameDefaultDescription
ThermalConductanceUA UA value [W/K]
ThermalConductanceC1_flow Enthalpy flow rate medium 1 [W/K]
ThermalConductanceC2_flow Enthalpy flow rate medium 2 [W/K]
IntegerflowRegime Heat exchanger flow regime, see Buildings.Fluid.Types.HeatExchangerFlowRegime
ThermalConductanceCMin_flow_nominal Minimum enthalpy flow rate at nominal condition [W/K]
ThermalConductanceCMax_flow_nominal Maximum enthalpy flow rate at nominal condition [W/K]
Realdelta1E-3Small value used for smoothing

Outputs

TypeNameDescription
RealepsHeat exchanger effectiveness

Modelica definition

function epsilon_C "Computes heat exchanger effectiveness for given capacity flow rates and heat exchanger flow regime" input Modelica.SIunits.ThermalConductance UA "UA value"; input Modelica.SIunits.ThermalConductance C1_flow "Enthalpy flow rate medium 1"; input Modelica.SIunits.ThermalConductance C2_flow "Enthalpy flow rate medium 2"; input Integer flowRegime "Heat exchanger flow regime, see Buildings.Fluid.Types.HeatExchangerFlowRegime"; input Modelica.SIunits.ThermalConductance CMin_flow_nominal "Minimum enthalpy flow rate at nominal condition"; input Modelica.SIunits.ThermalConductance CMax_flow_nominal "Maximum enthalpy flow rate at nominal condition"; input Real delta = 1E-3 "Small value used for smoothing"; output Real eps(min=0, max=1) "Heat exchanger effectiveness"; protected Modelica.SIunits.ThermalConductance deltaCMin "Small number for capacity flow rate"; Modelica.SIunits.ThermalConductance deltaCMax "Small number for capacity flow rate"; Modelica.SIunits.ThermalConductance CMin_flow "Minimum capacity flow rate"; Modelica.SIunits.ThermalConductance CMax_flow "Maximum capacity flow rate"; Modelica.SIunits.ThermalConductance CMinNZ_flow "Minimum capacity flow rate, bounded away from zero"; Modelica.SIunits.ThermalConductance CMaxNZ_flow "Maximum capacity flow rate, bounded away from zero"; Real gaiEps(min=0, max=1) "Gain used to force UA to zero for very small flow rates"; Real gaiNTU(min=1E-10, max=1) "Gain used to force NTU to a number slightly above zero for very small flow rates. Because NTU is used in NTU^-(0.22), it must not be zero."; Real NTU "Number of transfer units"; Real Z(min=0, max=1) "Ratio of capacity flow rate (CMin/CMax)"; algorithm deltaCMin := delta*CMin_flow_nominal; deltaCMax := delta*CMax_flow_nominal; // effectiveness CMin_flow :=Buildings.Utilities.Math.Functions.smoothMin( C1_flow, C2_flow, deltaCMin/4); CMax_flow :=Buildings.Utilities.Math.Functions.smoothMax( C1_flow, C2_flow, deltaCMax/4); // CMin and CMax, constrained to be non-zero to compute eps-NTU-Z relationship CMinNZ_flow :=Buildings.Utilities.Math.Functions.smoothMax( CMin_flow, deltaCMin, deltaCMin/4); CMaxNZ_flow :=Buildings.Utilities.Math.Functions.smoothMax( CMax_flow, deltaCMax, deltaCMax/4); Z := CMin_flow/CMaxNZ_flow+1E-10*deltaCMin; // Gain that goes to zero as CMin_flow gets below deltaCMin // This is needed to allow zero flow gaiEps := Buildings.Utilities.Math.Functions.spliceFunction( pos=1, neg=0, x=CMin_flow-deltaCMin, deltax=deltaCMin/2); gaiNTU := Buildings.Utilities.Math.Functions.spliceFunction( pos=1, neg=delta, x=CMin_flow-deltaCMin, deltax=deltaCMin/2); NTU := gaiNTU*UA/CMinNZ_flow; eps := gaiEps*Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_ntuZ( NTU=NTU, Z=Z, flowRegime=flowRegime); end epsilon_C;

Buildings.Fluid.HeatExchangers.BaseClasses.epsilon_ntuZ

Computes heat exchanger effectiveness for given number of transfer units and heat exchanger flow regime

Information

This function computes the heat exchanger effectiveness for a given number of transfer units, capacity flow ratio and heat exchanger flow regime. The different options for the flow regime are declared in Buildings.Fluid.Types.HeatExchangerFlowRegime.

Inputs

TypeNameDefaultDescription
RealNTU Number of transfer units
RealZ Ratio of capacity flow rate (CMin/CMax)
IntegerflowRegime Heat exchanger flow regime, see Buildings.Fluid.Types.HeatExchangerFlowRegime

Outputs

TypeNameDescription
RealepsHeat exchanger effectiveness

Modelica definition

function epsilon_ntuZ "Computes heat exchanger effectiveness for given number of transfer units and heat exchanger flow regime" import f = Buildings.Fluid.Types.HeatExchangerFlowRegime; input Real NTU "Number of transfer units"; input Real Z(min=0, max=1) "Ratio of capacity flow rate (CMin/CMax)"; input Integer flowRegime "Heat exchanger flow regime, see Buildings.Fluid.Types.HeatExchangerFlowRegime"; output Real eps(min=0, max=1) "Heat exchanger effectiveness"; protected Real a "Auxiliary variable"; algorithm if (flowRegime == Integer(f.ParallelFlow)) then // parallel flow a := 0; eps := (1 - Modelica.Math.exp(-NTU*(1 + Z)))/(1 + Z); elseif (flowRegime == Integer(f.CounterFlow)) then// counter flow // a is constraining Z since eps is not defined for Z=1. a := smooth(1, if Z < 0.97 then Z else Buildings.Utilities.Math.Functions.smoothMin( x1=Z, x2=0.98, deltaX=0.01)); eps := (1 - Modelica.Math.exp(-NTU*(1 - a)))/(1 - a*Modelica.Math.exp(-NTU*( 1 - a))); elseif (flowRegime == Integer(f.CrossFlowUnmixed)) then a := NTU^(-0.22); eps := 1 - Modelica.Math.exp( ( Modelica.Math.exp( - NTU * Z * a) - 1) / (Z * a)); elseif (flowRegime == Integer(f.CrossFlowCMinUnmixedCMaxMixed)) then // cross flow, (single pass), CMax mixed, CMin unmixed. (Coil with one row.) a := 0; eps := (1 - Modelica.Math.exp(-Z*(1 - Modelica.Math.exp(-NTU))))/Z; elseif (flowRegime == Integer(f.CrossFlowCMinMixedCMaxUnmixed)) then // cross flow, (single pass), CMin mixed, CMax unmixed. a := 0; eps := 1 - Modelica.Math.exp(-(1 - Modelica.Math.exp(-Z*NTU))/Z); elseif (flowRegime == Integer(f.ConstantTemperaturePhaseChange)) then // one side is experiencing constant temperature phase change // Z is unused a := 0; eps := 1 - Modelica.Math.exp(-NTU); else a := 0; eps := 0; assert(Integer(f.ParallelFlow) <= flowRegime and flowRegime <= Integer(f.ConstantTemperaturePhaseChange), "Flow regime is not implemented."); end if; end epsilon_ntuZ;

Buildings.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater

Returns the isobaric expansion coefficient for water

Information

This function is used to identify the isobaric expansion coefficient of water at a given temperature. The function used is a fourth order polynomial fit to data from Incropera and Dewitt (1996).

References

Fundamentals of Heat and Mass Transfer (Fourth Edition), Frank Incropera and David P. Dewitt, John Wiley & Sons, 1996

Inputs

TypeNameDefaultDescription
TemperatureT Thermodynamic state record [K]

Outputs

TypeNameDescription
RealbetaDynamic viscosity [1/K]

Modelica definition

function isobaricExpansionCoefficientWater "Returns the isobaric expansion coefficient for water" input Modelica.SIunits.Temperature T "Thermodynamic state record"; output Real beta( unit="1/K") "Dynamic viscosity"; algorithm beta := (-8.53296*10^(-6)*T^4+0.011562287*T^3-5.88800657*T^2+ 1341.798661*T-115406.5225)*10^(-6); //Equation is a fourth order polynomial fit to data from Fundamentals of //Heat and Mass Transfer (Fourth Edition), Frank Incropera & David DeWitt, //John Wiley & Sons, 1996 end isobaricExpansionCoefficientWater;

Buildings.Fluid.HeatExchangers.BaseClasses.lmtd

Log-mean temperature difference

Information

This function computes the log mean temperature difference of a heat exchanger.

Note that the implementation requires the temperature differences Ta1 - Tb2 and Tb1 - Ta2 to be not equal to each other.

Inputs

TypeNameDefaultDescription
TemperatureT_a1 Temperature at port a1 [K]
TemperatureT_b1 Temperature at port b1 [K]
TemperatureT_a2 Temperature at port a2 [K]
TemperatureT_b2 Temperature at port b2 [K]

Outputs

TypeNameDescription
TemperatureDifferencelmtdLog-mean temperature difference [K]

Modelica definition

function lmtd "Log-mean temperature difference" input Modelica.SIunits.Temperature T_a1 "Temperature at port a1"; input Modelica.SIunits.Temperature T_b1 "Temperature at port b1"; input Modelica.SIunits.Temperature T_a2 "Temperature at port a2"; input Modelica.SIunits.Temperature T_b2 "Temperature at port b2"; output Modelica.SIunits.TemperatureDifference lmtd "Log-mean temperature difference"; protected Modelica.SIunits.TemperatureDifference dT1 "Temperature difference side 1"; Modelica.SIunits.TemperatureDifference dT2 "Temperature difference side 2"; algorithm dT1 :=T_a1 - T_b2; dT2 :=T_b1 - T_a2; lmtd :=(dT2 - dT1)/Modelica.Math.log(dT2/dT1); end lmtd;

Buildings.Fluid.HeatExchangers.BaseClasses.ntu_epsilonZ

Computes number of transfer units for given heat exchanger effectiveness and heat exchanger flow regime

Information

This function computes the number of transfer units for a given heat exchanger effectiveness, capacity flow ratio and heat exchanger flow regime. The different options for the flow regime are declared in Buildings.Fluid.Types.HeatExchangerFlowRegime.

Note that for the flow regime CrossFlowUnmixed, computing the function requires the numerical solution of an equation in one variable. This is handled internally and not exposed to the global solver.

Inputs

TypeNameDefaultDescription
Realeps Heat exchanger effectiveness
RealZ Ratio of capacity flow rate (CMin/CMax)
IntegerflowRegime Heat exchanger flow regime

Outputs

TypeNameDescription
RealNTUNumber of transfer units

Modelica definition

function ntu_epsilonZ "Computes number of transfer units for given heat exchanger effectiveness and heat exchanger flow regime" import f = Buildings.Fluid.Types.HeatExchangerFlowRegime; input Real eps(min=0, max=0.999) "Heat exchanger effectiveness"; input Real Z(min=0, max=1) "Ratio of capacity flow rate (CMin/CMax)"; input Integer flowRegime "Heat exchanger flow regime"; output Real NTU "Number of transfer units"; protected Real a "Auxiliary variable"; function epsilon_ntuZ_crossFlowUnmixed "Internal function to solve eps=f(NTU, Z) for NTU for cross flow unmixed" extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction; input Real eps(min=0, max=0.999) "Heat exchanger effectiveness"; input Real Z(min=0, max=1) "Ratio of capacity flow rate (CMin/CMax)"; protected Real NTUExp "Auxiliary variable"; algorithm NTUExp := u^(-0.22); y := 1 - Modelica.Math.exp( ( Modelica.Math.exp( - u * Z * NTUExp) - 1) / (Z * NTUExp))-eps; end epsilon_ntuZ_crossFlowUnmixed; algorithm if (flowRegime == Integer(f.ParallelFlow)) then // parallel flow a := Z+1; assert(eps < 1/a, "Invalid input data. eps > 1/(1+Z) is physically not possible for parallel flow. Received eps = " + String(eps) + " Z = " + String(Z) + " 1/(Z+1) = " + String(1/a)); NTU := -(Modelica.Math.log(1-eps*a))/(a); elseif (flowRegime == Integer(f.CounterFlow)) then// counter flow // a is constraining Z since eps is not defined for Z=1. a := smooth(1, if Z < 0.97 then Z else Buildings.Utilities.Math.Functions.smoothMin( x1=Z, x2=0.98, deltaX=0.01)); NTU := Modelica.Math.log((1-eps)/(1-eps*a)) / (a-1); elseif (flowRegime == Integer(f.CrossFlowUnmixed)) then a := 0; // The function Internal.solve evaluates epsilon_ntuZ at NTU=x_min-1e-10 and NTU=x_max+1e-10 // when it solves iteratively epsilon_ntuZ for ntu // Therefore, we set x_min=1.5*1e-10 to prevent computing NTU^(-0.22)=(-1e-10)^(-0.22). NTU :=Modelica.Math.Nonlinear.solveOneNonlinearEquation( f=function epsilon_ntuZ_crossFlowUnmixed(eps=eps, Z=Z), u_min=1.5*1e-10, u_max=1e6); elseif (flowRegime == Integer(f.CrossFlowCMinUnmixedCMaxMixed)) then // cross flow, (single pass), CMax mixed, CMin unmixed. (Coil with one row.) a := smooth(1, if Z > 0.03 then Z else Buildings.Utilities.Math.Functions.smoothMin( x1=0.02, x2=Z, deltaX=0.01)); NTU := -Modelica.Math.log(1+(Modelica.Math.log(1-eps*a)/a)); elseif (flowRegime == Integer(f.CrossFlowCMinMixedCMaxUnmixed)) then // cross flow, (single pass), CMin mixed, CMax unmixed. a := smooth(1, if Z > 0.03 then Z else Buildings.Utilities.Math.Functions.smoothMin( x1=0.02, x2=Z, deltaX=0.01)); NTU := -Modelica.Math.log(1+Z*Modelica.Math.log(1-eps))/Z; elseif (flowRegime == Integer(f.ConstantTemperaturePhaseChange)) then // one side is experiencing constant temperature phase change // Z is unused a := 0; NTU := -Modelica.Math.log((1-eps)); else a := 0; NTU := 0; assert(Integer(f.ParallelFlow) <= flowRegime and flowRegime <= Integer(f.ConstantTemperaturePhaseChange), "Flow regime is not implemented."); end if; end ntu_epsilonZ;

Buildings.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater

Returns the Prandtl number for water

Information

This function is used to identify the Prandtl number of water at a given temperature. The function used is a fourth order polynomial fit to data from Incropera and Dewitt (1996).

References

Fundamentals of Heat and Mass Transfer (Fourth Edition), Frank Incropera and David P. Dewitt, John Wiley & Sons, 1996

Inputs

TypeNameDefaultDescription
TemperatureT Thermodynamic state record [K]

Outputs

TypeNameDescription
RealPrPrandtl number

Modelica definition

function prandtlNumberWater "Returns the Prandtl number for water" input Modelica.SIunits.Temperature T "Thermodynamic state record"; output Real Pr "Prandtl number"; algorithm Pr := ((2.55713*10^(-7))*T^4-0.000350293*T^3+0.180259651*T^2- 41.34104323*T+3571.372195); //Equation is a fourth order polynomial fit to data from Fundamentals //of Heat and Mass Transfer (Fourth Edition), Frank Incropera & David DeWitt, //John Wiley & Sons, 1996 end prandtlNumberWater;