Nodal Newton-Raphson analysis for looped pipe networks — flow distribution, pressure heads, and friction factors via Darcy-Weisbach / Colebrook-White. Equivalent to Hardy-Cross but handles arbitrary topologies.
| ID | Label | Elev (m) | Type | Head/Flow | |
|---|---|---|---|---|---|
m HGL | |||||
L/s | |||||
L/s | |||||
L/s | |||||
L/s |
Reservoir: HGL = fixedHead + elevation. Free: extQ L/s (negative = demand, 0 = junction).
Define the network and click Solve Network
Default: 2-loop, 5-node, 6-pipe example with 8 L/s demand at node E.
Pipe flow: Q = sign(ΔH) · √(|ΔH| / r), where r = fL / (D A² · 2g) — Darcy-Weisbach head-loss formula.
Friction factor: Swamee-Jain approximation to Colebrook-White (±1%), updated after each Newton convergence.
Nodal NR: Residual F_i = extQ_i + Σ Q_into_i; Jacobian ∂F_i/∂H_j = ±1/(2√|ΔH|·r). Converges quadratically.
Fluid: Water at 20°C (ν = 1.004 × 10⁻⁶ m²/s). Change ν in code for other fluids.
Reservoir: Fixed piezometric HGL = fixedHead + elevation. Minor losses not included (add as equivalent length if needed).