','..','$myPermit') ?>
SYLLABUS Previous: 6.1 Splitting advection from
Up: 6 LAGRANGIAN METHOD
Next: 6.3 Non-Linear equations with
Introduced a decade ago by Yabe and Aoki [34], a whole family of schemes have been proposed along the same lines, relying on different interpolations to propagate the solution along the characteristics.
Using a cubic-Hermite polynomial, the discretized function and its first
derivative
is approximated in a continuous
manner with
![]() |
![]() |
(1) |
![]() |
(2) |
For pedagogical reasons, the scheme implemented in JBONE
assumes that
so that both quantities
can be interpolated from only one piece of the piecewise continuous
polynomial, namely
defined in the interval
.
After an initialization where the
function is discretized
with cubic-Hermite polynomials by sampling on a grid and the
derivative are calculated
with centered finite differences, the CIP scheme is
implemented as
double alpha=timeStep*diffusCo/(dx[0]*dx[0]); //These are only constant
double beta =timeStep*velocity/(dx[0]); // if the problem and the
int n=f.length-1; // mesh are homogeneous
for (int j=0; j<n; j++) {
a=dx[0]*(df[j]+ df[j+1])-2*(f[j+1]-f[j]);
b=dx[0]*(df[j]+2*df[j+1])-3*(f[j+1]-f[j]);
fp[j+1]= f[j+1] -beta*(dx[0]*df[j+1]-beta*(b-beta*a));
dfp[j+1]= df[j+1] -beta/dx[0]*(2*b-3*beta*a);
}
a=dx[0]*(df[n]+ df[0])-2*(f[0]-f[n]);
b=dx[0]*(df[n]+2*df[0])-3*(f[0]-f[n]);
fp[0]= f[0] -beta*(dx[0]*df[0]-beta*(b-beta*a));
dfp[0]= df[0] -beta/dx[0]*(2*b-3*beta*a);
The applet below illustrates the high quality of this approach, which combines a low level of dispersion with low damping.
Some additional bookkeeping is of course necessary in a code that is intended
for
: exercise 6.01 deals with exactly this problem and can be
implemented in a similar manner as illustrated with the
Cubic--Spline scheme.
SYLLABUS Previous: 6.1 Splitting advection from Up: 6 LAGRANGIAN METHOD Next: 6.3 Non-Linear equations with