A variable-depth shallow-water simulation. Trigger an undersea displacement, adjust its height and width, and observe the wave shoal as it reaches the coast.
Long-wave (shallow-water) limit: wavelength >> depth, so the sea surface η(x,y,t) obeys
∂²η/∂t² = g ∇·(h ∇η) with still-water depth h(x,y). Local celerity
c = √(g h) (≈ 200 m/s ≈ 720 km/h over a 4.4 km abyss, only ~10 m/s near the shore), so the front slows and the crests bunch up.
Energy flux E c is conserved along a ray, giving Green’s law A ∝ h-1/4: a 1 m deep-ocean wave is amplified several-fold by the shelf — the “GREEN GAIN” tile shows the factor for the current front depth. The grid solves the linear equation with a leapfrog scheme (Δt = 2.1 s, Δx ≈ 1.26 km) and a sponge at the open edges.
Honest simplifications: linear (no advection, no breaking, no friction, no dispersion), no Coriolis, a stylised coastline, a flat shoreline wall instead of real run-up/inundation (the dry cells just reflect), and the vertical scale is exaggerated ×0.55 per metre for visibility. The town, ships and pier are illustrative models; boats ride the computed surface. Real warning systems use nonlinear solvers (e.g. MOST, GeoClaw) on measured bathymetry.
Running self-check…