back to projects

Simulation of Rayleigh-Bénard Convection

University of Exeter

Dec 2025

  • Python
  • Dedalus
  • Spectral methods
  • Direct numerical simulation

Overview

Convection carries much of the heat in stars, but stellar evolution models only approximate it, using mixing-length theory, which treats convection as parcels of fluid travelling a fixed distance before mixing and leaves out effects like rotation.1 Simulating simplified convection directly is a way to test those approximations.

The standard simplified system is Rayleigh-Bénard convection: a layer of fluid heated from below and cooled from above. Weakly heated, heat simply conducts through it. Past a critical point, buoyancy beats viscosity and diffusion, warm fluid rises in plumes while cool fluid sinks, and the layer organises into convection cells, like the granules on the surface of the Sun.

This was a final-year computational lab project at the University of Exeter, asking three questions: when does convection start, how does the heat it carries grow with the heating, and what changes when the layer rotates?

Methods

Setup

The simulations solve the Boussinesq equations, which treat the fluid as incompressible except where temperature differences make it buoyant, using Dedalus, an open-source spectral solver in Python.2 The domain is periodic in the horizontal with a 4:1 aspect ratio: each convection roll needs a width of about twice the layer height, so this leaves room for at least two. The top and bottom are held at fixed temperatures with no-slip walls. The grid was 64×64, increased to 128×128 above Ra = 10⁶, where the thermal boundary layers become too thin to resolve otherwise and the simulation goes unstable.

Parameters

In dimensionless form the problem is set by two numbers. The Rayleigh number measures how strongly buoyancy drives the flow against viscosity and heat diffusion; the Prandtl number, the ratio of momentum to heat diffusivity, was fixed at 1.

$$ \mathrm{Ra} = \frac{g,\alpha,\Delta T,H^{3}}{\nu,\kappa} $$

Ra was swept from 10³ to 10⁷.

Diagnostics

The main diagnostic is the Nusselt number, Nu, the heat carried across the layer relative to conduction alone, so pure conduction gives Nu = 1. Each run starts from a still layer with a small random perturbation. Below onset the perturbation decays and Nu returns to 1; above it, the perturbation grows into convection cells. The critical Rayleigh number is where that switch happens. Late-time averages of Nu, and horizontally averaged temperature profiles, were then used to characterise heat transport above onset.

Rotation

The rotating runs used a 2.5D version of the code,3 which computes on a 2D grid but keeps all three velocity components, so the Coriolis force can act properly without the cost of a full 3D simulation. The rotation rate was set by a Taylor number of 10⁴.

Results

Onset, $\mathrm{Ra}_c$TheoryHeat transport, $\beta$
No rotation17081707.760.270 ± 0.012
Ta = 10⁴4732≈ 40360.23
  • Onset. Without rotation, convection starts at Ra = 1708, against 1707.76 from linear stability theory.4 Rotation raises it to 4732, against about 4036 predicted for rapid rotation: the Coriolis force resists vertical motion, so stronger heating is needed to start convection.
  • Heat transport. Above onset the Nusselt number follows a power law, $\mathrm{Nu} \propto \mathrm{Ra}^{\beta}$. Without rotation $\beta = 0.270$, close to the 0.285 reported for higher Rayleigh numbers.5 With rotation it falls to 0.23, so a rotating layer carries less heat for the same heating. Scaling laws like these are what allow simulations at modest Rayleigh numbers to be extrapolated to stars, where Ra is far beyond what can be simulated.
  • Temperature profiles. Past Ra = 10⁵ the interior becomes well mixed and nearly isothermal, and the temperature change is confined to thin boundary layers at the walls. Heat must still conduct across those layers, so they end up limiting how much heat gets through.

Horizontally averaged temperature against height for Ra from 10³ to 10⁷: the profile goes from nearly straight to a flat middle with steep edges

Horizontally averaged temperature across the layer, hot floor (left) to cold lid (right), as Ra increases. Near onset the profile is close to linear; at high Ra the interior is well mixed and the change is confined to thin boundary layers.

Conclusion

The simulations reproduce the theoretical onset of convection almost exactly and give a heat-transport scaling consistent with earlier work. Rotation both delays convection and makes it less efficient, the kind of effect mixing-length theory leaves out.

These are idealised 2D and 2.5D runs at a single Prandtl number and rotation rate, so they are a test of the physics rather than a model of a star, but they capture the processes that set how heat moves through one.

Credits

Thanks to my lab partner, and to T. Joshi-Hartley for the 2.5D code used in the rotating simulations. University of Exeter, 2025.

References

  1. T. Joshi-Hartley, Models of Rotating, Internally Heated and Cooled Convection, PhD thesis, University of Exeter (2025). hdl:10779/exe.30085462.v1 ↩

  2. K. J. Burns et al., "Dedalus: a flexible framework for numerical simulations with spectral methods", Physical Review Research 2 (2020), 023068. doi:10.1103/PhysRevResearch.2.023068 ↩

  3. T. Joshi-Hartley, Cartesian_2.5D. github.com/tj294/Cartesian_2.5D ↩

  4. S. Chandrasekhar, Hydrodynamic and Hydromagnetic Stability, Oxford University Press (1961). ↩

  5. H. Johnston and C. R. Doering, "Comparison of turbulent thermal convection between conditions of constant temperature and constant flux", Physical Review Letters 102 (2009), 064501. doi:10.1103/PhysRevLett.102.064501 ↩