← Back to the calculator

How the sprinkler hydraulic calculator works

A sprinkler system is a pipe network with leaks on purpose. The calculator finds the pressure needed at its source so that every open head gives at least its required flow, then asks whether the water supply can give that pressure at that flow. Everything below runs in your browser, and the same code runs from the command line.

The three relations

Friction in each pipe is Hazen-Williams in the form NFPA 13 prints, with flow Q in gpm, inside diameter d in inches and the roughness coefficient C:

p = 4.52 Q1.85 / (C1.85 d4.87) psi per foot

The length is the pipe plus its fittings' equivalent length, which you type as fit=. Each foot of rise costs 0.433 psi. A head discharges Q = K√P, with P its pressure in psi. Inside diameters for schedule 10 and 40 steel come from the outside diameters and wall thicknesses in ASME B36.19M and B36.10M; any other pipe takes its inside diameter as id=.

Solving every pipe at once

A hand calculation starts at the most remote head with its required flow, adds the friction to the next head, takes that head's flow from its pressure, and carries the sum back toward the riser. Where two paths meet at different pressures it corrects one with a K-factor for the whole branch. That works for a tree. In a loop or a grid the split of flow between paths is unknown until the pressures are, and the hand method turns into an iteration such as Hardy Cross.

This calculator uses the global gradient algorithm of Todini and Pilati (1988), the method EPANET uses (Rossman, EPANET 2.2 User Manual, US EPA, 2020). It is Newton's method on all pipe flows and node pressures together: each step linearises every pipe's loss about its current flow, solves one symmetric linear system for the node heads, and updates the flows from them. Trees, loops and grids are the same problem to it. Each head is modelled the way EPANET models an emitter, as an extra link from its node to a point at zero pressure with loss (Q/K)2. A head cannot draw water in, so if a node's pressure would go below zero its head is shut, like a check valve, and reopened when the pressure comes back. On the example grid the solve takes 6 Newton steps; across the 61 test networks the median is 7.

The design point

Each open head must give the larger of the density times the area it covers and K√(minimum pressure). The calculator finds the lowest pressure at the source at which every head meets its flow, by bisection on the source pressure with a full network solve at each trial. The head that just meets its flow is the most demanding one. Every other head gives a little more than it needs: that excess is the over-discharge, and it is real water the supply must give.

In the example (12 heads, K 5.6, 0.15 gpm/sq ft over 130 sq ft, so 19.5 gpm a head) the source needs 27.2 psi at 240.4 gpm for the heads, plus 250 gpm of hose: 490.4 gpm. Head H13 is the most demanding at 12.13 psi; the 12 heads over-discharge by 6.4 gpm in total.

The water supply

A flow test gives a static pressure and a residual pressure at a measured flow. Between and beyond them the supply is taken to follow the Hazen-Williams shape:

P(Q) = Pstatic − (Pstatic − Presidual) (Q / Qtest)1.85

On graph paper with flow spaced by its 1.85 power (N1.85 paper) that is a straight line, which is why sprinkler designers plot it that way. The example's supply (65 psi static, 45 psi at 800 gpm) gives 56.9 psi at 490.4 gpm, a margin of 29.7 psi over the demand. The calculator also finds where the system's own curve meets the supply: with every listed head open, the system would really take 608.4 gpm, hose included, at 52.9 psi.

Checked against EPANET

The test suite builds 61 seeded networks (the example, 30 random grids with uneven elevations, sizes, C values and K factors, and 30 random trees) and runs each through the EPANET 2.2 toolkit, with every head as an emitter of exponent 0.5. EPANET's US-unit Hazen-Williams has slightly different constants (4.727 C−1.852 d−4.871 in feet and cubic feet per second, and 0.4333 psi per foot), so for the comparison the calculator runs with those constants. On the 59 networks where every head stays at positive pressure, every node pressure and pipe flow agrees with EPANET to within 0.00001 psi and gpm. The other two have heads above the water's reach; EPANET 2.2 lets an emitter draw water in at negative pressure, which a sprinkler cannot, so they are not the same problem.

The NFPA form and EPANET's form differ a little: rewritten for gpm and inches, EPANET's constant is 4.533 against NFPA 13's 4.52, with exponents 1.852 and 4.871 against 1.85 and 4.87. On the example the design pressure is 27.21 psi with the NFPA form and 27.23 psi with EPANET's.

A second test needs no EPANET: a single branch line on one level, worked by the head-by-head hand method above, matches the network solver's design pressure to within a millionth of a psi for four line lengths and K factors.

What a grid buys

The same heads and pipes, with and without the far cross main (check/grid_vs_tree.mjs): branch lines of 1-1/4 in schedule 40 with heads at 12 ft, 2-1/2 in schedule 10 cross mains 12 ft apart, K 5.6 at 0.15 gpm/sq ft over 130 sq ft. When the design area is every line in a four-line grid, the far cross main has little to do. When the design area is the far four lines of a ten-line grid fed from the other end, the shut lines and the far cross main become a second path, and the demand at the same pipe sizes drops a great deal. The geometry is illustrative, not a real building.

Heads a line4 lines open: grid psitree psi10 lines, far 4 open: grid psitree psi
221.822.122.127.0
328.128.927.939.8
438.740.236.360.4
555.558.247.792.2
681.786.162.5140.7
7121.9128.981.4214.5
8183.2194.0105.4325.9

A tree designer would not keep a 2-1/2 inch cross main carrying several hundred gpm past six lines; they would upsize it. The table shows how much of that upsizing a grid does for free.

Questions

Why compare against EPANET?

EPANET is the US EPA's free, open-source water network solver and uses the same gradient method, so agreement to a hundred-thousandth of a psi on 59 networks shows the network solve is right. It does not check the design rules: those are tested separately against a hand calculation.

Does a grid always need less pressure than a tree?

Not by much when the whole grid is the design area: 0.3 to 10.9 psi in the table above. It helps most when the design area sits at the far end of a large grid, where the shut lines and the far cross main form a second path to the open heads.

What it leaves out

It calculates the heads you list as open; it does not pick the most remote design area, apply area reductions or room design, or add fittings for you. Pumps, backflow preventers and valves are not separate items: put their loss into the supply or a pipe's equivalent length. Velocity pressure is left out throughout, which NFPA 13 permits. It warns when a pipe runs faster than 32 ft/s.