When you stop a flowing liquid abruptly, the kinetic energy turns into pressure and a pressure wave runs along the pipe. If it is strong enough, the pipe, the fittings or the equipment are damaged.
The critical time: the wave's round trip
The pressure wave travels along the pipe at close to the speed of sound, reflects from the end and returns. The time to return to the valve depends on the pipe length and the wave speed.
The rule is this: if the closing time is shorter than that round trip, the pressure rise reaches its maximum — the sudden-closure case. If it is longer, the reflected wave returns before closure is complete and limits the rise.
So "closing slowly" is relative: two seconds is slow on a short line and sudden on a line kilometres long.
Wave speed depends on pipe elasticity
The liquid's own sound speed is an upper bound; as the pipe wall flexes, the effective wave speed falls and the pressure rise is reduced. Water hammer is therefore gentler in plastic pipe than in steel.
If there is free gas in the liquid the wave speed drops dramatically — a small amount of air markedly softens the transient. That is both a remedy and a source of uncertainty.
Column separation: the real danger
If a rarefaction wave takes the pressure below the vapour pressure somewhere, the liquid column separates and a vapour cavity forms. When the wave returns, that cavity collapses and produces a pressure peak far more severe than the original.
Most pipeline damage is caused not by the direct transient but by that secondary collapse. See the cavitation note.
Modelling
The problem is one-dimensional wave propagation and is usually handled with line models; three-dimensional CFD is unnecessary here. CFD contributes on local questions: the flow inside the valve, where cavitation begins, the force distribution on equipment.
In either case the solution is compressible and transient; an incompressible assumption erases the wave completely.
References
- Singhal, A. K., Athavale, M. M., Li, H. & Jiang, Y. (2002). Mathematical basis and validation of the full cavitation model. Journal of Fluids Engineering, 124(3), 617–624. DOI: 10.1115/1.1486223
- Ferziger, J. H., Perić, M. & Street, R. L. (2020). Computational Methods for Fluid Dynamics, 4th ed. Springer. DOI: 10.1007/978-3-319-99693-6