I'm trying to study with a finite difference method the 2D advection equation with a space-dependant flow. Taking a function $f(x,y,t)$ solution of the equation :

$$ \partial_t\,f+\nabla(\textbf{v}\,f)=0 $$

where $\textbf{v}$ is known to be divergence free :

$$\textbf{v}=a \begin{bmatrix} \,y \\ x \end{bmatrix} $$ where $a$ is a given constant. Finally, the equation to study take the form :


As a first try, I tried to implement a very naive centred explicite scheme with the discretization $x=q\,\Delta_x$, $y=p\,\Delta_y$, $t=n\,\Delta t$ and $\; f(x,y,t)=f^n_{qp}\;$ where $\;(q,p)\in\left[2,K-1\right]^2\;$ and $\;n\in\left[1,N\right]$:

$$f^{n+1}_{qp}=f^n_{qp}+\frac{a \Delta t}{2}\left[p\,(f^n_{q+1\,p}-f^n_{q-1\,p})+q\,(f^n_{q\,p+1}-f^n_{q\,p-1})\right]$$

where we took $\Delta_x=\Delta_y=h$ for simplicity.

I fixed boundary conditions as zero-flux condition, I don't know if it's the right thing to do since the problem I'm studying should not have boundaries.

I tried to perform a Von Neumann stability analysis for this scheme but it's seems to be simply unstable in any condition. But the fact that the scheme does not depend on $h$ puzzles me, I think it's going nowhere...

Questions :

Computational sciences are quite new for me, and I was wondering if I was going right in my reflections :

  • Should I rather try an implicite method or a Crank–Nicolson method? Should it be better in terms of stability?
  • Concerning boundary conditions, since my system shouldn't have any boundary, should I try to implement absorbing boundary conditions?
  • Is there any general method(s) to numerically study this kind of equations, for instance in higher dimensions, or with additional terms (like diffusion terms)?
  • Is there any litterature that could help me in this study?

1 Answer 1


You have discretized an advection equation using a forward difference in time and centered differences in space. You have correctly deduced that this is an unstable discretization; in fact it is unstable even for constant-coefficient advection in one dimension. There are many stable discretizations you could use; the most common (and simplest) is to switch to a centered difference in time. To learn about other discretizations, I recommend Chapter 10 of LeVeque's finite difference text. There are many other good references.

I do not recommend using an implicit method for this or most other hyperbolic problems. Implicit methods are more expensive (per timestep) and more difficult to implement, and for this kind of problem an implicit method will not allow you to take much larger timesteps without badly diffusing (smearing) the solution or introducing oscillations.

There is really no such thing as "absorbing boundary conditions" for advection, since there is no reflection. All you can (and should) do is specify the solution values along incoming characteristics at the boundary. Those depend on the initial data, which you haven't specified.

I should add that it's also easy to solve this kind of problem with Clawpack, which (however) uses finite volume methods.

  • $\begingroup$ Thanks for your answer. As you suggested, I tried to implement a CTCS scheme (with Dirichlet BC and a simple 2D gaussian as initial condition) but the result still unstable though... Leveque's text is very complete about how discritizing 1D advection equations with constant veocity transport but how about generalization in higher dimensions and with space dependant velocity flow $\textbf{v}$? It seems to me that a given stable 1D scheme can lead to an unstable one when directly transposed in 2D (I found an interesting work dealing this issue). $\endgroup$
    – dolun
    Commented Oct 20, 2014 at 15:06
  • $\begingroup$ Since you have a new question, you should post it! But not in the comments, please. $\endgroup$ Commented Oct 20, 2014 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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