A number of schemes for the solution of the advection equation are described below. These include finite differences, schemes based on the method of characteristics, the application of filtering techniques to the results from finite difference schemes and schemes for solving conservative laws.
Equation (2.21) may be replaced by a three-point two-time level finite difference scheme method with appropriate initial and boundary condition in the region 0 < x < L, 0 < t < T. The general form of many of these finite difference schemes can be written in the form (Noye [1986]) n + l n Cj- 1 C j . 1 ' + < 1 - 2y) ' n + l n CJ ~ CJ * < + 7 n + l n Cj* 1 ~ C j+i At At At + u n + l n+l „ n + l n +l e <p Cj - C j . , + (1-9) Cj* 1 ~ C j . 1 Ax 2Ax (2.22) + 0 -0) ' iß n n Cj - C j . , + ( I -9) n n c j * 1 - C j . 1 > {r Ax 2Ax
Different finite difference schemes are obtained depending on the choice of the weighting coefficients, 7, and 9.
Equation (2.22) can be simplified into
n + l n + l n + l i n i n > n
+ üq Cj + a^Cj+i — b-yCj -i + Dq Cj + b^Cj+\ (2.23) in which
Numerical Methods fo r Solving the One-Dimensional Advective-Diffusion Equation 2.16
a_x = 2y - 00(1 + <p), b_{ = 2y + Cr( 1 - 0)(1 + <p), a0 = 2(1 - 2y a Cr<p6), b0 = 2(1 - 2y - Cr<p( 1 - 0)),
ax = 2y + Cr0( 1 - <p), and bx = 2y - Cr(\ - 0)(1 - <p).
Analogous to the advective-diffusion equation, the modified equivalent partial differential equation given by Noye and Steinle [1986] as
^ + U— + y “W 1 (o )Ü !£ = o (2-24)
dt dx q\ q dxq
in which the coefficients for the first three higher-order derivatives are given by
V2(Cr) = O i l - 20) - <p,
rjJO) = 1 - 6y - 3 0y>(1 - 20) + 2Cr2(l - 30 + 302) and
(2.25)
V,(Cr) = <p(12y - 1) + Cr(l - 20)(4 + 3<p2 - 24y)
- 12CrV(l - 30 + 302) + 6Cr3(l - 40 + 602 - 403).
The properties of equation (2.24) can be used to provide insight into the behaviour of the finite difference approximation.
If rjq(Cr) = 0 for q = 2 ,3 ,...,0 , the finite difference approximation is said to be of order Q, since the truncation error is
E = T u^ q' \ (Cr)— (2.26)
q\ q dx"
is 0(Ax°). This is the order of accuracy of a finite difference method if there are no discontinuities in the initial or boundary conditions. It will be shown later that the accuracy of the finite difference scheme is significantly reduced in the presence of a discontinuity in the initial or boundary conditions.
If the modified partial differential equation has a non-vanishing term r^2(Cr) then the finite difference approximation is first-order and introduces artificial diffusion in the scheme. If the modified partial differential equation contains the term, r/3(Cr) the numerical scheme introduces dispersion in the solution.
(a) Forward Time Centred Space (FTCS)
The forward time centred space scheme can be written as
c-"
= 0/2c'.,
+ - 0/2c/.,.The modified equivalent partial differential equation is
be be uAx n b2c i 2\
— + u— + ---Cr--- + O(Ax).
bt bx 2 bx2
Although this is a first-order scheme, r]2(Cr) = Cr, it is unconditionally unstable because
Cr > 0.
(b) Lax-Friedrichs (LAF)
The Lax-Friedrichs scheme, given by
cl" = 1(1+ 0 ) c ", + 1(1 -
can be obtained from equation (2.22) by substituting <p = 1/Cr, and 6 = y = 0, or aA — 0,
ax — 0, a0 = 1, b.i — (1 + Cr)/2, bQ = 0 and bx = (1 - Cr)l2 in equation (2.23). Substituting these values in equation (2.25) then
V2(Cr) = Crlc r rj3( 0 ) = -2 + 2 0 2 and
«.(O )
= -JL +
4 0+ -1 -
1 2 0+
6 e r3.4 O O
Since the non-vanishing term occurs for Q = 1, then this is only a first-order approximation to the advection equation.
The Lax-Friedrichs scheme has the modified equivalent partial differential equation
+ ♦ H*L \ Cr* - l ] f £ ♦ 0(Ax2) = 0 (2.27)
bt bx 2 Cr a^:2
which is in the form of an advective-diffusion equation. The Lax-Friedrichs scheme has introduces artificial diffusion or anti-diffusion depending on the magnitude if Cr. The scheme is unstable when | Cr\ > 1 because it introduces anti-diffusion. The scheme introduces artificial diffusion for Cr < 1.
The simulated profile for the hypothetical example using the Lax-Friedrichs scheme is illustrated in Figure 2.2. The effect of the artificial diffusion introduced by this scheme is obvious.
Numerical Methods fo r Solving the One-Dimensional Advective-Dijffusion Equation 2.18
O 40 .
d is t a n c e
Figure 2.2 Analytical and Lax-Friedrichs solution of the advection equation
a so.
O 40.
d is t a n c e
(c) Forward Time Upwind (FTUP)
The first-order upwind scheme, where <p = 1, 0 = 7 = 0, then aA = 0, a0 = 1, a{ = 0,
bA — Cr, bQ = (l - Cr), and bx = 0, can be written as
c"*1 = C r c f + (1 -
Substituting these values into equation (2.25) then, r^(Cr) = Cr - 1 and the modified equivalent partial differential equation is
— + u— + — (Cr - 1) + 0(A x2) = 0. (2.28)
dt dx 2
The upwind scheme introduces artificial diffusion if 0 < Cr < 1, otherwise artificial anti diffusion is introduced and the scheme is unstable.
In Figure 2.3 the simulated results using the forward time upwind scheme have been plotted against the exact profile.
The effect of the numerical diffusion introduced by the first-order scheme is obvious. It produces results that are smeared in regions near the discontinuity and spreads the smoother Sine-squared profile.
Comparing the truncation error between equations (2.27) and (2.28) indicates that more diffusion is introduced in the Lax-Friedrichs scheme compared with the forward time upwind scheme. In general, stable first-order schemes introduce artificial diffusion. This is confirmed by comparing the simulated profiles in Figures 2.2 and 2.3.
(id) Lax-Wendroff (LAW)
Choosing <p = Cr, 6 = y = 0 (aA = ax = 0 and aQ = 1) yields the Lax-Wendroff scheme c;*' = i o n + 0 ) c " , + (1 - Cr2)Cj - i o ( l - Cr)C;„ (2.29)
with r]2(Cr) = 0, r]3(Cr) = 1 - (Cr)2 then the modified equivalent partial differential equation is i £ + u— + .mA-*-(1 - Cr2)— + 0 (Ax3) = 0.
dt dx 6 dx3
No artificial diffusion or anti-diffusion is introduced by the use of the second-order Lax- Wendroff scheme. However, there is a third-order or dispersion term introduced by the finite difference approximation. For a stable solution, -1 < Cr < 1, the dispersion coefficient is positive. In this case the analytical solution of a dispersion equation with positive coefficients, see Appendix A, indicates that oscillations are observed behind the advancing front. This is the observation in the numerical scheme, shown in Figure 2.4.
Numerical Methods fo r Solving the One-Dimensional Advective-Diffusion Equation 2.20
d is ta n c e
Figure 2.4 Analytical and Lax-Wendroff solution of the advection equation
The second-order Lax-Wendroff scheme produces a reasonable approximation to the smooth profile. For the sharp front however, although the analytical solution is monotone, trailing oscillations are observed in the numerical solution. This is due the dispersion term in the Lax- Wendroff scheme.
(e) Beam-Warming (BAW)
There are numerical schemes where the dispersion coefficient is negative. The Beam-Warming, (see, for example LeVeque [1992], p. 101) is such a scheme. The Beam-Warming scheme is given by
/l + l n C r n a n n v , n n n
Cj = Cj - — (3c, - 4c,., + + — (cy - 2 c,_, +
and the modified equivalent partial differential equation is given by LeVeque (1992, p. 119) as
— + u— - i ^ ! ( : 2 - 3 0 + Cr2)— + 0(Ax3) = 0.
dt dx6 dx1
In this case the dispersion coefficient is negative- in the stability region 0 < Cr < 2. The analytical solution for the advective dispersion equation with a negative dispersion coefficient indicates that oscillations would occur forward of the advancing front. Numerical results for this scheme exhibit the characteristic oscillations which occur forward of the front, see Figure 2.5.
CD
Figure 2.5 Analytical and Beam and Warming solution of the advection equation
The results shown in Figures 2.2 to 2.5 are typical of what would be obtained with other standard stable first- or second-order explicit or implicit schemes.
(/) Noye and Tan Marching Scheme (NAT)
The third-order Noye and Tan marching scheme approximation of equation (2.21) is
(4 + 2 Cr)c"" + (2 - 2Cr)Cj''
(2.30) = (2 + 3 0 + 0 2)c/-i + (4 - 2 0 - 2 0 2)c/ + ( O 2 - 0 ) c /„
which was obtained by setting 6 = (O - l) /( 3 0 ) , <p = ( O + 2)/3 and = ( O - l)2/ 18 in equation (2.23).
The modified equivalent partial differential equation for equation (2.30) is
— + U— + i ^ ! ( 2 + O - 2 O 2 - 0 3) ^ £ + 0(A x4) = 0
dt dx 12 dx*
where, th(Cr) = r]3(Cr) = 0 and ^(C r) = 2/3 + Cr/3 - 2(Cr)2/3 - (Cr)3/3. This scheme introduces a fourth-order diffusion term as the leading truncation error term. It is therefore third- order accurate for pure advection. For a stable solution, 0 < Cr < 1.
The simulated profile using the Noye and Tan marching scheme for pure advection is illustrated in Figure 2.6.
Numerical Methods fo r Solving the One-Dimensional Advective-Diffusion Equation 2.22
d is t a n c e
Figure 2.6 Analytical and Noye and Tan marching solution of the advection equation
Although this scheme has a leading diffusion term in the truncation error term, higher-order diffusion terms may still cause overshoot and undershoot in regions where steep gradients exist in the profile (Tamamidis and Assanis [1993]). This can be explained simply by considering the analytical solution of the following approximation to the advective equation.
be
T t 1 2 3 (2.31)
The right hand side term is the highest-order leading term in the modified equivalent partial differential equation and A which depends on u, Ax and At, is a coefficient unique for each finite difference approximation. The behaviour of this equation can be examined by considering the evolution in time of a single Fourier component in space
c(x,t) = c0eißkx
where c0 is the initial concentration, ß = 2itIL, L is the length of the computational domain and
i = (-1)1/2. It is sufficient to consider only a single Fourier mode in space because a linear system with constant coefficients is being considered.
Using the method of separation of variables, the analytical solution to equation (2.31) is
c{x,t) = c0exp{A(ißkyt} exp{ißk(x - ut)}.
c(x,t) = c0exp{ißk(x - ut)}
for the pure advection equation by the amplification factor exp{A(ißkyt}. As illustrated by Potter (1973), three classes of problem can be identified when the amplification factor is; (z) positive real, which gives rise to decay type solutions, (ii) negative real, growth type solutions or (iii)
imaginary, producing oscillatory solutions.
The amplification factor is negative and real for the diffusion equation, p = 2 and the profile will decay with time. For the dispersion equation p = 3, the amplification factor is
exp{-Ä(kß)3t}. This results in an oscillatory solution. The amplification factor for the fourth- order equation, p = 4 is exp{A(kß)*t}. Although this is a diffusive term the exponent is positive and the solution should amplify with time. However, its influence depends on the coefficients, the mesh size and the relative high frequencies that describe the initial profile. Highly oscillatory Fourier modes appear around discontinuities.
Although over and undershooting of the step function has occurred in the simulated profile shown in Figure 2.6, there is excellent resolution of the smoother Sine-squared profile. Negative concentrations are predicted by the scheme for both profiles. This is an undesirable feature of this and many other schemes, although this scheme represents a significant improvement over first- and second-order schemes, introducing very little diffusion and dispersion in comparison to lower-order schemes.
2 .4 .2 Other Schemes for Solving the Advection Equation
The above is only a small sample of the numerous techniques based on naive finite differences that can be used to model the advection of a profile. There are a number of alternative techniques that could be used. These include; (z) spectral (see, for example Gottlieb and Orszag [1977], Huntley et al. [1978] and Gottlieb et al. [1984]), (ii) finite elements (see, for example Donea [1984] and Johnson [1990]) (iii) Laplace transform (see, for example Celia et al. [1989], Sudicky [1989], Moridis and Reddell [1991], Li et al. [1992] and Yates [1992]), (zv) method o f characteristics or Lagrangian techniques (Holly and Preissmann [1977], Li [1990a]) and (v)
filtering (Engquist et al. [1989] and Shyy et al. [1992]). Only the method of characteristics, which includes the Quasi-characteristics and a recently developed filtering technique are described below. Discussion of the Laplace transform techniques is left to Chapter 4.
There is also another very important class of schemes which are used for the solution of conservative laws (see, for example Sod [1985], Mitchell and Griffiths [1980] and LeVeque [1992]). These schemes, which are applicable to both conservative and non-conservative laws are discussed in Section 2.4.3.
(a) Method of Characteristics
Based on the method of characteristics, the Holly and Preissmann scheme described in Section 2.2 can be used to model the advection of a profile. Bedford et al. (1983) describe its application for the conservative form of the advective-diffusion equation with non-uniform velocity, source- sink term and lateral inflows. The conservative advective equation was re-written in an equivalent non-conservative form with a first-order reaction term and source-sink term and was
Numerical Methods fo r Solving the One-Dimensional Advective-Diffusion Equation 2.24
solved using the Holly and Preissmann scheme. Bedford et al. (1983) found that this method was superior to a four point second-order implicit finite difference scheme for modelling advection. This scheme is exact in time for the pure advection of a concentration profile in a constant flow field. Its accuracy depends on the accuracy of the interpolation scheme. Using a fourth-order Hermite cubic interpolation, the simulated profile for the hypothetical example is illustrated in Figure 2.7.
d is t a n c e
Figure 2.7 Analytical and Holly and Preissmann solution of the advection equation
There is excellent resolution of both the smooth and step profile. However, over and undershoot of the step profile has resulted in negative concentrations. Although not as obvious, negative simulated concentrations have also occurred for the smooth profile. These are due to the inability of Hermite cubic interpolation to prevent the formation of extraneous inflection points near extrema.
(b) Non-Linear Filtering Techniques
Recently there has been an attempt to use filters to suppress the numerical oscillation in second and higher-order schemes. These filtering techniques can be applied to any scheme which produces oscillations in the simulated concentration profile. They seem to work best on second- order schemes which introduce dispersion.
Shyy et al. (1992) modified the non-linear filtering technique developed by Engquist et al.
(1989) to eliminate numerical generated oscillations. The filtering algorithm is designed to suppress high frequency numerically generated oscillations with wavelengths, 2 Ax and 4Ax. The process begins by first scanning the results from a numerical scheme for any local extrema. A local extrema is located when 5+5 < 0, where 5+ is the forward difference, 5+ = cj+l - c; and <5. is the backward difference, 5. = c; - cjA. The concentration, c; is corrected by the
weighted amount e = o)(/nin(£+,£.)) where e+ = max{ \ 5+ | , 15. | )/2, e. = min{ 15+1, 15. | ) and w is an arbitrary weighting coefficient. To maintain conservation when a correction is made at a point, the same correction is subtracted from the neighbouring point with the greatest difference from Cj. For the modelling of the pure advection of a step function, Shyy et al. (1992) found that cj = 1.6 eliminated the spurious oscillation introduced by three second-order schemes. In addition, the best results were obtained by applying the filter at each time step.
The filtering technique was used to suppress the oscillations in the second-order Lax-Wendroff scheme for the example used in this study. The results of applying the filtering technique for the example used in this study and using cj = 2, are illustrated in Figure 2.8.
.0 2 5. 5 0. 7 5. 1 0 0.
d is ta n c e
Figure 2.8 Analytical and Shyy et al. filtered Lax-Wendroff solution of the advection equation
The oscillations introduced by the second-order Lax-Wendroff scheme shown in Figure 2.4, have been eliminated by the filtering technique and the scheme has maintained a sharp profile across the discontinuity. However, for non-monotone profiles it introduced significant diffusion. These schemes require special procedures to isolate extrema consisting of more than one point and they attenuate extrema that are not the result of over or undershooting (see Figure 2.8). In addition, there is some doubt that the local adjustment of the nodal concentration near extrema is conservative for non-uniform grid spacing. The results are also very sensitive to the value of the arbitrary weighting coefficient, c j.
These examples illustrate that although it is very simple to apply mathematical techniques to solve these equations, one must exercise extreme caution when applying these techniques, otherwise the numerical scheme may produce non-physical solutions.
Numerical Methods fo r Solving the One-Dimensional Advective-Dijffusion Equation 2.26