Now consider the discretized domain as shown in Fig. 40.4. The i is the column number which represents the spatial discritization of the domain in x direction. Similarly, j is the row number which represents the spatial discretization in y direction and n is the temporal discretization. Now, we can discretize the diffusion equation as follows.
(40.41)
(40.42)
(40.43)
Putting (40.41), (40.42) and (40.43) in (40.35), we have
(40.44)
This is the explicit finite difference form of the equation (40.35). The equation (40.44) can be used to obtain the concentration at different time step using iterative procedure as shown in Fig. 40.5. The concentration at (i, j) of time step (n+1)
can be obtained from the known concentration values at
(i−1, j), (i+1, j), (i, j+1), and at (i, j−1) of previous time step (n). The iteration can be performed using any prgramming language. For C0=0, |
|
The solutions obtained using the code are shown in Fig. 40.6.
Fig. 40.6 Solution of the two dimensional diffusion equation |