Pipe Network Hardy Cross Simulator Back
Fluid Engineering

Pipe Network Hardy Cross Simulator

Explore the Hardy Cross method, the classic iterative technique for finding the flow distribution in a looped pipe network. Send a total flow through two parallel pipes joining the same pair of nodes, change the resistances and the initial split, and watch in real time how the flow in each pipe converges.

Parameters
Total flow Q
L/s
Total flow passing between the two nodes
Pipe 1 resistance K₁
Upper pipe. h₁ = K₁·Q₁² (Q in m³/s)
Pipe 2 resistance K₂
Lower pipe. h₂ = K₂·Q₂² (Q in m³/s)
Initial guess (pipe 1 share)
%
Starting point of the iteration: share of the total flow assigned to pipe 1
Results
Pipe 1 converged flow (L/s)
Pipe 2 converged flow (L/s)
Head loss (converged) (m)
First flow correction ΔQ (L/s)
Iterations to converge
Flow split ratio
Pipe loop diagram — flow animation

Two pipes, upper and lower, join the two nodes into a loop. The density and speed of the particles reflect the converged flow split, and the head loss is shown on each pipe.

Flow convergence per iteration
Head loss vs pipe-1 flow
Theory & Key Formulas

$$h = K\,Q^{2}, \qquad \Delta Q=-\frac{\sum K\,Q^{2}\,\text{sign}}{\sum 2\,K\,|Q|}$$

Head loss h in each pipe (K: resistance, Q: flow in m³/s) and the loop flow correction ΔQ. The correction ΔQ is applied to every pipe in the loop in the same sense, preserving junction continuity while driving the loop head-loss imbalance to zero.

$$Q_1 = Q\,\frac{\sqrt{K_2}}{\sqrt{K_1}+\sqrt{K_2}}, \qquad Q_2 = Q\,\frac{\sqrt{K_1}}{\sqrt{K_1}+\sqrt{K_2}}$$

Converged flows of the two parallel pipes balanced at h₁ = h₂ (closed form). The iteration converges to these values; this tool actually runs the iteration loop and uses the closed form only as a cross-check.

$$\Delta Q=-\frac{K_1 Q_1^{2}-K_2 Q_2^{2}}{2\,(K_1 Q_1 + K_2 Q_2)}$$

The correction applied to the parallel two-pipe loop. Each iteration sets Q₁ += ΔQ, Q₂ −= ΔQ and repeats until |ΔQ| falls below the tolerance (1e-6 m³/s).

What is the Pipe Network Hardy Cross Simulator?

🙋
I've never heard of the "Hardy Cross method". Is it something for calculating water pipes?
🎓
Exactly — it's a method for water-distribution networks. The mains under a city are not a single branching tree; many pipes connect around into "loops" (closed rings). You want to know the flow in every one of those pipes. But that cannot be solved in one step by hand. Hardy Cross, a structural engineer, published an iterative way to solve it practically in 1936 — long before computers were common.
🙋
Why can't it be solved in one step? Flows look like something you'd just add up.
🎓
Because there are two conditions, and they fight each other. The first is continuity — at every junction, the flow in equals the flow out. The second is energy — go around any closed loop and the head losses sum to zero, meaning you return to the same pressure you started at. The catch is that the head loss in a pipe varies with the square of the flow (h = K·Q²). So the simultaneous equations become non-linear, and you can't solve them by simple substitution.
🙋
Just one squared term changes things that much. How did Hardy Cross actually solve it?
🎓
The idea is beautifully clean. First, guess the pipe flows "any way you like", as long as they satisfy continuity. Those guesses won't satisfy the loop energy condition, so each loop has a small leftover head-loss imbalance. Then compute a "flow correction ΔQ" for the whole loop — the imbalance divided by the loop's sensitivity, which is one step of Newton's method. Add that same correction to every pipe in the loop. Continuity stays intact, and only the energy imbalance shrinks. Repeat, and the corrections get smaller and smaller until the flows converge.
🙋
This tool uses two parallel pipes, right? If I change the initial guess away from 50% with the slider, does it still settle on the same flows?
🎓
Yes — that's the reassuring part of the Hardy Cross method. Whether you set the initial guess to 30% or 70%, the iteration reaches the same converged flows. For two parallel pipes the answer can even be written in closed form: Q₁ = Q·√K₂/(√K₁+√K₂). The pipe with lower resistance carries more flow, exactly as intuition says. Look at the "flow convergence" chart — even from a different start, the curve homes in on the same value. It converges in roughly 3 to 5 iterations.
🙋
If two pipes look like this, then a whole city's hundreds of pipes are handled by computers.
🎓
Right. Modern water-supply simulators (EPANET is the well-known one) use more refined solvers inside, but the starting idea is the same as Hardy Cross — satisfy continuity and energy alternately. The same underlying idea carries over to district-heating grids and gas-distribution networks. The wisdom from the hand-calculation era is still alive today.

Frequently Asked Questions

The Hardy Cross method is an iterative technique for finding the flow distribution in a pipe network that contains loops (closed circuits). You first guess any set of pipe flows that already satisfies continuity at every junction (flow in equals flow out). The guessed flows will not satisfy the loop energy condition (the head losses around a loop must sum to zero), so each loop has a leftover head-loss imbalance. The method computes a flow correction deltaQ that cancels that imbalance with a one-step Newton ratio, and adds the same correction to every pipe in the loop. Repeating this shrinks the correction until the flows converge.
A pipe network must satisfy two conditions at once. Continuity requires that the flow into every junction equals the flow out of it. Energy requires that, around every closed loop, the head losses sum to zero. Because the head loss in a pipe varies with the square of the flow (h = K*Q^2), the resulting set of equations is non-linear and cannot be solved in one step by substitution. In 1936 the structural engineer Hardy Cross published an iterative method that made network analysis practical, decades before computers were widely available.
The correction is deltaQ = -(sum of K*Q^2*sign) / (sum of 2*K*|Q|). The numerator is the loop head-loss imbalance around the loop, and the denominator is the loop's sensitivity to flow (the sum of head-loss derivatives). This is one Newton step against the loop imbalance. The same deltaQ is added in the same sense to every pipe in the loop, which keeps junction continuity intact while driving the loop energy imbalance toward zero.
For two pipes connecting the same pair of nodes, the flow distributes so that the head loss in each pipe is equal. Solving h1 = h2 with h = K*Q^2 gives the converged flows Q1 = Q*sqrt(K2)/(sqrt(K1)+sqrt(K2)) and Q2 = Q*sqrt(K1)/(sqrt(K1)+sqrt(K2)). The pipe with lower resistance carries more flow, distributed in inverse ratio to the square root of the resistance. This tool uses the closed form only as a cross-check and actually runs the Hardy Cross iteration loop to reach the same answer.

Real-World Applications

Water-distribution (supply) network design: The supply mains of a city connect in a grid of loops, from pumping stations and reservoirs all the way to each home. Without knowing how much flows in each pipe and how much the pressure drops at each point, neither pipe diameters nor layout can be decided. The Hardy Cross method is the starting point of this analysis, and although modern water-supply simulators (such as EPANET) use more advanced internal solvers, their skeleton — satisfy continuity and energy simultaneously — is the same.

District heating and cooling networks: In large districts, hot or chilled water is sent from a single energy plant to every building through ring-shaped piping. Because each building's load changes from moment to moment, the flow distribution changes with it. Solving the loop flows and pressure losses lets engineers estimate pump power and confirm that the required temperature and flow reach the far ends.

Gas networks and industrial plant piping: Medium- and low-pressure city-gas networks also contain many loops, and supply to demand points is analysed with the Hardy Cross idea. Systems where a fluid splits across several routes and rejoins — chemical-plant piping or HVAC duct networks — can be handled with the same "remove the loop imbalance by iteration" approach.

Engineering education and an introduction to numerical methods: The Hardy Cross method is a remarkably transparent first example of solving non-linear simultaneous equations iteratively with Newton's method. Once you feel, on the smallest possible loop of two parallel pipes, that "different initial values converge to the same solution", you have the foundation for larger computational fluid analysis and circuit-network analysis. This tool is a teaching aid for building that intuition.

Common Misconceptions and Pitfalls

The most common misconception is to treat the resistance K as a fixed constant. To keep things transparent, this tool fixes K, but in a real pipeline the K in h = K·Q² depends weakly on the flow (Reynolds number) through the friction factor. In the turbulent regime the change in K is small but not strictly zero, and a full analysis updates the friction factor each iteration. Read the tool's result as the exact converged solution for the K you supply.

Next, do not over-trust that the iteration always converges in a few steps. A simple loop of two parallel pipes converges in 3 to 5 iterations, but a large network of many interlocking loops, or an extremely lopsided initial guess, can converge slowly or oscillate. An implementation must always cap the iteration count (about 50 in this tool) so it never enters an infinite loop. When it does not converge, you need to revisit the initial values or switch to a more robust solver.

Finally, the mistake of thinking the correction ΔQ is computed separately for each pipe. The heart of the Hardy Cross method is that ΔQ is computed once for the whole loop and added in the same sense to every pipe in that loop. Correcting each pipe independently would break the continuity condition (flow in equals flow out) at each junction. It is precisely because the same correction is applied loop-wide that you can erase only the energy imbalance while keeping continuity intact. That is why this classic method has not faded.

How to Use

  1. Enter total inflow to the network in L/s (e.g., 100 L/s). This is the constraint that loop flow must satisfy.
  2. Set resistance coefficients for Pipe 1 and Pipe 2 in units of m·s²/L² (typical range 0.001–0.1 for industrial steel pipes). Higher resistance increases head loss per unit flow squared.
  3. Provide an initial guess for flow distribution between the two pipes (e.g., 60 L/s in Pipe 1, 40 L/s in Pipe 2). The simulator iteratively corrects this guess using the Hardy Cross equation: ΔQ = −Σ(hL) / (2·Σ(R·Q)) until convergence within 0.01 L/s.
  4. Run simulation and observe converged flows, head loss across the loop, and number of iterations required.

Worked Example

Given: Total inflow 120 L/s, Pipe 1 resistance R₁ = 0.008 m·s²/L², Pipe 2 resistance R₂ = 0.012 m·s²/L², initial guess Q₁ = 80 L/s and Q₂ = 40 L/s. First iteration calculates head loss: hL1 = 0.008 × 80² = 51.2 m, hL2 = 0.012 × 40² = 19.2 m. Loop imbalance Σ(hL) = 51.2 − 19.2 = 32 m. Correction factor ΔQ = −32 / (2 × (0.008 × 80 + 0.012 × 40)) = −32 / 1.92 ≈ −16.7 L/s. Updated: Q₁ = 63.3 L/s, Q₂ = 56.7 L/s. After 5–7 iterations, converged solution typically yields Q₁ ≈ 72 L/s, Q₂ = 48 L/s with head loss ≈ 41.5 m.

Practical Notes

  1. For symmetrical pipes (R₁ = R₂), convergence is faster (2–3 iterations); asymmetrical networks with R ratio > 5:1 may require 8–12 iterations.
  2. Initial guess quality matters: guessing equal split (60–60 L/s for 120 L/s total) versus poor split (90–30 L/s) changes first correction magnitude from ~5 L/s to ~20 L/s but final result is independent.
  3. Resistance coefficients depend on pipe diameter, length, and roughness; use Darcy-Weisbach f-factors from Moody charts for accurate R values in design calculations.
  4. Divergence occurs only if initial guess violates conservation (sum ≠ total inflow); simulator enforces this constraint automatically.