Onset of convection (2-D)
A layer heated from below convects only if buoyancy wins over viscous resistance and thermal diffusion. Below a critical Rayleigh number every temperature perturbation decays and heat crosses the shell by conduction alone; above it the perturbation grows exponentially until convection reaches a finite amplitude. This example finds that threshold in the spherical annulus by measuring the growth rate of one perturbation at six Rayleigh numbers.


Temperature (300 to 1300 K) at Ra = 4000, Nr = 64 (64 × 512 cells). The wavenumber-4 perturbation grows on the conductive profile, saturates after about 3.2 Gyr (0.1 diffusion times) and settles into four steady cells.
Set-up
| shell | |
| boundaries | free slip; 1300 K at the core-mantle boundary, 300 K at the surface |
| fluid | Boussinesq, constant viscosity set by eta_for_Ra |
| initial state | the conductive profile of the spherical annulus plus a 1 K perturbation of azimuthal wavenumber |
| transport | temperature on the grid with the TVD scheme, so no marker noise seeds other modes |
| run | 0.3 thermal diffusion times, |
The conductive state of the spherical annulus is not linear in
which is what temp.initial_profile = "conductive" sets. Starting from the exact conductive state of the discrete problem means a run below the threshold has nothing to do but let the perturbation decay.
Measuring the growth rate
Near the conductive state the equations are linear in the perturbation, so each mode grows or decays as
and docs/scripts/fig_onset.jl fits it by least squares from each run's diagnostics.csv. It uses the last two thirds of a run, or, for a run that grows by more than a factor 100 and saturates, the linear phase only (from a tenth of the run to the time

A: rms velocity of the six runs, logarithmic scale. Straight lines are exponential growth or decay; Ra = 2000 and 4000 bend over where they reach finite amplitude. B: fitted growth rate in units of the diffusion time
| Ra | 600 | 800 | 1000 | 1400 | 2000 | 4000 |
|---|---|---|---|---|---|---|
| −2.73 | +1.52 | +5.79 | +14.3 | +27.2 | +70.0 |
The growth rate changes sign between Ra = 600 and 800, giving
How it compares
For a plane layer with free-slip, isothermal walls the linear-stability threshold is
Running it
for ra in 600 800 1000 1400 2000 4000; do
MILEVA_OUTDIR=output/onset_Ra$ra julia --project=. -t 2 \
examples/annulus_onset_2d.jl $ra 4 64
done
julia --project=. docs/scripts/fig_onset.jl outputArguments are the Rayleigh number, the wavenumber Nr. Each run took about 10 minutes on 2 threads.
References
Chandrasekhar, S. (1961), Hydrodynamic and Hydromagnetic Stability, Oxford, Clarendon Press. Turcotte, D. L. & Schubert, G. (2014), Geodynamics, 3rd edn., Cambridge University Press, section 6.19, doi:10.1017/CBO9780511843877.