Your CFD simulation was running fine — then the residuals exploded to infinity and everything turned to NaN. Nine times out of ten, the culprit is a time step that's too large, violating the CFL condition. The Courant–Friedrichs–Lewy number is the single most important control on the stability of any transient (time-marching) simulation, and getting it right is the difference between a clean run and a wasted afternoon. This guide gives you a free CFL calculator (validated against the standard formulas), explains the condition in plain language, and shows you exactly how to choose a stable, efficient time step.
Table of Contents
The CFL / Courant Number Calculator
Three modes: compute the Courant number from your time step, find the maximum stable time step from a target CFL, or handle multi-dimensional / compressible cases. Each field has a working default.
⏱️ CFL / Courant Number Calculator
What Is the CFL / Courant Number?
The CFL number (also called the Courant number) is a dimensionless quantity that answers a simple question: in one time step, how many mesh cells does the flow travel across?
where u is the flow velocity, Δt is the time step, and Δx is the cell size. It's named after Richard Courant, Kurt Friedrichs and Hans Lewy, who derived the stability condition in their landmark 1928 paper on partial differential equations.
- CFL < 1 — the flow stays within a single cell each step. The solver can "see" where information comes from. Stable.
- CFL > 1 — the flow skips over one or more cells per step. Information is lost, and the solution grows without bound. Unstable.
The CFL Stability Condition
The formal CFL condition states that the numerical domain of dependence must contain the physical domain of dependence. In plain terms: the time step must be small enough that the flow doesn't travel further than one cell before the scheme updates it. For explicit time-marching schemes this gives:
This is a necessary condition for convergence when solving hyperbolic PDEs (like the Euler and Navier–Stokes equations) with explicit schemes. Violate it, and the simulation produces unphysical results — the solution "blows up" and diverges.
The Formula & How to Use It
The real power comes from rearranging the formula. Since you usually know the velocity and the cell size, you solve for the time step:
Pick a target CFL (say 0.7 for an explicit solver), and this gives you the largest stable time step. Worked example:
- Flow velocity u = 10 m/s
- Smallest cell Δx = 0.01 m
- Target CFL = 0.5
- Δt = 0.5 × 0.01 / 10 = 0.0005 s (0.5 ms)
The calculator's second mode also tells you how many time steps a simulation of a given duration will need — directly proportional to your compute cost.
Explicit vs Implicit Solvers
The CFL limit you must obey depends entirely on your solver type:
| Explicit solver | Implicit solver | |
|---|---|---|
| CFL limit | ≤ 1 (often 0.5–0.9) | Can be 5, 10, 100+ |
| Stability | Conditionally stable | Unconditionally stable |
| Cost per step | Low (cheap) | Higher (solves a system) |
| Best for | Fast transients, shocks, DES/LES | Steady-state, slow transients |
| Catch | Time step strictly limited | Large CFL hurts time accuracy |
Implicit schemes can be unconditionally stable — any CFL can be applied without the solution blowing up. But there's a catch: at very high Courant numbers, the time step becomes so large that it no longer resolves the physics accurately. For a time-accurate transient simulation, keep CFL around 1 even with an implicit solver.
Multi-Dimensional & Compressible Flow
In 2D and 3D, contributions from each direction add up:
This is why a fine cell in any direction tightens the limit. For compressible flow, the fastest-moving information isn't the flow itself — it's the pressure (sound) waves. So you use the wave speed:
At Mach 0.15 in air, the flow might be 50 m/s but sound travels at 343 m/s — so the wave speed is ~393 m/s, forcing a much smaller time step than the flow velocity alone would suggest. The calculator's multi-D mode handles both effects.
CFL, Mesh Size & y⁺
The CFL number ties your time step directly to your mesh — which is why this calculator pairs so naturally with mesh-quality tools:
- Grid independence: as you refine the mesh in a grid independence study, Δx shrinks — so Δt must shrink too, or the CFL number rises past its limit.
- Near-wall meshing (y⁺): resolving the boundary layer to a low y⁺ creates extremely thin first cells. Those tiny cells can force very small time steps in explicit or scale-resolving simulations — a real cost driver.
- Velocity: the higher the flow speed (related to your Reynolds number setup), the smaller the stable time step.
Common Mistakes
- Using an average cell size instead of the smallest. One tiny cell sets the limit for the whole domain — always use the worst case.
- Ignoring the speed of sound in compressible flow. The wave speed (u + c), not the flow speed, governs stability.
- Assuming implicit means "any time step is fine." It's stable, but large CFL destroys time accuracy for transients.
- Setting the time step once and forgetting it. If velocity rises during the run (e.g. accelerating flow), the CFL rises too.
- Refining the mesh without shrinking Δt. A finer mesh needs a smaller time step to keep CFL in check.
- Mixing units. Velocity in m/s, cell size in m, time in s — a stray mm silently corrupts the CFL.
- Chasing an unnecessarily tiny time step. Too small wastes compute for no accuracy gain; aim for the largest stable and accurate step.
- Forgetting to monitor the Courant field. Most solvers report CFL per cell — plot it and check the maximum, not just the average.
Frequently Asked Questions
What is the CFL or Courant number?
A dimensionless value comparing the distance flow travels in one time step to the cell size: CFL = u·Î”t/Δx. It measures how many cells the flow crosses per step and is the key control on explicit time-marching stability.
What is the CFL condition for stability?
For explicit schemes, the Courant number must not exceed about 1. If the flow crosses more than one cell per time step, information is lost and the solution diverges. Explicit solvers need CFL ≤ 1, often below 0.7.
How do you calculate the maximum time step?
Rearrange the formula: Δt = CFL·Î”x/u. For u = 10 m/s, Δx = 0.01 m and target CFL = 0.5, the maximum time step is 0.0005 s.
What is a good CFL number for CFD?
For explicit solvers, ≤ 1 (0.5–0.9 is common). Implicit solvers can run at 5, 10 or higher, but for time-accurate transients keep CFL near 1 so the time step resolves the physics.
What is the difference between explicit and implicit solvers for the CFL limit?
Explicit solvers are cheap per step but strictly limited to CFL ≈ 1. Implicit solvers cost more per step but are unconditionally stable, allowing larger time steps — though very large steps reduce time accuracy.
Does a finer mesh require a smaller time step?
Yes, for explicit solvers. Since CFL depends on cell size, smaller cells force a smaller time step. Very fine near-wall meshes (low y⁺) can demand extremely small time steps.
Conclusion
The CFL / Courant number is the guardrail of transient CFD. It links your time step, mesh size and flow speed into a single value that decides whether your simulation runs cleanly or diverges into NaN. The workflow is simple: find the smallest cell and fastest wave speed, choose a target CFL for your solver (≤ 1 explicit, low for accurate implicit transients), compute the time step, and monitor the Courant field as you go.
Use the calculator above at the start of every transient run — it takes seconds and saves you from the most common cause of blown-up simulations.
For more CFD theory, meshing guides and free engineering calculators, explore Free CFD Tutorial. If this tool helped you, please share it with your classmates and colleagues.


Comments
Post a Comment