FRICTION_LAMINAR
Overview
The FRICTION_LAMINAR function calculates the Darcy friction factor for fluid flowing through a circular pipe under laminar flow conditions. This is a fundamental calculation in fluid mechanics used to determine pressure losses in piping systems when the flow is smooth and orderly.
This implementation uses the fluids library, a comprehensive Python package for fluid dynamics and heat transfer calculations. For detailed documentation, see the fluids.friction module.
The Darcy friction factor (also known as the Darcy-Weisbach friction factor or Moody friction factor) for laminar flow is derived from the exact analytical solution of the Navier-Stokes equations for fully developed, steady-state flow in a circular pipe. The theoretical relationship is:
f_d = \frac{64}{Re}
where f_d is the Darcy friction factor and Re is the Reynolds number, a dimensionless quantity that characterizes the flow regime. The Reynolds number is defined as Re = \frac{\rho v D}{\mu}, where \rho is fluid density, v is flow velocity, D is pipe diameter, and \mu is dynamic viscosity.
This equation is valid for laminar flow in round pipes, which typically occurs when Re < 2040 (based on recent research by Avila et al., 2011). Beyond this critical Reynolds number, the flow transitions to turbulent conditions where different friction factor correlations apply.
Note that experimental studies, such as those by McKeon et al. (2004), suggest that the theoretical f_d = 64/Re relationship may underestimate actual friction factors by approximately 4% on average for Reynolds numbers above 10, likely due to minor flow disturbances in real-world conditions.
This example function is provided as-is without any representation of accuracy.
Excel Usage
=FRICTION_LAMINAR(Re)
Re(float, required): Reynolds number, [-]
Returns (float): Darcy friction factor, [-] str: Error message if inputs are invalid.
Examples
Example 1: Typical laminar flow (Re = 128)
Inputs:
| Re |
|---|
| 128 |
Excel formula:
=FRICTION_LAMINAR(128)
Expected output:
0.5
Example 2: Very low Reynolds number (Re = 10)
Inputs:
| Re |
|---|
| 10 |
Excel formula:
=FRICTION_LAMINAR(10)
Expected output:
6.4
Example 3: Moderate laminar flow (Re = 500)
Inputs:
| Re |
|---|
| 500 |
Excel formula:
=FRICTION_LAMINAR(500)
Expected output:
0.128
Example 4: Near transition Reynolds number (Re = 2000)
Inputs:
| Re |
|---|
| 2000 |
Excel formula:
=FRICTION_LAMINAR(2000)
Expected output:
0.032
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.friction import friction_laminar as fluids_friction_laminar
def friction_laminar(Re):
"""
Calculate the Darcy friction factor for laminar flow using the theoretical solution fd = 64/Re.
See: https://fluids.readthedocs.io/fluids.friction.html#fluids.friction.friction_laminar
This example function is provided as-is without any representation of accuracy.
Args:
Re (float): Reynolds number, [-]
Returns:
float: Darcy friction factor, [-] str: Error message if inputs are invalid.
"""
try:
Re = float(Re)
except (ValueError, TypeError):
return "Error: Could not convert parameters to required types."
# Validate Reynolds number
if Re <= 0:
return "Error: Reynolds number must be positive."
try:
result = fluids_friction_laminar(Re=Re)
# Handle NaN and infinity
if result != result: # NaN check
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 friction_laminar: {str(e)}"