Governing model
The surge shaft stores or releases water as tunnel flow catches up with a changed outlet demand. With shaft area As, tunnel area At, level change h, and tunnel-flow change q:
As dh/dt = q − ΔQd
dq/dt = (gAt/L)[−h − (hf(Q0+q) − hf(Q0))]
Darcy–Weisbach and local losses are represented by:
hf(Q) = (fL/D + K) v|v|/(2g), v = Q/At
Textbook constant: gravitational acceleration g = 9.81 m/s². The state is advanced with an illustrative fixed 1/120 s RK4 time step. The displayed simulation clock runs at a scaled 5× pace.
What is simplified
The tunnel is treated as one rigid water column with uniform velocity. The shaft is open to the atmosphere, the reservoir level is fixed, and water is treated as incompressible. The model omits elastic pressure waves, air entrainment, turbine dynamics, detailed junction geometry, cavitation, and overflow hydraulics. It is therefore a surge-tank model, not a water-hammer solver.
What is illustrative
Pipe dimensions, flow rates, friction factors, local-loss coefficients, the ±12 m shaft boundary and the four presets are illustrative teaching choices, not measurements from a real installation. The visual cutaway is scaled and is not a construction drawing. At the boundary the calculation stops rather than pretending to model spill or air entry.