Beruflich Dokumente
Kultur Dokumente
c1 = const c0 c2 = const
64
• Boundary conditions: c0 = c2 = 0
• Solution:
q (t ) Dt 1 2 ∞
(− 1)n exp(− Dn 2π 2t / l 2 )
lKc1 l
= 2 − − 2
6 π
∑1 n2
• With t → ∞:
DKc1 ⎛ l2 ⎞
q (t ) = ⎜t − ⎟
l ⎜⎝ 6 D ⎟⎠
65
Diffusion through a plane sheet
66
permeability
coefficient kp
lag-time tlag
67
Time dependent solutions for Fick‘s second law:
Diffusion from a single spot
∂c
• Flux is radial J r = −D
∂r
∂c ∂J
• Remember: =− r
∂t ∂r
∂c 1 ∂ ⎛ 2 ∂c ⎞
=D 2 ⎜r ⎟
∂t r ∂r ⎝ ∂r ⎠
68
69
Steady-state solutions
• Sources
– create particles
• Adsorbers
– destroy particles
Spherical adsorber
c=0
71
Spherical adsorber
• Solution:
⎛ a⎞
c(r ) = c0 ⎜1 − ⎟
⎝ r⎠
∂c
J r (r ) = − D
a
= − Dc0 2
∂r r
72
Diffusion current
• Remember:
– Flux Jr(a) = number of particles entering the sphere per unit area in
time τ
= 4πDac0
• I is called diffusion current
73
Disk-like adsorber
74
I = 4Dsc0
Disk-like aperture
75
I = 2 Ds(c2 − c1 )
Disk-like adsorbers on a sphere
76
• In analogy to electricity: V c0
I=V/R I = c0 / R
• Diffusion resistance for sphere: Ra = 1/4πDa
• Diffusion resistance for each disk: Rs = 1/4Ds
• Total resistance: R = Ra + Rs/N = 1/4πDa + 1/4DNs
R = Ra + Rs / N
1 1
= +
4πDa 4 DNs
1 ⎛ πa ⎞
= ⎜1 + ⎟
4πDa ⎝ Ns ⎠
⎛ πa ⎞
= Ra ⎜1 + ⎟
⎝ Ns ⎠ 77
Disk-like adsorbers on a sphere
• Solution:
4πDac0
I=
1 + (πa / Ns )
I 1
=
I 0 1 + (πa / Ns )
1,0
0,8
0,6
I/I0
0,4
0,2
0,0
0 1 2 3 4 5
N
79
Disk-like adsorbers on a sphere
• Example:
a = 5 µm
s = 10 Å
80
x=0 x=b 81
c1 c2
Diffusion through apertures in a planar barrier
• I2,1 = DA(c2-c1)/b
• Rs = ½ Ds
R
• Rtotal = R2,1 + s
N
b 1
= +
DA 2 DNs
b ⎛ A ⎞
= ⎜1 + ⎟
DA ⎝ 2 Nsb ⎠
b ⎛ 1 ⎞
= ⎜1 + ⎟
DA ⎝ 2nsb ⎠
• Particle released at x = a
• What is the probability of being adsorbed at x = 0 ?
Ileft Iright
• Ileft = DAcm/a
• Iright = DAcm/(b-a)
I left b−a
=
I left + I right b
84
• Particle released at x = a
• What is the mean time W(a) for particles to be captured at x = 0
and x = b ?
Ileft Iright
2τ + W (x + δ ) − W ( x ) + W (x − δ ) − W ( x ) = 0
2τ 1 1
+ [W (x + δ ) − W (x )] − [W (x ) − W ( x − δ )] = 0
δ δ δ
dW (x ) dW ( x ) 2τ
− + =0
dx x dx x −δ δ
d 2W 2τ
+ =0
dx 2 δ 2
d 2W 1
+ =0
dx 2 D 86
• Boundary conditions:
– adsorbing boundary
W=0
– adsorbing boundary
dW/dx = 0
– solution: W (x ) =
1
2D
(
bx − x 2 )
– mean time to capture particle released at random position x:
b2
b
1
∫ W ( x )dx = 87
b0 12 D
Mean time to capture:
adsorbing and reflecting boundary
• Boundary conditions:
– adsorbing boundary at x = 0
– reflecting boundary at x = b
• With
W(0) = 0
dW/dx = 0 at x = b
the solution is
W (x ) =
1
2D
(
2bx − x 2 )
88
b2
b
1
∫ W ( x )dx =
b0 3D
89
Mean time to capture
2
b /2D
adsorbing boundary at x = 0,
reflecting boundary at x = b
2
b /4D
W
adsorbing boundaries at x = 0, x = b
0
0 b/2 b
x
90
• In one dimension:
d 2W 1
+ =0
dx 2 D
91
Diffusion
Physical derivation
h
q1 q2
c c0
c1 c2
x 93
Physical derivation
Dτ
∆c = c1′ − c1 = (c0 − 2c1 + c2 )
h2
94
wi,j+1
h k
95
x
Numerical solutions (one-dimensional):
Forward scheme
• Error: O(k+h2)
k 1
• Conditionally stable: D 2 ≤
h 2
• Number of multiplications: Z ≅ 2n
96
Forward scheme
With
λ = D(k / h 2 )
and
⎡(1 − 2λ ) λ 0L 0 ⎤
⎢ λ (1 − 2λ ) λ O M ⎥
⎢ ⎥
A=⎢ 0 λ O O 0 ⎥
⎢ ⎥
⎢ M O O O λ ⎥
⎢⎣ 0 L 0 λ (1 − 2λ )⎥⎦
this can be written as
w ( j ) = Aw ( j −1)
97
Numerical solutions (one-dimensional):
Backward scheme
• Implicit method
wi , j − wi , j −1 wi +1, j − 2 wi , j + wi−1, j
−D =0
k h2
• Error: O(k+h2)
• Unconditionally stable
• Needs boundary conditions
• Values may be negative
98
Backward scheme
With
λ = D(k / h 2 )
and
⎡(1 + 2λ ) −λ 0 L 0 ⎤
⎢ −λ (1 + 2λ ) − λ O M ⎥
⎢ ⎥
A=⎢ 0 −λ O O 0 ⎥
⎢ ⎥
⎢ M O O O −λ ⎥
⎢⎣ 0 L 0 − λ (1 + 2λ )⎥⎦
Aw ( j ) = w ( j −1)
99
Numerical solutions (one-dimensional)
• Error: O(k2+h2)
• Unconditionally stable
• Number of operations (inluding solving the tridigonal system):
Z ≅ 5n
• Needs boundary conditions
• Values may be negative
100
J. Crank, P. Nicolson. A practical method for numerical evaluation of solutions of partial
differential equations of the heat-conduction type. Proc. Camb. Phil. Soc. 43:50-67 (1947)
Crank-Nicholson method
With
λ = D(k / h 2 )
and
⎡ λ ⎤
⎢(1 + λ ) −
2
0 L 0 ⎥
⎢ λ λ ⎥
⎢ − (1 + λ ) − O M ⎥
⎢ 2 2 ⎥
λ
A=⎢ 0 − O O 0 ⎥
⎢ 2 ⎥
⎢ λ ⎥
⎢ M O O O − ⎥
⎢ 2 ⎥
λ
⎢ 0
⎢⎣
L 0 − (1 + λ )⎥⎥
2 ⎦
101
Crank-Nicholson method
and
⎡ λ ⎤
⎢(1 − λ ) 2
0 0 ⎥
L
⎢ λ λ ⎥
⎢ (1 − λ ) O M ⎥
⎢ 2 2 ⎥
λ
B=⎢ 0 O O 0 ⎥
⎢ 2 ⎥
⎢ λ ⎥
⎢ M O O O ⎥
⎢ 2 ⎥
λ
⎢ 0
⎢⎣
L 0 (1 − λ )⎥⎥
2 ⎦
• The equation
Aw ( j +1) = Bw ( j )
can be written as
Ax = b
which is basically a tridiagonal linear system:
b1 x1 + c1 x2 = d1 ; i = 1
ai xi −1 + bi xi + ci xi+1 = d i ; i = 2, K, n − 1
an xn −1 + bn xn = d n ; i = n
103
Solving the tridiagonal linear system
• Direct methods
– Gauss‘s elimination method without pivoting
– LU decomposition / Thomas algorithm
– Crout reduction
• Iterative methods
– Jacobi method
– Gauss-Seidel method
– Successive over-relaxation method
104
LU decomposition
b1′ = b1
d1′ = d1
for k = 2K n do
ak
ak′ = , bk′ = bk − ak′ ck −1 , d k′ = d k − ak′ d k′ −1
bk′ −1
end
d n′
xn =
bn′
for k = n − 1K1 do
d′ − c x
xk = k k k +1
bk′
end
Step 1
INPUT c[x] = input data for x = 1,...,nx-1
Set c[0] = c[nx] = 0
Set lambda = Dk/h2
Set u[0] = 0
106
Step 4
OUTPUT c[1] through c[nx-1]
107
Boundary conditions
• Dirichlet conditions:
value at the boundary is function of time, e.g., w(0,t) = b(t)
• Neumann conditions:
specify flux at the boundary
108
Numerical solutions:
Two dimensional forward scheme
• Basic equation:
∂c ⎛ ∂ 2 c ∂ 2c ⎞
= D⎜⎜ 2 + 2 ⎟⎟
∂t ⎝ ∂x ∂y ⎠
• Grid:
– x, y space divided in elements of length h, k with indices a, b
– timestep of length τ, index n
• Concentration at all points is known for t = 0
• Solution:
wa ,b,n +1 − wa ,b,n
=
D
(wa−1,b,n − 2wa ,b,n + wa+1,b,n )
τ h 2
• Approximate ⎛ ∂c ⎞ ⎛ ∂ 2c ⎞
⎜ ⎟ = D⎜⎜ 2 ⎟⎟
⎝ ∂t ⎠ x ⎝ ∂x ⎠
by Taylor series
∂u (x ) 1 2 ∂ 2u ( x ) 1 2 ∂ 3u ( x )
u (x + h ) = u (x ) + h + h + h K
∂x 2 ∂x 2
6 ∂x 3
∂u (x ) 1 2 ∂ 2u (x ) 1 2 ∂ 3u (x )
u (x − h ) = u ( x ) − h + h − h K
∂x 2 ∂x 2 6 ∂x 3
e.g.: addition
∂ 2u ( x )
u (x + h ) + u (x − h ) = 2u ( x ) + h
∂x
2
2
+ O h4 ( )
∂ 2 c ( x ) c ( x + h ) − 2c ( x ) + c ( x − h )
⇒ ≅
∂x 2 h2 110
Miscellaneous equations
• Douglas equation
– implicit (1 − 6λ )wi −1, j +1 + (10 + 12λ )wi , j +1 + (1 − 6λ )wi +1, j +1
= (1 + 6λ )wi−1, j + (10 − 12λ )wi , j + (1 + 6λ )wi +1. j
error: O(k2+h4)
unconditionally stable
– explicit
1
wi , j +1 =
2
( )
2 − 5λ + 6λ 2 wi , j + λ (2 - 3λ )(wi +1, j + wi −1, j )
2
3
− λ (1 - 6λ )(wi + 2, j + wi − 2, j )
1
12
error: O(k2+h4)
conditionally stable: λ ≤ 2/3
111
Miscellaneous equations
– unconditionally stable
– error: O(k2+h2)
112