← Shallow-water baseline
LESSON F · CLEBSCH VARIABLESFour scalars, one moving fluid

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 ↓
THE REPRESENTATION
u flat = d phi + alpha d beta
velocity vector = metric raised one-form

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.

HEIGHT / DENSITYh(x,y,t)

Water column carried by the flux hu. Pressure comes from its gradient.

BERNOULLI POTENTIALφ(x,y,t)

Its differential supplies the exact, curl-free part of the velocity one-form.

LABEL WEIGHTα(x,y,t)

A materially transported scalar that weights how strongly the β-label contributes.

MATERIAL LABELβ(x,y,t)

Another transported scalar. Its level curves move with the water.

THE IMPORTANT CHANGE OF PROBLEM

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.

height changes with mass-flux divergence
pressure enters the Bernoulli potential

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.

LIVE PERIODIC GRIDheight h with velocity vectors
ready
GLYPHS

Arrows are vectors: they point where a particle moves.

time0
mass drift
energy
divergence RMS
vorticity RMS
ζ − dα∧dβ RMS
THE FOUR STATE FIELDS AT ONCEClick a tile to bring it to the main grid.

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.

0-FORMS · SCALARS

φ, α, β, h

Each assigns one number to every grid point. Their colors have no direction.

φ(x,y), α(x,y), β(x,y), h(x,y)
take d
1-FORMS · COVECTORS

dφ + αdβ

A one-form measures displacements. Its kernel bars show which displacements produce zero reading.

u♭(δx) ∈ ℝ
raise ♯
VECTORS

u

The metric turns the measuring one-form into the arrow that transports water and labels.

ẋ = u(x,t)
WHERE DOES ROTATION COME FROM?

The crossing of two scalar foliations.

vorticity two-form = d alpha wedge d beta

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.

VECTOR VS. COVECTOR

Same two numbers here; different jobs.

vector u

Consumes time and produces displacement.

covector u♭

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 SHALLOW-WATER SYSTEM IN CLEBSCH VARIABLES

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.

  1. alpha and beta are material invariants

    The two labels are painted onto the water.

  2. Bernoulli evolution of phi

    Kinetic and pressure terms update the exact potential.

  3. mass continuity

    Height is a density, so it changes under compression.

  4. reconstruct velocity

    The one-form is rebuilt from the four scalar fields.