# Finite differences scheme for 2D advection equation

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 :

$$\partial_t\,f+a\left[y\,\partial_x\,f+x\,\partial_y\,f\right]=0$$

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?

• 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). – dolun Oct 20 '14 at 15:06