1 · Pump curve
Hₚ = H₀ · n² − Kₚ · Q²
Approximate centrifugal-pump curve. Speed ratio n is relative to nominal speed; the affinity-law head scaling is n².
2 · Pipe losses
hₗ = [f(L/D) + K] · v²/(2g)
v = Q/A; Re = ρvD/μ. Darcy friction uses 64/Re in laminar flow and the approximate Swamee–Jain relation in turbulent flow, with a smooth transitional blend.
3 · Operating point
Hₚ(Q) = Hstatic + hₗ(Q). A bisection solver finds the non-negative flow intersection at each fixed physics step.
4 · Reservoir balance
dV/dt = Qpump − Qdemand − Qleak − Qevap. The simulation uses a fixed 1/120 s explicit-Euler step and clips volume to physical tank bounds.
5 · Leakage & power
Qleak = Cᵈ A √(2gH); P = ρgQH/η. Leakage is an approximate orifice model; electric input power is approximated from hydraulic power and a fixed efficiency.
Assumptions and honest limits
Single equivalent pipe; incompressible water; constant properties near 20 °C; quasi-steady pump operating point; no water hammer, cavitation, detailed pump map, pipe elasticity, complex junction network, or real meteorological forcing. The filter-clog slider adds an approximate minor-loss penalty. Reservoir demand is capped by available water. All visual geometry is illustrative, not a construction drawing.
All outputs are educational approximations, not engineering design values.