Governing equations
The model treats the penstock as one moving water column and the surge tank as a vertical storage volume. After the downstream valve closes, pipe flow enters the tank:
dH/dt = (Q − Qs) / At
dQ/dt = (g Ap / L) [Hr − H − hf(Q)]
Here H is tank water-surface head, Q is signed pipe flow, Qs is spill flow, At is tank area, Ap is pipe area and L is pipe length.
hf = f (L/D) · v|v| / (2g), v = Q/Ap
Friction is signed so it always opposes motion. If the free surface exceeds the illustrative rim, a rectangular-weir approximation gives Qs = 1.84 b (H − Hcrest)3/2, with b set to 2 m (illustrative).
Reference values and checks
Gravity is 9.81 m/s² (textbook); water density is 1,000 kg/m³ (textbook approximation). The initial head loss is calculated with Darcy–Weisbach. The small-amplitude, lossless surge period is:
T = 2π √[L At / (g Ap)]
The page independently checks that period against a fixed-step RK4 calibration, checks Darcy head by summing pipe segments, and tracks volume and mechanical-energy balances during the live run. These checks test the implementation of this model, not whether its assumptions describe a particular installation.
What is simplified
- The fast pressure-wave front immediately after valve closure is not resolved. The simulation begins with the slower surge-tank motion after that initial transient.
- The penstock is represented by one-dimensional lumped inertia. Pressure and velocity are not distributed along the pipe; elastic pipe-wall effects, wave reflections, branches and turbine dynamics are omitted.
- The tank has a constant cross-section. The rim spill is an illustrative weir approximation, not a structural failure or flood model.
- Initial conditions assume steady flow before instantaneous downstream closure. Real valve motion takes time and changes the transient.
How to interpret it
Increasing tank area reduces the level swing because the same displaced volume is spread over more area. Increasing pipe length adds moving water inertia and lengthens the natural period. Friction removes mechanical energy and damps repeated swings. The readouts and parameter values are illustrative; gravity and water density are textbook reference values. This is an educational model, not a design or safety assessment.