Aladdin Ali

Shallow Water Lab

Lift a gate between two water levels. A rarefaction spreads upstream while a shock travels downstream.

Flume cross-section

Model Exact

Velocity history

0m/s

Each row is one instant in the flume. Select a point to move the time cursor and gauge.

How close is the solution?

Compare the numerical water depth in each cell with its exact average. Refining the grid narrows the smeared shock. The closed ends keep the total volume fixed.

Four-grid benchmark (JSON)
Mean depth error
—
Volume drift per unit width
—
Model, boundaries and reference

A first-order conservative finite-volume scheme evolves water depth and discharge in a 120 m rectangular channel. Each interface uses a local Lax–Friedrichs flux. The time step adapts to the fastest gravity wave with a target Courant number of 0.45.

The model assumes a horizontal frictionless bed, hydrostatic pressure and uniform channel width. It omits vertical motion, turbulence and dry beds. The exact profile joins a rarefaction to a shock through a constant intermediate state. Playback ends before the first physical wave reaches either wall.

For the derivation, see Ketcheson, LeVeque and del Razo’s shallow-water Riemann problem. The independent smooth-wave check is documented in the project README.