Governing equations
For small pressure and velocity disturbances in a straight, uniform pipe:
∂p′/∂t + ρa² ∂u′/∂x = 0
∂u′/∂t + (1/ρ) ∂p′/∂x = 0
Characteristic variables are R = p′ + ρau′ (right-going) and S = p′ − ρau′ (left-going). Pressure is p′ = (R + S) / 2.
Boundaries and reference values
The open reservoir fixes the pressure disturbance to zero, so R = −S at the upstream boundary. The valve imposes a linearly decreasing velocity, reaching zero after the selected closing time. The rapid-closure reference is the Joukowsky rise:
Δp = ρaΔV
The first one-way travel time is L/a; the first round trip is 2L/a. Flow rate is Q = πD²V/4 and static gauge pressure is ρgH.
Numerical method
R and S are shifted one grid cell per fixed step with Δt = Δx/a, giving Courant number aΔt/Δx = 1. This characteristic update is stable for the ideal linear wave equations and does not depend on display frame rate. The animation uses an accumulator and a fixed simulation step.
What is simplified
Water density is 998.2 kg/m³ at 20°C and gravitational acceleration is 9.80665 m/s²; both are textbook values. Length, wave speed, flow speed, diameter, head and pressure rating are illustrative inputs. The wave speed is entered as an effective pipe-system value rather than calculated from a particular wall material.
The model is one-dimensional, linear, lossless and single-phase. It omits friction, viscoelastic wall damping, bends, branches, air pockets, cavitation, nonlinear valve coefficients and structural rupture. The rating comparison is an illustrative threshold, not a pipe-design or safety assessment. A rating exceedance does not mean the model has calculated a real failure.