Water hammer
A valve closes. A pressure wave races through the pipe.
ONE PIPE · ONE VALVE
Close the valve to launch a compression wave. The reservoir reflects it back through the pipe.
Does the model agree?
Independent comparisons are recalculated when the controls change.
Peak pressure rise
Numerical peak compared with the fast/slow closure estimate.
Wave arrival
Measured at the upstream sensor and compared with length ÷ wave speed.
Continuity balance
Integrated storage change compared with net boundary flux.
Courant condition
Fixed time step checked against the one-dimensional wave stability limit.
Measure the first arrival
Launch the same closure again, detect the first flow change at the reservoir end, and compare its travel time with the predicted value.
MODEL NOTESThe science+
Governing equations
The solver evolves small pressure-head and flow perturbations about a steady initial flow. In one spatial dimension:
h is pressure-head change (m), q is flow-rate change (m³/s), A is pipe area (m²), g is gravitational acceleration, and r = fV₀/D is the linearised Darcy-friction rate (s⁻¹).
Wave speed and closure
The elastic wave speed uses water bulk modulus K = 2.2 GPa, water density ρ = 998 kg/m³, and steel Young’s modulus E = 200 GPa TEXTBOOK APPROXIMATIONS. The thin-wall compliance expression assumes a uniform steel pipe with a simplified restraint factor.
The reservoir boundary holds h = 0. The valve boundary ramps the flow perturbation from zero to −AV₀ over the selected closing time. The rapid-closure reference is the Joukowsky rise, ΔH = aV₀/g; for slow linear closure, the Michaud estimate ΔH ≈ 2LV₀/(gT) is used.
Numerics and checks
A staggered-grid, centred finite-difference scheme advances flow and pressure with a fixed step. The Courant number is held at 0.82 SCALED NUMERICAL SETTING, below the one-dimensional wave limit of one. The displayed continuity check compares the integrated head-storage change with the boundary-flux integral. The arrival test detects the first upstream flow perturbation above a small threshold.
What is simplified
The pipe is straight, horizontal, uniform, completely full, and connected to a fixed-head reservoir. The fluid and pipe are represented by one-dimensional linear acoustics. Friction is linearised around the initial flow. The valve closes linearly; no valve geometry, nonlinear turbulence, cavitation, column separation, air pockets, branches, leaks, or structural vibration are solved. The hoop-stress indicator is a thin-wall estimate against an illustrative 250 MPa threshold, not a pipe rating or a rupture model.
What is illustrative
Pipe dimensions, starting head, presets, the 250 MPa comparison threshold, and the visible apparatus are educational examples. Material properties are textbook approximations, not a specification for a real installation. The displayed pressure is gauge pressure relative to atmosphere.
Independent educational simulation. Not affiliated with a water utility, pipe manufacturer, or engineering standards body.