76
4. Finite Difference Methods
included. After rearrangement, we have
[ Dl1t
Vl1tJ
[2DMJ
[DM
Vl1tJ
- (l1x)2 + 211x Ci- l ,n+1 + 1 + (l1x)2 Ci,n+1 - (l1x)2 - 211x Ci+l,n+l
(4.1.14)
We can write similar equations for all nodes. When these equations are
combined with the boundary conditions, a set of tridiagonal equations are
formed. Thus, the concentration values of all nodes can be obtained by using
the Thomas algorithm.
(3) The explicit and implicit schemes can be averaged to yield the CrankNicolson difference scheme, i.e.,
Ci,n+~~ Ci,n = ~ (D Ci+l,n - (~;)~ + Ci-l,n _ vCi+l,n2~XCi-1,n
D Ci+l,n+l - 2Ci,n+l + Ci-l,n+l _ VCi+l,n+l - Ci-1,n+l)
+
(l1x)2
2 1 1 x ·
(4.1.15)
After rearranging, we have
[ DM
VMJ
[DM]
[DM
VMJ
- (l1x)2 + 211x Ci- l ,n+1 + 2 1 + (l1x)2 Ci,n+l - (l1xf - 211x Ci+l,n+1
[ Dl1t
Vl1tJ
[Dl1t ]
[DM
VMJ
= (l1x)2 + 211x Ci-l,n + 2 1 - (l1x)2 Ci,n + (l1x)2 - 211x Ci+l,n·
(4.1.16)
The right-hand side of this equation includes only the known concentrations
at t n , therefore the forms of both Eq. (4.1.16) and Eq. (4.1.14) are exactly the
same. We can still use the Thomas algorithm to solve the tridiagonal equations and obtain the concentration values at t n + l .
The truncation errors of explicit Eq. (4.1.11) and implicit Eq. (4.1.13) are
both O[(M) + (l1x)2], but in the Crank-Nicolson scheme, the truncation
error is 0 [(M)2 + (l1x)2]. Since these three schemes are all similar to those
for groundwater flow, it is not necessary to explain the solution procedures
in detail.
The convergence and stability of the three schemes will be stated below. If
the solution of the difference equation tends to the solution of the original
partial differential equation as I1t -+ 0 and I1x -+ 0, the difference scheme is
called a convergent one. If the calculation error produced at a certain time
level decreases, or at least does not increase when it pro pagates to the next
time level, the difference scheme is called a stable one. One can prove that the
implicit scheme ofEq. (4.1.13) and the Crank-Nicolson scheme ofEq. (4.1.16)
are unconditionally convergent and stable, while the explicit scheme of Eq.
(4.1.11) is not. Convergence and stability of an explicit scheme depend on the
step sizes of both time and space. F or Eq. (4.1.11), the restrictive conditions
4. Finite Difference Methods
included. After rearrangement, we have
[ Dl1t
Vl1tJ
[2DMJ
[DM
Vl1tJ
- (l1x)2 + 211x Ci- l ,n+1 + 1 + (l1x)2 Ci,n+1 - (l1x)2 - 211x Ci+l,n+l
(4.1.14)
We can write similar equations for all nodes. When these equations are
combined with the boundary conditions, a set of tridiagonal equations are
formed. Thus, the concentration values of all nodes can be obtained by using
the Thomas algorithm.
(3) The explicit and implicit schemes can be averaged to yield the CrankNicolson difference scheme, i.e.,
Ci,n+~~ Ci,n = ~ (D Ci+l,n - (~;)~ + Ci-l,n _ vCi+l,n2~XCi-1,n
D Ci+l,n+l - 2Ci,n+l + Ci-l,n+l _ VCi+l,n+l - Ci-1,n+l)
+
(l1x)2
2 1 1 x ·
(4.1.15)
After rearranging, we have
[ DM
VMJ
[DM]
[DM
VMJ
- (l1x)2 + 211x Ci- l ,n+1 + 2 1 + (l1x)2 Ci,n+l - (l1xf - 211x Ci+l,n+1
[ Dl1t
Vl1tJ
[Dl1t ]
[DM
VMJ
= (l1x)2 + 211x Ci-l,n + 2 1 - (l1x)2 Ci,n + (l1x)2 - 211x Ci+l,n·
(4.1.16)
The right-hand side of this equation includes only the known concentrations
at t n , therefore the forms of both Eq. (4.1.16) and Eq. (4.1.14) are exactly the
same. We can still use the Thomas algorithm to solve the tridiagonal equations and obtain the concentration values at t n + l .
The truncation errors of explicit Eq. (4.1.11) and implicit Eq. (4.1.13) are
both O[(M) + (l1x)2], but in the Crank-Nicolson scheme, the truncation
error is 0 [(M)2 + (l1x)2]. Since these three schemes are all similar to those
for groundwater flow, it is not necessary to explain the solution procedures
in detail.
The convergence and stability of the three schemes will be stated below. If
the solution of the difference equation tends to the solution of the original
partial differential equation as I1t -+ 0 and I1x -+ 0, the difference scheme is
called a convergent one. If the calculation error produced at a certain time
level decreases, or at least does not increase when it pro pagates to the next
time level, the difference scheme is called a stable one. One can prove that the
implicit scheme ofEq. (4.1.13) and the Crank-Nicolson scheme ofEq. (4.1.16)
are unconditionally convergent and stable, while the explicit scheme of Eq.
(4.1.11) is not. Convergence and stability of an explicit scheme depend on the
step sizes of both time and space. F or Eq. (4.1.11), the restrictive conditions
