In a liquid-filled, elastic pipe, changes in flow propagate as coupled pressure and velocity waves. The model solves the one-dimensional, linear, frictionless water-hammer equations:
∂u/∂t + (1/ρ) ∂p/∂x = 0
∂p/∂t + ρa² ∂u/∂x = 0
For a thin-walled, axially constrained pipe, an approximate wave speed is:
a = √[K / {ρ(1 + KD/Ee)}]
Here ρ is density, K is water bulk modulus, E is pipe Young's modulus, D is inside diameter, and e is wall thickness. The rapid-closure pressure step approaches Δp = ρau₀; the end-to-end return time is 2L/a.
Numerical method: two Riemann invariants propagate one grid cell each fixed time step (Δt = Δx/a). The upstream boundary holds pressure fixed; the valve imposes a linear ramp in velocity. The reflection check uses a separate delayed recurrence. The storage check integrates pressure and boundary flux independently using the trapezoidal rule.
Simplifications: single-phase water, uniform pipe, linear wall elasticity, no viscous friction, no turbulence, no gas pockets, no pipe rupture, no valve-flow coupling, no cavitation solution. At sub-vapour pressure or beyond an illustrative pipe rating, the prediction is flagged, not claimed to describe damage. A real valve's closure law may differ from the imposed linear velocity ramp.
Constants (textbook, approximate): water density 998.2 kg/m³, water bulk modulus 2.2 GPa, pipe Young's modulus 200 GPa, vapour-pressure threshold 2.3 kPa. Illustrative: chosen pipe, operating pressure, valve timing, and rating. Scaled: pipe proportions, wave brightness, moving tracer dots, playback and gauge graphics. No affiliation with a pipe or valve manufacturer.