Model. Linear long-wave (shallow-water) equations, ηt = −∇·(h u), ut = −g ∇η, i.e. ηtt = ∇·(g h ∇η) with speed c = √(g h), on a staggered grid with a forward-backward leapfrog step. Walls are zero-flux faces; “absorbing” walls are a damping sponge (a numerical beach).
Huygens. Every cell passes on what its neighbours do, so wavefronts are rebuilt from secondary sources: a gap of width w spreads the wave by about λ/w, and two gaps a distance d apart give bright directions sinθ = n λ/d.
Dispersion. Real water waves obey ω2 = g k tanh(k h); for k h < 0.3 that is within about 1.5 % of ω = k √(g h). This solver is non-dispersive; the chart shows both curves and your wave, and the readout lists the long-wave speed error. cg = ½ c (1 + 2kh / sinh 2kh).
Refraction and Green’s law. Where the depth changes slowly the wave keeps its frequency but changes speed (Snell: sinθ/c constant) and its amplitude follows A ∝ h−1/4; the dashed curve in the section plot is that envelope.
Stability (CFL). The scheme is stable only for cmax dt ≤ dx/√2; ν > 1 makes the surface blow up.
Energy. E = ½ρ[ g ∑η2 dA + ∑h uold unew dA ] is an exact invariant of the scheme with reflecting walls and no source or sponge (check below); otherwise it changes by design.
Honest simplifications. Linear small-amplitude waves only: no breaking, nonlinearity, surface tension or friction. The 24 m basin is a coastal-engineering scale model. Colours are exaggerated for visibility.
Independent checks (run on load, same core as the 3D page):
| running… |