Environmental Engineering Reference
In-Depth Information
here formulated for a function
u
depending on the independent variable
x
.
For second order derivatives the central FD scheme is usually without alterna-
tive. It is obtained by using the finite difference approximation of the first order FD
approximations:
2
u
@x
2
@
1
D
x
u
ð
x
þ
D
x
Þ
u
ð
x
Þ
D
x
u
ð
x
Þ
u
ð
x
D
x
Þ
D
x
(21.10)
or (compare Sidebar 4.2)
2
u
@x
2
@
uðx þ
D
xÞ
2
uðxÞþuðx
D
xÞ
D
x
2
(21.11)
A simple example may illustrate the entire procedure. FD transforms the differ-
ential equation for 1D steady state transport
D
@
@x
2
v
@
c
2
c
@x
l
c ¼
0
(21.12)
into
D
c
ð
x
þ
D
x
Þ
c
ð
x
Þþ
c
ð
x
D
x
Þ
D
x
2
v
c
ð
x
Þ
c
ð
x
D
x
Þ
D
x
l
cðxÞ¼
0
(21.13)
Here the backward FD for the first order derivative has been chosen. In fact the
backward FD delivers a numerical algorithm that usually converges much better
method the version, in which forward or central schemes are used. For details about
this consult an introductory textbook on numerics (for example: Thomas
1995
;
Moler
2004
).
Equation (
21.13
) serves as basis for a numerical solution of (
21.12
) if we divide
the model region of interest, that is an interval
x
min
x x
max
on the
x
-axis, into
peaces of length
D
x
. Using the numerical method we can obtain approximate values
for
c
(
x
) at the mesh positions, called
nodes
x
D
x; ::::x
max
D
x
(lets take x as a vector here). For each position
x
(
21.13
) states a relation between
the (unknown) function value
c
(
x
) and the (also unknown) function values at the
neighboring two nodes.
Boundary conditions have to be considered separately, but without problem.
A Dirichlet boundary condition at the left side of the interval for example,
cðx
min
Þ¼c
0
, according to (
21.13
) leads to:
¼ x
min
þ
D
x; x
min
þ
2
D
cðx
min
þ
2
D
xÞ
2
cðx
min
þ
D
xÞþc
0
D
x
2
v
c
ð
x
min
þ
D
x
Þ
c
0
D
x
l
cðx
min
þ
D
xÞ¼
0
(21.14)