This demo shows how the Isothermal Liquid library can be used to model water hammer in a long pipe. After opening a valve to slowly establish steady flow in the pipe, the valve is quickly shut. If the Valve is shut quickly enough, it triggers a water hammer effect. A water hammer arrestor suppresses the pressure spikes.
The valve is modeled using a Variable Local Restriction (IL) block, and the pipe is divided into 20 segments using two Pipe (IL) blocks. Breaking the pipe into more segments increases fidelity at the expense of simulation performance. The water hammer effect requires modeling both dynamic compressibility and inertia in the pipes. The water hammer arrestor is modeled using a Gas-Charged Accumulator (IL) block. A Variant Connector block enables and disables the water hammer arrestor.
These figures show the pressure shock wave and resulting oscillations due to a sudden valve closure when the water hammer arrestor is disabled.
This animation shows the pressure shock wave and resulting oscillations along the pipeline due to a sudden valve closure when the water hammer arrestor is disabled.
This figure compares the pressure and flow rate at the pipe midpoint with the water hammer arrestor disabled and enabled.