Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Phase 2 — 2D Spatial Dynamics: Diffusion, the Poisson Problem, and Cavity Flow

Authors
Affiliations
University of Valencia

Two dimensions add a qualitatively new ingredient that the 1-D fundamentals could not show: an elliptic constraint. An incompressible flow cannot evolve its vorticity without simultaneously solving a Poisson equation for the streamfunction at every step — a global, instantaneous coupling with no time-step of its own. This chapter builds up to that coupling through 2-D diffusion, the Poisson solve in isolation, and finally the lid-driven cavity, where advection, diffusion, and the elliptic inversion all act together Durran (2010)Cushman-Roisin & Beckers (2011).

What you will learn

  • How diffusion smooths a 2-D field on the staggered grid

  • Why incompressible dynamics needs an elliptic (Poisson) solve, and what its solution looks like

  • How somax’s vorticity–streamfunction Navier–Stokes model assembles advection + diffusion + Poisson into the canonical cavity benchmark

1. Two-dimensional diffusion

The 2-D diffusion equation smooths a field isotropically,

∂tu=ν ∇2u=ν(∂xxu+∂yyu),\partial_t u = \nu\,\nabla^2 u = \nu\left(\partial_{xx} u + \partial_{yy} u\right),

and inherits the parabolic step limit from one dimension in a slightly stricter form, ν Δt (Δx−2+Δy−2)≤1/2\nu\,\Delta t\,(\Delta x^{-2} + \Delta y^{-2}) \le 1/2. A compact blob relaxes into an ever-wider, ever-flatter mound while conserving its integral — the multidimensional version of the smoothing seen in (1).

watermark extension not installed; skipping reproducibility readout.

Figure 1 contrasts the initial spike with the relaxed field.

<Figure size 1200x500 with 4 Axes>
A 2-D Gaussian blob before and after diffusing under . The peak collapses and the support broadens isotropically.

Figure 1:A 2-D Gaussian blob before and after diffusing under (1). The peak collapses and the support broadens isotropically.

2. The Poisson problem — the elliptic heart of incompressible flow

An incompressible 2-D flow is divergence-free, so it derives from a streamfunction ψ\psi with u=(−∂yψ, ∂xψ)\mathbf{u} = (-\partial_y\psi,\ \partial_x\psi). Its vorticity ω=∂xv−∂yu\omega = \partial_x v - \partial_y u then satisfies a Poisson equation,

∇2ψ=ω,\nabla^2 \psi = \omega ,

which must be solved — globally and instantaneously — to recover the velocity from the vorticity at every time step. Unlike advection or diffusion, (2) has no time derivative: it is an elliptic constraint, and its fast, accurate inversion is the workhorse behind both the Navier–Stokes cavity below and the quasi-geostrophic models of Phase 4. somax exposes the inversion directly as PoissonSolver2D.

Poisson solve: psi shape (130, 130), finite=True

Figure 2 shows the source on the left and the recovered streamfunction on the right; the closed ψ\psi contours are the streamlines of the vortex pair that the source implies.

<Figure size 1200x500 with 4 Axes>
Left: a dipolar vorticity source. Right: the streamfunction recovered by inverting  with homogeneous Dirichlet boundaries; the contours are the implied streamlines.

Figure 2:Left: a dipolar vorticity source. Right: the streamfunction recovered by inverting (2) with homogeneous Dirichlet boundaries; the contours are the implied streamlines.

3. Lid-driven cavity — advection, diffusion, and Poisson together

The lid-driven cavity is the standard benchmark that exercises all three ingredients at once. The vorticity transport equation

∂tω+u⋅∇ω=ν ∇2ω,∇2ψ=ω,\partial_t \omega + \mathbf{u}\cdot\nabla\omega = \nu\,\nabla^2\omega , \qquad \nabla^2\psi = \omega ,

is integrated in a square box whose top wall slides at constant speed while the other three are no-slip. Vorticity is generated at the moving lid, advected into the interior, diffused, and continuously re-inverted through (3) to update the velocity. somax’s IncompressibleNS2D assembles exactly this loop.

cavity Reynolds number ~ u_lid*L/nu = 500

Figure 3 shows the spun-up cavity: the primary recirculating vortex fills the box, driven by the lid, with the streamfunction contours revealing the characteristic central eddy and weaker bottom-corner circulations.

<Figure size 1200x500 with 3 Axes>
Lid-driven cavity at moderate Reynolds number. Left: vorticity, generated at the sliding top wall and swept around the box. Right: streamlines from the Poisson inversion , showing the primary central vortex.

Figure 3:Lid-driven cavity at moderate Reynolds number. Left: vorticity, generated at the sliding top wall and swept around the box. Right: streamlines from the Poisson inversion (3), showing the primary central vortex.

Summary

  • 2-D diffusion (1) smooths isotropically under a parabolic step limit, the direct extension of the 1-D case.

  • Incompressible flow carries an elliptic constraint: the Poisson equation (2) must be inverted every step to recover velocity from vorticity — a global coupling with no time-step of its own, exposed as PoissonSolver2D.

  • The lid-driven cavity (3) welds advection, diffusion, and the Poisson solve into one loop; the same vorticity–streamfunction structure reappears in the quasi-geostrophic ocean models.

With the elliptic machinery in place, the next chapter turns to low-order chaos — the Lorenz systems — before Phase 4 assembles the full geophysical models.

References
  1. Durran, D. R. (2010). Numerical Methods for Fluid Dynamics: With Applications to Geophysics (2nd ed., Vol. 32). Springer. 10.1007/978-1-4419-6412-0
  2. Cushman-Roisin, B., & Beckers, J.-M. (2011). Introduction to Geophysical Fluid Dynamics: Physical and Numerical Aspects (2nd ed., Vol. 101). Academic Press.