This example model shows how the Thermal Liquid foundation library can be used to model water hammer in a long pipe. After slowly establishing a steady flow within the pipe by opening a valve accordingly, the same valve is shut within a few milliseconds. This triggers a water hammer effect. The valve is modeled using a Variable Local Restriction (TL) block and the pipe is divided into four segments using the Pipe (TL) block. Breaking the pipe into more segments increases fidelity at the expense of simulation performance.