Adventures in Boundary Conditions

Permeating the World in a Particularly Unsubtle Way

Von Neumann Stability of Linear Advection Solvers

1 Linear Advection Equation

The continuity (aka wave) equation that has a constant speed \(a\) is known as the linear advection equation, as defined by:

\[\begin{gathered} \frac{\partial q}{\partial t} + a \frac{\partial q}{\partial x} = 0 \end{gathered}\]

where \(a\) is some constant.

This equation is relatively easy to solve analytically:

\[\begin{gathered} q(x,t) \equiv q(s), \\ s \equiv x - at \end{gathered}\]

then:

\[\begin{gathered} \frac{\partial q}{\partial t} = \frac{dq}{ds}\frac{\partial s}{\partial t} = -a \frac{dq}{ds}, \\ \frac{\partial q}{\partial x} = \frac{dq}{ds}\frac{\partial s}{\partial x} = \frac{dq}{dx} \\ \rightarrow \frac{dq}{dt} + a \frac{\partial q}{\partial x} = 0 \end{gathered}\]

We then define \(x = at\) as the characteristic of the equation, with \(a\) as the characteristic speed.

To solve this numerically, we can discretize this using forward time, centered space (FTCS), using finite differences of \(q^n_i \equiv q(i\delta x, n \delta t)\)

\[\begin{gathered} \frac{q^{n+1}_i - q^n_i}{\delta t} + a \frac{q^n_{i+1} - q^n_{i-1}}{2\delta x} = 0 \end{gathered}\].

2 Von Neumann Stability

We can check for the stability of the scheme using von Neumann stability analysis, which commonly uses the trial solution of \(q^n_j = \xi^n e^{ikj}\). This will reveal whether the scheme itself is stable and also display whether dissipation and dispersion errors per step.

With the given solution of \(\xi(k) = e^{\frac{-iak \delta t}{\delta x}} = e^{ik\sigma}\), we define:

  • Dissipation error per step: \(\epsilon_{amp} \equiv |e^{-ik\sigma}| - |\xi(k)| = 1 - |\xi(k)|\)
  • Dispersion error per step: \(\epsilon_{phase} \equiv 1 - \frac{\textrm{arg}\lbrack\xi(k)\rbrack}{\textrm{arg}\lbrack e^{ik\sigma}\rbrack} = 1 + \frac{\textrm{arg}\lbrack\xi(k)\rbrack}{k \sigma}\)

For the fourth-order FTCS method with centered differences defined as:

\[\begin{gathered} q^{n+1}_j = q^n_j - \frac{1}{12}\sigma(q^n_{j-2} - 8q^n_{j-1} + 8q^n_{j+1} - q^n_{j+2}) \end{gathered}\]

with \(\sigma \equiv \frac{a\delta t}{\delta x}\)

By substituting \(q^n_j = \xi^n e^{ikj}\) we can find:

\[\begin{gathered} \xi^{n+1}e^{ikj} = \xi^ne^{ikj} - \frac{1}{12}\sigma\xi^n(e^{ik(j-2)} - 8e^{ik(j-1)} + 8e^{ik(j+1)} - e^{ik(j+2)}) \\ \xi = 1 - \frac{1}{12}\sigma(e^{-2ik} - 8e^{-ik} + 8^{ik} - e^{2ik}) \\ \xi = 1 - \frac{i\sigma}{6}(8 \textrm{sin} \space k - \textrm{sin}\space 2k ) \\ \xi = 1 - \frac{i \sigma}{3}\textrm{sin}\space k (4 - \textrm{cos}\space k) \end{gathered}\]

Thus, the dissipation error per step is: \[\begin{gathered} \epsilon_{amp} = 1 - |\xi(k)| = 1 - \lbrack 1 + \frac{\sigma^2}{9}\textrm{sin}^2 \space k (4 - \textrm{cos}\space k)^{2} \rbrack^{\frac{1}{2}} \end{gathered}\]

And the dispersion error per step is: \[\begin{gathered} \epsilon_{phase} = 1 + \frac{\textrm{arg}\lbrack\xi(k)\rbrack}{k\sigma} = 1 - \frac{1}{k\sigma}\textrm{tan}^{-1}\lbrack\frac{\sigma}{3}\textrm{sin}k(4-\textrm{cos}k)\rbrack \end{gathered}\]