Note on CFL


System

$$\frac{\partial y}{\partial t} + u\frac{\partial y}{\partial x} = 0.$$

For and upwind scheme with $u>0$, the system can be discretized as

$$y_i^{n+1} = y_i^n + \frac{u\Delta t}{\Delta x}(y_i-y_{i-1}).$$

The term $$u\Delta t/\Delta x$$ is the CFL, which we can call $c$:

$$c = \frac{u\Delta t}{\Delta x}.$$

Hence, our discrete equation can be rewritten as

$$y_i^{n+1} = y_i^n + c(y_i-y_{i-1}).$$

If the CFL was 0.5, then $c=0.5$ in the above equation and we solve it as written.


It is also common to write

$$y_i^{n+1} = y_i^n + \frac{u\Delta t}{\Delta x}(y_i-y_{i-1}),$$ $$\Delta t = c\frac{\Delta x}{u}.$$

The equation is the same as above, but it is considered differently. $c$ is still the CFL, but we think of it a factor multiplying the advection timescale $\Delta x/u$ on the grid. It is also common the code the equations this way.


Note

The PDE we are solving can have arbitrary variables representing the speed $u$ and variable $y$. You may run across the speed written as $a$ or $c$. If $c$ is used for the wave speed it is easy to be confused about the speed $c$ and the CFL, in which case, you might use CFL instead of $c$ when refering to the CFL.