Ch 22. Hamiltonian & variational GFD
Overview
Integrate the same vortex system with a humble 2nd-order method and with classical RK4, and watch the energy: RK4’s error is far smaller — and grows forever — while the cruder method’s error, if the method carries the right geometry, stays bounded until the end of time. The geometry is Hamiltonian structure, and this chapter uses it to answer a question the whole book has leaned on without answering: GFD’s conservation laws are Noether charges of symmetries, and PV — the book’s central quantity since Ch. 7 — is the charge of the fluid’s own peculiar symmetry, particle relabeling.
The model
Notebook: notebooks/ch22_hamiltonian-gfd.py → exported to
/nb/ch22_hamiltonian-gfd.html. Governing equations use the symbols in
notation.
gfdlib.vortex implements the Kirchhoff point-vortex system — an exact
finite-dimensional Hamiltonian reduction of 2D Euler in which positions
themselves are the conjugate pair — with its four Noether invariants
(H, Q, P, L), a symplectic implicit-midpoint integrator, and a same-order
non-symplectic control (Heun). Known solutions (co-rotating pair period,
dipole translation speed) are verified in the test suite.
Both fluids
- Atmosphere & ocean together: this chapter’s payoff is not one phenomenon but a design principle for the models of both fluids. Climate and ocean models run for centuries of model time — far beyond trajectory accuracy — and what keeps their statistics physical is conservation structure (mimetic grids, conservative advection, careful energy/enstrophy bookkeeping descended from Arakawa’s schemes), exactly the structure-vs-accuracy distinction the energy-drift experiment makes visible in miniature.
- Ocean, concretely: interacting mesoscale eddies are routinely modeled as point-vortex systems; the 3-vortex integrable / 4-vortex chaotic transition sets genuine limits on predicting eddy encounters (e.g. Gulf Stream ring interactions).
Exercises
- (analytic) Verify by direct differentiation that Kirchhoff’s
generates
exactly
gfdlib.vortex.vortex_rhsthrough , , and show directly from the antisymmetry of the double sum. - (computational) Modify
ch22_hamiltonian-gfd.pyto add leapfrog applied naively to as a fourth method. It fails (leapfrog’s symplecticity requires a separable Hamiltonian, and Kirchhoff’s is maximally non-separable) — document how it fails compared to Heun. - (exploratory) For the chaotic 4-vortex configuration, find the combination at which RK4’s secular energy error first crosses above midpoint’s bounded band. How does that crossing time scale as you halve ? (Prediction: RK4’s error , midpoint’s band , so .)
Further reading
Salmon, R. (1988), Ann. Rev. Fluid Mech. 20, 225–256 (“Hamiltonian fluid mechanics”); Salmon, Lectures on Geophysical Fluid Dynamics, ch. 7; Shepherd, T. G. (1990), Adv. Geophys. 32, 287–338; Aref, H. (1983), Ann. Rev. Fluid Mech. 15, 345–389 (point-vortex motion); Hairer, Lubich & Wanner, Geometric Numerical Integration 2nd ed., ch. VI (symplectic methods, backward error analysis).