Numerical Methods For! Parabolic Equations!: B X A T X F T F
Numerical Methods For! Parabolic Equations!: B X A T X F T F
Multi-Dimensional Problems!
• Alternating Direction Implicit (ADI)!
• Approximate Factorization of Crank-Nicolson!
Splitting!
Grétar Tryggvason!
Spring 2011!
∂f ∂2 f
=α 2 ; t > 0, a < x < b
Numerical Methods for! ∂t ∂x
which is a parabolic equation requiring!
One-Dimensional Heat
f ( x,0) = f 0 ( x) Initial Condition!
Equations! and!
f (a, t ) = φ a (t ); f (b, t ) = φb (t ) Boundary Condition!
(Dirichlet)!
or!
∂f ∂f
(a, t ) = ϕ a (t ); (b, t ) = ϕ b (t ) Boundary Condition!
∂x ∂x (Neumann)!
Explicit: FTCS! n
∂2 f ⎞ f jn+1 − 2 f jn + f jn−1
Parabolic equations can be viewed as the limit of a =
hyperbolic equation with two characteristics as the ⎛ ∂f ⎞
n
⎛ ∂2 f ⎞
n
∂ x 2 ⎟⎠ j h2
=α⎜ 2 ⎟
signal speed goes to infinity! ⎝⎜ ∂t ⎠⎟ ⎝ ∂x ⎠ n
j j
∂f⎞ f jn+1 − f jn
=
∂ t ⎟⎠ j Δt
f jn +1 − f jn f jn+1 − 2 f jn + f jn−1
t! =α
Δt h2
α Δt
Increasing (
f jn +1 = f jn + 2 f jn+1 − 2 f jn + f jn−1
h
)
signal speed!
n+1
x!
n
j-1 j j+1
Computational Fluid Dynamics
Computational Fluid Dynamics
Explicit Method: FTCS - 2! Explicit Method: FTCS - 3!
∂f ∂ f αh2 2
G = [1 + 2r(1 − cos β )]
−1 n+1
n
Unconditionally stable! j-1 j j+1
Computational Fluid Dynamics
Computational Fluid Dynamics
Crank-Nicolson - 2! Combined Method A - 1!
Similar to Leapfrog!
n
splitting f j by time average ! f jn +1 + f jn −1 / 2( )
f jn +1 − f jn −1 f jn+1 − f jn +1 − f jn −1 + f jn−1
f jn +1 − f jn −1 f jn+1 − 2 f jn + f jn−1 =α
=α 2Δt h2
2Δt h 2
f jn +1 (1 + 2r ) = f jn −1 + 2r (f jn+1 − f jn −1 + f jn−1 )
O(Δt 2 , h 2 ) but unconditionally unstable!!
n+1
n+1
n
n
n-1
n-1
j-1 j j+1
j-1 j j+1
Computational Fluid Dynamics
Computational Fluid Dynamics
DuFort-Frankel - 2! Parabolic Equation - Summary!
Modified Equation! f t = αf xx
⎡1 Δt ⎤ 2
FTCS!
f t − αf xx = ⎢ αh 2 − α 3 2 ⎥ f xxxx f jn +1 − f jn
=α
f jn+1 − 2 f jn + f jn−1 αh 2
(1 − 6r )f xxxx Stable for!
1
⎣12 h ⎦ Δt h2 12 r≤
2
⎡ 1 1 Δt 4 ⎤ BTCS!
+⎢ αh 4 − α 3 Δt 2 + 2α 5 4 ⎥ f xxxxxx f jn +1 − f jn
=α
f jn++11 − 2 f jn +1 + f jn−+11 αh 2
(1 + 6r )f xxxx Unconditionally!
⎣ 360 3 h ⎦ Δt h2 12
Stable!
Conditionally consistent! Crank-Nicolson! f jn +1 − f jn α
Δt
=
2h 2 ⎣
(
⎡ f jn+1+1 − 2 f jn +1 + f jn−1+1 ) αh 2
f xxxx +
α 3 Δt 2
f xxxxxx
Unconditionally!
Amplification factor ! (
+ f jn+1 − 2 f jn + f jn−1 ⎤⎦ )
12 12 Stable!
f t = αf xx
DuFort-Frankel! Unconditionally!
f jn +1 − f jn −1
2Δt
=α
f jn+1 − f jn +1 − f jn −1 + f jn−1
h 2
αh 2
12
(1 − 12r 2 )f xxxx
Stable,!
Conditionally! Numerical Methods for!
Consistent!
3-Level Implicit! 3 f jn +1 − 4 f jn + f jn −1
=
Multi-Dimensional Heat
2Δt αh 2 Unconditionally!
f n +1 − 2 f jn +1 + f jn−+11
α j +1
h2
12
f xxxx
Stable! Equations!
And others!!
∂f ⎛∂ f ∂ f ⎞ 2 2 ∂f ⎛ ∂2 f ∂2 f ⎞
= α ⎜⎜ 2 + 2 ⎟⎟ = α ⎜⎜ 2 + 2 ⎟⎟
∂t ∂t ⎝ ∂x ∂y ⎠
⎝ ∂x ∂y ⎠
Applying forward Euler scheme:!
Two-dimensional grid! ⎛ f i +n1, j − 2 f i ,nj + f i −n1, j f i ,nj +1 − 2 f i ,nj + f i ,nj −1 ⎞
f i ,nj+1 − f i ,nj
= α⎜ + ⎟
Δt ⎜ Δx 2 Δy 2 ⎟
j+1! ⎝ ⎠
j! If! Δx = Δy = h
f i ,nj+1 − f i ,nj α n
j-1!
i-1! i! i+1! Δt
=
h2
(
f i +1, j + f i −n1, j + f i ,nj +1 + f i ,nj −1 − 4 f i ,nj )
Computational Fluid Dynamics
Computational Fluid Dynamics
Explicit Method - 2! Explicit Method - 3!
Δtα 1
= One-dimensional flow!
h2 2
Δtα 1
= Two-dimensional flow!
Implicit time integration!
h2 4
Δtα 1
= Three-dimensional flow!
h2 6
f in, j+1 = n +1 n +1 n +1 n +1 n
i-1 j
The matrix equation is expensive to solve!
i
i+1 j-1
Can larger time-step be achieved without having solve the Fractional Step:! (Δx = Δy = h )
matrix equation resulting from the two-dimensional
system?! Step 1:!
αΔt
2h
[
f n +1/ 2 − f n = 2 ( f i+1,
n +1/ 2 n +1/ 2
j − 2 f i, j
n +1/ 2
+ f i−1, n n n
]
j ) + ( f i, j +1 − 2 f i, j + f i, j−1 )
The break through came with the Alternation-Direction-
Step 2:!
Implicit (ADI) method (Peaceman & Rachford-mid1950ʼs)! αΔt
2h
[
f n +1 − f n +1/ 2 = 2 ( f i+1,
n +1/ 2 n +1/ 2
j − 2 f i, j j ) + ( f i, j +1 − 2 f i, j + f i, j−1 )
n +1/ 2
+ f i−1, n +1 n +1 n +1
]
ADI consists of first treating one row implicitly with
backward Euler and then reversing roles and treating the Combining the two becomes equivalent to:!
other by backwards Euler. ! αΔt ⎡ ∂ 2 f n +1/ 2 1 ⎛ ∂ 2 f n +1 ∂ 2 f n ⎞⎤
f n +1 − f n = ⎢ + ⎜⎜ + ⎟⎥
Peaceman, D., and Rachford, M. (1955). The numerical solution of parabolic and
2 ⎣ ∂x 2 2 ⎝ ∂y 2 ∂y 2 ⎟⎠⎦
elliptic differential equations, J. SIAM 3, 28-41!
Midpoint! Trapisodial!
n
j+1
i-1 j
i
i+1 j-1
Computational Fluid Dynamics
Computational Fluid Dynamics
Stability Analysis:! ε j = ε e e
n n ikx imy
⎡ f n+1/ 2 ⎤ ⎡ fn ⎤ ⎡ f n+1/ 2 ⎤
⎢ i,1 ⎥ ⎢ i,1 ⎥ ⎡ −2 1 0 ⎤ ⎢ i,1 ⎥ αΔt n +1/2 ikh
⎢ f n+1/ 2 ⎥ ⎢ fn ⎥ αΔt ⎢ ⎥ ⎢ f n+1/ 2
1 −2 ⎥ ⎥ ε n +1/2 = ε n +
h2 ⎣
⎡ε ( e − 2 + e−ikh ) + ε n ( eimh − 2 + e−imh )⎤⎦
⎢ i,2 ⎥ = ⎢ i,2 ⎥+ 2 ⎢ ⎢ i,2 ⎥ + source
⎢ ⎥ ⎢ ⎥ h ⎢ 1 ⎥⎢ ⎥ αΔt 2 kh
⎢ n+1/ 2 ⎥ ⎢ n ⎥ ⎢
⎣
⎥
0 1 −2 ⎦ ⎢ f n+1/ 2 ⎥ ε n +1/2 1 − 2 h 2 sin 2
⎢⎣ f i, N ⎥⎦ ⎢⎣ f i, N ⎥⎦ ⎢⎣ i, N ⎥⎦ =
αΔt
εn 1 + 2 2 sin 2
mh
h 2
This equation is easily solved by forward elimination Similarly, !
αΔt 2 mh
ε n +1 1 − 2 h 2 sin 2
and back-substitution!
=
ε n +1/2 αΔt kh
1 + 2 2 sin 2
h 2
Combining !
Implicit methods for parabolic equations!
⎛ αΔt 2 kh ⎞⎛ αΔt 2 mh ⎞
εn +1 ⎜ 1 − 2 2 sin ⎟⎜ 1 − 2 2 sin ⎟ • Allow much larger time step (but must be
=⎜ h 2 ⎟⎜ h 2 ⎟ <1
αΔ αΔ balanced against accuracy!)!
εn ⎜1+ 2 t
sin 2
mh ⎟⎜ 1 + 2 t
sin 2
kh ⎟
⎜ ⎟⎜ ⎟
⎝ h2 2 ⎠⎝ h2 2 ⎠ • Preserve the parabolic nature of the equation!
⎝ 2 ⎠ ⎝2⎠ ∂t ⎜⎝ 1 − δ xx ⎟ f = ⎢1 + δ xx + 2δ yy + 2δ zz ⎥ f n
2 ⎠ ⎣ 2 ⎦
⎛ αΔt ⎞ n +1** αΔt
1− δ yy ⎟ f = f n +1* − δ yy f n
⎝⎜
ADI is an approximate factorization of the
2 ⎠ 2
Crank-Nicolson method!
⎛ αΔt ⎞ n +1 αΔt
1− δ zz ⎟ f = f n +1** − δ zz f n
⎝⎜ 2 ⎠ 2
f n +1
i, j (
= 1 + αΔtδ yy f ) n +1/2
i, j
1. Stability limits of 1-D case apply.!
Eliminate the half step:! 2. Different Δt can be used in x and y directions.!
f n +1
i, j ( )
= 1 + αΔtδ yy (1 + αΔtδ xx ) f n
i, j
Backward Euler!
Multi-Dimensional Problems!
• Alternating Direction Implicit (ADI)!
• Approximate Factorization of Crank-Nicolson!
Splitting!