Water flowing down a penstock carries momentum. When the turbine's guide vanes close, that momentum can't vanish instantly — the flow deceleration launches a pressure wave that travels up and down the pipe at the elastic wave speed a (set by the fluid's compressibility and the pipe wall's stiffness, typically 900–1400 m/s for steel).
Joukowsky equation (instant closure):
ΔH = a·ΔV / g
Rapid closure if Tc < 2L/a → full Joukowsky surge
Slow closure if Tc > 2L/a → surge reduced roughly by 2L/(a·Tc)
The pipe is solved with the classic method of characteristics (Wylie & Streeter): discretise the penstock into reaches of length Δx = L/N and step time by Δt = Δx/a. Head H and flow Q at each interior node come from two characteristic equations:
C+: H = C_P − B·Q (from the upstream node)
C−: H = C_M + B·Q (from the downstream node)
B = a / (g·A) — pipe's hydraulic impedance
At the closing valve the two equations are combined with the orifice law Q ∝ τ(t)·√H to solve for the new head and flow every step, which is what produces the pressure spike you see colour the pipe red.
A surge tank — an open vertical shaft between a long low-pressure tunnel and the short high-pressure penstock — protects the penstock by absorbing the rejected flow as a slow, undamped mass oscillation (rigid water-column theory) instead of letting the full elastic shock reach the valve:
d z/dt = (q_tunnel − q_penstock) / A_surge
d q_tunnel/dt = (g·A_tunnel / L_tunnel) · (−z − friction)
Toggle the surge tank off and close the valve fast to see the unmitigated Joukowsky spike; turn it back on to see the same closure produce a much smaller surge at the turbine, at the cost of a slow oscillation in the tank itself — exactly the trade-off real hydro plants are engineered around.