previous up next SYLLABUS  Previous: 2.1 Explicit 2 levels  Up: 2 FINITE DIFFERENCES  Next: 2.3 Lax-Wendroff

2.2 Explicit 3 levels

Slide : [ 3 levels Scheme - Code - Run || VIDEO login]

A more accurate scheme in $ \mathcal{O}(\Delta x^2 \Delta t^2)$ is obtained from centered differences

Figure 2.2#fig.3: Explicit 3 levels.

$\displaystyle \frac{f_j^{t+\Delta t} -f_j^{t-\Delta t}}{2\Delta t} +
u \frac{f_...
...- f_{j-1}^t}{2\Delta x}
- D \frac{f_{j+1}^t -2f_j^t +f_{j-1}^t}{\Delta x^2} = 0$      

$\displaystyle f_j^{t+\Delta t} = f_j^{t-\Delta t} - \beta\left[ f_{j+1}^t - f_{j-1}^t \right] + 2\alpha\left[ f_{j+1}^t -2f_j^t +f_{j-1}^t\right]$ (2.2.0#eq.5)

The scheme involves three time levels (fm[j], f[j], fp[j]) and has been implemented in JBONE as

      for (int j=1; j<n; j++) {
        fp[j]=fm[j] -beta*(f[j+1]-f[j-1]) +2*alpha*(f[j+1]-2.*f[j]+f[j-1]);}
      fp[0]=fm[0]   -beta*(f[ 1 ]-f[ n ]) +2*alpha*(f[ 1 ]-2.*f[0]+f[ n ]);
      fp[n]=fm[n]   -beta*(f[ 0 ]-f[n-1]) +2*alpha*(f[ 0 ]-2.*f[n]+f[n-1]);
A special starting procedure is required to calculate an approximation at a time $ -\Delta t$ anterior to the initial condition $ t=0$ . This can be implemented by taking one step backwards in time with the explicit 2 levels scheme (2.1#eq.1). The example below shows the result obtained using the same parameters for the advection equation as in the previous section.
JBONE applet:  press Start/Stop to simulate the advection of a box function and to test how the explicit 3 levels scheme affects the dispersion and the damping of short and long wavelengths superposed in a box function.

Despite the mathematically higher accuracy in $ \mathcal{O}(\Delta x^2 \Delta t^2)$ and the excellent conservation of the lowest order moment, the initial box function is strongly distorted by the phase errors created from numerical dispersion, when short wavelengths propagate at a different speed from longuer wavelengths due to inaccuracies in the finite difference approximations.

Numerical experiments: explicit 3-levels
  1. Switch to Cosine and check how the scheme performs for the advection of harmonic functions with ICWavelength=4 mesh points per wavelength. Measure the propagation speed and compare with the physical Velocity that is given as an input parameter. What happens with ICWavelength=2 mesh point per wavelength?
  2. Switch to a Gaussian initial condition and observe how the pulse propagates accross the periodic domain. Explain how the initial pulse gets distorted.
  3. Switch to Explicit 2-level and compare the numerical dispersion / damping in 2 and 3 levels schemes.
  4. Back to Explicit 3-level, change the sign of Velocity=-1 and verify that a symmetric scheme indeed works for both directions.
  5. Add a small physical Diffusion=0.1 and verify that the same spatial difference used in (2.1#eq.1) is here in fact always unstable (exercise 2.02).

Because the numerical dispersion slows down short wavelengths $ k\Delta x \simeq \pi/2$ , the solution can become locally negative even if it was strictly positive at the beginning. This is of course not physical and can be a problem if $ f(x,t)$ is a density... Low numerical damping, however, makes the 3 levels scheme attractive when a simple solution is sought only for advection. The choice between a 2 or 3 level scheme ultimately depends on the specific application and always implies a sound monitoring of the numerical parameters at run time.

SYLLABUS  Previous: 2.1 Explicit 2 levels  Up: 2 FINITE DIFFERENCES  Next: 2.3 Lax-Wendroff

back up next contents bibliography Copyright © Lifelong-learners at 03:01:26, October 21st, 2017