Professional Documents
Culture Documents
Scheme
The 1D Diffusion Problem is:
T
T
(D )
t x
x
Here the diffusion constant is a function of T:
D T
5/ 2
z
D
T
Or equivalently,
z (1 f ) T 7/2
with constant f = 5/7.
John Crank
1916 2006
Phyllis Nicolson
1917 1968
T z T
(
)
t x T x
The RHS is then turned into the Laplacian of function z:
T 2 z
2
t x
Now split both sides at the nth time step, we get:
t
x 2
If we substitute z back we get an expression for the function value at n+1 time
step ... ? But wait
x 2
t
2D
This is roughly the diffusion time across one cell. A domain
containing hundreds of cells would require enormous time for
the diffusion to cause some noticeable effect. Thus we need
some scheme that allows us to take larger time steps but
retains stability. The trick here is to link the function value at nth time step with n+1 th time step. We write the differencing
scheme as:
t
x 2
Ti n 1 Ti n
(1 f ) Ti n11(7/ 2) 2(1 f ) Ti n 1(7 / 2) (1 f ) Ti n11(7/ 2)
t
x 2
Instead of stability issues, it requires us to solve a complicated
nonlinear equation system at each time step. But theres a way to get
around this problem.
We can write the integral of D at the n+1 th time step, which causes
the nonlinearity as:
z
T
i ,n
ai
bi
ci
ri
where
x 2
h
t
c
T
i i
i i 1 ri
T
T
T
(D ) (D )
t x
x
y
y
The 2D Crank-Nicholson scheme is essentially the same as the
1D version, we simply use the operator splitting technique to
extend the method to higher dimensions. Explicitly, the
scheme looks like this:
Step 1. evolve half time step on x direction with y direction variance attached
n 5/ 2
n 1/ 2
n
5/ 2 n 1/2
(Ti n1, j )5/ 2 Ti n1,1/2
2(
T
)
h
)
T
(
T
)
Ti 1, j
j
i, j
i, j
i 1, j
ai
ci
bi
f [(Ti n1, j )7/2 2(Ti ,nj ) 7/2 (Ti n1, j )7/2 ] h(Ti ,nj )
g (1 f )[(Ti ,nj 1 )7/2 2(Ti ,nj ) 7/ 2 (Ti ,nj 1 )7/ 2 ]
ri
2x 2
where h
t
x 2
g 2
y
ai
ci
bi
7/ 2
n 1/ 2 7/ 2
n 1/2 7/ 2
n 1/2
f [(Ti ,nj1/2
)
2(
T
)
(
T
)
]
h
(
T
)
1
i, j
i , j 1
i, j
7/2
n 1/2 7/2
n 1/2 7/2
g (1 f )[(Ti n1,1/2
)
2(
T
)
(
T
]
j
i, j
i 1, j )
ri
2y 2
where h
t
y 2
g 2
x