CHURCHILL
Overview
The CHURCHILL function calculates the Darcy friction factor using the Churchill (1977) correlation, a universal equation that provides continuous predictions across laminar, transition, and turbulent flow regimes. This makes it particularly valuable for engineering applications where flow conditions may vary or where smooth transitions between regimes are required.
The friction factor is fundamental to pressure drop calculations in pipe flow, appearing in the Darcy-Weisbach equation for head loss. While many correlations exist only for specific flow regimes, the Churchill equation uniquely spans all three regimes with a single explicit formula.
The correlation is defined as:
f = 2 \left[ \left(\frac{8}{\text{Re}}\right)^{12} + (A_2 + A_3)^{-1.5} \right]^{1/12}
where the intermediate terms are:
A_2 = \left\{ 2.457 \ln\left[ \left(\frac{7}{\text{Re}}\right)^{0.9} + 0.27 \frac{\varepsilon}{D} \right] \right\}^{16}
A_3 = \left( \frac{37530}{\text{Re}} \right)^{16}
Here, \text{Re} is the Reynolds number (dimensionless ratio of inertial to viscous forces), and \varepsilon/D is the relative roughness (pipe wall roughness divided by pipe diameter).
This implementation uses the fluids library, a comprehensive Python package for fluid dynamics calculations. For more details on the underlying implementation and alternative friction factor correlations, see the fluids.friction documentation.
The original correlation was published by Stuart W. Churchill in “Friction factor equation spans all fluid flow regimes,” Chemical Engineering Journal 91, 91-92 (1977).
This example function is provided as-is without any representation of accuracy.
Excel Usage
=CHURCHILL(Re, eD)
Re(float, required): Reynolds number, [-]eD(float, required): Relative roughness, [-]
Returns (float): Darcy friction factor, [-], or error message (str) if input is invalid.
Examples
Example 1: Laminar flow regime (Re = 1000)
Inputs:
| Re | eD |
|---|---|
| 1000 | 0.0001 |
Excel formula:
=CHURCHILL(1000, 0.0001)
Expected output:
0.064
Example 2: Turbulent flow regime (Re = 100000)
Inputs:
| Re | eD |
|---|---|
| 100000 | 0.0001 |
Excel formula:
=CHURCHILL(100000, 0.0001)
Expected output:
0.0185
Example 3: Transition flow regime (Re = 3000)
Inputs:
| Re | eD |
|---|---|
| 3000 | 0.0001 |
Excel formula:
=CHURCHILL(3000, 0.0001)
Expected output:
0.043
Example 4: Higher roughness value (Re = 100000, eD = 0.01)
Inputs:
| Re | eD |
|---|---|
| 100000 | 0.01 |
Excel formula:
=CHURCHILL(100000, 0.01)
Expected output:
0.038
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.friction import Churchill_1977 as fluids_churchill_1977
def churchill(Re, eD):
"""
Calculate Darcy friction factor using the Churchill (1977) universal equation for all flow regimes.
See: https://fluids.readthedocs.io/fluids.friction.html#fluids.friction.Churchill_1977
This example function is provided as-is without any representation of accuracy.
Args:
Re (float): Reynolds number, [-]
eD (float): Relative roughness, [-]
Returns:
float: Darcy friction factor, [-], or error message (str) if input is invalid.
"""
try:
Re = float(Re)
eD = float(eD)
except (ValueError, TypeError):
return "Error: Could not convert parameters to required types."
if Re <= 0:
return "Error: Reynolds number must be positive."
if eD < 0:
return "Error: Relative roughness cannot be negative."
try:
result = fluids_churchill_1977(Re=Re, eD=eD)
if result != result: # Check for NaN
return "nan"
if result == float('inf'):
return "inf"
if result == float('-inf'):
return "-inf"
return float(result)
except Exception as e:
return f"Error computing churchill: {str(e)}"