Water column carried by the flux hu. Pressure comes from its gradient.
A periodic plane · material labels · one-forms · shallow water
Clebsch variables,
without the sleight of hand.
The variables are scalar fields. They do not become a velocity until their differentials are assembled into a one-form and the metric raises that covector to a vector. This lab keeps every step visible on one planar grid.
Open the live grid ↓On this Cartesian plane, raising an index preserves the two displayed components. That numerical coincidence is why vectors and covectors are easy to conflate here.
Its differential dφ supplies the exact, curl-free part of the velocity one-form.
A materially transported scalar that weights how strongly the β-label contributes.
Another transported scalar. Its level curves move with the water.
Do not project shallow water to zero divergence.
In the random-flow lab, subtracting d p is a useful incompressible comparison. In shallow water, convergence and divergence are physical: they raise and lower the water column. Pressure acts through the evolution of φ while the continuity equation evolves h.
On a torus, the velocity state may also carry two harmonic periods. This planar lab sets them to zero; a topology-aware solver must retain and audit them separately.
Arrows are vectors: they point where a particle moves.
The careful version
Scalar → covector → vector → transport.
Clebsch notation is compact because it suppresses those type conversions. Expand them, and the construction becomes much less mysterious.
φ, α, β, h
Each assigns one number to every grid point. Their colors have no direction.
φ(x,y), α(x,y), β(x,y), h(x,y)dφ + αdβ
A one-form measures displacements. Its kernel bars show which displacements produce zero reading.
u♭(δx) ∈ ℝu
The metric turns the measuring one-form into the arrow that transports water and labels.
ẋ = u(x,t)The crossing of two scalar foliations.
The exact piece disappears because d squared phi is zero. Rotation is large where α and β change strongly in independent directions. If their contours are parallel, their wedge product vanishes.
Same two numbers here; different jobs.
Consumes time and produces displacement.
Consumes displacement and produces a number.
In Cartesian coordinates with the identity metric, lowering an index copies the components. On a curved or stretched mesh, the metric changes them.
The labels move; height compresses; φ pays the Bernoulli bill.
D t is the material derivative. The lab semi-Lagrangian-advects the labels and φ, advances h with conservative periodic face fluxes, and fixes the irrelevant spatial mean of φ. A weak periodic de-aliasing diffusion kappa equals five times ten to the minus four suppresses grid-scale folds once the transported labels become finer than the mesh; the vorticity audit makes the remaining representation error visible.
- alpha and beta are material invariants
The two labels are painted onto the water.
- Bernoulli evolution of phi
Kinetic and pressure terms update the exact potential.
- mass continuity
Height is a density, so it changes under compression.
- reconstruct velocity
The one-form is rebuilt from the four scalar fields.