1
$\begingroup$

I am trying to solve numerically (obviously) inviscid Burgers' equation with the finite difference method. The equation is the following:

$$ \displaystyle \partial_t u + u \, \partial_x u = 0 $$

which also reads

$$ \displaystyle \partial_t u + \frac{1}{2} \partial_x u^2 = 0$$

And since the discrete solution is positive, the upwind scheme reads

$$ \displaystyle u_j^{n+1} = u_j^n + \frac{\Delta t}{\Delta x} \left[ \left(u_{i-1}^n\right)^2 - \left(u_{i}^n\right)^2 \right] $$

All that remains is to define the computational domain and put it all in a loop and that's it, right? To definite this domain, I know we can use the famous CFL condition. I never heard about this condition at school and I just know how to use it for a simple convection case like

$$ \partial_t u + c \, \partial_x u = 0, \qquad \text{CFL} \Rightarrow \frac{c\Delta t}{\Delta x} \leq 1.$$

I don't find any documents describing the general method to follow to apply this condition in my case or in any other case. I just found this work about the same problem but I didn't understand the explanation of the condition use which is the following:

CFL use

Anyway, I need help to understand how to use this condition. I have managed to implement my algorithm and get a solution but I would like to understand everything that is happening.

Thank you in advance.

$\endgroup$
2
$\begingroup$

For the simplest case of linear advection, applying von Neumann stability analysis gives the necessary restriction on the time step size, known as the CFL condition:

$$ \frac{c\Delta t}{\Delta x}\le 1 $$

For a nonlinear equation such as Burgers' equation, it is not possible to derive an expression for the necessary restriction on the time step size due to the nonlinearity. In practice for nonlinear problems, the same expression that was derived for the linear advection equation is used, where $c$ is now replaced by $S^n_{max}$, the maximum wavespeed throughout the domain at time $n$. For Burgers' equation, an obvious choice for $S^n_{max}$ is

$$S^n_{max}=\max_i|u_i^n|$$

A more thorough choice is to consider the wavespeeds of any shocks or expansion waves that are present:

$$S^n_{max}=\max_i\left(\left|\frac{1}{2}(u_i^n+u_{i+1}^n)\right|,\max(u_i^n,u_{i+1}^n)\right)$$

The timestep is the calculated as

$$\Delta t=CFL\Delta x/S^n_{max}$$

where $CFL\le1$ is a user-specified coefficient. In practice, a value of $CFL=0.9$ is usually appropriate to account for the uncertainty in the estimate (Toro 1997).

$\endgroup$
0
$\begingroup$

The CFL condition is not always the same. It changes depending on the equation and the discretization. For example, here you have no fixed c, and have a variable speed of sound and a nonlinear PDE. What you should try to do is von neumann analysis to see if you can derive the CFL condition for some basic linear cases like advection or heat diffusion. Then you can try it on a nonlinear case, like this one (there's some special treatment you can use for nonlinear cases iirc, but I don't think you can get a real CFL for burger's equation). And then read over the work that you posted a picture of as it's rather in depth and you need the background to really understand it.

$\endgroup$
  • $\begingroup$ Trying to apply the Von Neumann analysis is the first thing I did (because it is the only method) but obviously I did not work on this equation: the non linearity prevents me from reading an equation for the error $\epsilon_j^n$. I am looking for tips and methods for these specials treatment for non linear cases. $\endgroup$ – Loïc Apr 18 at 15:50
  • $\begingroup$ You asked for help understanding how this worked, hence why I suggested started with von neumann analysis for linear cases and then trying it for this case. Given that you didn't provide your background I gave the best guess I could for hwo to come to understand their proof. One thing to note is that as far as i can tell they developed their condition having known the initial condition and used that. It's possible that given your initial condition you could have had a larger time step $\endgroup$ – EMP Apr 18 at 16:04
  • $\begingroup$ Thank you @EMP, I'll try to document me on the subject. $\endgroup$ – Loïc Apr 18 at 16:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.