Environmental Engineering Reference
In-Depth Information
A Neumann condition at the right hand side,
@c=@x ¼
0, transferred to the first
order FD leads to:
D
cðx
max
2
D
xÞcðx
max
D
xÞ
D
x
2
v
c
ð
x
max
D
x
Þ
c
ð
x
max
2
D
xÞ
l
cðx
max
D
xÞ¼
0
(21.15)
D
x
In that way we obtain as many equations as there are unknowns in the vector x.
Before we proceed with the description of the numerical procedure lets take a
partial differential equation as another example. Using the approximations (
21.11
)
one obtains for the 2D Laplace equation in
x
,
y
-coordinates:
2
u
2
u
@y
2
@
@x
2
þ
@
uðx þ
D
x; yÞ
2
uðx; yÞþuðx
D
x; yÞ
D
x
2
(21.16)
uðx; y þ
D
yÞ
2
uðx; yÞþuðx; y
D
yÞ
D
y
2
þ
¼
0
which can be applied In 2D space domains, which are discretized into a rectangular
mesh
or
grid
, as shown in the following figures.
At nodes at the boundary the discretization (
21.16
) changes according to the
boundary condition. Let's give one example for a Dirichlet boundary condition. If
at the right boundary we have a value
u
bnd
specified, then we obtain instead:
u
bnd
2
uðx; yÞþuðx
D
x; yÞ
D
x
2
uðx; y þ
D
yÞ
2
uðx; yÞþuðx; y
D
yÞ
D
y
2
þ
¼
0
(21.17)
Other node values have to be replaced, if the Dirichlet condition is for a node on
the other sides. For a Neumann condition at the right side, we have to make the
following modification:
u
ð
x
;
y
Þþ
u
ð
x
D
x
;
y
Þ
D
x
2
uðx; y þ
D
yÞ
2
uðx; yÞþuðx; y
D
yÞ
D
y
2
þ
¼
0
(21.18)
uðxþ
D
x;yÞuðx;yÞ
D
x
¼
@u
This
results
from the first order approximation 0
@x
(see (
21.9
)), which is equivalent to
uðx þ
D
x; yÞuðx; yÞ¼
0(Fig.
21.2
).
In case of an equidistant mesh with equal grid spacing
h ¼
D
x ¼
D
y
the approxi-
mation of (
21.16
) simplifies to the well-known five-point stencil:
1
h
2
uðx þ
D
x; yÞþuðx
D
x; yÞþuðx; y þ
D
yÞþuðx; y
D
yÞ
ð
4
uðx; yÞ
Þ ¼
0
(21.19)