Model. Linear long-wave (shallow-water) equations, ηt = −∇·(h u), ut = −g ∇η, i.e. the wave equation ηtt = ∇·(g h ∇η) with speed c = √(g h), solved on a staggered grid (η in cells, velocities on cell faces) by a forward-backward leapfrog scheme. Walls are zero-flux faces; the “absorbing” walls are a damping sponge (a numerical beach), not real wave breaking.
Huygens. Each grid cell passes on what its neighbours do, so a wavefront is rebuilt from secondary sources; at a gap of width w the wave spreads by diffraction (angle about λ/w) and two gaps separated by d interfere with bright directions sinθ = n λ/d.
Dispersion. Real water waves obey ω2 = g k tanh(k h). For k h < 0.3 this is within about 1.5 % of ω = k √(g h), which is all this solver represents: it is non-dispersive. The right-hand chart shows both curves and where your wave sits; the readout lists the speed error of the long-wave assumption (it grows as the period shortens or the water deepens). Group speed (full theory) is cg = ½ c (1 + 2kh / sinh 2kh).
Stability (CFL). The explicit scheme is stable only if cmax dt ≤ dx/√2; the slider shows ν = c dt √2 / dx. Above 1 numerical noise grows exponentially and the surface blows up.
Energy. E = ½ρ[ g ∑η2 dA + ∑h uold unew dA ] (potential + kinetic) is an exact invariant of the discrete scheme when walls are reflecting and no wave-maker or sponge is acting (check below); with the source on or absorbing walls it changes by design.
Honest simplifications. Linear, small-amplitude waves only (no breaking, no nonlinearity, no surface tension, no friction); the vertical scale is exaggerated and the floor drawn relative to depth, not to scale; a 24 m basin is a coastal-engineering scale model, not a bathtub. Wave heights in the picture are exaggerated by the slider factor.
Independent checks (run on load, same core as the 2D page):
| running… |