A pressurised water main is flowing steadily. Close the valve to launch a pressure wave back towards the reservoir.
Change the pipe. Watch the surge.
Run through the first pressure-wave reflection. Compare the largest valve-pressure rise with the rapid- or slow-closure estimate.
The scienceEquations, assumptions and limits
Governing equations
∂p/∂t + ρa² ∂u/∂x = 0
∂u/∂t + (1/ρ) ∂p/∂x + [f/(2D)]u|u| = 0
Here p is gauge pressure, u is mean axial water speed, ρ is density, a is pressure-wave speed, D is pipe diameter and f is the Darcy friction factor.
Rapid: Δp ≈ ρaΔu
Slow linear closure: Δp ≈ 2ρLΔu/tc
The surge estimate switches at the round-trip wave time, 2L/a. The slow-closure expression is an engineering approximation, not an exact solution for every transient.
Numerical method
The pipe is represented by a one-dimensional staggered grid. Pressure and velocity are advanced with a leapfrog finite-difference scheme at a fixed time step. The Courant number is held at 0.80 scaled, below the textbook stability limit of 1 for this ideal wave model.
There are 220 scaled pipe intervals. The reservoir end has fixed pressure; the valve end imposes a linear decrease in flow speed until closure. Darcy friction is applied as a distributed momentum loss.
Constants and labels
Water density is 998 kg/m³ textbook (approximately 20 °C). Atmospheric pressure is 101.325 kPa textbook; water vapour pressure is 2.34 kPa textbook (approximately 20 °C). The reservoir gauge pressure is 30 bar illustrative.
All slider settings are illustrative, not measurements of a particular installation. Time and the displayed pipe geometry are scaled for the exhibit.
What is simplified
This is a single-phase, one-dimensional model. It does not resolve pipe-wall viscoelasticity, changing friction during the transient, branches, air pockets, valve flow coefficients, structural supports or cavitation bubbles. If the calculated absolute pressure falls to the vapour-pressure threshold, the real pipe may separate into liquid columns; this model continues the mathematical wave and flags that result as outside its physical range. The valve is represented by an imposed flow ramp rather than a detailed mechanical valve.
The wave speed is an input that combines fluid compressibility and pipe-wall elasticity. The model is educational and is not a design or safety tool for real water systems.