An Explicit Fourth-Order Compact Finite
Dierence Scheme for Three Dimensional
Convection-Diusion Equation
Jun Zhangy
Department of Computer Science and Engineering, University of Minnesota,
4-192 EE/CS Building, 200 Union Street S.E., Minneapolis, MN 55455
December 22, 1996, revised September 8, 1997
Abstract
We present an explicit fourth-order compact nite dierence scheme for approximating the three dimensional convection-diusion equation with variable
coecients. This 19-point formula is dened on a uniform cubic grid. We compare advantages and implementation cost of the new scheme with the standard
7-point scheme in the context of basic iterative methods. Numerical examples are used to verify the fourth-order convergence rate of the scheme and to
show that the Gauss-Seidel iterative method converges for large values of the
convection coecients. Some algebraic properties of the coecient matrices
arising from dierent discretization schemes are compared. We also comment
on potential use of the fourth-order compact scheme with multi-level iterative
methods.
Key words: Three dimensional convection-diusion equation, fourth-order compact
scheme, iterative methods.
1 Introduction
Numerical simulation of three-dimensional (3D) problems tends to be computationally intensive and may be prohibitive on conventional computers due to the
requirements on memory and CPU time to obtain solution with required accuracy.
Traditional numerical schemes have low accuracy and thus require ne discretization. The size of the resulting linear systems is usually so large that even modern
computers may not be able to handle them directly. One approach to alleviate these
This research was partially supported by a grant (DMS970001P) from Pittsburgh Supercomputing Center. This paper has been published in Communications in Numerical Methods in Engineering, 14, 263{280 (1998).
y E-mail: [email protected]. URL: http://www.cs.umn.edu/~jzhang.
1
diculties is to use higher-order or spectral methods, which usually yield comparable accuracy with much coarser discretization, resulting in linear systems of smaller
size.
In the two dimensional (2D) case, some fourth-order compact nite dierence
schemes for the convection-diusion equation and the Navier-Stokes equation have
been designed by several authors, see, e.g., [3, 5, 9, 11]. These schemes have good numerical stability and yield high accuracy approximations. Recent studies by Zhang
[13, 14] indicate that the fourth-order compact schemes work well with some contemporary iterative methods, e.g., the multigrid methods. At least for the diusiondominated problems and with the multigrid solution methods, the fourth-order compact schemes have been found [6] computationally more ecient than the traditional
second-order central dierence scheme. To obtain computed solution of given accuracy, the fourth-order compact schemes may be hundreds of times faster and uses
less memory than the central dierence scheme.
In this paper, we present an explicit fourth-order compact nite dierence scheme
for approximating the 3D convection-diusion equation
u(x; y; z ) + ((x; y; z ); (x; y; z ); (x; y; z )) ru(x; y; z ) = f (x; y; z );
(1)
for specied forcing function f in a continuous 3D domain with appropriate boundary conditions prescribed on @ . Here is assumed to be comprised of a union of
rectangular solids. u is assumed to be suciently dierentiable with respect to x; y
and z in and ; ; and f are suciently regular.
Eq. (1) is very important in computational uid dynamics to describe transport
phenomena. ; and are called the convection coecients. The magnitudes of the
convection coecients determine the ratio of the convection to diusion. For large
values of the convection coecients, Eq. (1) is said to be convection-dominated,
otherwise it is diusion-dominated.
For problems with large convection coecients, basic iterative methods, e.g., Jacobi and Gauss-Seidel, do not converge for solving linear systems resulting from the
standard 7-point central dierence discretization. On the other hand, the rst-order
upwind scheme yields solution of low accuracy. Recently, Greif and Varah [4] used a
cyclic reduction technique to precondition the linear system resulted from discretization of the 3D convection-diusion equation with constant coecients and showed
that the reduced system has better algebraic properties than the original system.
On the other hand, our experience with the 2D fourth-order compact schemes suggests that the 3D fourth-order compact scheme be an eective approach to provide
stable and high accuracy solution for the 3D convection-diusion problems.
This paper is organized as follows. In Section 2 we present the fourth-order
compact nite dierence scheme and compare advantages and implementation cost
of this scheme with the standard 7-point scheme in the context of basic iterative
methods. In Section 3, we conduct two numerical experiments to verify the fourthorder convergence rate of our scheme and to compare the algebraic properties of the
coecient matrices arising from dierent discretization schemes. Section 4 contains
conclusions and some remarks.
2
z
6
-x
+
y
u16
u8
u2
u3
u17
e
u18
e
u12
e
u13
u5
u11
0 u
u1
e
u14
ijk
9 4
6
15
u
u
u
u
e
u7
e
e
u10
e
Figure 1: Labeling of the 3D grid points in a unit cube.
2 Finite Dierence Scheme
We assume the discretization is done on a uniform grid with a meshsize h. We
use a local coordinate system and the unit cubic grids are labeled as in Figure 1.
(Our labeling system is slightly dierent from that used by Ananthakrishnaiah et
al. [1].) The approximate value of a function u(x; y; z ) at an internal mesh point
(i; j; k) is denoted by u0 . The approximate values of its immediate 18 neighboring
points are denoted by u ; l = 1; 2; : : : ; 18; as in Figure 1. The 8 corner points of the
unit cube are not used in our scheme. The discrete values of ; ; and f for
l = 0; 1; : : : ; 6; are dened similarly. The ideas and procedure of developing fourthorder compact nite dierence schemes for the 3D general linear elliptic problems
with variable coecients were presented by Ananthakrishnaiah et al. [1], but the
formulas given in [1] are so general and abstract that people have to spend lots of
time to derive explicit schemes for their individual equations. Our explicit fourthorder compact scheme for Eq. (1) was derived from the general implicit formulas of
[1] by employing the computer algebra package Mathematica1 . The discretization
scheme yields a 19-point formula
l
l
l
l
Xc u = F :
18
l
l
l
=0
0
The coecients of the approximating scheme (2) are given by
?[24 + h2(20 + 20 + 20) + h(1 ? 3 + 2 ? 4 + 5 ? 6 )];
= 2 ? h4 (20 ? 31 ? 2 + 3 ? 4 ? 5 ? 6 )
c0 =
c1
+ h8 [420 + 0 (1 ? 3 ) + 0 (2 ? 4 ) + 0 (5 ? 6 )];
2
h
c2 = 2 ? (20 ? 1 ? 32 ? 3 + 4 ? 5 ? 6 )
4
1
Mathematica is a registered trademark of Wolfram Research, Inc.
3
l
(2)
+ h8 [420 + 0 (1 ? 3 ) + 0 (2 ? 4 ) + 0 (5 ? 6 )];
2
h
c3 = 2 + (20 + 1 ? 2 ? 33 ? 4 ? 5 ? 6 )
4
+ 8 [420 ? 0 (1 ? 3 ) ? 0 (2 ? 4 ) ? 0 (5 ? 6 )];
h2
h
c4 = 2 + (20 ? 1 + 2 ? 3 ? 34 ? 5 ? 6 )
4
+ 8 [420 ? 0 (1 ? 3 ) ? 0 (2 ? 4 ) ? 0 (5 ? 6 )];
h2
h
c5 = 2 ? (20 ? 1 ? 2 ? 3 ? 4 ? 35 + 6 )
4
+ 8 [420 + 0 (1 ? 3 ) + 0 (2 ? 4 ) + 0 (5 ? 6 )];
h2
h
c6 = 2 + (20 ? 1 ? 2 ? 3 ? 4 + 5 ? 36 )
4
+ 8 [420 ? 0 (1 ? 3 ) ? 0 (2 ? 4 ) ? 0 (5 ? 6 )];
h2
h
h2
h
c7 = 1 + (0 + 0 ) + (2 ? 4 + 1 ? 3 ) + 0 0 ;
2
h
8
h
c8 = 1 ? (0 ? 0 ) ? (2 ? 4 + 1 ? 3 ) ?
2
8
4
h2
4 0 0 ;
h
h2
h
c9 = 1 ? (0 + 0 ) + (2 ? 4 + 1 ? 3 ) + 0 0 ;
2
h
8
h
c10 = 1 + (0 ? 0 ) ? (2 ? 4 + 1 ? 3 ) ?
2
8
4
h2
4 0 0 ;
h
h2
h
c11 = 1 + (0 + 0 ) + (5 ? 6 + 1 ? 3 ) + 0 0 ;
2
h
8
h
c12 = 1 + (0 + 0 ) + (5 ? 6 + 2 ? 4 ) +
2
8
4
h2
4 0 0 ;
h
h2
h
c13 = 1 ? (0 ? 0 ) ? (5 ? 6 + 1 ? 3 ) ? 0 0 ;
2
h
8
h
c14 = 1 ? (0 ? 0 ) ? (5 ? 6 + 2 ? 4 ) ?
2
8
4
h2
4 0 0 ;
h
h
h2
c15 = 1 + (0 ? 0 ) ? (5 ? 6 + 1 ? 3 ) ? 0 0 ;
2
h
8
h
c16 = 1 + (0 ? 0 ) ? (5 ? 6 + 2 ? 4 ) ?
2
8
4
h2
4 0 0 ;
h
h
h2
c17 = 1 ? (0 + 0 ) + (5 ? 6 + 1 ? 3 ) + 0 0 ;
2
h
8
h
c18 = 1 ? (0 + 0 ) + (5 ? 6 + 2 ? 4 ) +
2
8
h2
F0 =
2 (6f0 + f1 + f2 + f3 + f4 + f5 + f6 )
4
4
h2
4 0 0 ;
+ h4 [0 (f1 ? f3 ) + 0 (f2 ? f4 ) + 0 (f5 ? f6 )]:
3
Note that when = = 0, Eq. (1) reduces to the 3D Poisson equation.
Our scheme (2) reduces to the explicit 19-point formula developed by Kwon et al.
[8], Spotz and Carey [12]. In a recent paper [16], we showed that the fourth-order
compact scheme with multigrid method is a fast and high accuracy 3D Poisson
solver which is hundreds of times more ecient than that with the central dierence
scheme.
We remark that our scheme is in compact form in the sense that it only involves
the 18 neighboring grid points nearest to the reference grid in a unit cube. For
problems with Dirichlet boundary conditions, no special formula is needed for approximating grid points near the boundary. The compactness also means that the
computed accuracy of the scheme is increased at the expenses of only a slight increase in the density of the sparse matrix structure compared to the minimal O(h2 )
stencil. An additional advantage of compactness is that it reduces the communications required by a domain decomposition approach to parallelizing the discretization
compared to non-compact stencils.
The coecient matrix of the linear system resulting from the fourth-order compact discretization of Eq. (1) is not diagonally dominant for large values of the
convection coecients. (This can be proved for constant coecient problems as in
the 2D case, see [13].) However, our numerical examples will show that the GaussSeidel iterative method with this scheme converges for large values of the convection
coecients even without the diagonal dominance.
Except for some nominal arithmetic operations to compute the stencil coecients
(which can usually be done once for all at the beginning of the computation), one
iteration of a Gauss-Seidel type iterative method with the 19-point scheme requires
37 operations, while one iteration with the traditional 7-point scheme requires 13
operations. Hence, the implementation cost of the 19-point scheme is almost 3 times
as expensive as that of the 7-point scheme. The relatively high cost of the 19-point
scheme is rewarded by the high accuracy of the computed solution. Suppose that
the meshsize used for the 19-point scheme is h19 and that for the 7-point scheme is
h7 . If comparable accuracy can be achieved by choosing h19 = 2h7 , the size of the
linear system from the 19-point scheme is only about 1=8 of the size of the linear
system from the 7-point system. If convergence rate remains the same, the 19-point
scheme will be 104=37 2:8 times faster than the 7-point scheme. Furthermore,
there are at least two factors which make the 19-point scheme more attractive.
First, for basic iterative methods, smaller system usually means faster convergence.
For the 3D Poisson equation, we showed in [16] that multigrid method with the
fourth-order scheme converges faster than that with the second-order scheme even
with the same meshsize! Second, the 19-point scheme usually requires much coarser
discretization, say, h19 > 4h7 or even h19 8h7 , and still yield comparable accuracy.
This fact means that relative computational cost using the 19-point scheme is even
lower. These advantages make the fourth-order compact scheme computationally
more ecient than the 7-point scheme. For some detailed comparisons, readers are
referred to Zhang [16].
5
Table 1: Maximum errors and the estimated order of convergence rate for Test
Problem 1.
Re
0
1
10
102
103
104
105
106
h = 1=5
h = 1=10 h = 1=20 h = 1=40 Conv. Order
1.735(-2)
1.649(-2)
3.218(-2)
2.613(-1)
3.661(-1)
3.815(-1)
3.821(-1)
3.821(-1)
1.104(-3)
1.060(-3)
2.020(-3)
2.180(-2)
7.501(-2)
1.029(-1)
1.038(-1)
1.039(-1)
6.842(-5)
6.582(-5)
1.278(-4)
1.716(-3)
1.224(-2)
2.402(-2)
2.722(-2)
2.752(-2)
4.296(-6)
4.144(-6)
8.003(-6)
1.117(-4)
1.151(-3)
5.257(-3)
7.244(-3)
7.553(-3)
3.993
3.989
3.997
3.941
3.411
2.192
1.910
1.865
3 Numerical Results
In our numerical experiments, the domain was chosen as the unit cube (0; 1)3 . We
used the Gauss-Seidel iterative method to solve the discretized linear systems. Our
programs were run on a Cray-90 supercomputer at the Pittsburgh Supercomputing
Center and we used the Cray Fortran 77 programming language in single precision
arithmetic (roughly equivalent to double precision on conventional machines). The
computations were terminated when the residual in discrete L2 norm was reduced
by a factor of 1010 . The maximum error is the maximum absolute error over all the
discrete grids.
3.1 Test Problem 1
We chose the convection coecients in Eq. (1) as
(x; y; z ) = Re sin y sin z cos x;
(x; y; z ) = Re sin x sin z cos y;
(x; y; z ) = Re sin x sin y cos z:
The forcing function f (x; y; z ) and the Dirichlet boundary conditions were prescribed
to satisfy the exact solution u(x; y; z ) = cos(4x +6y +8z ): Re is a constant reecting
the ratio of the convection to diusion and simulating the Reynolds number.
For dierent values of Re, we rened the meshsize h to test the error decreasing
rate. The maximum errors for 0 Re 106 and h = 1=5; 1=10; 1=20; 1=40; are
listed in Table 1. We remark that the computed results changed little for Re 106 .
The convergence order was calculated by using the maximum errors for h = 1=20
and h = 1=40.
It is clear from Table 1 that, for small to medium Re, the error decreased rapidly
as the meshsize was rened and our iterative method demonstrated a fourth-order
convergence rate. But the computed accuracy was inversely aected by the magnitude of Re. The only minor exception was for Re = 0 and Re = 1. For large Re,
our iterative method still converged, but yielded a second-order convergence rate.
6
Table 2: Maximum errors and the estimated order of convergence rate for Test
Problem 2.
Re
0
1
10
102
103
104
105
106
h = 1=5
h = 1=10 h = 1=20 h = 1=40 Conv. Order
1.357(-3)
1.409(-3)
2.302(-3)
2.244(-2)
7.079(-2)
7.542(-2)
7.561(-2)
7.563(-2)
9.566(-5)
9.752(-5)
1.435(-4)
1.831(-3)
1.439(-2)
2.172(-2)
2.200(-2)
2.205(-2)
5.920(-6)
6.038(-6)
8.985(-6)
1.235(-4)
1.535(-3)
5.668(-3)
6.348(-3)
6.366(-3)
3.296(-7)
3.370(-7)
5.629(-7)
7.877(-6)
1.109(-4)
8.832(-4)
1.749(-3)
1.785(-3)
4.167
4.163
3.997
3.971
3.791
2.682
1.860
1.834
The deterioration of computed accuracy for large Re was not unexpected and may
be attributed to two reasons. The rst and the main reason is that the second-order
elliptic equation (1) approaches a rst-order hyperbolic equation as Re increases to
innity. Second, as we shall see later in Table 3, the Frobenius norm of the coecient
matrix is very large for large Re which indicates the existence of entries of very large
magnitude. This may result in rounding errors during nite precision computation.
3.2 Test Problem 2
The convection coecients of our second test problem was chosen as
(x; y; z ) = Rex(1 ? 2y)(1 ? z );
(x; y; z ) = Rey(1 ? 2z )(1 ? x);
(x; y; z ) = Rez (1 ? x)(1 ? z ):
The forcing function f (x; y; z ) and the Dirichlet boundary conditions were prescribed
to satisfy the exact solution u(x; y; z ) = sin x sin y sin z:
It is again observed that the fourth-order convergence rate was achieved for
small to medium Re. When the magnitude of Re increased, the computed accuracy
decreased. However, we note that the scheme is stable in the sense that the GaussSeidel method converged for all values of the convection coecients tested. Once
again, the tested results changed little for Re 106 .
3.3 Algebraic Properties
The coecient matrix from the 19-point scheme is not diagonally dominant for large
Re. For Test Problem 1 with h = 1=20, Table 3 lists some algebraic properties of
the coecient matrices arising from the 19-point scheme and those arising from the
7-point central dierence scheme and the standard upwind scheme. The algebraic
properties of a matrix in which we are interested are the percentage of the weakly
row and column diagonal dominance and the Frobenius norm. These data were
obtained by using SPARSKIT package [10]. Note that the coecient matrix from
7
Table 3: Algebraic properties (percentage of weakly row and column diagonal dominance and the Frobenius norm) of the matrices arising from dierent discretization
schemes for Test Problem 1 with h = 1=20.
Re
0
1
10
102
103
104
Fourth-Order Compact Scheme
Row
100% 28:4% 28:4% 27:8% 15:0% 14:4%
Column 100% 77:5% 77:8% 63:0% 15:0% 12:7%
Norm 2:0(3)y 2:0(3) 2:1(3) 2:4(3) 4:9(4) 4:8(6)
Central Dierence Scheme
Row
100% 28:4% 28:4% 23:5% 5:26% 0:15%
Column 100% 85:6% 86:4% 71:4% 2:30% 0:01%
Norm
5:4(2) 5:4(2) 5:4(2) 5:5(2) 1:2(3) 1:1(4)
Standard Upwind Scheme
Row
100% 28:4% 28:4% 28:4% 21:3% 15:1%
Column 100% 82:1% 83:9% 85:7% 84:0% 84:0%
Norm
5:4(2) 5:4(2) 5:6(2) 8:0(2) 3:4(3) 3:0(4)
y 2:0(3) stands for 2:0 103 .
105
106
13:2% 13:1%
13:9% 14:1%
4:8(8) 4:8(10)
0:00% 0:00%
0:00% 0:00%
1:1(5) 1:1(6)
15:0% 15:0%
83:7% 83:9%
3:0(5) 2:8(6)
the upwind scheme should be 100% weakly diagonally dominant in exact arithmetic,
but this was not the case in nite precision computation. Nevertheless, these matrices (from the 19-point scheme) were actually used for the computations. In terms
of these algebraic properties which usually inuence the convergence of iterative
methods, the matrices from the fourth-order scheme are better than those from the
central dierence scheme, but worse than those from the upwind scheme. Hence,
the fourth-order scheme may be considered as a compromise between the central
dierence scheme and the upwind scheme, and a compromise between accuracy of
the computed solution and convergence of the iterative solution methods.
Figure 2 shows the number of Gauss-Seidel iterations required for convergence
as a function of Re for both test problems (h = 1=20) with the fourth-order compact
scheme. It shows that the Gauss-Seidel iterative method converged regardless of the
value of the Reynolds number. It is interesting to note that the smallest iteration
counts were achieved for 102 Re 103 . We think that this was because that
the spectral radius of the Gauss-Seidel iteration matrix (which actually governs the
convergence) reaches its minimum in the interval of 102 Re 103 (see [15] for an
analysis of the 1D fourth-order compact scheme).
4 Concluding Remarks
The traditional second-order central dierence and the rst-order upwind schemes
have their inherent diculties, although some defect-correction techniques may be
used to combine these two schemes to yield stable and second-order methods for
diusion-dominated problems [7]. It has been observed that, at least in the 2D
8
Test Problem 2
1400
1200
1200
1000
1000
Number of iterations
Number of iterations
Test Problem 1
1400
800
600
400
200
0
0
10
800
600
400
200
2
4
10
10
Reynolds number (Re)
0
0
10
6
10
2
4
10
10
Reynolds number (Re)
6
10
Figure 2: Number of Gauss-Seidel iterations as a function of the Reynolds number
(Re) for both test problems with h = 1=20.
case, some defect-correction techniques fail to improve computed accuracy for some
high Reynolds number ow problems and the rst-order upwind schemes may yield
unreliable computational results [2].
The fourth-order compact scheme is stable and yields high accuracy solution. For
the large Re cases, although the computed accuracy reduces to the second-order, it is
still more accurate than the rst-order upwind scheme. The scheme is also compact
and easy to implement.
The fact that basic iterative methods such as Gauss-Seidel with our fourth-order
compact scheme converge for large values of the convection coecients suggests that
this scheme be suitable for implementation with multi-level or multigrid methods.
Since the accuracy of the solution is determined by the ne grid discretization, the
converged coarse grid solution provides acceleration to the convergence of the ne
grid solution. This ideal combination of stability and high accuracy is not found
with either the central dierence scheme or the standard upwind scheme.
Acknowledgements
The explicit scheme of this paper was derived from a note of John W. Stephenson
which was given and explained to the author by Murli M. Gupta. The author would
like to acknowledge their valuable contributions and also thank three anonymous
referees for their constructive comments which improved the presentation of this
paper.
9
References
[1] U. Ananthakrishnaiah, R. Monahar and J. W. Stephenson, Fourth-order nite
dierence methods for three-dimensional general linear elliptic problems with
variable coecients, Numer. Methods for PDEs. 3, 229{240 (1987).
[2] A. Brandt and I. Yavneh, Inadequency of rst-order upwind dierence schemes
for some recirculating ows, J. Comput. Phys. 93, 128{143 (1991).
[3] S. C. R. Dennis and J. D. Hudson, Compact h4 nite-dierence approximations
to operators of Navier-Stokes type, J. Comput. Phys. 85, 390{416 (1989).
[4] C. Greif and J. M. Varah, Iterative solution of cyclically reduced systems arising from discretization of the three dimensional convection-diusion equation,
SIAM J. Sci. Comput. (to appear).
[5] M. M. Gupta, R. P. Manohar and J. W. Stephenson, A single cell high order
scheme for the convection-diusion equation with variable coecients, Int. J.
Numer. Methods Fluids 4, 641{651 (1984).
[6] M. M. Gupta, J. Kouatchou and J. Zhang, Comparison of second and fourth
order discretizations for multigrid Poisson solver, J. Comput. Phys. 132, 226{
232 (1997).
[7] P. W. Hemker, Mixed defect correction iteration for the accurate solution of
the convection diusion equation, in Multigrid Methods, W. Hackbusch and U.
Trottenberg, Eds., Lecture Notes in Math., No. 960, Springer-Verlag, Berlin,
1982, pp. 485{501.
[8] Y. Kwon, R. Manohar and J. W. Stephenson, A single cell nite dierence
approximations for Poisson's equation in three variables, Appl. Math. Notes 2,
13{20 (1982).
[9] M. Li, T. Tang and B. Fornberg, A compact fourth-order nite dierence scheme
for the steady incompressible Navier-Stokes equations, Int. J. Numer. Methods
Fluids 20, 1137{1151 (1995).
[10] Y. Saad, SPARSKIT: a basic tool kit for sparse matrix computations, Technical
Report 90-20, Research Institute for Advanced Computer Science, NASA Ames
Research Center, Moet Field, CA, 1990.
[11] W. F. Spotz and G. F. Carey, High-order compact scheme for the steady
stream-function vorticity equations, Int. J. Numer. Methods Eng. 38, 3497{
3512 (1995).
[12] W. F. Spotz and G. F. Carey, A high-order compact formulation for the 3D
Poisson equation, Numer. Methods for PDEs. 12, 235{243 (1996).
[13] J. Zhang, On convergence of iterative methods with a fourth-order compact
scheme, Appl. Math. Lett. 10, 49{55 (1997).
10
[14] J. Zhang, Accelerated high accuracy multigrid solution of the convectiondiusion equation with high Reynolds number, Numer. Methods for PDEs.
13, 77{92 (1997).
[15] J. Zhang, On convergence and performance of iterative methods with fourthorder compact schemes, Numer. Methods for PDEs. (to appear).
[16] J. Zhang, Fast and high accuracy multigrid solution of the three dimensional
Poisson equation, Department of Mathematics, The George Washington University, Washington, DC 20052, (preprint, 1996).
11
© Copyright 2026 Paperzz