Hydraulic engineering domain knowledge for OpenSolve Pipe development. Use when implementing solvers, adding components, or reviewing hydraulic calculations.
fluids.friction.friction_factor(Re, eD)1/√f = -2.0 × log₁₀((ε/D)/3.7 + 2.51/(Re×√f))
ε = absolute roughness (ft or m)D = pipe inner diameter (ft or m)Re = Reynolds number (dimensionless)| Fitting | L/D |
|---|---|
| 90° LR Elbow | 20 |
| 90° SR Elbow | 30 |
| 45° Elbow | 16 |
| Gate Valve (open) | 8 |
| Ball Valve (open) | 3 |
| Swing Check | 50 |
| Tee (through) | 20 |
| Tee (branch) | 60 |
K-Factor Calculation from L/D:
K = f × (L/D)
where f is the Darcy friction factor
| Material | Roughness (ft) | Roughness (mm) |
|---|---|---|
| Carbon Steel | 0.00015 | 0.046 |
| Stainless Steel | 0.00005 | 0.015 |
| PVC | 0.000005 | 0.0015 |
| HDPE | 0.000023 | 0.007 |
| Ductile Iron | 0.00083 | 0.25 |
| GRP (Fiberglass) | 0.000033 | 0.01 |
h_f = f × (L/D) × (v²/2g)