Environmental Engineering Reference
In-Depth Information
4
15
3
2
10
1
0
5
12
10
8
6
4
0
2
0
Fig. 21.4 Solution of the example setting for the Poisson equation with general boundary
conditions and sources/sinks
21.5 Solution for the 2D Diffusion-Decay Equation
The program M-file from the last sub-chapter can be easily extended to account for
decay. This shows the strengths of the numerical methods. The differential equation
for the steady state is:
2
Dr
c l c ¼
0
(21.24)
(see chapter 5), where the unknown function is again denoted by c to indicate
concentration. D is the diffusivity and
l
the decay constant.
We can re-write the ( 21.24 )as
c ¼ D c
2
r
(21.25)
which now shows a high resemblance with the Poisson ( 21.21 ). We see that the
difference is only on the right hand side, where we have a function depending on
c in this case. In the formalism of the finite difference procedure that is thus not
a crucial difference. Following the FD approach the term
ð l =DÞc is evaluated at the
center position and enters the differential equation for each block. Thus we obtain
another term in the main diagonal of the matrix B . This is considered by replacing
the former initial setting for B by:
B = [ones(N,2) -(4+lambda/D)*ones(N,1) ones(N,2)];
Search WWH ::




Custom Search