Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DedalusProject/dedalus/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Cartesian initial value problems (IVPs) involve time-evolving PDEs on rectangular domains. Dedalus uses Fourier bases for periodic directions and Chebyshev bases for bounded directions with boundary conditions. These examples demonstrate:- Setting up 1D and 2D Cartesian problems
- Implementing boundary conditions with tau terms
- Using CFL-adaptive timestepping
- Saving and visualizing simulation data
Rayleigh-Bénard Convection
File:examples/ivp_2d_rayleigh_benard/rayleigh_benard.py
Description
This example simulates 2D horizontally-periodic Rayleigh-Bénard convection—the classic problem of thermal convection between heated horizontal plates. When heated from below, the fluid becomes unstable and spontaneously forms convection rolls.Physical Setup
- Domain: Periodic in x, bounded in z with height Lz = 1 and width Lx = 4
- Boundary conditions: No-slip walls with fixed temperatures (hot bottom, cold top)
- Non-dimensionalization: Height and freefall time
- Parameters: Ra = 2×10⁶, Pr = 1
Governing Equations
The Boussinesq equations for incompressible convection:Complete Code
Running the Example
Expected Results
- Runtime: ~5 cpu-minutes
- Output: Buoyancy and vorticity snapshots in
snapshots/ - Physics: Convection rolls develop from random noise, reaching a turbulent steady state
KdV-Burgers Equation
File:examples/ivp_1d_kdv_burgers/kdv_burgers.py
Description
Solves the 1D Korteweg-de Vries / Burgers equation, demonstrating the interplay between nonlinear steepening (Burgers), linear dispersion (KdV), and dissipation. This simple example runs in seconds and creates a space-time plot.Equation
a is the dissipation coefficient and b is the dispersion coefficient.
Complete Code
Running the Example
Expected Results
- Runtime: A few seconds (serial only)
- Output: Space-time plot
kdv_burgers.png - Physics: Initial soliton-like pulse evolves with dispersion and dissipation
Shear Flow
File:examples/ivp_2d_shear_flow/shear_flow.py
Description
Simulates 2D periodic incompressible shear flow with a passive tracer for visualization. Demonstrates the Kelvin-Helmholtz instability where initially smooth shear layers roll up into vortices.Physical Setup
- Domain: Fully periodic in both x and z
- Initial condition: Two shear layers with small vertical perturbations
- Parameters: Re = 5×10⁴, Sc = 1
- Non-dimensionalization: Shear-layer spacing and velocity jump
Key Features
Initial Conditions
Running the Example
Expected Results
- Runtime: ~10 cpu-minutes
- Physics: Kelvin-Helmholtz billows form and evolve into turbulent structures
- Visualization: Tracer field beautifully shows vortex roll-up