Steady flows in every pipe of a looped water network and the head loss from the source to every node, by Hardy Cross loop corrections (finished with simultaneous loop corrections to full precision), Hazen-Williams friction. Nodes are numbered 1..N; node 1 is the source and supplies the total demand.
\Delta Q = -\frac{\sum k\,Q|Q|^{0.852}}{1.852\sum k|Q|^{0.852}},\quad k = \frac{10.67L}{C^{1.852}D^{4.871}}
Inputs
pipes pipes as node pairs 1-2, 2-3, ... (the flow sign follows this direction) edgesL pipe lengths in m (in pipe order) vectorD pipe diameters in mm (in pipe order) vectorC Hazen-Williams C of each pipe (in pipe order) vectordemands demand at nodes 1..N in m^3/s (node 1, the source, takes 0) vector
Returns
flows flow in each pipe, positive from its first to its second node (m^3/s) [m^3/s]head_loss head loss from node 1 to each node (m) [m]loops independent loopsiterations Hardy Cross sweeps before the Newton finish
Applies when
- one source (node 1)
- connected network
- 40 <= C <= 160
- demands >= 0
Example
m.ask("Hardy cross network with pipe list = [1-2, 2-3, 3-4, 4-1, 2-4], lengths = [600, 500, 600, 500, 780], diameters = [300, 250, 200, 250, 200], C factors = [120, 120, 120, 120, 120] and node demands = [0, 0.04, 0.05, 0.03].")
→ flows = [0.0714399845267, 0.0331343839504, -0.0168656160496, -0.0485600154733, -0.00169439942369] m^3/s, head_loss = [0.0, 2.39874834362, 3.56973630784, 2.37675423164] m, loops = 2, iterations = 14