Heat, fluids & energy

Nonlinear Pipe Network Balance Lab

A small water network on a 3 x 3 lattice of tanks and houses: the steady flows and pressures solved by Newton's method on heads and flows (the global gradient method) in 20 fixed steps under Hazen-Williams or Darcy-Weisbach, shown step by step, with each pipe's flow, speed and head loss, each house's pressure, a Colebrook check, and Hardy Cross's method by hand. Five challenges are scored for you. For learning how flow conservation and nonlinear losses are balanced.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Pipes (row p is pipe p: 1 to 6 the horizontal ones, 7 to 12 the vertical ones; open, diameter) (required)
About this input

The twelve pipes of the lattice, row p for pipe p (1 to 6 left to right, 7 to 12 top to bottom): open (1) or closed (0), and the diameter in mm (50, 75, 100, 150, 200, 250, 300 or 400; kept while closed). A blank row is a closed pipe. Edited on the canvas.

Default 12 rows
ColumnRange or allowed values
Open 0 to 1
Diameter (mm) 50 to 400
Pipe roughness (required)
About this input

The absolute roughness of every pipe wall, 0.001 to 5 mm. Used under Darcy-Weisbach; checked always.

Unit mm Default 0.1 Range 0.001 to 5
Pipe length (required)
About this input

The length of every pipe, 10 to 2,000 m.

Unit m Default 300 Range 10 to 2000
Pressure target (required)
About this input

The pressure head, 0 to 100 m, below which a house is marked and counted.

Unit m Default 20 Range 0 to 100
Your prediction of the split (challenge 1)
When omitted Blank
About this input

Challenge 1: your prediction of the share of the 30 L/s that takes the path through site 2, 0 to 100%. Blank until you predict; the flows stay hidden until then. Not used outside challenge 1.

Unit % Default Not set Range 0 to 100
Mode (required)
About this input

Solver, or By hand: balance the loops yourself with a circulation round each complete square (Hardy Cross). Set with the chip on the canvas.

Default Solver Allowed Solver, By hand
Sites (row k is site k of the 3 x 3 lattice, left to right from the top: type, level or elevation, demand) (required)
About this input

The nine sites of the 3 x 3 lattice, row k for site k (left to right from the top): its type (Off, Junction or Reservoir), its level or elevation in m (a reservoir's water level or a house's ground elevation, 0 to 200) and its demand in L/s (a house's draw, 0 to 200; a tank row carries 0). A site in use needs all three; a blank row is an Off site. Edited on the canvas.

Default 9 rows
ColumnRange or allowed values
Type Off, Junction, Reservoir
Level or elevation (m) 0 to 200
Demand (L/s) 0 to 200
Circulation round square 4 (required)
About this input

The clockwise circulation round square 4 in By hand mode, -100 to 100 L/s; ignored in Solver mode and on an incomplete square. Set with the handle on the canvas.

Unit L/s Default 0 Range -100 to 100
Hazen-Williams C (required)
About this input

The Hazen-Williams C of every pipe, 60 to 150 (higher is smoother). Used under Hazen-Williams; checked always.

Default 130 Range 60 to 150
Friction law (required)
About this input

The head-loss law: Hazen-Williams or Darcy-Weisbach (Swamee-Jain friction factor).

Default Hazen-Williams Allowed Hazen-Williams, Darcy-Weisbach
Challenge (required)
About this input

Selects a challenge: 0 for none, 1 to 5 for a predefined challenge, which loads its own network and settings and leaves only some inputs to you.

Default 0 Range 0 to 5
Head tolerance (required)
About this input

The largest head mismatch that counts as settled, from 0.01 m down to 0.00000001 m.

Default 0.0001 m Allowed 0.01 m, 0.001 m, 0.0001 m, 0.000001 m, 0.00000001 m
Circulation round square 3 (required)
About this input

The clockwise circulation round square 3 in By hand mode, -100 to 100 L/s; ignored in Solver mode and on an incomplete square. Set with the handle on the canvas.

Unit L/s Default 0 Range -100 to 100
Circulation round square 2 (required)
About this input

The clockwise circulation round square 2 in By hand mode, -100 to 100 L/s; ignored in Solver mode and on an incomplete square. Set with the handle on the canvas.

Unit L/s Default 0 Range -100 to 100
Circulation round square 1 (required)
About this input

The clockwise circulation round square 1 in By hand mode, -100 to 100 L/s; ignored in Solver mode and on an incomplete square. Set with the handle on the canvas.

Unit L/s Default 0 Range -100 to 100

Outputs

Network
About this output

Branched (no loop) or Looped. Blank when not valid.

No unit declared
Network cost
About this output

The illustrative cost of the active pipes: cost units per metre by diameter times the length. Blank when not valid.

No unit declared
Pipe length used
About this output

The pipe length used (the challenge's when a challenge is selected), m. Blank when not valid.

Unit m
Steps from 1 cm to 10 nm
About this output

The steps the method takes to shrink the mismatch from 0.01 m to 0.00000001 m: 1 or 2 under Hazen-Williams, more under Darcy-Weisbach. Blank when either is not reached, when the precision floor is above 0.00000001 m, when not valid and while challenge 3 is unsolved.

No unit declared
Formula module versions
About this output

The formula modules the model is built from, with their versions.

No unit declared
Site with the lowest pressure
About this output

The house with the lowest pressure (the lowest-numbered on a tie). Blank as the lowest pressure.

No unit declared
Lowest pressure head
About this output

The lowest pressure head at any house at step 20, m. Blank when not valid and while challenge 1 awaits a prediction or challenge 3 or 4 is unsolved.

Unit m
Model version
About this output

The model version.

No unit declared
Model Status
About this output

NOT VALID with the reason when an input or the network cannot be used; CHECK when the results are shown but need care (not settled, precision, a count on a threshold, negative pressure, a pipe above 5 m/s, or hand mode not available); otherwise OK.

No unit declared
Houses below the target
About this output

The houses whose pressure head is below the target. Blank as the lowest pressure.

No unit declared
Each site at step 20: head, pressure, target flag, tank outflow and the imbalance before the first step
About this output

Each site at step 20: type, level or elevation, demand, head, pressure in m and kPa, the below-target flag, a tank's outflow (negative when it fills) and a house's imbalance before the first step. Heads and pressures follow the challenge withholding.

No unit declared
Total demand
About this output

The total demand of the houses, L/s. Blank when an input is out of range.

Unit L/s
Mode used
About this output

The mode used. Blank when not valid.

No unit declared
Reservoirs (tanks)
About this output

The tanks (Reservoir sites) of the network used. Blank when an input is out of range.

No unit declared
Roughness used
About this output

The roughness used, mm. Blank when not valid.

Unit mm
Each pipe at step 20: flow, direction, speed, head loss, Reynolds number, friction factor, Colebrook check and trial flow
About this output

Each pipe at step 20: its ends, active flag and diameter; for an active pipe its flow, direction, speed, head loss, loss per km, Reynolds number, friction factor and Colebrook difference (Darcy-Weisbach) and the hand-mode trial flow. Results follow the challenge withholding.

No unit declared
Pressure target used
About this output

The pressure target used, m. Blank when not valid.

Unit m
Precision floor
About this output

The smallest head mismatch double precision can resolve here: 1E-12 times (1 + the largest head), m. Blank when not valid.

Unit m
Complete squares
About this output

The squares whose four pipes are all active. Blank when an input is out of range.

No unit declared
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Friction law used
About this output

The friction law used. Blank when not valid.

No unit declared
Largest head mismatch at step 20
About this output

The largest head mismatch at step 20, m (0 below the precision floor). Blank when not valid and while challenge 3 is unsolved.

Unit m
Challenge score
About this output

The challenge score: 100 when met, else 0.

No unit declared
Challenge feedback
About this output

Feedback on the selected challenge: the prediction prompt, the met text or the not-met hint (blank with none).

No unit declared
Active pipes
About this output

The open pipes with neither end Off. Blank when an input is out of range.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the share through site 2 (challenge 1, once predicted), the network cost (2), the largest hand imbalance (3, in By hand mode), the signed flow of pipe 3 (4) or the lowest pressure (5); blank with none or when not valid.

No unit declared
Challenge goal
About this output

The goal of the selected challenge (blank with none).

No unit declared
Junctions (houses)
About this output

The houses (Junction sites) of the network used. Blank when an input is out of range.

No unit declared
Steps to settle
About this output

The first step whose largest head mismatch is within the tolerance (0 to 20); blank when never, when not valid, and while challenge 3 is unsolved.

No unit declared
Each square: complete or not, the circulation, the solver's loop sum and the hand-mode imbalance and Hardy Cross step
About this output

Each square: complete or not; in By hand mode the circulation, the trial imbalance and the Hardy Cross step; and the solver's loop sum at step 20. Results follow the challenge withholding.

No unit declared
Independent loops
About this output

The independent loops: active pipes minus houses (a path from one tank to another counts). Blank when an input is out of range.

No unit declared
The solver film: each step's flows, heads, largest head mismatch, largest flow change and loop sums
About this output

The solver film, steps 0 to 20: each active pipe's flow (L/s, 0 below 0.001), each site's head, the largest head mismatch (0 below the precision floor), the largest flow change and each complete square's loop sum. The flows, heads and loop sums are blank while challenge 1 awaits a prediction; every column but the step while challenge 3 is unsolved; the heads while challenge 4 is unsolved.

No unit declared
Hand mode
About this output

Active, Available (one tank and every loop a complete square, mode Solver) or Not available. Blank when not valid.

No unit declared
Largest loop imbalance by hand
About this output

In By hand mode, the largest head imbalance round a complete square at your circulations, m. Blank otherwise, and while challenge 1 awaits a prediction.

Unit m
Head tolerance used
About this output

The head tolerance used, as a value in m. Blank when not valid.

Unit m
Hazen-Williams C used
About this output

The Hazen-Williams C used. Blank when not valid.

No unit declared
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab solves a small water network: nine sites on a fixed 3 x 3 lattice, joined by up to twelve pipes along the lattice edges. Each site is Off, a house (a Junction, with a ground elevation and a demand) or a tank (a Reservoir, with a fixed water level). Each pipe is open or closed and has one of eight diameters; every pipe shares one length. The model finds the steady flow in every pipe and the head at every house by Newton's method on heads and flows together, the global gradient method, in 20 fixed steps under either the Hazen-Williams or the Darcy-Weisbach head-loss law. It returns every step, so the page can play the solution as a film, and it reports each pipe's flow, speed and head loss, each house's pressure, a Colebrook check of the friction factor and an illustrative pipe cost. In By hand mode the learner balances the loops themselves with Hardy Cross's method. Five scored challenges go with it.

It is a lab for learning how a looped network settles: why water splits between routes so that every route loses the same head, why the head loss grows much faster than the flow, why Newton's method closes in so quickly under one law and more slowly under the other, and what loops buy in pressure and in a second route. It is not a design method for a real water system. The network is idealised (one shared pipe length, no fittings, pumps or valves, tanks whose level never changes, water at 20 C) and the costs are illustrative units, not prices.

The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the lattice with its tanks, houses and pipes, the flow arrows, the shading of each site by its head, and the step-by-step film all come from the model's own frames and result tables. The page computes no flow, head, pressure or head loss itself.

Inputs and units

Input Meaning and unit
Sites Nine rows, one per site, numbered left to right from the top. Each row in use gives the type (Off, Junction or Reservoir), the level or elevation in m (a tank's water level or a house's ground elevation, 0 to 200) and the demand in L/s (a house's draw, 0 to 200). A tank's demand and an Off site's level and demand are not used. A blank row is an Off site. Default: one tank at 55 m (site 4) and eight houses.
Pipes Twelve rows, one per pipe: open (1) or closed (0), and the diameter in mm, one of 50, 75, 100, 150, 200, 250, 300 or 400 (kept while the pipe is closed). Pipes 1 to 6 are the horizontal edges, left to right from the top (1: sites 1 to 2, 2: 2 to 3, 3: 4 to 5, 4: 5 to 6, 5: 7 to 8, 6: 8 to 9); pipes 7 to 12 the vertical ones (7: 1 to 4, 8: 2 to 5, 9: 3 to 6, 10: 4 to 7, 11: 5 to 8, 12: 6 to 9). A blank row is a closed pipe. Default: eleven pipes open, pipe 12 closed.
Friction law Hazen-Williams (default) or Darcy-Weisbach, with the Swamee-Jain friction factor.
Hazen-Williams C From 60 to 150 (default 130); higher is smoother. Used under Hazen-Williams, range-checked always.
Pipe roughness The absolute roughness of every pipe wall, from 0.001 to 5 mm (default 0.1 mm). Used under Darcy-Weisbach, range-checked always.
Pipe length The length of every pipe, from 10 to 2,000 m (default 300 m).
Head tolerance The largest head mismatch that counts as settled: 0.01 m, 0.001 m, 0.0001 m (default), 0.000001 m or 0.00000001 m.
Pressure target From 0 to 100 m of pressure head (default 20 m). A house below it is marked and counted.
Mode Solver (default) or By hand.
Circulation round square 1 to 4 From -100 to 100 L/s each (default 0): the clockwise flow you add round each unit square in By hand mode. Ignored in Solver mode and on a square whose four pipes are not all active.
Challenge number 0 for free exploration, or 1 to 5 to load a challenge.
Your prediction of the split Challenge 1 only: the share of the 30 L/s you expect to take the path through site 2, from 0 to 100%. It starts blank, and a blank means not yet predicted.

The squares are numbered like the sites: square 1 top left (pipes 1, 8, 3, 7), square 2 top right (2, 9, 4, 8), square 3 bottom left (3, 11, 5, 10) and square 4 bottom right (4, 12, 6, 11). A positive flow runs from the lower- numbered end of a pipe to the higher one: left to right, and top to bottom.

Where each input is set:

  • On the canvas only: the sites (type, level and demand, through the site's popover), the pipes (open or closed, and the diameter), the mode chip, and the four circulations, each set by dragging the circular handle inside its square in steps of 0.01 L/s, with an exact entry in its popover. None of these is in the input panel.
  • In the input panel: the friction law, the Hazen-Williams C (shown under Hazen-Williams), the roughness (shown under Darcy-Weisbach), the pipe length, the head tolerance, the pressure target and the challenge number.
  • Your prediction of the split appears in the panel only while challenge 1 is selected.

On the page a tank row carries a demand of 0 and an unused site is a blank row; the model ignores both values.

Governing relationships

Heads and pressures. The head H of a site is the height of the water surface it would hold, in m. A tank's head is its level in every step. A house's pressure head is p = H - z, with z its ground elevation; in kPa it is 9.80665 × p (water of density 1000 kg/m³). Water runs from the higher head to the lower.

The two head-loss laws. For a pipe of diameter D and length L (both in m) carrying a flow Q (in m³/s, positive in the pipe's own direction), the head loss h is positive in the direction of the flow:

  • Hazen-Williams: h = r·Q·|Q|^0.852, with r = K·L / (C^1.852 · D^4.871) and K = 10.6667224661815, the SI form of the textbook US constant 4.727 converted with 0.3048 m per ft and 28.317 L/s per cubic foot per second.
  • Darcy-Weisbach: h = f·k·Q·|Q|, with k = L / (2·g·D·A²), A = π·D²/4 and g = 9.80665 m/s². The friction factor comes from the Swamee-Jain formula f = 0.25 / [log10(ε/(3.7·D) + 5.74/Re^0.9)]², with ε the roughness and the Reynolds number Re = 4·|Q| / (π·D·ν), ν = 1.0×10⁻⁶ m²/s (water at 20 C). Re is held at no less than 4,000 inside the formula, so laminar and transitional flow are not modelled.

Below a flow of 1 mL/s the loss is made linear in Q, with the same value at 1 mL/s, so it stays continuous and every slope stays positive. The slope of the loss, d = n·h/Q, uses n = 1.852 (Hazen-Williams) or 2 (Darcy-Weisbach), and n = 1 below the floor. Under Darcy-Weisbach this slope leaves out how f changes with the flow, so the method there is a quasi-Newton method.

Conservation at each house. The flow into a house minus the flow out equals its demand. Round any closed loop, the head losses taken with their signs add up to zero, because the loop returns to the head it started from.

The global gradient method (Newton's method on heads and flows). Each step starts from the flows Q and heads H of the previous frame. For every active pipe it computes the energy mismatch e = h(Q) - (H_from - H_to), the slope d at Q and a base flow b = Q - e/d. It then forms one linear system M·ΔH = rhs over the houses:

  • the diagonal entry of house i is the sum of 1/d over the active pipes at i (a tank or an Off site gets 1);
  • the entry linking two houses joined by an active pipe is -1/d;
  • the right-hand side of house i is -(its demand + the base flows leaving i - the base flows entering i).

The new heads are H + ΔH (houses only) and the new flows are Q = b + (ΔH_from - ΔH_to)/d. Substituting these flows into each house's balance gives exactly the linear system, so from the first step on every house balances its flow to rounding. What then shrinks, step by step, is the energy mismatch round the loops. This incremental form is the same iteration as the textbook global gradient method, written for the head correction rather than the head.

The start. Every active pipe starts at a speed of 0.3 m/s in its positive direction (Q = 0.3·A), and every house at the highest tank level.

Network counts. A pipe is active when it is open and neither end is Off. The number of independent loops is the active pipes minus the houses (a path from one tank to another counts as a loop). A square is complete when its four pipes are all active. Before any system is solved, the model spreads reachability out from the tanks along active pipes for eight rounds (the longest path in the lattice has eight pipes); a house that is never reached is cut off.

Settling. The residual of frame k is the largest |e| over the active pipes. The precision floor is 1×10⁻¹² × (1 + the largest head size at step 20), the smallest mismatch double precision can resolve for those heads. The tolerance in effect is the larger of your head tolerance and that floor. The steps to settle are the first frame, from 0 to 20, whose residual is within the tolerance in effect. The steps from 1 cm to 10 nm are the first frame within 0.00000001 m minus the first frame within 0.01 m.

Hardy Cross by hand. In By hand mode the trial flow of each pipe is its step-1 flow (which already meets every demand) plus the circulation of each complete square that contains it, taken clockwise: + for the top and right pipes of the square, - for the bottom and left. A circulation adds and removes the same flow at each corner, so continuity holds for any circulations. For each complete square the model returns

  • the trial imbalance: the sum of the four signed head losses at the trial flows, in m (positive means the clockwise losses are too large);
  • the Hardy Cross step: -(trial imbalance) / (the sum of the four slopes d at the trial flows), in L/s: the correction Hardy Cross's method of 1936 would make next.

The Colebrook check. Under Darcy-Weisbach each active pipe also solves the Colebrook equation 1/√f = -2·log10(ε/(3.7·D) + 2.51/(Re·√f)) by 20 fixed-point steps from the Swamee-Jain value, with the same held Re, and reports the difference 100 × (f_Swamee-Jain / f_Colebrook - 1), in %.

Cost. The network cost is the sum over active pipes of the cost per metre of its diameter times the length, with 30, 40, 55, 80, 115, 155, 200 and 310 cost units per metre for 50, 75, 100, 150, 200, 250, 300 and 400 mm.

The one crossing rule. Every threshold test uses one band: a value meets a lower bound T when it is at least T - 1×10⁻⁹ × (1 + |T|), and stays within an upper bound T when it is at most T + 1×10⁻⁹ × (1 + |T|). Ties for the lowest pressure use the same band, and the lowest-numbered house wins.

Calculation sequence

  1. The model checks your values in the order of the status list under Errors and warnings, up to the challenge number and your prediction.
  2. It fixes the values in use: yours, or in a challenge the challenge's network and settings, except the inputs that challenge leaves free.
  3. It classifies the network: active pipes, houses, tanks, loops, complete squares, total demand, and whether each house can be reached from a tank. A network with no tank, no house or a cut-off house is NOT VALID.
  4. It sets frame 0 and runs the 20 Newton steps, each one solving the linear system for the head corrections and updating every flow and head.
  5. It computes each frame's residual, the precision floor, the steps to settle and the steps from 1 cm to 10 nm.
  6. It reads each pipe, site and square at step 20: flow, direction, speed, head loss, Reynolds number, friction factor and Colebrook difference; head, pressure and below-target flag; tank outflow; loop sums.
  7. In By hand mode, when hand mode is available, it forms the trial flows from your circulations and returns each complete square's imbalance and Hardy Cross step.
  8. It sets the status and, in a challenge, scores the challenge and withholds what the challenge keeps back.

Outputs and interpretation

  • Lowest pressure head (m) at any house at step 20, and the site with the lowest pressure.
  • Steps to settle: the first step, 0 to 20, at which the largest head mismatch is within the tolerance in effect; blank when it never is. The results shown are always those of step 20; the count says when they became good enough.
  • Network: Branched (no loop) or Looped; independent loops, total demand (L/s), houses below the target, and the counts of houses, tanks, active pipes and complete squares.
  • Hand mode: Active, Available (one tank and every loop a complete square, but the mode is Solver) or Not available; the largest loop imbalance by hand (m) while it is active.
  • Network cost in cost units; the largest head mismatch at step 20 (m, 0 below the precision floor); the steps from 1 cm to 10 nm, typically 1 or 2 under Hazen-Williams and more under Darcy-Weisbach; the precision floor (m).
  • Each pipe at step 20: its ends, whether it is active, the diameter, flow (L/s), direction, speed (m/s), head loss (m), loss per km (m/km), Reynolds number (the actual value, before the 4,000 hold), friction factor and Colebrook difference (%, both under Darcy-Weisbach only) and the hand-mode trial flow. A flow below 0.001 L/s reads 0, with no direction, speed or head loss.
  • Each site at step 20: type, level or elevation, demand, head, pressure in m and kPa, the below-target flag, a tank's outflow (L/s, negative when the tank fills) and a house's imbalance before the first step (negative where water is missing).
  • Each square: complete or not, the circulation and the trial imbalance and Hardy Cross step in By hand mode, and the solver's loop sum at step 20.
  • The solver film: frames 0 to 20, each with every active pipe's flow, every site's head, the largest head mismatch, the largest flow change and each complete square's loop sum. Mismatches and loop sums below the precision floor read 0.
  • Settings used: the pipe length, friction law, C, roughness, head tolerance (as a value in m), pressure target and mode in effect (the challenge's while a challenge is selected), and the model and module versions.

Reading the canvas: arrows on each pipe show the direction of flow at the frame shown, and each site is shaded by its head in that frame, on a scale set from the film's own range of heads. Playing the film shows the first step fixing every house's balance at once and the later steps removing the mismatch round the loops. Under Hazen-Williams the mismatch falls roughly by squaring each step (quadratic convergence); under Darcy-Weisbach it falls by a steadier factor each step, because the slope leaves out how the friction factor changes with the flow.

What to take from the lab: water divides between routes until each route from the same tank to the same house loses the same head, and because the loss grows with nearly the square of the flow while falling with nearly the fifth power of the diameter, a slightly wider pipe draws a much larger share. Loops cost more pipe but keep more pressure and give each house a second route.

Challenges

Selecting a challenge loads its own network and settings and leaves only the inputs it names to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. Every challenge uses Hazen-Williams.

  1. Predict the split (introductory). A tank feeds one house drawing 30 L/s by two paths, one of them through site 2 whose two pipes are 200 mm instead of 150 mm. Predict what share of the 30 L/s takes the path through site 2. It is met when your prediction is within 3 percentage points of the share the model computes. The value scored is that share, in %.
  2. Meet the pressure on a budget (intermediate). A tank at 45 m feeds eight houses through the full grid of 150 mm pipes. Change only the diameters of the four highlighted pipes (1, 2, 7 and 10) so that every house keeps at least 20 m of pressure for a total pipe cost of at most 376,000. The value scored is the network cost.
  3. Balance by hand (intermediate). A network with two complete squares, in By hand mode. Set the two circulations so that each loop's head imbalance is within 0.01 m. The value scored is the largest loop imbalance.
  4. Neither fill nor drain (advanced). Three tanks meet at one junction. Set the middle tank's water level, to 0.1 m, so that its pipe (pipe 3) carries less than 0.5 L/s either way. The value scored is the signed flow of pipe 3.
  5. Make it a tree (advanced). A tank at 60 m feeds eight houses through the full grid of 200 mm pipes. Switch pipes off until no loop is left and every house is still connected, keeping at least 42 m of pressure at every house. It is met when the network has no loop and the lowest pressure meets 42 m. The value scored is the lowest pressure.

Held-back results. Challenge 1 holds back its answer until you predict: while your prediction is blank, every flow, head, pressure, flow change and loop sum is blank, the canvas draws no flow arrows or head shading, and the feedback asks you to predict first. Any prediction, 0 included, reveals everything, met or not. Challenge 3 withholds the solver's flows, heads, pressures, loop sums, settling counts and lowest pressure until it is met, so the canvas shows only your trial flows. Challenge 4 withholds the heads and pressures, the head losses and the friction values until it is met; the flows and their directions stay, as they are the feedback. Challenges 2 and 5 withhold nothing.

Validation and status logic

The status reads the first match in the list under Errors and warnings. The first fourteen checks read the values you entered, whether or not the selected law, mode or challenge uses them; the network checks (no tank, no house, a cut-off house) read the network in use, which in a challenge is the challenge's. The CHECK items apply inside challenges too and never change a MET decision. A challenge number that is not a whole number from 0 to 5 counts as no challenge selected.

Assumptions and limitations

  • Steady flow of water at 20 C on a 3 x 3 lattice; one length for every pipe; no fittings or minor losses, pumps or valves; tank levels fixed.
  • Hazen-Williams is an empirical law for water in turbulent flow. Under Darcy-Weisbach the Reynolds number is held at no less than 4,000, so a slow pipe shows its actual Reynolds number beside a friction factor taken at 4,000.
  • Swamee-Jain is stated for relative roughness from 1×10⁻⁶ to 1×10⁻²; outside it, for example a 5 mm roughness in a 50 mm pipe, the Colebrook column shows the difference.
  • Below 1 mL/s a pipe's loss is linear in the flow; flows below 0.001 L/s read 0.
  • Exactly 20 Newton steps, with no test that stops early. In ordinary networks the mismatch falls far below the tolerance well before step 20; a network that has not settled by step 20 reads CHECK.
  • Very large heads (only with extreme inputs) cannot be resolved to the finest tolerance in double precision; the settling count then uses the precision floor and the status says so.
  • Hand mode needs exactly one tank and every loop to be a single complete square; a loop round two squares is not offered.
  • Costs are illustrative units by diameter, not prices. Negative pressures are solved but would not occur in a real main, which would draw in air instead.

Restrictions and non-computing states

Under NOT VALID every result and every table is blank, except the model and module versions; the challenge status (No challenge selected, or NOT MET when a challenge is selected), a score of 0, and the goal and not-met hint of a selected challenge. When only the network checks fail (no tank, no house or a cut-off house) and every entered value is in range, the counts of houses, tanks, active pipes, loops and complete squares and the total demand stay, because they explain the refusal.

In challenges 1, 3 and 4 the results listed under Challenges stay blank until the challenge allows them.

Before the model runs, the page refuses a site row that is in use but lacks its type, level or demand, a pipe row that lacks its open flag or diameter, and a blank list choice; these are refused at entry rather than reported by the model.

Errors and warnings

The status messages, first match wins (n is the lowest failing site or pipe):

  • NOT VALID: site n needs a type: Off, Junction or Reservoir
  • NOT VALID: site n needs a level from 0 to 200 m (a reservoir's water level or a junction's ground elevation)
  • NOT VALID: site n needs a demand from 0 to 200 L/s
  • NOT VALID: pipe n must be open (1) or closed (0)
  • NOT VALID: pipe n needs a diameter from the list: 50, 75, 100, 150, 200, 250, 300 or 400 mm
  • NOT VALID: the pipe length must be from 10 to 2,000 m
  • NOT VALID: choose the friction law from the list
  • NOT VALID: the Hazen-Williams C must be from 60 to 150
  • NOT VALID: the roughness must be from 0.001 to 5 mm
  • NOT VALID: choose the head tolerance from the list
  • NOT VALID: the pressure target must be from 0 to 100 m
  • NOT VALID: choose the mode from the list: Solver or By hand
  • NOT VALID: each loop circulation must be from -100 to 100 L/s
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and the split prediction blank or from 0 to 100%
  • NOT VALID: the network needs at least one reservoir
  • NOT VALID: the network needs at least one junction
  • NOT VALID: site n is cut off from every reservoir, so its pressure is undefined: the lowest house that no chain of active pipes connects to a tank.
  • CHECK: after 20 steps the largest head mismatch is still above the tolerance; the results shown are those of step 20
  • CHECK: the heads are so large that double precision cannot reach the chosen tolerance; steps are counted to one part in 10^12 of the largest head instead: your tolerance is below the precision floor.
  • CHECK: a head mismatch lies within 0.1% of a counting threshold, so another engine may count one step more or fewer: a frame's mismatch sits within 0.1% of the tolerance in effect, 0.01 m or 0.00000001 m.
  • CHECK: site n has negative pressure: a real main would draw in air or collapse there, though the model still solves it
  • CHECK: pipe n runs faster than 5 m/s; real mains stay below about 3 m/s, so expect very large head losses
  • CHECK: balancing by hand needs exactly one reservoir; the solver's flows are shown, or ... needs at least one loop, and a branched network has none; ..., or ... needs every loop to be a single complete square; open the pipes inside the larger loop; ...: By hand is selected but hand mode is not available, for the first of these reasons that applies.
  • OK

References

This laboratory is an educational model of a small looped water network. Each pipe loses head by the Hazen-Williams law, or by the Darcy-Weisbach law with the Swamee-Jain friction factor, and a Colebrook solution is shown beside it as a check. The flows and heads are found together by Newton's method, in the global gradient form of Todini and Pilati, so every house balances its flow and the head losses round every loop cancel. A by-hand mode applies Hardy Cross's loop corrections of 1936, the first practical method for networks of pipes.

Sources and further reading

  • The Darcy-Weisbach equation, the Colebrook and Swamee-Jain friction factors, and the Hardy Cross method for simple pipe networks: E. Maurer, Hydraulics and Water Resources: Examples Using R, Santa Clara University, 2024, chapter 4, Water flowing in pipes: energy losses (sections 4.2 to 4.5 and 4.8). Santa Clara University online textbook
  • The Colebrook friction-factor equation: C. F. Colebrook, "Turbulent flow in pipes, with particular reference to the transition region between the smooth and rough pipe laws", Journal of the Institution of Civil Engineers 11(4), 1939, pages 133-156. doi:10.1680/ijoti.1939.13150
  • The history of Hardy Cross's loop-correction method and its Newton-Raphson basis: D. Brkić and P. Praks, "Short overview of early developments of the Hardy Cross type methods for computation of flow distribution in pipe networks", Applied Sciences 9(10), 2019, article 2019. arXiv:1904.08488
  • The original loop-balancing method: H. Cross, Analysis of Flow in Networks of Conduits or Conductors, University of Illinois Engineering Experiment Station, Bulletin No. 286, 1936.
  • The explicit friction factor: P. K. Swamee and A. K. Jain, "Explicit equations for pipe-flow problems", Journal of the Hydraulics Division (ASCE) 102(5), 1976, pages 657-664.
  • The global gradient method for looped networks: E. Todini and S. Pilati, "A gradient algorithm for the analysis of pipe networks", in B. Coulbeck and C. Orr (editors), Computer Applications in Water Supply, volume 1, Systems Analysis and Simulation, Research Studies Press, 1988, pages 1-20.
  • The Hazen-Williams formula: G. S. Williams and A. Hazen, Hydraulic Tables, John Wiley and Sons, 1905.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; a real water main needs fittings, pumps, varying tank levels and a qualified engineer's design, none of which this idealised network includes.

Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms