How To Keep the Courant Number Below 1

 

How To Keep the Courant Number Below 1?

The intention of this article is to define what a Courant number is and to give a best practice of how to set your mesh and time step in case you have problems with the Courant number. If you want to have more details you should read this article.

The Courant–Friedrichs–Lewy or CFL condition expresses that the distance that any information travels during the time step length within the mesh must be lower than the distance between mesh elements. In other words, information from a given cell or mesh element must propagate only to its immediate neighbors.

The derivation of the CFL condition leads to the formula for Courant number and is given by:

 

C=uΔtΔx

C=uΔtΔx

where C is Courant number, u is velocity magnitude, Δt is time step size and Δx is the length between mesh elements.

The Courant number is a dimensionless value representing the time a particle stays in one cell of the mesh. It must be below 1 and should ideally be below 0.7. If the Courant number exceeds 1, the time step is too large to see the particle in one cell, it “skips” the cell. If it is smaller than 0.7, the particle stays in the cell for at least two time steps. The picture below visualizes this situation.

difference between courant number 1 and 0.7 simscale
Figure 1: Example of a mesh comparing Courant number > 1 and Courant number <0.7

When the Courant number exceeds the value of 1, instabilities are amplified throughout the domain and may cause divergence of the simulation. Accordingly, to decrease the Courant number we can either:

  • Decrease the time step Δt or
  • Coarsen the mesh i.e. increase Δx
  1. Make sure the sizes of the elements in the mesh do not differ too much. Measure the average cell size of your mesh. Let’s consider a case where it is about 1.7 mm.
  2. Now have a look at your flow velocity, let’s assume it is 30 m/s. Accordingly, the average time a particle stays in one cell is 1.7e-3 / 30 = 5.67e-5 s.
  3. This is the basis for defining the time step: To make sure your time is not too high set your initial time step to 10% this calculated value (in our case this would be 5.6e-6 s).
  4. Multiply this time by the number of time steps you want to calculate to receive the value for the end time.

While defining the simulation control settings for your CFD simulation you can set a maximum limit to the Courant number as shown below:

simulation control maximal courant number
Figure 2: Maximal Courant number setting under Simulation control in SimScale Workbench. Try keeping it below 0.7.

When this maximum limit is set the solver will try to manipulate the time step size based on Maximal step defined to keep Courant number 1

Note

Often the reason for a failed simulation is not actually the Courant number, but something else. This issue might just result in a bad Courant number. If you followed this guideline and still get error messages, have a closer look at your boundary conditions and the quality of your mesh quality of your mesh.

Important Information

If none of the above suggestions solved your problem, then please post the issue on our forum or contact us.

Comments

Popular posts from this blog

A Short Guide To Metric Nuts and Bolts

CAN Bus Wiring Diagram, a Basics Tutorial

Best Free CFD Tutorial: FreeCAD Openfoam CFD Workbench