VON_KARMAN
Calculates the limiting Darcy friction factor for fully rough flow from relative roughness using the von Karman relation. This represents the asymptotic infinite-Reynolds-number rough-pipe limit where friction depends only on \epsilon/D and no longer varies with Reynolds number.
The limiting relation is:
\frac{1}{\sqrt{f_d}} = -2\log_{10}\left(\frac{\epsilon/D}{3.7}\right)
Although real flows always have finite Reynolds number, this expression is useful as a fully rough reference curve and limiting case.
Excel Usage
=VON_KARMAN(eD)
eD(float, required): Relative roughness, [-]
Returns (float): Limiting Darcy friction factor for fully rough flow [-]
Example 1: Typical commercial pipe roughness
Inputs:
| eD |
|---|
| 0.0001 |
Excel formula:
=VON_KARMAN(0.0001)
Expected output:
0.0119798
Example 2: Moderate roughness pipe
Inputs:
| eD |
|---|
| 0.001 |
Excel formula:
=VON_KARMAN(0.001)
Expected output:
0.0196355
Example 3: Very smooth pipe (small eD)
Inputs:
| eD |
|---|
| 0.00001 |
Excel formula:
=VON_KARMAN(0.00001)
Expected output:
0.00806325
Example 4: Very rough pipe (large eD)
Inputs:
| eD |
|---|
| 0.05 |
Excel formula:
=VON_KARMAN(0.05)
Expected output:
0.0715507
Python Code
Show Code
from fluids.friction import von_Karman as fluids_von_karman
def von_karman(eD):
"""
Calculate Darcy friction factor for rough pipes at infinite Reynolds number from the von Karman equation.
See: https://fluids.readthedocs.io/fluids.friction.html#fluids.friction.von_Karman
This example function is provided as-is without any representation of accuracy.
Args:
eD (float): Relative roughness, [-]
Returns:
float: Limiting Darcy friction factor for fully rough flow [-]
"""
try:
eD = float(eD)
if eD <= 0:
return "Error: eD must be positive."
result = fluids_von_karman(eD=eD)
if result != result:
return "Error: Result is NaN."
if result == float('inf') or result == float('-inf'):
return "Error: Result is not finite."
return float(result)
except Exception as e:
return f"Error: {str(e)}"