WALL_FACTOR_FD
This function computes a wall-property correction factor for pressure-drop or friction-factor correlations. It modifies constant-property friction predictions based on the ratio of bulk to wall viscosity (or Prandtl number analog).
The correction is expressed as:
\frac{f_d}{f_{d,cp}} = \left(\frac{\mu}{\mu_{wall}}\right)^n
The exponent n is selected from empirical values based on flow regime (laminar or turbulent) and phase model (liquid or gas).
Excel Usage
=WALL_FACTOR_FD(mu, mu_wall, turbulent, liquid)
mu(float, required): Viscosity of fluid away from the wall (Pa*s).mu_wall(float, required): Viscosity of the fluid at the wall (Pa*s).turbulent(bool, optional, default: true): Whether turbulent coefficients are used.liquid(bool, optional, default: false): Whether liquid-phase coefficients are used.
Returns (float): Wall correction factor for friction factor or pressure drop (-).
Example 1: Turbulent liquid pressure drop factor
Inputs:
| mu | mu_wall | turbulent | liquid |
|---|---|---|---|
| 0.0008 | 0.0003 | true | true |
Excel formula:
=WALL_FACTOR_FD(0.0008, 0.0003, TRUE, TRUE)
Expected output:
0.782542
Example 2: Laminar liquid pressure drop factor
Inputs:
| mu | mu_wall | turbulent | liquid |
|---|---|---|---|
| 0.0008 | 0.0003 | false | true |
Excel formula:
=WALL_FACTOR_FD(0.0008, 0.0003, FALSE, TRUE)
Expected output:
0.566159
Example 3: Turbulent gas pressure drop factor
Inputs:
| mu | mu_wall | turbulent | liquid |
|---|---|---|---|
| 0.000015 | 0.000013 | true | false |
Excel formula:
=WALL_FACTOR_FD(0.000015, 0.000013, TRUE, FALSE)
Expected output:
1.01441
Example 4: Laminar gas pressure drop factor
Inputs:
| mu | mu_wall | turbulent | liquid |
|---|---|---|---|
| 0.000015 | 0.000013 | false | false |
Excel formula:
=WALL_FACTOR_FD(0.000015, 0.000013, FALSE, FALSE)
Expected output:
0.866667
Python Code
Show Code
from ht.core import wall_factor_fd as ht_wall_factor_fd
def wall_factor_fd(mu, mu_wall, turbulent=True, liquid=False):
"""
Compute a wall correction factor for frictional pressure loss.
See: https://ht.readthedocs.io/en/latest/ht.core.html
This example function is provided as-is without any representation of accuracy.
Args:
mu (float): Viscosity of fluid away from the wall (Pa*s).
mu_wall (float): Viscosity of the fluid at the wall (Pa*s).
turbulent (bool, optional): Whether turbulent coefficients are used. Default is True.
liquid (bool, optional): Whether liquid-phase coefficients are used. Default is False.
Returns:
float: Wall correction factor for friction factor or pressure drop (-).
"""
try:
return ht_wall_factor_fd(mu, mu_wall, turbulent=turbulent, liquid=liquid)
except Exception as e:
return f"Error: {str(e)}"