Buildings.Fluid.HeatExchangers.CoolingTowers

Package with cooling tower models

Information

This package contains components models for cooling towers.

The model Buildings.Fluid.HeatExchangers.CoolingTowers.DryCooler computes the performance of a dry cooler using the epsilon-NTU approach, with flow and temperature dependent convective heat transfer coefficients. It uses the dry bulb air temperature as an input.

The model Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach computes a fixed approach temperature. It can be used with either the dry bulb or the wet bulb temperature as an input, as it simply sets the coolant leaving temperature to be equal to the air temperature plus a constant offset. Note that this model does not compute fan energy consumption.

The model Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc computes the performance of a wet, open cooling tower based the York formula. It uses the wet bulb temperature as an input.

The model Buildings.Fluid.HeatExchangers.CoolingTowers.Merkel computes the performance of a wet, open cooling tower using the Merkel formula. It uses the wet bulb temperature as an input.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Buildings.Fluid.HeatExchangers.CoolingTowers.DryCooler DryCooler Cooling tower model based on epsilon-NTU relation
Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach FixedApproach Cooling tower with constant approach temperature
Buildings.Fluid.HeatExchangers.CoolingTowers.Merkel Merkel Cooling tower model based on Merkel's theory
Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc YorkCalc Cooling tower with variable speed using the York calculation for the approach temperature
Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations Correlations Package with correlations for cooling tower performance
Buildings.Fluid.HeatExchangers.CoolingTowers.Data Data Cooling tower performance data
Buildings.Fluid.HeatExchangers.CoolingTowers.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluid.HeatExchangers.CoolingTowers.Validation Validation Collection of validation models
Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses BaseClasses Package with base classes for Buildings.Fluid.HeatExchangers.CoolingTowers

Buildings.Fluid.HeatExchangers.CoolingTowers.DryCooler Buildings.Fluid.HeatExchangers.CoolingTowers.DryCooler

Cooling tower model based on epsilon-NTU relation

Buildings.Fluid.HeatExchangers.CoolingTowers.DryCooler

Information

Model for a steady-state or dynamic dry cooling tower with a variable speed fan using epsilon-NTU method for heat transfer.

Thermal performance

To compute the thermal performance, this model takes as parameters the nominal cooling capacity, air dry-bulb temperature, and cooling fluid (water or glycol) inlet and outlet temperatures as specified in the data record Buildings.Fluid.HeatExchangers.CoolingTowers.Data.DryCooler.Generic. The cooling tower performance is modeled using the effectiveness-NTU relationship for a crossflow configuration.

Changes in convective heat transfer coefficient on the coolant-side and the air-side due to change in flow rate and temperature are taken into account using the model Buildings.Fluid.HeatExchangers.BaseClasses.HADryCoil. This correction can be configured in the data record Buildings.Fluid.HeatExchangers.CoolingTowers.Data.DryCooler.Generic.

Extends from Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed (Base class for cooling towers with variable speed fan).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Genericdat Performance data record
Nominal condition
MassFlowRatem_flow_nominaldat.Q_flow_nominal/cp_defaul...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominaldat.dp_nominalPressure difference [Pa]
Fan
PowerPFan_nominaldat.PFan_nominalFan power at full speed [W]
RealyMin0.3Minimum control signal until fan is switched off (used for smoothing between forced and free convection regime) [1]
fanfanRelPowdat.fanRelPowFan relative power consumption as a function of control signal, fanRelPow=P(y)/P(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputTLvgLeaving water temperature [K]
input RealInputyFan control signal [1]
output RealOutputPFanElectric power consumed by fan [W]
input RealInputTDryBulEntering air dry bulb temperature [K]

Modelica definition

model DryCooler "Cooling tower model based on epsilon-NTU relation" extends Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed( final PFan_nominal=dat.PFan_nominal, final m_flow_nominal = dat.Q_flow_nominal / cp_default / (dat.TCooOut_nominal - dat.TCooIn_nominal), final dp_nominal = dat.dp_nominal, final fanRelPow = dat.fanRelPow); parameter Buildings.Fluid.HeatExchangers.CoolingTowers.Data.DryCooler.Generic dat "Performance data record"; final parameter Modelica.Units.SI.ThermalConductance UA_nominal = per.UA_nominal "Thermal conductance at nominal flow, used to compute heat capacity"; final parameter Real eps_nominal = per.eps_nominal "Nominal heat transfer effectiveness"; final parameter Real NTU_nominal(min = 0) = per.NTU_nominal "Nominal number of transfer units"; Modelica.Blocks.Interfaces.RealInput TDryBul( final min=0, final unit="K", displayUnit="degC") "Entering air dry bulb temperature"; protected Modelica.Blocks.Sources.RealExpression TCooIn( final y = Medium.temperature( Medium.setState_phX( p = port_a.p, h = inStream(port_a.h_outflow), X = inStream(port_a.Xi_outflow)))) "Cooling loop fluid inlet temperature"; Modelica.Blocks.Sources.RealExpression mCoo_flow(final y = port_a.m_flow) "Cooling fluid mass flow rate"; Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.DryCooler per( redeclare final package Medium = Medium, final dat = dat, final m_flow_nominal = m_flow_nominal, final yMin = yMin) "Model for thermal performance"; equation connect(per.y, y); connect(per.TDryBul, TDryBul); connect(per.Q_flow, preHea.Q_flow); connect(per.m_flow, mCoo_flow.y); connect(TCooIn.y, per.TCooIn); end DryCooler;

Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach

Cooling tower with constant approach temperature

Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach

Information

Model for a steady-state or dynamic cooling tower with constant approach temperature. The approach temperature is the difference between the leaving water temperature and the entering air temperature. The entering air temperature is used from the signal TAir. If connected to the a dry-bulb temperature, then a dry cooling tower is modeled. If connected to a wet-bulb temperature, then a wet cooling tower is modeled.

By connecting a signal that contains either the dry-bulb or the wet-bulb temperature, this model can be used to estimate the water return temperature from a cooling tower. For a more detailed model, use for example the YorkCalc model.

Extends from Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTower (Base class for cooling towers).

Parameters

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

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputTLvgLeaving water temperature [K]
input RealInputTAirEntering air dry or wet bulb temperature [K]

Modelica definition

model FixedApproach "Cooling tower with constant approach temperature" extends Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTower; parameter Modelica.Units.SI.TemperatureDifference TApp( min=0, displayUnit="K") = 2 "Approach temperature difference"; Modelica.Blocks.Interfaces.RealInput TAir(min=0, unit="K") "Entering air dry or wet bulb temperature"; protected Modelica.Blocks.Sources.RealExpression QWat_flow( y = m_flow*( Medium.specificEnthalpy(Medium.setState_pTX( p=port_b.p, T=TAir + TApp, X=inStream(port_b.Xi_outflow))) - inStream(port_a.h_outflow))) "Heat input into water"; equation connect(QWat_flow.y, preHea.Q_flow); end FixedApproach;

Buildings.Fluid.HeatExchangers.CoolingTowers.Merkel Buildings.Fluid.HeatExchangers.CoolingTowers.Merkel

Cooling tower model based on Merkel's theory

Buildings.Fluid.HeatExchangers.CoolingTowers.Merkel

Information

Model for a steady-state or dynamic cooling tower with a variable speed fan using Merkel's calculation method.

Thermal performance

To compute the thermal performance, this model takes as parameters the nominal water mass flow rate, the water-to-air mass flow ratio at nominal condition, the nominal inlet air wetbulb temperature, and the nominal water inlet and outlet temperatures. Cooling tower performance is modeled using the effectiveness-NTU relationships for various heat exchanger flow regimes.

The total heat transfer between the air and water entering the tower is computed based on Merkel's theory. The fundamental basis for Merkel's theory is that the steady-state total heat transfer is proportional to the difference between the enthalpy of air and the enthalpy of air saturated at the wetted-surface temperature. This is represented by

dQ̇total = UdA/cp (hs - ha),

where hs is the enthalpy of saturated air at the wetted-surface temperature, ha is the enthalpy of air in the free stream, cp is the specific heat of moist air, U is the cooling tower overall heat transfer coefficient, and A is the heat transfer surface area.

The model also treats the moist air as an equivalent gas with a mean specific heat cpe defined as

cpe = Δh / ΔTwb,

where Δh and ΔTwb are the enthalpy difference and wetbulb temperature difference, respectively, between the entering and leaving air.

For off-design conditions, Merkel's theory is modified to include Sheier's adjustment factors that change the current UA value. The three adjustment factors, based on the current wetbulb temperature, air flow rates, and water flow rates, are used to calculate the UA value as

UAe = UA0 · fUA,wetbulb · fUA,airflow · fUA,waterflow,

where UAe and UA0 are the equivalent and design overall heat transfer coefficent-area products, respectively. The factors fUA,wetbulb, fUA,airflow, and fUA,waterflow adjust the current UA value for the current wetbulb temperature, air flow rate, and water flow rate, respectively. These adjustment factors are third-order polynomial functions defined as

fUA,x = cx,0  + cx,1 x + cx,2 x2 + cx,3 x3,

where x = {(T0,wetbulb - Twetbulb),   ṁair ⁄ ṁ0,air,   ṁwat ⁄ ṁ0,wat} for the respective adjustment factor, and the coefficients cx,0, cx,1, cx,2, and cx,3 are the user-defined values for the respective adjustment factor functions obtained from Buildings.Fluid.HeatExchangers.CoolingTowers.Data.Merkel.BaseClasses.UACorrection. By changing the parameter UACor, the user can update the values in this record based on the performance characteristics of their specific cooling tower.

Comparison with the cooling tower model of EnergyPlus

This model is similar to the model CoolingTower:VariableSpeed:Merkel that is implemented in the EnergyPlus building energy simulation program version 8.9.0. The main differences are:

  1. Not implemented are the basin heater power consumption and the make-up water usage.
  2. The model has no built-in control to switch individual cells of the tower on or off. To switch cells on or off, use multiple instances of this model, and use your own control law to compute the input signal y.

Assumptions

The following assumptions are made with Merkel's theory and this implementation:

  1. The moist air enthalpy is a function of wetbulb temperature only.
  2. The wetted surface temperature is equal to the water temperature.
  3. Cycle losses are not taken into account.

References

EnergyPlus 8.9.0 Engineering Reference, March 23, 2018.

Extends from Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed (Base class for cooling towers with variable speed fan).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Genericdat Performance data
Nominal condition
MassFlowRatem_flow_nominaldat.Q_flow_nominal/cp_defaul...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominaldat.dp_nominalPressure difference [Pa]
Fan
PowerPFan_nominaldat.PFan_nominalFan power at full speed [W]
RealyMin0.3Minimum control signal until fan is switched off (used for smoothing between forced and free convection regime) [1]
fanfanRelPowdat.fanRelPowFan relative power consumption as a function of control signal, fanRelPow=P(y)/P(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputTLvgLeaving water temperature [K]
input RealInputyFan control signal [1]
output RealOutputPFanElectric power consumed by fan [W]
input RealInputTWetBulEntering air wet bulb temperature [K]

Modelica definition

model Merkel "Cooling tower model based on Merkel's theory" extends Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed( final PFan_nominal = dat.PFan_nominal, final m_flow_nominal = dat.Q_flow_nominal / cp_default / (dat.TCooOut_nominal - dat.TCooIn_nominal), final dp_nominal = dat.dp_nominal, final fanRelPow=dat.fanRelPow); parameter Data.Merkel.Generic dat "Performance data"; final parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal(max=0) = dat.Q_flow_nominal "Nominal heat transfer, (negative)"; final parameter Modelica.Units.SI.ThermalConductance UA_nominal=per.UA_nominal "Thermal conductance at nominal flow, used to compute heat capacity"; final parameter Real eps_nominal=per.eps_nominal "Nominal heat transfer effectiveness"; final parameter Real NTU_nominal(min=0)=per.NTU_nominal "Nominal number of transfer units"; Modelica.Blocks.Interfaces.RealInput TWetBul( final min=0, final unit="K", displayUnit="degC") "Entering air wet bulb temperature"; protected Modelica.Blocks.Sources.RealExpression TCooIn( final y=Medium.temperature( Medium.setState_phX( p=port_a.p, h=inStream(port_a.h_outflow), X=inStream(port_a.Xi_outflow)))) "Inlet temperature of cooled fluid"; Modelica.Blocks.Sources.RealExpression mWat_flow(final y=port_a.m_flow) "Water mass flow rate"; Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.Merkel per( redeclare final package Medium = Medium, dat=dat, final yMin=yMin) "Model for thermal performance"; equation connect(per.y, y); connect(per.TWetBul, TWetBul); connect(per.Q_flow, preHea.Q_flow); connect(per.m_flow, mWat_flow.y); connect(TCooIn.y, per.TCooIn); end Merkel;

Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc

Cooling tower with variable speed using the York calculation for the approach temperature

Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc

Information

Model for a steady-state or dynamic cooling tower with variable speed fan using the York calculation for the approach temperature at off-design conditions.

Thermal performance

To compute the thermal performance, this model takes as parameters the inlet and outlet temperatures of the cooling loop and the inlet air wet bulb temperature, and the rejected heat at the design condition. The design mass flow rate (of the chiller condenser loop) is then calculated based on these parameters.

For off-design conditions, the model uses the actual range temperature and a polynomial to compute the approach temperature for free convection and for forced convection, i.e., with the fan operating. The polynomial is valid for a York cooling tower. If the fan input signal y is below the minimum fan revolution yMin, then the cooling tower operates in free convection mode, otherwise it operates in the forced convection mode. For numerical reasons, this transition occurs in the range of y ∈ [0.9*yMin, yMin].

Fan power consumption

The fan power consumption at the design condition can be specified as follows:

In the forced convection mode, the actual fan power is computed as PFan=fanRelPow(y) * PFan_nominal, where the default value for the fan relative power consumption at part load is fanRelPow(y)=y3. In the free convection mode, the fan power consumption is zero. For numerical reasons, the transition of fan power from the part load mode to zero power consumption in the free convection mode occurs in the range y ∈ [0.9*yMin, yMin].
To change the fan relative power consumption at part load in the forced convection mode, points of fan controls signal and associated relative power consumption can be specified. In between these points, the values are interpolated using cubic splines.

Comparison the cooling tower model of EnergyPlus

This model is similar to the model Cooling Tower:Variable Speed that is implemented in the EnergyPlus building energy simulation program version 6.0. The main differences are

  1. Not implemented are the basin heater power consumption, and the make-up water usage.
  2. The model has no built-in control to switch individual cells of the tower on or off. To switch cells on or off, use multiple instances of this model, and use your own control law to compute the input signal y.

Assumptions and limitations

This model requires a medium that has the same computation of the enthalpy as Buildings.Media.Water, which computes

h = cp (T-T0),

where h is the enthalpy, cp = 4184 J/(kg K) is the specific heat capacity, T is the temperature in Kelvin and T0 = 273.15 Kelvin. If this is not the case, the simulation will stop with an error message. The reason for this limitation is that as of January 2015, OpenModelica failed to translate the model if Medium.temperature() is used instead of Water.temperature().

References

EnergyPlus 2.0.0 Engineering Reference, April 9, 2007.

Extends from Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed (Base class for cooling towers with variable speed fan).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Genericdat Performance data
Nominal condition
MassFlowRatem_flow_nominaldat.Q_flow_nominal/cp_defaul...Nominal mass flow rate [kg/s]
PressureDifferencedp_nominaldat.dp_nominalPressure difference [Pa]
Fan
PowerPFan_nominaldat.PFan_nominalFan power at full speed [W]
RealyMin0.3Minimum control signal until fan is switched off (used for smoothing between forced and free convection regime) [1]
fanfanRelPowdat.fanRelPowFan relative power consumption as a function of control signal, fanRelPow=P(y)/P(y=1)
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputTLvgLeaving water temperature [K]
input RealInputyFan control signal [1]
output RealOutputPFanElectric power consumed by fan [W]
input RealInputTWetBulEntering air wet bulb temperature [K]

Modelica definition

model YorkCalc "Cooling tower with variable speed using the York calculation for the approach temperature" extends Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTowerVariableSpeed( final PFan_nominal = dat.PFan_nominal, final m_flow_nominal = dat.Q_flow_nominal / cp_default / (dat.TCooOut_nominal - dat.TCooIn_nominal), final dp_nominal = dat.dp_nominal, final fanRelPow=dat.fanRelPow); parameter Data.YorkCalc.Generic dat "Performance data"; final parameter Modelica.Units.SI.TemperatureDifference TApp_nominal( displayUnit="K") = dat.TCooOut_nominal - dat.TAirInWB_nominal "Design approach temperature (coolant out - air out)"; final parameter Modelica.Units.SI.TemperatureDifference TRan_nominal( displayUnit="K") = dat.TCooIn_nominal - dat.TCooOut_nominal "Design range temperature (coolant in - coolant out)"; Modelica.Blocks.Interfaces.RealInput TWetBul( final min=0, final unit="K", displayUnit="degC") "Entering air wet bulb temperature"; Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.BoundsYorkCalc bou "Bounds for correlation"; Modelica.Units.SI.TemperatureDifference TRan(displayUnit="K") = T_a - T_b "Range temperature"; Modelica.Units.SI.TemperatureDifference TAppAct(displayUnit="K")= Buildings.Utilities.Math.Functions.spliceFunction( pos=TAppCor, neg=TAppFreCon, x=y - yMin + yMin/20, deltax=yMin/20) "Approach temperature difference"; Modelica.Units.SI.MassFraction FRWat=m_flow/mWat_flow_nominal "Ratio actual over design water mass flow ratio"; Modelica.Units.SI.MassFraction FRAir=y "Ratio actual over design air mass flow ratio"; protected package Water = Buildings.Media.Water "Medium package for water"; parameter Real FRWat0(min=0, start=1, fixed=false) "Ratio actual over design water mass flow ratio at nominal condition"; parameter Modelica.Units.SI.MassFlowRate mWat_flow_nominal( min=0, start=m_flow_nominal, fixed=false) "Nominal water mass flow rate"; Modelica.Units.SI.TemperatureDifference dTMax(displayUnit="K") = T_a - TWetBul "Maximum possible temperature difference"; Modelica.Units.SI.TemperatureDifference TAppCor( min=0, displayUnit="K") = Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( TRan=TRan, TWetBul=TWetBul, FRWat=FRWat, FRAir=Buildings.Utilities.Math.Functions.smoothMax( x1=FRWat/bou.liqGasRat_max, x2=FRAir, deltaX=0.01)) "Approach temperature for forced convection"; Modelica.Units.SI.TemperatureDifference TAppFreCon( min=0, displayUnit="K") = (1 - dat.fraFreCon)*dTMax + dat.fraFreCon* Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( TRan=TRan, TWetBul=TWetBul, FRWat=FRWat, FRAir=1) "Approach temperature for free convection"; Modelica.Units.SI.Temperature T_a "Temperature in port_a"; Modelica.Units.SI.Temperature T_b "Temperature in port_b"; protected Modelica.Blocks.Sources.RealExpression QWat_flow(y=m_flow*( Medium.specificEnthalpy( Medium.setState_pTX( p=port_b.p, T=TWetBul + TAppAct, X=inStream(port_b.Xi_outflow))) - inStream(port_a.h_outflow))) "Heat input into water"; initial equation TApp_nominal = Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( TRan=TRan_nominal, TWetBul=dat.TAirInWB_nominal, FRWat=FRWat0, FRAir=1); // this will be solved for FRWat0 mWat_flow_nominal = m_flow_nominal/FRWat0; // Check that a medium is used that has the same definition of enthalpy vs. temperature. // This is needed because below, T_a=Water.temperature needed to be hard-coded to use // Water.* instead of Medium.* in the function calls due to a bug in OpenModelica. assert(abs(Medium.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default) - Water.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default)) < 1E-5 and abs(Medium.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default) - Water.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default)) < 1E-5, "The selected medium has an enthalpy computation that is not consistent with the one in Buildings.Media.Water Use a different medium, such as Buildings.Media.Water."); equation // States at the inlet and outlet if allowFlowReversal then if homotopyInitialization then T_a=Water.temperature(Water.setState_phX(p=port_a.p, h=homotopy(actual=actualStream(port_a.h_outflow), simplified=inStream(port_a.h_outflow)), X=homotopy(actual=actualStream(port_a.Xi_outflow), simplified=inStream(port_a.Xi_outflow)))); T_b=Water.temperature(Water.setState_phX(p=port_b.p, h=homotopy(actual=actualStream(port_b.h_outflow), simplified=port_b.h_outflow), X=homotopy(actual=actualStream(port_b.Xi_outflow), simplified=port_b.Xi_outflow))); else T_a=Water.temperature(Water.setState_phX(p=port_a.p, h=actualStream(port_a.h_outflow), X=actualStream(port_a.Xi_outflow))); T_b=Water.temperature(Water.setState_phX(p=port_b.p, h=actualStream(port_b.h_outflow), X=actualStream(port_b.Xi_outflow))); end if; // homotopyInitialization else // reverse flow not allowed T_a=Water.temperature(Water.setState_phX(p=port_a.p, h=inStream(port_a.h_outflow), X=inStream(port_a.Xi_outflow))); T_b=Water.temperature(Water.setState_phX(p=port_b.p, h=inStream(port_b.h_outflow), X=inStream(port_b.Xi_outflow))); end if; connect(QWat_flow.y, preHea.Q_flow); end YorkCalc;