pipe-flow-reynolds
v1.0.3
Published
Pipe flow calculations: Reynolds number, flow regime, Darcy friction factor (Colebrook/Haaland) and Darcy-Weisbach pressure drop.
Downloads
140
Maintainers
Readme
pipe-flow-reynolds
Internal (pipe) flow calculations, done properly and without dependencies:
- Reynolds number and laminar / transitional / turbulent regime
- Darcy friction factor
- laminar
64/Re - Haaland explicit approximation (no iteration)
- full Colebrook–White solved iteratively (seeded from Haaland)
- laminar
- Darcy–Weisbach head loss and pressure drop
- volumetric flow rate for a circular pipe
Everything is SI. nu is kinematic viscosity (m²/s); if you only have dynamic
viscosity mu (Pa·s) and density, use reynoldsFromDynamic.
Quick start
const pf = require('pipe-flow-reynolds');
// Water, 2 m/s in a 50 mm pipe (nu ≈ 1e-6 m²/s)
const Re = pf.reynolds(2, 0.05, 1e-6); // 1e5
pf.regime(Re); // 'turbulent'
// commercial steel, eps/D ≈ 1e-4
const f = pf.frictionFactor(Re, 1e-4); // ~0.0185 via Colebrook
// pressure drop over 100 m
pf.pressureDrop(f, 100, 0.05, 2, 1000); // PaFriction factor
frictionFactor(Re, relRoughness) picks the right correlation for you: 64/Re
below Re = 2300, Colebrook–White otherwise. If you specifically want one method:
pf.laminarFriction(2000); // 0.032
pf.haalandFriction(1e5, 1e-4); // explicit, ~2% of Colebrook
pf.colebrookFriction(1e5, 1e-4); // iterated, tight tolerancerelRoughness is the relative roughness eps/D (dimensionless). Pass 0 for a
hydraulically smooth pipe.
Transitional flow (2300 < Re < 4000) has no reliable single correlation.
frictionFactoruses the turbulent branch there; treat the result with care.
License
MIT
