More Smearing with decreasing timestep in advection problems

I find it kind of counter intuitive, that the result of an advection gets more smeared out at the borders when decreasing the timestep (which should make it more accurate).

Let there be a equally spaces grid $x_1, \dots, x_n$ with a constant 1D advection $v=1$. Let the initial values be $$u^0=[0, 0, 1, 1, 0, 0]$$

with the corresponding divergence field

$$\nabla\cdot (uv) = [0,0,1,0,-1,0]$$

With a timestep of $\delta_t = 1$ we get for one timestep with the explicit euler forward time scheme and forward differences for the derivative:

$$u^1=[0, 0, 0, 1, 1, 0]$$

But with a smaller timestep $\delta_t=0.5$ we get:

$$u^{0.5}=\left[0,0,\frac{1}{2}, 1, \frac{1}{2}, 0\right]\\ u^1=\left[0,0,\frac{1}{4}, \frac{1}{2}, \frac{1}{2}, \frac{1}{4}\right]$$

So while the CFL number requires a smaller timestep for stability, in this case a smaller number leads to unsharp boundaries and decreasing the $\delta_x$ helps.

Is there some other stablity condition than CFL and Peclet numbers for this problem?

1 Answer

You solve the 1D-advection equation with $$c$$ a constant velocity:

$$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x}=0~~~~~~~~(1)$$

When you discretize this equation (with an explicit scheme in time and an upwind scheme for a positive velocity $$c \geq 0$$ in space for instance), you get:

$$\frac{u_i^{n+1} - u_i^n}{\Delta t}+c\frac{u_i^n-u_{i-1}^{n}}{\Delta x} = 0 ~~~~~~~~(2)$$

BUT here you approximate your solution and by doing so you commit an error, called the truncation error. Let's find it :

The key idea is to use the Taylor expansion for each of your discretized quantities:

$$u_i^{n+1} = u_i^n + \Delta t \frac{\partial u}{\partial t}+\frac{\Delta t^2}{2}\frac{\partial^2 u }{\partial t^2}+O(\Delta t^3)$$

$$u_{i-1}^{n} = u_{i}^n - \Delta x \frac{\partial u}{\partial x}+\frac{\Delta x^2}{2}\frac{\partial^2 u }{\partial x^2}+O(\Delta x^3)$$

Then you plug those expressions into (2). You should find:

$$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x} + \frac{1}{2}\Delta t \frac{\partial^2 u }{\partial t^2} - c \frac{\Delta x}{2} \frac{\partial^2 u }{\partial x^2} = 0$$

You recognize the first two terms, it is your equation (1) and by putting the rest in the right-hand size, you find that this equation is now equal to:

$$\frac{\partial u}{\partial t} + c\frac{\partial u}{\partial x}= Err$$

with $$Err = - \frac{1}{2}\Delta t \frac{\partial^2 u }{\partial t^2} + c \frac{\Delta x}{2} \frac{\partial^2 u }{\partial x^2} ~~~~~~~(3)$$

which is NOT equation (1). Let's simplify a little this expression. You use the fact that from (1), you derive in time:

$$\frac{\partial^2 u}{\partial t^2} + c\frac{\partial^2 u}{\partial t\partial x}=0$$ Omitting mathematical arguments, you can switch partial derivatives and by using (1) again, you get:

$$\frac{\partial^2 u}{\partial t^2} = c^2\frac{\partial^2 u}{\partial x^2} ~~~~~(4)$$

Plug (4) into (3) and by introducing the CFL number : $$CFL=\frac{c\Delta t}{\Delta x}$$ you should end up with:

$$Err = \frac{c\Delta x}{2}\frac{\partial^2 u}{\partial x^2}(1-CFL)$$

This is the error you commit by approximating derivatives. The truncation error depends on the second derivative in space which is called a diffusion term, hence a smearing effect (think about the heat equation). Now you understand that when your CFL tends to 1 (that is to say a larger $$\Delta t$$ for $$c$$ and $$\Delta x$$ fixed), the error vanishes and so you solve exactly (1), that is your first result. On the other hand, when your CFL decreases (small $$\Delta t$$), the error gets larger and your solution is smeared, as you have experienced in your second example. Indeed, decreasing $$\Delta x$$ helps because by doing so you increase your CFL even if your time step is fixed by your stability condition. You recover the fact the results get better with a refined mesh, fortunately !

• This is a nice explanation, why i actually get a diffusion term, which explains the observation. Is there a common way to reduce this for a smaller CFL number or is this related to the fact, that the peclet number is needed for stability in the general case? Do i understand it correct, that a smaller mesh just allows to get closer to CFL=1 again? Currently i try to get a working scheme for a minimal example, so i hoped to get a 1D solution which can be done with a few steps and obvious results on paper. In (2) you mean (i-1) on the right term?
– allo
Jul 31 '16 at 9:32
• Can't answer for Peclet number, just heard of it. In general, your mesh is designed in order to achieve a certain spatial resolution, not especially to deal with the CFL. Your CFL is given by your condition stability and the mesh size is fixed by the user, the time step is then derived, not the inverse. Having a smaller mesh is above all to get an accurate solution. As you can see, the truncation error depends also on the mesh size, and decreases with it. In numerical simulations, all is a balance between dt and dx to get an accurate solution in a minimum amount of time. Yes, corrected in (2) Aug 1 '16 at 12:53