Theory & Method
This page describes the mathematical foundations of the contour dynamics method as implemented in ContourDynamics.jl.
Contour Dynamics
Vortex Patches and Green's Functions
Consider a 2D inviscid flow with piecewise-constant potential vorticity (PV). The streamfunction
where
For a single vortex patch with uniform PV jump
This is the contour dynamics equation: the velocity at any point depends only on the boundary of the PV patch, not its interior.
Segment Integration
The contour is discretized into piecewise-linear segments connecting nodes
Euler Kernel
For the Euler kernel, this integral has a closed-form antiderivative. Projecting onto the segment's tangent and normal directions:
where
This is exact — no quadrature error.
QG Kernel
For the QG scalar kernel
The logarithmic singularity is handled by the exact Euler antiderivative. The smooth remainder
SQG Kernel
Surface quasi-geostrophic (SQG) dynamics replaces the Laplacian PV inversion with a fractional Laplacian:
where
The segment integral has a closed-form antiderivative:
Unlike the Euler and QG kernels, the SQG velocity is singular at the contour boundary — the tangential component diverges logarithmically. A regularization
Ewald Summation
Periodic Green's Functions
On a doubly-periodic domain
Real-Space Sum
where
Fourier-Space Sum
where
Singular Subtraction for Periodic Velocity
The periodic segment velocity uses the same singular-subtraction approach: the log singularity from the central image is handled by the exact unbounded Euler formula, and the smooth correction
QG Periodic Decomposition
For the QG kernel on a periodic domain, we decompose:
where
SQG Periodic Decomposition
For the SQG kernel
The Fourier coefficients decay as
The periodic segment velocity uses singular subtraction: the regularized unbounded SQG velocity (exact
Contour Surgery
The Dritschel surgery algorithm (Dritschel, 1988) handles the topological changes that arise during long-time evolution.
Node Redistribution (Remeshing)
After each surgery pass, nodes are redistributed along each contour to maintain segment lengths between
Compute cumulative arc lengths along the contour
Walk the perimeter, placing new nodes at arc-length intervals
Short segments (
) are merged; long segments ( ) are subdivided
Reconnection
When two contour segments approach within distance
Same contour: the contour is split (pinched) into two daughter contours
Different contours with same PV: the contours are merged (stitched together)
Reconnection uses a spatial index (hash-map binned by
Filament Removal
After reconnection, contours with
Surgery Parameters
| Parameter | Symbol | Description |
|---|---|---|
delta | Proximity threshold for detecting close segments | |
mu | Minimum segment length after remeshing | |
Delta_max | Maximum segment length after remeshing | |
area_min | Minimum contour area; smaller contours are removed | |
n_surgery | — | Number of time steps between surgery passes |
Typical choices:
Multi-Layer QG
Modal Decomposition
For an
The coupling matrix is diagonalized:
If
: barotropic mode — uses the Euler kernel Otherwise:
— uses a QG kernel
The velocity in physical layers is recovered by projecting back through the eigenvector matrix.
Time Integration
RK4
The classical 4th-order Runge-Kutta scheme advances all node positions simultaneously:
This is the recommended integrator for most applications.
Leapfrog with Robert-Asselin Filter
The leapfrog scheme is 2nd-order centred:
A Robert-Asselin filter (
References
Contour Dynamics and Surgery
Dritschel, D. G. (1988). Contour surgery: a topological reconnection scheme for extended integrations using contour dynamics. J. Comput. Phys., 77(1), 240-266. doi:10.1016/0021-9991(88)90165-9
Dritschel, D. G. (1989). Contour dynamics and contour surgery: numerical algorithms for extended, high-resolution modelling of vortex dynamics in two-dimensional, inviscid, incompressible flows. Comput. Phys. Rep., 10(3), 77-146. doi:10.1016/0167-7977(89)90004-X
Dritschel, D. G. & Ambaum, M. H. P. (1997). A contour-advective semi-Lagrangian numerical algorithm for simulating fine-scale conservative dynamical fields. Q. J. R. Meteorol. Soc., 123(540), 1097-1130. doi:10.1002/qj.49712354015
Surface Quasi-Geostrophic Dynamics
Held, I. M., Pierrehumbert, R. T., Garner, S. T. & Swanson, K. L. (1995). Surface quasi-geostrophic dynamics. J. Fluid Mech., 282, 1-20. doi:10.1017/S0022112095000012
Constantin, P., Majda, A. J. & Tabak, E. (1994). Formation of strong fronts in the 2-D quasigeostrophic thermal active scalar. Nonlinearity, 7(6), 1495-1533. doi:10.1088/0951-7715/7/6/001
Scott, R. K. & Dritschel, D. G. (2014). Numerical simulation of a self-similar cascade of filament instabilities in the surface quasigeostrophic system. Phys. Rev. Lett., 112, 144505. doi:10.1103/PhysRevLett.112.144505
Rodrigo, J. L. (2005). On the evolution of sharp fronts for the quasi-geostrophic equation. Comm. Pure Appl. Math., 58(6), 821-866. doi:10.1002/cpa.20059