Physics
Water hammer
A closing valve launches a pressure wave through a water pipe.

Try this
Compare fast and slow valve closure. Watch the reflected wave travel back from the reservoir. Restart after changing the valve time.
The model and its limits
One-dimensional elastic water-hammer equations solved by characteristics. Negative absolute pressures flag cavitation outside this single-phase model; bubbles are not simulated. The pipe is shortened visually.
Equations used in the module
Equations Δp = ρ a Δv ∂p/∂t + ρ a² ∂v/∂x = 0 ∂v/∂t + (1/ρ) ∂p/∂x = -f v


