Water hammer (or, more generally, fluid hammer) is a pressure surge or wave resulting when a fluid (usually a liquid but sometimes also a gas) in motion is forced to stop or change direction suddenly (momentum change).
Water hammer commonly occurs when a valve is closed suddenly at an end of a pipeline system, and a pressure wave propagates in the pipe. It may also be known as hydraulic shock.
This pressure wave can cause major problems, from noise and vibration to pipe collapse. It is possible to reduce the effects of the water hammer pulses with accumulators and other features.
Rough calculations can be made either using the Joukowsky equation, or more accurate ones using the method of characteristics.