Water hammer is the momentary increase in pressure which occurs in a water system when there is a sudden change of direction or velocity of the water. When a rapidly closed valve suddenly stops water flowing in a pipeline, pressure energy is transferred to the valve and pipe wall. Shock waves are set up within the system. Pressure waves travel backward until encountering the next solid obstacle, then forward, then back again.