Geophysical Fluid Dynamics

Interactive pedagogical notebooks exploring the mathematics and physics of rotating, stratified geophysical flows. Each notebook runs entirely in your browser via WebAssembly — no installation required.

Convection

Rayleigh-Bénard Convection & Lorenz Chaos

2D thermal convection in a Boussinesq fluid heated from below. Truncating the governing equations to three Fourier amplitudes yields the Lorenz (1963) system — the canonical model of deterministic chaos and the original "butterfly effect."

Ra = g α ΔT H³ / (ν κ)
  • Lattice-Boltzmann D2Q9 solver with real-time rendering
  • Lorenz attractor: sensitive dependence on initial conditions
  • Bifurcation from conduction → steady rolls → chaos
  • Nusselt number as a function of Rayleigh number
▶ Open Notebook
Rotating Fluids

Geostrophic Adjustment & Shallow Water Waves

Linearised shallow water equations on a rotating beta-plane. A Gaussian height perturbation simultaneously radiates fast inertia-gravity waves and slowly adjusts toward geostrophic balance, with Rossby waves drifting westward via the β-effect.

ω² = f² + c²(k² + l²) · L_R = c / f₀
  • Pseudo-spectral RK4 solver on a doubly-periodic domain
  • Inertia-gravity vs. Rossby wave dispersion relations
  • Rossby deformation radius controls adjustment scale
  • KE / PE energy partition during geostrophic adjustment
▶ Open Notebook
Turbulence

2D Navier-Stokes Turbulence

Decaying turbulence governed by the 2D incompressible Navier-Stokes equations in vorticity-streamfunction form. Unlike 3D turbulence, energy cascades upscale while enstrophy cascades to small scales — a consequence of the additional conservation law in two dimensions.

∂ω/∂t + J(ψ, ω) = ν ∇²ω
  • Pseudo-spectral solver with 2/3-rule dealiasing
  • Inverse energy cascade: k⁻⁵/³ power-law spectrum
  • Forward enstrophy cascade: k⁻³ spectrum
  • Vortex merging and coherent structure formation
▶ Open Notebook
Stratification

Internal Gravity Waves

Internal waves propagate through a stably stratified fluid, carrying energy at angles set by the ratio of wave frequency to the Brunt-Väisälä frequency. Their peculiar dispersion relation — energy and phase propagate perpendicular to each other — makes them unlike any surface wave.

N² = -(g/ρ₀)(∂ρ/∂z) · ω = N cos θ
  • Brunt-Väisälä (buoyancy) frequency and stable stratification
  • Angle-dependent dispersion: group velocity ⊥ phase velocity
  • Saint Andrews Cross wave-beam pattern
  • Wave reflection, focusing, and critical layers
▶ Open Notebook