Build a pump head and pipe friction loss calculator from your Excel sheet
Quick answer
Pump head (TDH) is the static lift plus the pressure difference, pipe friction (Darcy-Weisbach with Colebrook-White or Swamee-Jain, or Hazen-Williams for water), and fitting losses ΣK·v²/2g. Ask an AI for one HTML file with your sheet's formulas, test it against the sheet, and publish it at a link your crew opens.
For your team only, publish it on a private link or behind a password, both with Pro.
Make your team's version
Convika's AI rewrites this calculator from what you write. You try it on your phone before you keep it, with no account.
On this page
- What total dynamic head adds up
- Pipe friction by Darcy-Weisbach
- Hazen-Williams, for water only
- Fitting losses: ΣK·v²/2g
- Water properties by temperature
- Pump power: ρ·g·Q·H/η
- Worked example in SI units
- Worked example in US units
- The formulas against NRCS's worked examples
- Test cases to check the page against your sheet
- The prompt for ChatGPT, Claude, or Gemini
- What changes between Excel and JavaScript
- A phone layout a field engineer can check
- Publish the calculator for your crew in 5 steps
- Ways to put a pump head calculator on a phone
- Frequently asked questions
- Sources
Your pump sizing sheet works. Flow, pipe, fittings, and lift go in; the head and the motor size come out. The crew on site wants the same answer on a phone, without the workbook and without Excel. Ask an AI for a phone calculator and it points you to the app stores, which run their own formulas, not your sheet's.
This guide gives you each formula a pump head sheet uses, with its units, its range, and its source. Then come two worked examples, in SI and US units, a test table to hold the AI's page against your sheet, the prompt, and the steps to publish the page at a link your crew opens.
The formulas and tables were read on November 6, 2026, in the NRCS National Engineering Handbook (Part 634, Chapter 4, Pipe Flow), the Hydraulic Institute's HI Data Tool, the EPA's EPANET 2.2 manual, and the NIST Chemistry WebBook. Every number in the examples comes from a script, checked against NRCS's own worked examples.
What total dynamic head adds up
Total dynamic head (TDH) is the head the pump has to add to move the flow from the suction liquid surface to the discharge. NRCS writes it as the energy equation with a pump head, h_p (eq. 4-33, page 634-4.20):
z₁ + p₁/γ + v₁²/2g + h_p = z₂ + p₂/γ + v₂²/2g + h_f + Σh_L
Solved for the pump head:
TDH = (z₂ − z₁) + (p₂ − p₁)/(ρ·g) + (v₂² − v₁²)/(2g) + h_f + Σh_m
- z₂ − z₁, the static lift: from the suction liquid surface to the discharge liquid surface, or to the outlet for a pipe that discharges into the air. In m or ft.
- (p₂ − p₁)/(ρ·g), the pressure difference between the two surfaces as head of the pumped liquid. Zero when both tanks are open to the air. For a discharge tank under pressure, its gauge pressure goes here. In US units, head in ft = psi × 144 ÷ density in lb/ft³, close to 2.31 × psi ÷ SG.
- (v₂² − v₁²)/(2g), the velocity heads. Zero from tank to tank, because a liquid surface barely moves.
- h_f, pipe friction: Darcy-Weisbach or Hazen-Williams, below.
- Σh_m, fitting losses: ΣK·v²/2g, below.
γ is the specific weight, ρ·g. NRCS's pump power example uses 62.4 lb/ft³ for water.
Count the outlet once. A pipe that ends under water in a tank loses its velocity head there, and NRCS gives that discharge loss a K of 1.0. A pipe that ends in the air keeps it as the jet's velocity head, v₂²/2g. Put it in the sum as one or the other, not as both.
Pipe friction by Darcy-Weisbach
h_f = f · (L/D) · v²/(2g)
v = Q / (π·D²/4)
Re = v·D/ν
- h_f, friction loss, in m (ft); L, pipe length; D, inside diameter, in m (ft).
- v, mean velocity, in m/s (ft/s); Q, flow, in m³/s (ft³/s).
- g = 9.80665 m/s² (32.174 ft/s²). NRCS's examples use 32.2 ft/s².
- ν, kinematic viscosity, in m²/s (ft²/s), from the water table below.
- f, the Darcy friction factor, with no unit.
Sources: NRCS eq. 4-13, 4-17, and 4-18 (pages 634-4.6 to 4.8), and HI Data Tool eq. 3.A.1 and 3.A.4. Use the pipe's inside diameter. A nominal pipe size is a name, not a dimension.
The Reynolds number picks the friction factor. NRCS (page 634-4.7) puts laminar flow below Re 2,000, transitional flow from 2,000 to 4,000, and turbulent flow above 4,000. For laminar flow, f = 64/Re (eq. 4-14). The HI Data Tool calls 2,000 to 4,000 "the critical zone in which the flow may be highly unstable and the friction factor indeterminate." Have the page say so when Re lands there, and use the turbulent value, which is the larger one: at Re 3,000 and ε/D 0.0001, Colebrook-White gives 0.0436 and 64/Re gives 0.0213.
Air in a duct follows the same Darcy-Weisbach equation, with a Colebrook or Altshul-Tsal friction factor: the duct size calculator sizes ducts by it.
Colebrook-White, solved by iteration
1/√f = −2 · log₁₀( (ε/D)/3.7 + 2.51/(Re·√f) )
NRCS eq. 4-15 (page 634-4.8) and HI eq. 3.A.2. ε is the pipe's absolute roughness, in the same unit as D. f sits on both sides, so a sheet solves it with a circular reference, Goal Seek, or a column of repeated guesses. In JavaScript it's a loop with a stated tolerance and a cap:
const swameeJain = (Re, relRough) =>
0.25 / Math.log10(relRough / 3.7 + 5.74 / Re ** 0.9) ** 2;
function colebrook(Re, relRough) {
let x = 1 / Math.sqrt(swameeJain(Re, relRough)); // x = 1/√f
for (let i = 0; i < 50; i++) {
const next = -2 * Math.log10(relRough / 3.7 + 2.51 * x / Re);
if (Math.abs(next - x) < 1e-12 * next) return 1 / (next * next);
x = next;
}
throw new Error("Colebrook-White did not converge");
}
Started from Swamee-Jain, this loop settled in 7 to 15 rounds on every turbulent or transitional row of the test table below.
Swamee-Jain, explicit
f = 0.25 / [ log₁₀( ε/(3.7·D) + 5.74/Re^0.9 ) ]²
NRCS eq. 4-16 (page 634-4.8), and HI eq. 3.A.3 in its 1/√f form. Swamee and Jain published it in 1976 in the Journal of the Hydraulics Division (vol. 102, no. 5, pages 657 to 664). A 2011 review in FME Transactions (Genić and others, Table 1) lists its range as defined in that paper: Re from 5,000 to 10⁸, and ε/D from 0.000001 to 0.05. NRCS calls it "a close approximation (2 – 5% error) to the Colebrook-White equation". EPANET's Darcy-Weisbach option uses it above Re 4,000.
How close it is depends on where you are in that range. Against the iterated Colebrook-White on a grid of 201 × 201 points:
| Range | Swamee-Jain f against Colebrook-White |
|---|---|
| Re 5,000 to 10⁸, ε/D 10⁻⁶ to 10⁻² | 0.70% low to 2.83% high |
| Re 10⁴ to 10⁸, same ε/D | 0.70% low to 2.12% high |
| Re 10⁵ to 10⁸, same ε/D | 0.70% low to 1.14% high |
| Re 5,000 to 10⁸, ε/D 10⁻⁶ to 0.05 | 0.70% low to 2.99% high |
The largest gaps sit at the bottom of the Reynolds range with rough pipe (Re 5,000, ε/D 0.01 to 0.02).
Colebrook-White against Swamee-Jain on one case
In the SI worked example below (Re 190,325, ε/D 0.00046), Colebrook-White gives f = 0.01870 and Swamee-Jain 0.01881, 0.56% higher. Pipe friction comes out at 5.217 m and 5.247 m: 0.03 m on a TDH of 24.5 m. On NRCS's Example 4-7 (page 634-4.9), NRCS's spreadsheet gives 8.86 ft; the script gives 8.88 ft with Swamee-Jain and 8.85 ft with Colebrook-White.
Use the one your sheet uses. The test table can only match when the sheet and the page use the same friction factor.
Pipe roughness ε
| Pipe material | ε (mm) | ε (ft) |
|---|---|---|
| Commercial or welded steel, wrought iron | 0.046 | 0.00015 |
| Ductile iron | 0.061 | 0.0002 |
| Galvanized iron | 0.15 | 0.0005 |
| Asphalt-dipped cast iron | 0.12 | 0.0004 |
| Cast iron | 0.25 | 0.00085 |
| PVC, PE, HDPE | 0.002 | 0.0000066 |
| Drawn tubing, copper, brass | 0.0015 | 0.000005 |
| Concrete | 0.3 to 3 | 0.001 to 0.01 |
| Riveted steel | 0.9 to 9 | 0.003 to 0.03 |
Source: NRCS fig. 4-5 (page 634-4.7). The HI Data Tool's Table 3.A.1 gives similar values for most of these materials, such as 0.0457 mm for commercial steel and 0.26 mm for uncoated cast iron, and adds: "For commercial installations, 15 percent should be added to the values shown above." For old pipe, it says that "Prior experience or testing should be used to determine an accurate value." Put the table in the file as data, with a field beside the material list for a value of your own.
Hazen-Williams, for water only
SI: h_f = 10.704 · (Q/C)^1.85 · L / D^4.87 (Q in m³/s; D, L, h_f in m)
US: h_f = 4.732 · (Q/C)^1.85 · L / D^4.87 (Q in ft³/s; D, L, h_f in ft)
NRCS eq. 4-27 and 4-28 (page 634-4.11). C is the Hazen-Williams coefficient, with no unit. Other references round the constants differently. EPANET's US form is 4.727 · C^−1.852 · d^−4.871 · L · q^1.852 (Table 3.1), and in SI, 10.67 with exponents 1.852 and 4.8704 is common. On the SI worked example below, NRCS's form gives 6.17 m and the 10.67 form 6.05 m, 2% apart. On NRCS Example 4-13, the two US forms give 1.081 ft and 1.074 ft, where NRCS prints 1.08 ft. Write your sheet's version into the page and use the same one in both.
| Pipe | C |
|---|---|
| PVC, PE, HDPE | 150 |
| Very smooth, straight | 140 |
| Cast iron (uncoated) or steel, new | 130 |
| The same, 10 years old | 110 |
| The same, 20 years old | 90 |
| Cast iron, coated | 130 |
| Concrete, smooth with good joints | 120 |
| Corrugated metal | 60 |
Source: NRCS fig. 4-8 (page 634-4.12). EPANET's Table 3.2 gives new steel and plastic 140 to 150, and cast iron 130 to 140.
Where it stops working, in the EPA's words: "It cannot be used for liquids other than water and was originally developed for turbulent flow only." NRCS says it "was developed from empirical data of water flow in pipes." The formula has no viscosity in it, so it can't follow the water's temperature. In the SI example, warming the water from 20 °C to 60 °C lowers the Darcy-Weisbach friction from 5.22 m to 4.92 m, while Hazen-Williams stays at 6.17 m. The C you choose moves the answer more than the formula does: C 130, 140, and 150 give 6.17 m, 5.38 m, and 4.74 m, where Darcy-Weisbach gives 5.22 m.
Fitting losses: ΣK·v²/2g
h_m = ΣK · v²/(2g)
NRCS eq. 4-31 (page 634-4.14), and EPANET's "Minor Losses". K is each fitting's loss coefficient, with no unit, and v the velocity in the pipe the fitting sits on.
| Fitting | K | Source |
|---|---|---|
| Globe valve, wide open | 10 | NRCS fig. 4-14 |
| Swing check valve, fully open | 2.5 | EPANET Table 3.3 |
| Close-return bend | 2.2 | NRCS fig. 4-14 |
| Tee, through side outlet | 1.8 | NRCS fig. 4-14 |
| 90° short-radius elbow | 0.90 | NRCS fig. 4-14 |
| 90° medium-radius elbow | 0.75 | NRCS fig. 4-14 |
| 90° long-radius elbow | 0.60 | NRCS fig. 4-14 |
| 45° elbow | 0.42 | NRCS fig. 4-14 |
| Gate valve, wide open | 0.19 | NRCS fig. 4-14 |
| Ball valve, wide open | 0.06 | NRCS fig. 4-14 |
| Square-edged entrance | 0.5 | NRCS fig. 4-12, EPANET Table 3.3 |
| Discharge into a tank | 1.0 | NRCS page 634-4.15 |
EPANET's table rounds a few of these differently, such as 0.8 for a medium-radius elbow and 0.2 for an open gate valve.
NRCS (page 634-4.29): "A generally accepted criterion is that local losses should be included in a pipe design analysis if the local losses exceed 5% of the total head loss." In its Example 4-22, three pipes in series between two tanks, leaving the local losses out raised the computed flow by 17.56% with Darcy-Weisbach. Where the pipe changes size, each segment needs its own velocity, so the page needs one row per segment if your sheet has several.
Water properties by temperature
Density and kinematic viscosity of water, from the NIST Chemistry WebBook (saturated liquid; at atmospheric pressure the density differs by less than 0.01%):
| T (°C) | ρ (kg/m³) | ν (10⁻⁶ m²/s) |
|---|---|---|
| 0.01 | 999.8 | 1.792 |
| 5 | 999.9 | 1.518 |
| 10 | 999.7 | 1.306 |
| 15 | 999.1 | 1.139 |
| 20 | 998.2 | 1.003 |
| 25 | 997.0 | 0.893 |
| 30 | 995.6 | 0.801 |
| 40 | 992.2 | 0.658 |
| 50 | 988.0 | 0.553 |
| 60 | 983.2 | 0.474 |
| 70 | 977.7 | 0.413 |
| 80 | 971.8 | 0.364 |
| 90 | 965.3 | 0.325 |
| 100 | 958.3 | 0.294 |
| T (°F) | ρ (lb/ft³) | ν (10⁻⁵ ft²/s) |
|---|---|---|
| 40 | 62.42 | 1.663 |
| 50 | 62.41 | 1.406 |
| 60 | 62.36 | 1.208 |
| 70 | 62.30 | 1.052 |
| 80 | 62.21 | 0.926 |
| 100 | 61.99 | 0.738 |
| 120 | 61.71 | 0.606 |
| 140 | 61.38 | 0.510 |
| 160 | 61.00 | 0.438 |
| 180 | 60.58 | 0.382 |
| 200 | 60.12 | 0.338 |
| 212 | 59.83 | 0.316 |
ν is the dynamic viscosity divided by the density, both from NIST. NRCS's Example 4-6 uses 1.059 × 10⁻⁵ ft²/s at 70 °F, 0.7% above NIST's 1.052 × 10⁻⁵. Either works if the sheet and the page use the same table. Have the page interpolate linearly between rows and tell the AI not to fit a curve of its own.
Pump power: ρ·g·Q·H/η
SI: P_shaft (kW) = ρ · g · Q · TDH / (1000 · η)
US: P_shaft (hp) = γ · Q · TDH / (550 · η) (γ in lb/ft³, Q in ft³/s)
P_shaft (hp) = Q_gpm · TDH_ft · SG / (3960 · η)
NRCS eq. 4-35 to 4-39 (pages 634-4.23 to 4.24). The hydraulic power ρ·g·Q·H is what the water gets. Divide by the pump efficiency η for the shaft, and by the motor efficiency too for what the supply delivers. The 3,960 in the gpm form is the unit conversion, rounded: 550 ft·lb/s per hp × 448.83 gpm per ft³/s ÷ 62.4 lb/ft³ = 3,956.
NRCS's Example 4-21 (page 634-4.24): 41.67 ft of head at 1.24 ft³/s, with a pump efficiency of 0.80 and a motor efficiency of 0.90, gives 5.86 hp of hydraulic power, 7.33 hp at the shaft, and 8.14 hp from the supply, 72% from wire to water. The script reproduces all three.
Take η from the pump curve at the duty point. The Hydraulic Institute's Pump FAQs add: "Note that data displayed on a manufacturer's pump curve are based on 68 F or 20 C water." For another liquid, the power scales with its density.
Worked example in SI units
A pump lifts water at 20 °C from an open sump to an open tank 18 m higher, at 15 L/s (0.015 m³/s), through 150 m of commercial steel pipe with a 100 mm inside diameter (ε = 0.046 mm). The fittings are a square-edged entrance (0.5), 4 long-radius elbows (4 × 0.60), 2 open gate valves (2 × 0.19), a swing check valve (2.5), and the discharge into the tank (1.0), so ΣK = 6.78. The pump's efficiency at this flow is 70%.
| Step | Result |
|---|---|
| Water at 20 °C (NIST) | ρ = 998.16 kg/m³, ν = 1.0035 × 10⁻⁶ m²/s |
| Area and velocity | A = 0.007854 m², v = 1.910 m/s |
| Reynolds number | Re = 190,325: turbulent |
| f, Colebrook-White (9 rounds) | 0.01870 |
| f, Swamee-Jain | 0.01881 (+0.56%) |
| Pipe friction h_f | 5.217 m (5.247 m with Swamee-Jain) |
| Velocity head v²/2g | 0.186 m |
| Fitting losses ΣK·v²/2g | 1.261 m |
| TDH = 18 + 0 + 5.217 + 1.261 | 24.48 m |
| Hydraulic power ρ·g·Q·H | 3.59 kW |
| Shaft power at η = 0.70 | 5.13 kW |
| With Hazen-Williams, C = 130 | h_f = 6.17 m, TDH = 25.44 m |
The friction loss as a pressure drop is ρ·g·h_f = 51.07 kPa.
Worked example in US units
A pump moves 250 gpm of water at 60 °F from an open sump to a tank held at 20 psig, 60 ft higher, through 500 ft of steel pipe with a 4.0 in inside diameter (ε = 0.00015 ft). The fittings are the same as above (ΣK = 6.78), and the pump's efficiency is 72%.
| Step | Result |
|---|---|
| Water at 60 °F (NIST) | 62.364 lb/ft³, ν = 1.208 × 10⁻⁵ ft²/s |
| Flow | 250 gpm = 0.5570 ft³/s |
| Velocity | 6.383 ft/s |
| Reynolds number | Re = 176,130: turbulent |
| f, Colebrook-White / Swamee-Jain | 0.01880 / 0.01890 |
| Pipe friction h_f | 17.85 ft (17.95 ft with Swamee-Jain) |
| Velocity head v²/2g | 0.633 ft |
| Fitting losses ΣK·v²/2g | 4.29 ft |
| Tank pressure as head | 20 × 144 ÷ 62.364 = 46.18 ft (2.31 × 20 = 46.2 ft) |
| TDH = 60 + 46.18 + 17.85 + 4.29 | 128.33 ft |
| Shaft power, 250 × 128.33 ÷ (3960 × 0.72) | 11.25 hp |
The formulas against NRCS's worked examples
This table checks the formulas in this guide against the answers NRCS prints, in US units with g = 32.2 ft/s². It is not a test for the page: these examples type ν in directly, solve for the flow from a given head, use Hazen-Williams, or add a motor efficiency, and the calculator the prompt below builds does none of that. The page's own tests are in the next section.
| NRCS NEH 634, Ch. 4 | Inputs | NRCS gives | The script gives |
|---|---|---|---|
| Example 4-6 (page 634-4.8) | D 0.167 ft, Q 0.08 ft³/s, ν 1.059 × 10⁻⁵ ft²/s | v 3.7 ft/s, Re 58,347 | v 3.652 ft/s, Re 57,595 (58,347 from v rounded to 3.7) |
| Example 4-7 (page 634-4.9) | D 0.3 ft, Q 0.20 ft³/s, L 1,000 ft, ε 0.000166 ft, ν 1.13 × 10⁻⁵ ft²/s | h_f 8.86 ft | 8.88 ft (Swamee-Jain), 8.85 ft (Colebrook-White) |
| Example 4-10 (page 634-4.10) | 5 ft of head, L 100 ft, D 0.5 ft, ε 0.003 ft, ν 1.3135 × 10⁻⁵ ft²/s, no entrance loss | Q 1.285 ft³/s, v 6.54 ft/s | 1.285 ft³/s, 6.54 ft/s (Swamee-Jain) |
| Example 4-13 (page 634-4.13) | Hazen-Williams, C 150, L 2,000 ft, D 3.0 ft, Q 20 ft³/s | h_f 1.08 ft | 1.081 ft |
| Example 4-21 (page 634-4.24) | 41.67 ft, 1.24 ft³/s, η_pump 0.80, η_motor 0.90 | 5.86, 7.33, 8.14 hp | 5.86, 7.33, 8.14 hp |
Test cases to check the page against your sheet
Enter each row in your sheet and in the AI's page. The expected values use Colebrook-White, the NIST water table, g = 9.80665 m/s², and fittings entered as one ΣK. A correct page matches each value within 0.1%, or within 1 in the last digit printed where that is larger, and a 0 comes out as 0. The friction factor is printed to 5 significant figures, and the small values of T5 and T6 to 4. Swamee-Jain against Colebrook-White can differ by up to 3% in f, so the sheet and the page have to use the same method.
The inputs:
| # | Q (L/s) | D (mm) | L (m) | ε (mm) | T (°C) | Static (m) | Δp (kPa) | ΣK | η |
|---|---|---|---|---|---|---|---|---|---|
| T1 | 15 | 100 | 150 | 0.046 | 20 | 18 | 0 | 6.78 | 0.70 |
| T2 | 15 | 100 | 150 | 0.046 | 60 | 18 | 0 | 6.78 | 0.70 |
| T3 | 5 | 50 | 40 | 0.0015 | 15 | 6 | 150 | 3.2 | 0.60 |
| T4 | 80 | 250 | 1,200 | 0.26 | 10 | 35 | 0 | 4.5 | 0.80 |
| T5 | 0.05 | 50 | 10 | 0.0015 | 20 | 2 | 0 | 1.5 | 0.40 |
| T6 | 0.12 | 50 | 10 | 0.0015 | 20 | 2 | 0 | 1.5 | 0.40 |
| T7 | 0 | 100 | 150 | 0.046 | 20 | 18 | 0 | 6.78 | 0.70 |
| T8 | 30 | 150 | 300 | 0.002 | 25 | −4 | 300 | 8 | 0.75 |
The expected results:
| # | v (m/s) | Re | Regime | f | h_f (m) | h_m (m) | TDH (m) | P (kW) |
|---|---|---|---|---|---|---|---|---|
| T1 | 1.910 | 190,325 | turbulent | 0.018703 | 5.217 | 1.261 | 24.48 | 5.134 |
| T2 | 1.910 | 402,925 | turbulent | 0.017624 | 4.916 | 1.261 | 24.18 | 4.995 |
| T3 | 2.546 | 111,816 | turbulent | 0.017749 | 4.695 | 1.058 | 27.06 | 2.210 |
| T4 | 1.630 | 311,868 | turbulent | 0.020734 | 13.478 | 0.609 | 49.09 | 48.121 |
| T5 | 0.02546 | 1,269 | laminar | 0.050440 | 0.0003335 | 0.00004959 | 2.00 | 0.002448 |
| T6 | 0.06112 | 3,045 | transitional | 0.043347 | 0.001651 | 0.0002857 | 2.00 | 0.005879 |
| T7 | 0 | 0 | no flow | none | 0 | 0 | 18.00 | 0 |
| T8 | 1.698 | 285,252 | turbulent | 0.014737 | 4.331 | 1.176 | 32.19 | 12.589 |
What each row checks: T1 is the SI worked example. T2 is the same pipe at 60 °C, so the viscosity lookup has to change the answer. T3 adds a discharge tank at 150 kPa above the suction surface. T4 is a large, rough cast-iron line. T5 checks the laminar branch, f = 64/Re. T6 lands in the transitional zone, where the page should show its warning. T7 has no flow: the page must not divide by zero, and TDH is the static lift. T8 discharges 4 m below the suction surface into a tank held 300 kPa higher, so the static term is negative.
The expected values come from the NIST rows themselves. A page built on the rounded water table above lands within 0.1% of every one of them.
You stay responsible for checking the results against your own design standard before the crew uses them.
The prompt for ChatGPT, Claude, or Gemini
Paste your sheet's inputs and formulas as text: for each input, its name, unit, an example value, and the range it may take; for each result, its formula. Then send:
Turn my pump head spreadsheet into one HTML file that my crew opens
on a phone. Keep my method exactly. Don't add or change formulas.
Rules for the code:
- Plain JavaScript functions inside the file. No eval, no new Function,
no formula-parsing library, no fetch, and no outside data.
- Write every table into the file: pipe roughness, Hazen-Williams C,
fitting K values, and the water table below.
- Every LOG in my sheet is base 10: use Math.log10. Math.log is LN.
- Convert the inputs to SI once, compute in SI, and convert the
results for display.
Inputs (show each unit next to its field):
[name, unit, example value, allowed range, for each input]
Formulas from my sheet (cell: formula):
[each result cell's formula, as text]
Friction factor:
- Re below 2000: f = 64/Re.
- Re from 2000 to 4000: compute as turbulent and show
"Transitional flow: the friction factor is uncertain here."
- Re 4000 and above: Colebrook-White, iterated from a Swamee-Jain
start, stopping when the change is below 1e-12, at most 50 rounds.
If it doesn't converge, show a message instead of a number.
Also show f by Swamee-Jain.
- With no flow, show TDH = static lift and skip the friction.
Water properties: interpolate linearly by temperature in this table:
[T, density, kinematic viscosity]
Results card at the top: TDH and shaft power, large. Under it:
velocity, Re and the flow regime, f, pipe friction, fitting losses,
velocity head, and the pressure difference as head, with units.
Layout: one column on a 390 px wide phone, labels above the fields,
number fields with inputmode="decimal", and an SI / US switch.
Put "Pump head v1.0, [date], Colebrook-White" at the bottom.
Test mode: a "Run test cases" button that runs these rows and shows
each result beside the expected value. Mark it pass when it is within
0.1%, or within 1 in the expected value's last printed digit where
that is larger. An expected 0 must come out as exactly 0.
[the inputs and expected results tables above]
If your sheet uses Swamee-Jain or Hazen-Williams, say so in the friction lines instead and change the expected values to your sheet's.
What changes between Excel and JavaScript
- Logarithms. Microsoft's help for Excel's LOG function: "If base is omitted, it is assumed to be 10." JavaScript's Math.log is the natural log, Excel's LN. Swamee-Jain written with Math.log gives an f 5.3 times too small: 0.00355 instead of 0.01881 on the SI example.
- Minus signs and powers. Excel's table of operator precedence puts "Negation (as in –1)" before "Exponentiation", so
=-2^2is 4 in Excel. JavaScript refuses-2 ** 2and needs(-2) ** 2or-(2 ** 2). Check any power in your sheet that has a minus in front of it. - Iteration. A circular reference or Goal Seek stops at the sheet's own tolerance. The page's loop should state its tolerance and its cap, and say so when it doesn't converge. If the sheet stops early, the two disagree in the fourth digit.
- Percent cells. A cell showing 70% holds 0.7. Decide whether the page's efficiency field takes 70 or 0.70, and say which next to the field.
- Units. Convert at the edge: L/s or gpm to m³/s, mm or inches to m, psi to kPa. Compute in one system. Most mismatches in a test table are a unit converted twice or not at all.
- Lookups. VLOOKUP with an approximate match takes the row at or below the value; it doesn't interpolate. The sheet and the page must look up the water table the same way, or the T2 row won't match.
- Blank cells. Excel counts a blank cell as 0 in arithmetic, so a missing roughness becomes a smooth pipe. The page should stop and name the empty field.
- Rounding. Round what you display, never what you compute with.
A phone layout a field engineer can check
- One column. Each label sits above its field, with the unit beside it and an example value. Number fields bring up the number keypad.
- Pickers for the tables. Choosing a pipe material fills in ε and C. Choosing fittings and their counts fills in ΣK. A field beside each picker takes a value of your own.
- The results card first. TDH and shaft power, large, at the top of the screen.
- The intermediate values under it. Velocity, Re and the regime, f by both methods, pipe friction, fitting losses, velocity head, and the pressure difference as head. A field engineer checks these against what they expect before trusting the total.
- Warnings in words. Transitional flow, a friction factor that didn't converge, or an empty field, written as a sentence next to the result it affects.
- A version line. For example "Pump head v1.3, 2026-11-06, Colebrook-White, NIST water table", so everyone can see which version is on their screen. On Free, the Convika bar sits at the foot of the page, under it.
Publish the calculator for your crew in 5 steps
1. Upload the HTML file
Use the box below, or sign up and click Upload an HTML file on your dashboard. Drop the file on Upload a file, or open Paste code and paste what your AI wrote. Convika takes .html and .htm files up to 2 MB, so the sheet itself doesn't upload: the AI turns it into HTML first. Click Create my preview.
2. Run the test cases on your phone
Open the preview on your phone and run the test rows, or the page's test mode. Then try a few real pumps from your sheet. The page's scripts run as written, so the math happens in the phone's browser. Convika blocks eval and new Function and requests to other hosts, which is why the prompt asks for plain functions and every table in the file.
3. Choose who can open it
Click Publish page. Under Who can open this page?, choose:
- Public: "Anyone with the link can open it. It may show up in search results and in Convika's gallery." Free, with the Convika bar at the foot of the page.
- Private link: "Anyone with the link can open it, with no password or account. It stays out of search results and out of the gallery." Pro.
- Only people with the password: Convika's server checks the password before it sends the page. Pro.
Click Next. The first time, for a Public page, click Publish free. A private link or a password opens an order for Pro, $12 a month, and a first subscription starts free for 1 day with a card. A private link keeps the page out of search, but anyone who's forwarded it can open it. For a client's plant data or your own rates, choose the password. Anyone who opens the page can read its source, so the formulas and tables in it are readable too.
4. Send the link
Post the address in the crew's chat, or put it in the job pack. On a phone, adding it to the home screen gives it an icon that opens the live address. Convika doesn't make the page work offline or install it as an app: the phone needs a connection to open the link.
5. Publish each new version at the same link
When the method or a table changes, ask your AI for the whole corrected file. On the page's screen, under Update from an HTML file, click Upload a new version, add the file, and click Upload as a new version. Check the preview, run the test rows again, and click Publish v2 at the same link (with your version number). Everyone who has the link gets the new version. Keep one address per tool and the version number inside the page; updating at the same URL covers the details.
On Free, a new workspace keeps 1 page live. A second calculator, such as an NPSH available check for the same pump, can go into the same file as a second tab. Or it can stay live beside the first with Light, a monthly add-on to Free ($3 a month for up to 5 live pages, with the Convika bar), or with Pro.
Ways to put a pump head calculator on a phone
| Option | Whose formulas and tables | Opens on | Who can open it | When the method changes | Cost |
|---|---|---|---|---|---|
| HydroCalc Plus (App Store) | The app's: "industry-standard Hazen-Williams", plus "Darcy-Weisbach with real fluids" | iPhone and iPad, installed; "No internet connection required" | Each person who buys and installs it | The developer's app updates | $6.99, "One purchase, no in-app purchases" |
| PE-Calc's Darcy-Weisbach page | The site's: Swamee-Jain, "valid for 5×10³ ≤ Re ≤ 10⁸" | A browser | Anyone with the address | When the site changes | No price on the page |
| Power Apps canvas app | Rebuilt in the app | "the Power Apps mobile app or in a web browser" | People in your organization, by name or a Microsoft Entra ID security group; guests through guest sharing | You publish the app again | "A Power Apps license" for each user |
| The workbook itself | Yours | Excel, wherever each person has it | Whoever has a copy | Each copy stays as it was sent | Excel for each person |
| An AI-written HTML page on Convika | Yours, rewritten as JavaScript, with your tables in the file | A phone's browser, from a link | Public, Private link, or Only people with the password | Publish v2 at the same link, and everyone opens the new version | Free with the Convika bar; Pro for a private link or a password ($12 a month) |
Sources: the App Store page for HydroCalc Plus, PE-Calc's Darcy-Weisbach calculator, and Microsoft's pages on sharing a canvas app and running apps in a web browser, read on November 6, 2026. Convika's row comes from its own code.
Choose a store app when the app's method is the one you'd use anyway and the crew needs it with no signal. Choose Power Apps when your company already licenses it and the crew signs in with work accounts. Choose a page from your sheet when the crew should use your method, your fitting and roughness tables, and your units, from a link with no install, and get each correction at the same address.
Frequently asked questions
Is there a pump head and pipe pressure loss calculator I can use on my phone on site?
Yes. Store apps such as HydroCalc Plus and web calculators such as PE-Calc's run on a phone with their own formulas. To use your own sheet's method, tables, and units, have an AI write the sheet as one HTML file and publish it at a link. The crew opens it in the phone's browser, with no app to install.
How can I make my own Darcy-Weisbach pressure drop calculator for my team?
Give ChatGPT, Claude, or Gemini the formulas above, your units, and your roughness and fitting tables, and ask for one HTML file with plain JavaScript functions. Check it against your sheet with the test table, then publish it at one link. The pressure drop is ρ·g·h_f: 5.217 m of friction at 20 °C is 51.07 kPa.
How do I calculate pump head in Excel?
Add the static lift, the pressure difference as head, the pipe friction, and the fitting losses. For each pipe segment, compute the velocity Q/A, Re = v·D/ν, f from Swamee-Jain in one cell or from Colebrook-White with iterative calculation, h_f = f·(L/D)·v²/2g, and h_m = ΣK·v²/2g. TDH is the sum. Write the logarithms with LOG, which is base 10, not LN.
Should I use Darcy-Weisbach or Hazen-Williams?
Use Darcy-Weisbach for any liquid and any temperature. Hazen-Williams is for water only: the EPA says it "cannot be used for liquids other than water and was originally developed for turbulent flow only." In the SI example, Hazen-Williams with C 130 gives 18% more friction than Darcy-Weisbach, and C 150 gives 9% less.
How accurate is Swamee-Jain compared with Colebrook-White?
Between 0.70% low and 1.14% high above Re 100,000, and between 0.70% low and 2.83% high across Re 5,000 to 10⁸ and ε/D 10⁻⁶ to 10⁻², with the largest gap at low Re and rough pipe. NRCS calls it a close approximation with 2 to 5% error. Iterate Colebrook-White if your sheet does.
How do I calculate pump power from head and flow?
Shaft power is ρ·g·Q·H divided by the pump efficiency. In SI, that's kW = ρ·g·Q·H / (1000·η), with Q in m³/s and H in m. In US units, hp = gpm × ft × SG / (3960 × η). The SI example needs 5.13 kW at 70% efficiency; the US example needs 11.25 hp at 72%.
Can the calculator work offline or install like an app?
Not on Convika. Convika doesn't make pages work offline or install them as apps. The page opens from its link in the phone's browser, and a home-screen icon opens the live address. Store apps such as HydroCalc Plus say they need no connection.
How do I keep the calculator to my crew only?
Publish it with Only people with the password, which is Pro. A Private link stays out of search results and the gallery, but anyone who has the link can open it. Convika doesn't limit a page to company email addresses or named accounts.
Sources
- NRCS National Engineering Handbook, Part 634 Hydraulics, Chapter 4: Pipe Flow (210-634-H, 1st Ed., Feb 2022): sections 634.0403 to 634.0406, eq. 4-13 to 4-39, figs. 4-5, 4-8, 4-12, and 4-14, Examples 4-6 to 4-22, pages 634-4.6 to 4.29 (read November 6, 2026, 17:13 JST)
- HI Data Tool: Pipe Frictional Losses (Hydraulic Institute): eq. 3.A.1 to 3.A.5 and Table 3.A.1 (last updated July 19, 2024; read November 6, 2026, 17:24 JST)
- Pump FAQs (Hydraulic Institute): the pump curve entry, on curves at 68 °F or 20 °C water (read November 6, 2026, 17:16 JST)
- EPANET 2.2 manual, 3. The Network Model (US EPA): Pipes, Minor Losses, Tables 3.1 to 3.3 (read November 6, 2026, 17:23 JST)
- EPANET 2.2 manual, Analysis Algorithms (US EPA): friction factor by Reynolds number (read November 6, 2026, 17:23 JST)
- NIST Chemistry WebBook, Thermophysical Properties of Fluid Systems: water: saturation table, 0.01 to 100 °C and 40 to 212 °F (read November 6, 2026, 17:14 and 17:28 JST)
- Genić and others, "A Review of Explicit Approximations of Colebrook's Equation", FME Transactions 39 (2011), 67–71: Table 1, Swamee and Jain (1976) range (read November 6, 2026, 17:21 JST)
- LOG function (Microsoft Support) (read November 6, 2026, 17:34 JST)
- Calculation operators and precedence in Excel (Microsoft Support) (read November 6, 2026, 17:35 JST)
- HydroCalc Plus (App Store) (version 1.4.1; read November 6, 2026, 17:26 JST)
- Darcy-Weisbach Equation Calculator (PE-Calc) (no date on the page; read November 6, 2026, 17:26 JST)
- Share a canvas app in Power Apps (Microsoft Learn) (dated September 17, 2026; read November 6, 2026, 17:27 JST)
- Run apps in a web browser, Power Apps (Microsoft Learn) (dated August 25, 2026; read November 6, 2026, 17:33 JST)
Next step
How to check that an AI-made calculator matches your Excel sheet
Run the same input sets through Excel and the AI's page, compare to a stated tolerance, and find the places where Excel and JavaScript round differently.
Related articles
- Make an NPSH available calculator your operators can use on a tabletNPSHa for open, pressurized, and boiling tanks, suction lift or flooded, with altitude and vapor pressure tables, sourced and tested, from your sheet.
- Turn an Excel calculator into a web app your team opens on a phoneHave ChatGPT, Claude, or Gemini rewrite your sheet's formulas as one HTML file, test it against Excel, and share a link. Or keep the sheet as the engine.
- How to password protect an HTML page without code, on your own domainJavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.
- What should I check on an AI-made page before I share the link?AI-made pages fail where you don't look: a form that sends nowhere, a dead button, a made-up fact. A 5-step check on a phone, and a prompt for it.
- How to share an HTML file as a link that opens on any phoneUpload the file to a host and send its link; email and Google Drive send the code. 8 hosts compared, from Netlify Drop to Convika, with 4 steps.
More calculators built from Excel sheets
AI Skill Pod
Share AI skills with your team, the easy way
Everyone uses your team's skills in their own ChatGPT, Claude or Gemini, on any plan. Send one invite link. Free to start.
Start free on AI Skill Pod