Governing equations
The one-dimensional elastic water-hammer equations are written in hydraulic-head and volume-flow form:
∂H/∂t + (a² / gA) ∂Q/∂x = 0
∂Q/∂t + gA ∂H/∂x + f Q|Q| / (2DA) = 0
Here H is pressure head, Q is volume flow, a is wave speed, A is pipe area, D is diameter, f is the Darcy friction factor and g is gravitational acceleration.
Method and checks
The method of characteristics advances the two travelling wave invariants on a uniform grid with the fixed step Δt = Δx/a. The reservoir holds its head fixed. The valve imposes a linear fall in flow over the selected closure time.
- Textbook surge: Δp ≈ ρaV for rapid closure; Δp ≈ 2ρLV/tc for slow linear closure.
- Wave arrival: the first reservoir-flow response is compared with L/a.
- Volume balance: pipe compliance storage is compared with the time-integrated difference between inlet and outlet flow.
What is simplified
Water is represented by a single density and one wave speed. The pipe is uniform, straight and elastic; the reservoir is an ideal fixed-head boundary. Friction is quasi-steady. The model omits branches, pumps, detailed valve geometry, viscoelastic wall behaviour, air pockets and column separation. If the pressure reaches the water-vapour limit, the solver stops rather than pretending to model cavitation.
What is illustrative
Pipe dimensions, flow, closure time, friction factor and working-pressure rating are adjustable illustrative values, not a design recommendation. The default fixed reservoir head is 280 m (illustrative). Water density ρ = 998 kg/m³ at 20°C and standard gravity g = 9.80665 m/s² are textbook reference constants. The textbook surge formulas are ideal limiting estimates, not substitutes for a full network transient analysis.