1 / Pump and system meet at an operating point
Hₚ = H₀(n/n₀)² − KₚQ²
Hₛ = Hstatic + (fL/D + K)v²/(2g)
The solver finds the flow Q where pump head equals required system head. A bisection search is used rather than guessing a flow rate.
2 / Friction in the pipe
hƒ = f(L/D) · v²/(2g) and v = Q / (πD²/4)
The Darcy–Weisbach relation estimates pipe loss. Valve and intake restrictions are represented by an equivalent minor-loss coefficient.
3 / Water stored in the tank
dh/dt = (Qin − Qdemand) / Atank
Continuity is integrated at 1/120 s. Rain capture adds a small inflow using the fixed catchment area.
4 / Electrical input
Pe ≈ ρgQH / (ηpump · ηmotor)
Approximate pump and motor efficiencies convert hydraulic power into a grid estimate. The controller reduces speed if the configured power limit would be exceeded.
Assumptions & honest simplifications
Water is incompressible; density and viscosity are held near room-temperature values. The network is represented by one equivalent pipe and one tank. Pump and motor coefficients are illustrative, the friction correlation is approximate, and fast transients such as water hammer and cavitation are not modelled. This is an educational simulation, not a design tool.
CREDITS PLACEHOLDER · ADD SOURCES HERE