Courant number calculator: CFL, time step and diffusion number

Enter the velocity, the cell size and the time step to get the Courant number of a 1-D, 2-D or 3-D cell, computed the way OpenFOAM prints it. The calculator also gives the acoustic Courant number for compressible flow, the diffusion and cell Péclet numbers, the largest stable time step for six explicit schemes and the time step for a target Courant number. Paste a solver log to get the next OpenFOAM deltaT. Free, runs in your browser.

OpenFOAM-12 source (fluidSolver, foamRun, tutorials) · von Neumann analysis checked in NumPy · Updated 22 Nov 2026

Use your worst cell: the smallest cells where the flow is fastest. Δx is the cell length along each axis; for a skewed or tetrahedral cell, OpenFOAM's flux-based number is the one that counts.

Courant number0.22max over directions summed
Largest stable Δtno limitimplicit
Δt for the target455 µsC = 1
  • Calculating…
OpenFOAM system/controlDict
adjustTimeStep  yes;
maxCo           1;
deltaT          0.0004545;

What is the Courant number?

The Courant number is the number of cells the flow crosses in one time step. With velocity u, time step Δt and cell length Δx:

C = 0.3 means the fluid moves 30% of a cell per step. In 2-D and 3-D each direction adds its share:

OpenFOAM does not use cell lengths at all. It sums the magnitude of the volume flux through every face of the cell, halves it and divides by the cell volume:

That is the line CoNum = 0.5*gMax(sumPhi/mesh.V().primitiveField())*runTime.deltaTValue() in OpenFOAM-12's fluidSolver, printed as "Courant Number mean: … max: …". On a box-shaped cell each pair of opposite faces carries |ui| times the face area, so the flux formula gives exactly the sum above. The verifier checks this on 50 random cells. The OpenFOAM-12 cavity tutorial (lid speed 1 m/s, a 0.1 m box split into 20 × 20 cells, deltaT 0.005 s) runs at a maximum of exactly 1.

What Courant number limit does each scheme have?

An explicit scheme is stable only while C stays at or below its own limit. The limit comes from von Neumann analysis: write the error as waves and ask whether any wave grows from one step to the next. For first-order upwind the growth factor of a wave with phase angle θ = kΔx is:

|G| ≤ 1 for every wave only when 0 ≤ C ≤ 1. The calculator's limits were found the same way, numerically, by sweeping 2,001 wave angles and bisecting on C:

SchemeStable whenLimit on C (pure advection)
First-order upwind, explicit EulerC + 2d ≤ 11
Lax-FriedrichsC ≤ 11
Lax-WendroffC ≤ 11
Central in space, explicit Euler (FTCS)C² ≤ 2d ≤ 1; never for pure advectionnone: always unstable
Central in space, 3-stage RK3C ≤ √3 ≈ 1.7321.732
Central in space, classic RK4C ≤ 2√2 ≈ 2.8282.828
Implicit (backward Euler, Crank-Nicolson)no stability limitnone

Two cases surprise people. Central differences with a plain explicit Euler step (FTCS) are unstable for pure advection at every Courant number; they only work when enough diffusion is present (C² ≤ 2d ≤ 1). And central differences with a Runge-Kutta step go past 1: up to √3 ≈ 1.732 with RK3 and 2√2 ≈ 2.828 with classic RK4, because those methods reach that far up the imaginary axis.

Largest amplification factor over all wavelengths against the Courant number, for six explicit schemes00.511.5200.511.522.53UpwindLax-FriedrichsLax-WendroffFTCSRK3 + centralRK4 + centralCourant number Cmax |G|

Implicit time stepping (backward Euler, Crank-Nicolson) has no linear stability limit, and implicit pressure-based solvers such as OpenFOAM's PIMPLE can run above C = 1. A large C still costs accuracy: a feature that crosses five cells in one step is resolved by none of them. That is why OpenFOAM's damBreakLaminar tutorial still runs with maxCo 1 and maxAlphaCo 1.

What happens above the limit? Run it

The same test case as Skill-Lync's Courant number post: a pulse of height 1 between 0.1 m and 0.3 m, carried at 1 m/s around a periodic 1 m domain of 100 cells for 0.6 s, with Δt = C Δx / u. The dashed line is the exact answer. Pick a scheme and a Courant number and press Run.

Upwind at C = 0.8: the pulse after 0.6 s against the exact pulse-0.500.511.500.20.40.60.81exact pulsenumericalx (m)φ

Upwind, C = 0.8: 75 steps to t = 0.6 s · max |φ| 0.997 · stable

What the runs show (largest |φ| at t ≈ 0.6 s; the exact answer is 1):

SchemeC = 0.5C = 0.8C = 1C = 1.2C = 1.6C = 2C = 2.5
Upwind0.9310.99711.7×10⁶7.5×10¹¹1.6×10¹³2.4×10¹³
Lax-Friedrichs0.7070.9519574.8×10⁶9.1×10⁷3.1×10⁸
Lax-Wendroff1.221.1612.4×10¹²1.1×10²²1.2×10²⁴1.7×10²⁴
FTCS501008.1×10⁶9×10⁷4.4×10⁸2.9×10⁹2.4×10⁹2×10⁹
RK3 + central1.291.271.261.251.1715.74.4×10⁶
RK4 + central1.31.31.31.31.311.251.22

Upwind at C = 0.8 ends with a peak of 0.997 and a mean error of 0.055; at C = 0.5 the peak drops to 0.931. The smaller step is stable but smears more, because the numerical diffusion of upwind is u Δx (1 − C) / 2. At C = 1.2 the run reaches 6.19 after 10 steps and 1.7×10⁶ by 0.6 s. Lax-Wendroff stays bounded at C = 0.8 but overshoots to 1.16: second-order schemes ripple at sharp edges. FTCS grows even at C = 0.5 (1.84 after 10 steps, 50100 by the end). RK3 with central differences holds at C = 1.6 (1.17) and fails at 2 (15.7); RK4 holds at C = 2 (1.25) and at 2.5 (1.22), as the limits predict. Stable is not the same as accurate: every central-difference run ripples around the sharp edges of the pulse, with peaks of 1.2 to 1.3 at any Courant number.

Skill-Lync's CFD students run this exact experiment. In the public project index (1,77,222 reports, snapshot of 21 Nov 2026) 195 reports are titled "linear convection", such as Linear convection and the significance of the CFL number, and 679 solve Anderson's quasi-1-D nozzle with the MacCormack method, where the time step comes from a Courant number of 0.5 (see the nozzle calculator).

How do I choose the time step from the Courant number?

Turn the formula round and evaluate it on the worst cell, where the cells are smallest and the flow fastest:

Water at 2 m/s along a pipe, with 0.3 m/s of swirl in each cross direction, meshed with 2 mm cells along the axis and 0.5 mm cells across it near the wall:

The swirl matters more than it looks. The two cross-flow terms add 1,200 s⁻¹ to the 1,000 s⁻¹ along the axis, because 0.3 m/s across a 0.5 mm cell is as fast, in cells per second, as 1.2 m/s across a 2 mm one. Counting the axial flow alone would give a step of 1 ms, more than twice too long. With a 0.1 ms step this cell sits at C = 0.22. Its cell Péclet number along the axis is 3980: plain central differencing of the convection term is only free of wiggles when PeΔ ≤ 2, which is why real meshes use upwind-biased or limited schemes.

Which velocity do I use for compressible flow?

Pressure waves move at the speed of sound c relative to the fluid, so an explicit compressible (density-based) solver must use |u| + c:

Air at 300 K has c = √(1.4 × 287 × 300) = 347.2 m/s. At 50 m/s on 1 mm cells the flow alone would allow a step of 20 µs at C = 1. The sound waves cut that to 2.518 µs, about 7.9 times smaller:

This is why explicit density-based solvers crawl at low Mach numbers, and why low-speed flows are run with pressure-based solvers, whose Courant number is built from u alone.

What is the diffusion number limit?

Explicit central differencing of a diffusion term (heat conduction, viscous stresses, species diffusion) needs d ≤ 1/2 in 1-D, or ν Δt Σ 1/Δxi² ≤ 1/2 in more dimensions. Halving the cell size cuts the allowed step by four. Aluminium (α = 97.1 × 10⁻⁶ m²/s at 300 K) on 1 mm cells:

With both convection and diffusion, upwind needs C + 2d ≤ 1. The calculator applies the combined rule for upwind and FTCS; for the other explicit schemes it gives the advection limit and reports the diffusion number next to it. Solvers that treat diffusion implicitly, as OpenFOAM does, need not care: the OpenFOAM-12 cavity case has d = 0.004.

How does OpenFOAM adjust the time step with maxCo?

With adjustTimeStep yes; in system/controlDict, OpenFOAM-12's foamRun takes the smallest of three limits for the next step:

The 1.2 is deltaTFactor, a controlDict entry that defaults to 1.2. So a time step that overshoots is cut at once, but it can only grow by 20% per step. Two cases from the log tab:

  • Max Courant number 1.35 at Δt = 1 ms, maxCo 0.9: the next step is 1 × 0.9 / 1.35 = 0.6667 ms.
  • Max Courant number 0.3 at Δt = 0.1 ms, maxCo 0.9: the step wants to triple to 0.3 ms but takes 7 steps to get there (1.2⁶ ≈ 2.99 falls just short of 3).

VoF solvers add a second limit from the Courant number at the interface, maxAlphaCo, printed as "Interface Courant Number". The damBreakLaminar tutorial uses maxCo 1, maxAlphaCo 1, maxDeltaT 1 and a starting deltaT 0.001.

What this calculator does not model

  • Non-uniform and non-linear problems. The scheme limits are exact for linear advection with constant speed on a uniform periodic grid. Real flows are non-linear, have boundaries and stretched cells, so leave a margin: running at 0.5 to 0.9 of the limit is normal practice.
  • Multi-dimensional stability. In 2-D and 3-D the calculator applies the 1-D limits to the summed Courant number. For upwind this is the standard sufficient condition. For central and Runge-Kutta schemes the exact multi-D limit depends on the scheme details.
  • Limited and high-resolution schemes. TVD limiters, MUSCL and WENO reconstructions have their own, usually lower, limits that depend on the limiter and the time integrator. Check the solver documentation.
  • Commercial solver defaults. Settings for Ansys Fluent and other codes are covered in the companion Courant number post. The calculator only quotes OpenFOAM, whose source code we read.
Learn CFD

Skill-Lync's CFD courses start with exactly this: writing your own 1-D convection and nozzle solvers in MATLAB, choosing the time step, watching them blow up, then moving to OpenFOAM and Ansys Fluent.

Frequently asked questions

What is the Courant number?

The Courant number is how many cells the flow crosses in one time step: C = u Δt / Δx. C = 0.5 means the fluid moves half a cell per step. In 2-D or 3-D the contributions add, C = Δt (|u|/Δx + |v|/Δy + |w|/Δz), which is exactly what OpenFOAM prints as "Courant Number max" for a hexahedral cell.

What Courant number should I use?

For an explicit scheme, stay under its stability limit: 1 for first-order upwind, Lax-Friedrichs and Lax-Wendroff, √3 ≈ 1.73 for RK3 and 2√2 ≈ 2.83 for RK4 with central differences, with some margin (0.5 to 0.9 is common). Implicit solvers have no hard limit, but for an accurate transient keep the maximum near 1, as OpenFOAM's damBreak tutorial does with maxCo 1.

How do I calculate the time step from the Courant number?

Divide the target Courant number by the sum of |u_i|/Δx_i on your worst cell: smallest cells, fastest flow. Water at 2 m/s across 0.5 mm wall cells, with 0.3 m/s cross-flow, gives Δt = 455 µs for C = 1. For compressible explicit solvers use |u| + c, which for air at 50 m/s cuts the step from 20 µs to 2.52 µs.

What happens if the Courant number is greater than 1?

With an explicit scheme limited to C ≤ 1 the shortest waves grow every step and the run blows up. In Skill-Lync's 100-cell test, upwind at C = 1.2 turns a pulse of height 1 into a value of 6.19 within 10 steps. Implicit solvers stay stable above 1 but smear or lag fast transients.

What is the difference between the Courant number and the diffusion number?

The Courant number measures how far the flow carries information per step (u Δt/Δx); the diffusion number how far diffusion spreads it (ν Δt/Δx²). Explicit central diffusion needs d ≤ 0.5 in 1-D. Aluminium (α = 97.1 × 10⁻⁶ m²/s) on 1 mm cells allows at most 5.15 ms per step.

How does OpenFOAM choose the time step with maxCo?

With adjustTimeStep yes, OpenFOAM-12 sets the next step to the smallest of 1.2 × the current step (deltaTFactor), maxCo/Co × the current step and maxDeltaT. So it cuts at once when the Courant number overshoots and grows by at most 20% per step. A max Courant number of 1.35 at Δt = 1 ms with maxCo 0.9 gives 0.6667 ms next.

Related on Skill-Lync

Sources

  • OpenFOAM-12 source code, github.com/OpenFOAM/OpenFOAM-12, read 22 Nov 2026: applications/modules/fluidSolver/fluidSolver.C (Courant number from face fluxes; maxDeltaT() = min(maxDeltaT, maxCo/CoNum × deltaT)); src/finiteVolume/solver/solver.C (deltaTFactor, default 1.2); applications/solvers/foamRun/setDeltaT.C; tutorials incompressibleFluid/cavity (20 × 20 × 1 cells, convertToMeters 0.1, lid 1 m/s, deltaT 0.005, nu 1e-05) and incompressibleVoF/damBreakLaminar (adjustTimeStep yes, maxCo 1, maxAlphaCo 1, maxDeltaT 1).
  • R. Courant, K. Friedrichs, H. Lewy, "Über die partiellen Differenzengleichungen der mathematischen Physik", Mathematische Annalen 100 (1928) 32-74.
  • Von Neumann stability of upwind, Lax-Friedrichs, Lax-Wendroff and FTCS for linear advection and advection-diffusion, and the imaginary-axis reach of RK3 (√3) and RK4 (2√2): standard results (e.g. C. Hirsch, Numerical Computation of Internal and External Flows), re-derived numerically by the verifier.
  • J. D. Anderson, Computational Fluid Dynamics: The Basics with Applications (1995), chapter 7: quasi-1-D nozzle with MacCormack's method.
  • Properties: aluminium α = 97.1 × 10⁻⁶ m²/s at 300 K and air γ = 1.4, R = 287 J/(kg·K) (Incropera, Fundamentals of Heat and Mass Transfer, Table A.1); water ν = 1.004 × 10⁻⁶ m²/s at 20 °C.
  • Skill-Lync public project index, snapshot 21 Nov 2026: report titles matched for "linear convection" and "MacCormack".
  • Skill-Lync, scripts/verify/courant.py (NumPy): 70 checks. The OpenFOAM flux formula on 51 cells, every scheme limit by numerical von Neumann analysis, the largest stable Δt for each example, 42 demo runs and the OpenFOAM time-step updates. The page recomputes every one at build time.
Free counselling

From a stable time step to a CFD career.

Choosing Δt, reading a solver log and knowing why a run blew up are what CFD interviews test. A Skill-Lync counsellor can map the CFD course that fits your branch, year and the roles you want.

Talk to a CFD course counsellor

Free. We call you back, usually the same day.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.