# Miscellaneous utilities (ht.core)¶

ht.core.LMTD(Thi, Tho, Tci, Tco, counterflow=True)[source]

Returns the log-mean temperature difference of an ideal counterflow or co-current heat exchanger.

\begin{align}\begin{aligned}\Delta T_{LMTD}=\frac{\Delta T_1-\Delta T_2}{\ln(\Delta T_1/\Delta T_2)}\\\begin{split}\text{For countercurrent: } \\ \Delta T_1=T_{h,i}-T_{c,o}\\ \Delta T_2=T_{h,o}-T_{c,i}\end{split}\\\begin{split}\text{Parallel Flow Only:} \\ {\Delta T_1=T_{h,i}-T_{c,i}}\\ {\Delta T_2=T_{h,o}-T_{c,o}}\end{split}\end{aligned}\end{align}
Parameters: Thi : float Inlet temperature of hot fluid, [K] Tho : float Outlet temperature of hot fluid, [K] Tci : float Inlet temperature of cold fluid, [K] Tco : float Outlet temperature of cold fluid, [K] counterflow : bool, optional Whether the exchanger is counterflow or co-current LMTD : float Log-mean temperature difference [K]

Notes

Any consistent set of units produces a consistent output.

References

 [1] (1, 2) Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and David P. DeWitt. Introduction to Heat Transfer. 6E. Hoboken, NJ: Wiley, 2011.

Examples

Example 11.1 in [1].

>>> LMTD(100., 60., 30., 40.2)
43.200409294131525
>>> LMTD(100., 60., 30., 40.2, counterflow=False)
39.75251118049003

ht.core.wall_factor(mu=None, mu_wall=None, Pr=None, Pr_wall=None, T=None, T_wall=None, mu_heating_coeff=0.11, mu_cooling_coeff=0.25, Pr_heating_coeff=0.11, Pr_cooling_coeff=0.25, T_heating_coeff=0.11, T_cooling_coeff=0.25, property_option='Prandtl')[source]

Computes the wall correction factor for heat transfer, mass transfer, or momentum transfer between a fluid and a wall. Utility function; the coefficients for the phenomenon must be provided to this method. The default coefficients are for heat transfer of a turbulent liquid.

The general formula is as follows; substitute the property desired and the phenomenon desired into the equation for things other than heat transfer.

$\frac{Nu}{Nu_{\text{constant properties}}} = \left(\frac{\mu}{\mu_{wall}}\right)^n$
Parameters: mu : float, optional Viscosity of flowing fluid away from the surface, [Pa*s] mu_wall : float, optional Viscosity of the fluid at the wall, [Pa*s] Pr : float, optional Prandtl number of flowing fluid away from the surface, [-] Pr_wall : float, optional Prandtl number of the fluid at the wall, [-] T : float, optional Temperature of flowing fluid away from the surface, [K] T_wall : float, optional Temperature of the fluid at the wall, [K] mu_heating_coeff : float, optional Coefficient for viscosity - surface providing heating, [-] mu_cooling_coeff : float, optional Coefficient for viscosity - surface providing cooling, [-] Pr_heating_coeff : float, optional Coefficient for Prandtl number - surface providing heating, [-] Pr_cooling_coeff : float, optional Coefficient for Prandtl number - surface providing cooling, [-] T_heating_coeff : float, optional Coefficient for temperature - surface providing heating, [-] T_cooling_coeff : float, optional Coefficient for temperature - surface providing cooling, [-] property_option : str, optional Which property to use for computing the correction factor; one of ‘Viscosity’, ‘Prandtl’, or ‘Temperature’. factor : float Correction factor for heat transfer; to be multiplied by the Nusselt number or heat transfer coefficient or friction factor or pressure drop to obtain the actual result, [-]

Examples

>>> wall_factor(mu=8E-4, mu_wall=3E-4, Pr=1.2, Pr_wall=1.1, T=300,
... T_wall=350, property_option='Prandtl')
1.0096172023817749

ht.core.is_heating_property(prop, prop_wall)[source]

Checks whether or not a fluid side is being heated or cooled, from a property of the fluid at the wall and the bulk temperature. Returns True for heating the bulk fluid, and False for cooling the bulk fluid.

Parameters: prop : float Viscosity (or Prandtl number) of flowing fluid away from the heat transfer surface, [Pa*s] prop_wall : float Viscosity (or Prandtl number) of the fluid at the wall, [Pa*s] is_heating : bool Whether or not the flow is being heated up by the wall, [-]

Examples

>>> is_heating_property(1E-3, 1.2E-3)
False

ht.core.is_heating_temperature(T, T_wall)[source]

Checks whether or not a fluid side is being heated or cooled, from the temperature of the wall and the bulk temperature. Returns True for heating the bulk fluid, and False for cooling the bulk fluid.

Parameters: T : float Temperature of flowing fluid away from the heat transfer surface, [K] T_wall : float Temperature of the fluid at the wall, [K] is_heating : bool Whether or not the flow is being heated up by the wall, [-]

Examples

>>> is_heating_temperature(298.15, 350)
True

ht.core.wall_factor_fd(mu, mu_wall, turbulent=True, liquid=False)[source]

Computes the wall correction factor for pressure drop due to friction between a fluid and a wall. These coefficients were derived for internal flow inside a pipe, but can be used elsewhere where appropriate data is missing.

$\frac{f_d}{f_{d,\text{constant properties}}} = \left(\frac{\mu}{\mu_{wall}}\right)^n$
Parameters: mu : float Viscosity (or Prandtl number) of flowing fluid away from the wall, [Pa*s] mu_wall : float Viscosity (or Prandtl number) of the fluid at the wall, [Pa*s] turbulent : bool Whether or not to use the turbulent coefficient, [-] liquid : bool Whether or not to use the liquid phase coefficient; otherwise the gas coefficient is used, [-] factor : float Correction factor for pressure loss; to be multiplied by the friction factor, or pressure drop to obtain the actual result, [-]

Notes

The exponents are determined as follows:

Regime Phase Heating Cooling
Turbulent Liquid -0.25 -0.25
Turbulent Gas 0.1 0.1
Laminar Liquid -0.58 -0.5
Laminar Gas -1 -1

References

 [1] Kays, William M., and Michael E. Crawford. Convective Heat and Mass Transfer. 3rd edition. New York: McGraw-Hill Science/Engineering/Math, 1993.

Examples

>>> wall_factor_fd(mu=8E-4, mu_wall=3E-4, turbulent=True, liquid=True)
0.7825422900366437

ht.core.wall_factor_Nu(mu, mu_wall, turbulent=True, liquid=False)[source]

Computes the wall correction factor for heat transfer between a fluid and a wall. These coefficients were derived for internal flow inside a pipe, but can be used elsewhere where appropriate data is missing. It is also useful to compare these results with the coefficients used in various heat transfer coefficients.

$\frac{Nu}{Nu_{\text{constant properties}}} = \left(\frac{\mu}{\mu_{wall}}\right)^n$
Parameters: mu : float Viscosity (or Prandtl number) of flowing fluid away from the heat transfer surface, [Pa*s] mu_wall : float Viscosity (or Prandtl number) of the fluid at the wall, [Pa*s] turbulent : bool Whether or not to use the turbulent coefficient, [-] liquid : bool Whether or not to use the liquid phase coefficient; otherwise the gas coefficient is used, [-] factor : float Correction factor for heat transfer; to be multiplied by the Nusselt number, or heat transfer coefficient to obtain the actual result, [-]

Notes

The exponents are determined as follows:

Regime Phase Heating Cooling
Turbulent Liquid 0.11 0.25
Turbulent Gas 0.5 0
Laminar Liquid 0.14 0.14
Laminar Gas 0 0

References

 [1] Kays, William M., and Michael E. Crawford. Convective Heat and Mass Transfer. 3rd edition. New York: McGraw-Hill Science/Engineering/Math, 1993.

Examples

>>> wall_factor_Nu(mu=8E-4, mu_wall=3E-4, turbulent=True, liquid=True)
1.1139265634480144

>>> wall_factor_Nu(mu=8E-4, mu_wall=3E-4, turbulent=False, liquid=True)
1.147190712947014

>>> wall_factor_Nu(mu=1.5E-5, mu_wall=1.3E-5, turbulent=True, liquid=False)
1.0741723110591495

>>> wall_factor_Nu(mu=1.5E-5, mu_wall=1.3E-5, turbulent=False, liquid=False)
1.0