Governing equations
∂h/∂t + (a²/g) ∂u/∂x = 0
∂u/∂t + g ∂h/∂x + λu = 0, λ = f|V₀|/D
h and u are pressure-head and velocity disturbances about the initial flow; a is wave speed, g is gravitational acceleration, D is bore diameter and f is the Darcy friction factor. The solver uses travelling-wave characteristics on a fixed grid with Δt = Δx/a.
Boundary conditions
The upstream reservoir holds h = 0 pressure-head disturbance (scaled reference). At the downstream valve, velocity falls linearly from V₀ to zero over the selected closure time. Pressure and velocity disturbances are decomposed into right- and left-travelling waves.
Checks and estimates
For a rapid stop, the Joukowsky estimate is Δp = ρaΔV. The ideal round-trip time is 2L/a. The wall indicator uses the peak pressure rise in the thin-wall estimate σθ ≈ pD/(2t).
Simplifications
Water is treated as a one-dimensional, single-phase liquid with constant density (textbook value 998 kg/m³ at about 20°C). Wave speed is an input that represents the combined liquid-and-pipe elasticity. Friction is linearised about the initial flow and represented as wave attenuation. The model omits branches, fittings, air pockets, cavitation, temperature changes, pipe supports and detailed valve geometry.
Illustrative, not a design tool
Pipe dimensions, operating conditions, wall strength and the visible threshold are illustrative. The crack marker only indicates that the estimated hoop stress crossed the chosen illustrative limit; it does not simulate fracture or predict a real pipe failure. The scene is schematic and scaled for visibility.
An independent educational simulation; not affiliated with a water utility, pipe manufacturer or engineering standards body.