CFL Number Simulator Back
CFD Fundamentals Simulator

CFL Number Simulator — Stability of Explicit Time Integration

Interactive Courant number $\mathrm{CFL} = u\,\Delta t/\Delta x$ calculator. Vary advection speed $u$, time step $\Delta t$, grid spacing $\Delta x$ and the scheme limit $\mathrm{CFL}_\mathrm{max}$ to inspect stable / marginal / unstable behaviour, the maximum allowed $\Delta t$ and the maximum allowed $u$, with a 1D grid schematic of signal propagation.

Parameters
Advection speed u
m/s
Time step dt
ms
Grid spacing dx
mm
Scheme limit CFL_max

CFL condition: $\mathrm{CFL} = u\,\Delta t/\Delta x \le \mathrm{CFL}_\mathrm{max}$. Typical limits: Forward Euler / Lax-Wendroff $\mathrm{CFL}_\mathrm{max} = 1.0$, RK4 about 2.06.

Results
CFL number
Stability
Max allowed dt
Max allowed u
1D grid and signal propagation

Blue cells of width $\Delta x$ / yellow arrow shows the distance $u\,\Delta t$ travelled in one step / green = stable (CFL ≤ 1) / red = arrow crosses a cell, explicit scheme breaks down. The arrow length divided by the cell width equals CFL.

Stability map (CFL vs margin)

X axis CFL in [0, 3] / Y axis stability margin $\mathrm{CFL}_\mathrm{max} - \mathrm{CFL}$ / green band = stable (CFL < 0.9·CFL_max) / yellow band = marginal / red band = unstable (CFL > CFL_max) / yellow dot = current CFL.

Theory & Key Formulas

Definition of the Courant (CFL) number:

$$\mathrm{CFL} = \frac{u\,\Delta t}{\Delta x}$$

Explicit stability condition and the largest admissible $\Delta t$ and $u$:

$$\mathrm{CFL} \le \mathrm{CFL}_\mathrm{max},\quad \Delta t_\mathrm{max} = \frac{\mathrm{CFL}_\mathrm{max}\,\Delta x}{u},\quad u_\mathrm{max} = \frac{\mathrm{CFL}_\mathrm{max}\,\Delta x}{\Delta t}$$

Stability margin (negative means unstable):

$$\mathrm{margin} = \mathrm{CFL}_\mathrm{max} - \mathrm{CFL}$$

$u$ is the advection speed [m/s], $\Delta t$ is the time step [s], $\Delta x$ is the grid spacing [m], and $\mathrm{CFL}_\mathrm{max}$ is the scheme-specific stability limit (1.0 for Forward Euler and Lax-Wendroff, about 2.06 for RK4). Explicit time integration requires $\mathrm{CFL} \le \mathrm{CFL}_\mathrm{max}$ for stability.

What is the CFL number?

🙋
My CFD textbook keeps saying "if CFL exceeds 1 the solver blows up." What is CFL really, and why is 1 the magic threshold?
🎓
The Courant number $\mathrm{CFL} = u\,\Delta t/\Delta x$ is just the ratio of how far a signal travels in one time step ($u\,\Delta t$) to the cell width $\Delta x$. With the defaults of this tool ($u = 10$ m/s, $\Delta t = 1.00$ ms, $\Delta x = 10.0$ mm) the signal moves $u\,\Delta t = 10$ mm in one step, exactly one cell, so CFL = 10/10 = 1.000. That is the marginal point. Push past it with an explicit scheme and the solution diverges.
🙋
If I push $\Delta t$ to 2 ms, the CFL goes to 2.000 and the indicator turns red "unstable." What actually happens in a real solver?
🎓
The solution diverges exponentially — wave amplitudes shoot up by orders of magnitude, oscillations refuse to damp, and you typically see Inf or NaN within a few steps. Forward Euler's amplification factor becomes $|1 - \mathrm{CFL}| > 1$ in that regime, so every step magnifies the error. The proof comes from von Neumann stability analysis, and the original 1928 Courant-Friedrichs-Lewy paper laid the foundation.
🙋
Doubling $\Delta x$ to 20 mm drops CFL to 0.500 and the indicator turns green. So a finer mesh always forces a smaller time step?
🎓
Exactly — that is "the CFL trap." Halve $\Delta x$ and you must halve $\Delta t$ too, doubling the number of time steps and doubling the spatial cells, so the cost scales like $\Delta x^{-2}$ in 1D. In 3D it scales like $\Delta x^{-4}$. This is why DNS (direct numerical simulation) needs enormous computing resources and why LES or RANS models are so attractive — they relax the resolution requirement.
🙋
If I crank CFL_max up to 2.06, the indicator turns green again at CFL = 1.000. Is that RK4?
🎓
Yes — RK4 is a four-stage high-order scheme whose stability region extends to about CFL = 2.06 for advection. Many compressible DG-FEM and spectral-element codes use RK4 or TVD-RK3 for that reason. The cost is four function evaluations per step, twice that of Lax-Wendroff. In practice you balance the size of the stable region against the per-step cost.

FAQ

In multiple dimensions the sum of the directional CFLs (or the diagonal in a more general analysis) is constrained. For 2D advection, $\mathrm{CFL}_x + \mathrm{CFL}_y = u\,\Delta t/\Delta x + v\,\Delta t/\Delta y \le 1$; for 3D, all three terms must sum to no more than 1. On an isotropic mesh with $u = v = w$ the 3D time step is one-third of the 1D limit. Strang splitting (dimensional splitting) restores per-direction CFLs but the strictest direction still controls $\Delta t$. Higher-order schemes (Lax-Wendroff, MacCormack, RK4) loosen $\mathrm{CFL}_\mathrm{max}$ slightly, but the directional sum constraint is inherent to explicit multidimensional integration.
The advection-diffusion equation $\partial \phi/\partial t + u\,\partial \phi/\partial x = \nu\,\partial^2 \phi/\partial x^2$ has two stability constraints. The convective limit is $\mathrm{CFL} = u\,\Delta t/\Delta x \le 1$ and the diffusive limit is the cell Peclet-style number $d = \nu\,\Delta t/\Delta x^2 \le 0.5$ for explicit first-order schemes. A combined criterion $\mathrm{CFL}^2 \le 2d$ also appears in some analyses. The stricter of the two controls $\Delta t$: convection wins at high Reynolds numbers, diffusion wins at low Reynolds numbers. IMEX (implicit-explicit) splitting treats diffusion implicitly and convection explicitly, leaving only the convective CFL as a constraint.
For compressible Euler / Navier-Stokes the characteristic speed is $|u| + a$, where $a$ is the local sound speed. The CFL becomes $\mathrm{CFL} = (|u| + a)\,\Delta t/\Delta x \le 1$. Sound speed dominates in subsonic flow ($M = u/a \ll 1$), shrinking $\Delta t$ severely — a recurring issue in low-Mach compressible CFD. For air at $u = 10$ m/s and $a = 340$ m/s the characteristic speed is 350 m/s, so a 10 mm cell needs $\Delta t \le 28.6$ μs. Preconditioning (Turkel, Choi-Merkle) or pressure-based incompressible solvers are typical remedies.
Compute the maximum CFL across all cells every step and rescale the next step by $\Delta t_\mathrm{new} = \mathrm{CFL}_\mathrm{target}/\mathrm{CFL}_\mathrm{current} \cdot \Delta t_\mathrm{current}$, where $\mathrm{CFL}_\mathrm{target}$ is typically 0.5 to 0.8. OpenFOAM's adjustTimeStep, ANSYS Fluent's CFL-based time stepping and SU2 all use this idea. To keep second-order BDF2 accurate you usually limit the change per step (factor 1.2 maximum), and you clip both ends of $\Delta t$ so that shock formation or sudden boundary changes do not produce wildly varying time steps.

Real-world applications

Time-step design in commercial CFD: ANSYS Fluent, STAR-CCM+, OpenFOAM, SU2 and other major CFD solvers monitor CFL internally. Explicit time integration for compressible flow, blast or impact analysis typically targets CFL = 0.3 to 0.7, while implicit time integration for steady incompressible flow runs at CFL = 5 to 100. With this tool's defaults ($u = 10$ m/s, $\Delta x = 10$ mm) the maximum admissible $\Delta t$ is 1 ms, which scales nicely to an LES run choosing $\Delta t \approx 0.5$ ms for a CFL target of 0.5.

Weather and ocean models on supercomputers: WRF (US weather model), MPAS and NICAM (Japanese non-hydrostatic global model) are large explicit CFD codes whose cost is essentially set by the CFL condition. A forecast on a 1 km horizontal mesh with 50 m/s winds limits $\Delta t$ to 20 seconds, so even on the Earth Simulator or Fugaku a 24-hour forecast takes hours of wall time.

Seismic wave propagation and FDTD electromagnetics: The FDTD (finite-difference time-domain) method, used in computational electromagnetics, seismic propagation and acoustics, has a Courant condition of the form $c\,\Delta t \le \Delta x/\sqrt{N}$ where $N$ is the spatial dimension and $c$ is the wave speed. In 3D FDTD $c\,\Delta t \le \Delta x/\sqrt{3} \approx 0.577\,\Delta x$, so for light ($c \approx 3 \times 10^8$ m/s) and a 1 mm grid, $\Delta t$ shrinks to 1.93 ps. This is the chief reason RF and antenna codes cannot use arbitrarily fine meshes.

Shock and explosion simulation (ALE, SPH): Hydrocodes such as LS-DYNA, AUTODYN and Abaqus/Explicit use sound speed plus particle speed as the characteristic speed, so the local CFL spikes near shock fronts. Practical workflows hold CFL_target near 0.6 to 0.7 with adaptive mesh refinement to track shocks. Bird-strike, automotive crash and blast-resistant building simulations all rely on this scheme.

Common misconceptions

The most common mistake is assuming that "CFL ≤ 1 automatically gives an accurate solution." CFL is a stability condition, not an accuracy guarantee. Setting CFL = 0.001 inflates numerical diffusion and smears sharp wave fronts. In fact second-order schemes such as Lax-Wendroff preserve wave shape best near CFL = 0.7 to 1.0. Always balance the mesh resolution ($\Delta x$) against the time step ($\Delta t$); stability ≠ accuracy.

Another frequent misconception is that "with an implicit scheme you can take arbitrarily large time steps." Backward Euler and BDF2 are unconditionally stable, but large $\Delta t$ floods the solution with numerical diffusion, washing out unsteady features such as LES vortices. For transient analysis $\Delta t$ must resolve the smallest time scale of interest (the Kolmogorov scale in LES), so CFL = 1 to 5 is typical. Always run a time-step convergence study (halve $\Delta t$ and check that the answer barely changes) before trusting an implicit run.

The third pitfall is the belief that "CFL is a linear-stability concept, irrelevant to nonlinear problems." Nonlinear advection (Burgers, Euler) develops shocks where the local characteristic speed spikes, so the effective CFL jumps too. Industrial codes therefore operate at conservative CFL = 0.3 to 0.5 and use $(|u| + a)\,\Delta t/\Delta x$ rather than the linear $u\,\Delta t/\Delta x$. This tool's simple definition is excellent for education but always consult the specific definition used inside your solver before tuning $\Delta t$ in production runs.