Top-down pipe network with live pressure heads, velocities, a 24-hour demand pattern and a leak.
The science
Water flows from the reservoir through two looped pipe rings to six demand nodes. In each pipe the head loss follows Hazen-Williams: h = 10.67 L Q^1.852 / (C^1.852 D^4.871) (SI units). At every node the inflow equals the demand, and pressure head is the hydraulic head minus the ground elevation, p/(rho g) = H - z. The page solves all six node heads together with a damped Newton method.
As an independent check the loop-flow method of Hardy Cross is run from a deliberately wrong (but mass-balanced) flow: each loop is corrected by dQ = -sum(h) / sum(1.852 h/Q) until the flows agree with the Newton solution. Demand follows a 24-hour pattern with a morning and an evening peak. A leak is a pressure-dependent outflow q = q0 sqrt(p / 30 m) at node 5.
Simplifications: steady state at each instant (no water hammer, no tank filling), one fixed-head source standing for the pump and reservoir, a made-up small town, no pipe ageing within the day, and no minor losses.