Loading the engineShared by all simulations, so the next one opens instantly.
The physics

Heat a layer of fluid from below and cool it from above. Warm fluid is lighter and wants to rise, but viscosity holds it back and heat diffuses away before a parcel gets far. Only when buoyancy wins by a large enough margin does the layer turn over into convection rolls. Bénard saw the hexagonal cells in 1900, and Lord Rayleigh worked out the threshold in 1916. The same instability drives weather, the circulation in the Earth’s mantle and the granulation on the surface of the Sun.

What you see

Temperature in a slice through the layer: hot fluid (red) at the bottom plate, cold (blue) at the top, in a box twice as wide as it is high that wraps around at the sides. The fluid starts at rest with a linear temperature profile and a faint random disturbance. Above the threshold the disturbance grows into rolls; hot plumes rise from the bottom boundary layer, spread under the top plate and sink again as cold plumes. At higher Rayleigh numbers the plumes detach in bursts and the rolls wander.

Equation

In the Boussinesq approximation density changes matter only through buoyancy. For the vorticity ω and the temperature T:

∂ω∂t+𝐮⋅∇ω=ν∇2ω+gα∂T∂x,∂T∂t+𝐮⋅∇T=κ∇2T,

with the velocity 𝐮 from the streamfunction, −∇2ψ=ω. Two numbers set the behavior: the Rayleigh number Ra=gαΔTd3/(νκ) and the Prandtl number Pr=ν/κ. The plates are free-slip (no shear stress, no flow through them) and held at fixed temperatures.

With free-slip plates the threshold is exact: a roll of wavenumber k grows once Ra>(π2+k2)3/k2, lowest at Rac=27π4/4≈658. This box holds rolls with k=π and up, so convection starts at Ra=8π4≈779. The simulation reproduces the linear growth rate of that roll within 2% at Ra = 2000 and its decay at Ra = 700.

Numerics

A 128 by 64 grid, streamfunction and vorticity at the cell corners, temperature at the cell centers. Vorticity is advected with Arakawa’s Jacobian, temperature with a limited upwind flux that creates no new extremes, and time advances with a three-stage Runge-Kutta scheme. The Poisson equation is solved exactly with a Fourier transform sideways and a tridiagonal solve between the plates.

Presets

Rising plumes: Ra = 105. Thin thermal boundary layers at both plates shed plumes that feed a few large rolls.

Steady rolls: Ra = 3000, a few times the threshold. The disturbance settles into a steady pair of rolls.

Water, Pr = 7: the same Ra with a more viscous fluid. Momentum diffuses faster than heat, so the plumes are thinner and slower.

Vigorous convection: Ra = 3⋅105. Plumes detach in bursts and the large-scale circulation keeps changing.

Parameters

Rayleigh number Ra: 500 to 3⋅105, logarithmic. Below 779 every disturbance dies out. Applies live.

Prandtl number Pr: 0.1 to 10. Applies live.