The effect of the CFL number in the numerical solution in this conservation law

1.2k Views Asked by At

I've been studying the very basics of numerical methods applied to conservation laws, and I'm having trouble understanding the role of the CFL number in the upwind scheme. I want to understand it (if that's possible) in an intuitive way.

In order to make clear what I'm asking let's consider the easy conservation law: $u_{t}+f(u)_{x}=0;\quad u(x,0)=u_{0}(x)$ with $f(u)=0.5 u$ and (a piecewise) initial condition $u_{0}(x)= \{1\quad if \quad x\leq 0\quad ,\quad 0 \quad otherwise$. I know that the exact solution is just the initial condition displaced to the right with velocity 0.5, and in this case we only need that CFL$\leq$1 in order to have a stable upwind scheme, but what happened if we manipulate this number, for example, what is the difference in the numerical solution if we have CFL=1 vs CFL=0.25 or a CFL number close to 1 vs a CFL number close to 0. If someone can help me clarifying this concept I'll be glad!

2

There are 2 best solutions below

2
On BEST ANSWER

Since CFL number is proportional to the timestep, small CFL number means small timestep. Thus, you'll need to make more steps and it would take more computing time.

For the linear advection equation $$ u_t + c u_x = 0 $$ the simple upwind scheme is $$ \frac{u^{n+1}_m -u^n_m}{\tau} + c\frac{u^n_m -u^n_{m-1}}{h} = 0. $$ This scheme approximates original equation with $O(\tau, h)$ order. If we study the truncation error $$ \delta = u_t + \frac{\tau}{2} u_{tt} + O(\tau^2) + cu_x - \frac{ch}{2} u_{xx} + O(h^2) = u_t + c u_x + \frac{1}{2}(\tau u_{tt} - ch u_{xx}) + O(\tau^2, h^2) $$ we would see that this scheme approximates $$ u_t + cu_x = \frac{1}{2}(ch u_{xx} - \tau u_{tt}) $$ with order $O(\tau^2, h^2)$. This is so called first differential approximation. The numerical solution is much closer to the solution of the FDA equation ($O(\tau^2, h^2)$ far) than to the solution of the original equation ($O(\tau, h)$ far). Since $u_t = -cu_x$ (up to small terms) we could change $u_{tt} = c^2 u_{xx}$ and write that equation in form $$ u_t + cu_x = \frac{ch}{2}(1 - C)u_{xx} $$ where $C = \frac{c\tau}{h}$ is the CFL number. The term $\frac{ch}{2}(1-C)$ is the numerical viscosity (or diffusion, depends on context). The bigger the viscosity is the more blurred solution you get. So taking CFL number close to 1 results in sharper solutions.

Generally people take CFL number to be around $0.5 \div 0.9$ to have a margin of safety, for example when timestep is varying around time iterations or scheme is too complex to study its stability properly.

1
On

While I don't have an example, like uranix provided, here's a potentially more intuitive way to look at the CFL number.

The CFL number limits how large your time step $\Delta t$ can be, for your explicit numerical method to remain stable.

The key here is that you are choosing the CFL number (usually, as mentioned, around .5). Therefore, not only is it proportional to the time step, it is a crucial limiting factor to your time step.

The reason we want a larger $\Delta t$ of course is because:

Larger $\Delta t\implies $ less time steps $\implies$ less computing time to reach the same answer.

Smaller $\Delta t\implies $ more time steps $\implies$ more computing time to reach the same answer.