The science
Governing equations. One-dimensional compressible, elastic-pipe flow: ∂H/∂t + (a²/g) ∂V/∂x = 0 and ∂V/∂t + g ∂H/∂x + f V|V|/(2D) = 0, with H the piezometric head, V the mean velocity, a the pressure-wave speed. They are integrated with the method of characteristics on 40 reaches (Δt = Δx/a), a reservoir at the upstream node (fixed head 60 m) and a valve whose discharge is V = k τ(t) √H at the downstream node, with opening τ falling linearly from 1 to 0 in Tc.
Wave speed. Korteweg: a = √[(K/ρ) / (1 + (K/E)(D/e))] for a thin-walled pipe with K = 2.2 GPa; it falls from 1483 m/s (rigid pipe) to about 1100 m/s (steel) and 300 m/s (PVC).
Limits. Rapid closure (Tc ≤ 2L/a): Joukowsky, ΔH = a V0 / g, Δp = ρ a V0. Slow closure: the Michaud estimate ΔH ≈ 2 L V0 / (g Tc). The pressure at the valve oscillates with period 4L/a, damped by friction.
Honest simplifications. The valve opening is linear in time and its discharge law is quasi-steady; real valves have a nonlinear flow-versus-travel curve. Where the head would drop below vapour pressure (about −10 m gauge) the model clamps it there and does not track the vapour cavity, so later peaks after column separation are not reliable (the readout flags this). Steady friction only, no unsteady friction, no pipe-wall viscoelasticity (matters for plastic pipes), no fluid-structure interaction. The bulge and colours are exaggerated; real wall strain is a fraction of a percent. The 800 m pipeline is drawn compressed into a 9-unit model, and the time scale is slowed so the wave can be followed. Independent educational model.