Next: 2-d problem with Neumann
Up: The diffusion equation
Previous: An improved 1-d solution
Let us consider the solution of the diffusion equation in two dimensions. Suppose
that
![\begin{displaymath}
\frac{\partial T(x,y,t)}{\partial t} = D\,\frac{\partial^2 T...
...)}{\partial x^2}+D\,\frac{\partial^2 T(x,y,t)}
{\partial y^2},
\end{displaymath}](img891.png) |
(214) |
for
, and
. Suppose that
satisfies mixed
boundary conditions in the
-direction:
![\begin{displaymath}
\alpha_l(t)\,T(x,y,t) + \beta_l(t)\,\frac{\partial T(x,y,t)}{\partial x} = \gamma_l(y,t),
\end{displaymath}](img892.png) |
(215) |
at
, and
![\begin{displaymath}
\alpha_h(t) \,T(x,y,t)+ \beta_h(t)\,\frac{\partial T(x,y,t)}{\partial x} = \gamma_h(y,t),
\end{displaymath}](img893.png) |
(216) |
at
. Here,
,
, etc., are known functions of
,
whereas
,
are known functions of
and
.
Furthermore, suppose that
satisfies the following simple Dirichlet boundary
conditions in the
-direction:
![\begin{displaymath}
T(x,0,t) = T(x,L,t) = 0.
\end{displaymath}](img894.png) |
(217) |
As before, we discretize in time on the uniform grid
, for
.
Furthermore, in the
-direction, we discretize on the uniform grid
, for
, where
. Finally, in the
-direction, we discretize
on the uniform grid
, for
, where
.
Adopting the Crank-Nicholson temporal differencing scheme discussed in Sect. 6.6, and
the second-order spatial differencing scheme outlined in
Sect. 5.2, Eq. (214) yields
![$\displaystyle \frac{T_{i,j}^{n+1}-T_{i,j}^n}{\delta t} - \frac{D}{2}\,
\frac{T_...
... x)^2}
- \frac{D}{2}\left(\frac{\partial^2 T}{\partial y^2}\right)_{i,j}^{n+1}=$](img900.png) |
|
|
|
![$\displaystyle \frac{D}{2}\,
\frac{T_{i-1,j}^{n}-2\,T_{i,j}^{n}+T_{i+1,j}^{n}}{(...
...ta x)^2} +
\frac{D}{2}\left(\frac{\partial^2 T}{\partial y^2}\right)_{i,j}^{n},$](img901.png) |
|
|
(218) |
where
. The discretized boundary conditions
take the form
plus
![\begin{displaymath}
T_{i,0}^n = T_{i,J}^n = 0.
\end{displaymath}](img907.png) |
(221) |
Here,
, etc., and
, etc.
Adopting the Fourier method introduced in Sect. 5.7, we
write the
in terms of their Fourier-sine harmonics:
![\begin{displaymath}
T_{i,j}^n = \sum_{k=0}^{J} \hat{T}_{i,k}^n\,\sin(j\,k\,\pi/J),
\end{displaymath}](img911.png) |
(222) |
which automatically satisfies the boundary conditions (221).
The above expression can be inverted to give (see Sect. 5.9)
![\begin{displaymath}
\hat{T}_{i,j}^n = \frac{2}{J}\sum_{k=0}^{J} T_{i,k}^n\,\sin(j\,k\,\pi/J).
\end{displaymath}](img912.png) |
(223) |
When Eq. (218) is written in terms of the
, it reduces to
![$\displaystyle -\frac{C}{2}\,\hat{T}_{i-1,j}^{n+1} + \left\{1+C\,(1+j^2\,\kappa^2/2)\right\}\,
\hat{T}_{i,j}^{n+1}-\frac{C}{2}\,\hat{T}_{i+1,j}^{n+1}
=$](img914.png) |
|
|
|
![$\displaystyle \frac{C}{2}\,\hat{T}_{i-1,j}^{n} + \left\{1-C\,(1+j^2\,\kappa^2/2)\right\}\,
\hat{T}_{i,j}^{n}+\frac{C}{2}\,\hat{T}_{i+1,j}^{n},$](img915.png) |
|
|
(224) |
for
, and
. Here,
, and
.
Moreover, the boundary conditions (219) and (220) yield
where
![\begin{displaymath}
\hat{\Gamma}_{l\,j}^n = \frac{2}{J}\sum_{k=0}^{J} \gamma_{l,k}^n\,\sin(j\,k\,\pi/J),
\end{displaymath}](img920.png) |
(227) |
etc. Equations (224)--(226) constitute a set of
uncoupled tridiagonal matrix equations for the
, with one
equation for each separate value of
.
In order to advance our solution by one time-step, we first Fourier transform the
and the boundary conditions, according to Eqs. (223) and (227).
Next, we invert the
tridiagonal equations (224)--(226) to
obtain the
. Finally, we reconstruct the
via
Eq. (222).
Next: 2-d problem with Neumann
Up: The diffusion equation
Previous: An improved 1-d solution
Richard Fitzpatrick
2006-03-29