Computational Fluid Dynamics Numerical Methods for Parabolic Equations Grétar Tryggvason Spring 2011 http://www.nd.edu/~gtryggva/CFD-Course/ Computational Fluid Dynamics One-Dimensional Problems • Explicit, implicit, Crank-Nicolson • Accuracy, stability • Various schemes Multi-Dimensional Problems • Alternating Direction Implicit (ADI) • Approximate Factorization of Crank-Nicolson Splitting Outline Solution Methods for Parabolic Equations Computational Fluid Dynamics Numerical Methods for One-Dimensional Heat Equations Computational Fluid Dynamics b x a t x f t f < < > ∂ ∂ = ∂ ∂ , 0 ; 2 2 α which is a parabolic equation requiring ) ( ) 0 , ( 0 x f x f = Consider the diffusion equation Initial Condition ) ( ) , ( ); ( ) , ( t t b f t t a f b a φ φ = = Boundary Condition (Dirichlet) ) ( ) , ( ); ( ) , ( t t b x f t t a x f b a ϕ ϕ = ∂ ∂ = ∂ ∂ Boundary Condition (Neumann) or and Computational Fluid Dynamics Parabolic equations can be viewed as the limit of a hyperbolic equation with two characteristics as the signal speed goes to infinity Increasing signal speed x t Computational Fluid Dynamics 2 1 1 1 2 h f f f t f f n j n j n j n j n j − + + + − = Δ − α Explicit: FTCS f j n+1 = f j n + αΔt h 2 f j +1 n − 2 f j n + f j −1 n ( ) j-1 j j+1 n n+1 Explicit Method: FTCS - 1 ∂ 2 f ∂ x 2 ⎞ ⎠ ⎟ j n = f j +1 n − 2 f j n + f j −1 n h 2 ∂ f ∂t ⎞ ⎠ ⎟ j n = f j n+1 − f j n Δt ∂f ∂t ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ j n = α ∂ 2 f ∂x 2 ⎛ ⎝ ⎜ ⎞ ⎠ ⎟ j n
9
Embed
Solution Methods for Parabolic Equations One …gtryggva/CFD-Course/2011-Lecture-18.pdf · The implicit method is unconditionally stable, ... (1955). The numerical solution of parabolic
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Stability limits depend on the dimension of the problems!
Different numerical algorithms usually have different stability limits!
Stability!Computational Fluid Dynamics
Implicit time integration!
Computational Fluid Dynamics
f
i , j
n+1 = fi , j
n +Δtαh2
⎛⎝⎜
⎞⎠⎟
fi+1, jn + fi−1, j
n + fi, j−1n + fi, j+1
n − 4 fi, jn( )
Implicit Methods!
f
i , j
n+1 = fi , j
n +Δtαh2
⎛⎝⎜
⎞⎠⎟
fi+1, jn+1 + fi−1, j
n+1 + fi, j−1n+1 + fi, j+1
n+1 − 4 fi, jn+1( )
Evaluate the spatial derivatives at the new time (n+1), instead of at n!
(1+ 4A) f
i , j
n+1 − A fi+1, jn+1 + fi−1, j
n+1 + fi, j−1n+1 + fi, j+1
n+1( ) = fi , j
n
This gives a set of linear equations for the new temperatures:!
Known source term!
Recall forward in time method!
Computational Fluid Dynamics
�
fi , j
n+1 = 11+ 4A
A fi+1, jn+1 + f i−1, j
n+1 + f i, j−1n+1 + f i, j+1
n+1( ) + fi , j
n( )
Isolate the new fi,j and solve by iteration!
The implicit method is unconditionally stable, but it is necessary to solve a system of linear equations at each time step. Often, the time step must be taken to be small due to accuracy requirements and an explicit method is competitive.!
Implicit Methods!
Computational Fluid Dynamics
Second order accuracy in time can be obtained by using the Crank-Nicolson method!
n
n+1
i i+1
i-1
j+1
j-1
j
Implicit Methods!Computational Fluid Dynamics
The matrix equation is expensive to solve!
Crank-Nicolson!
Crank-Nicolson Method for 2-D Heat Equation!
⎟⎟⎠
⎞⎜⎜⎝
⎛∂∂+
∂∂+
∂∂+
∂∂=
Δ− +++
2
2
2
2
2
12
2
121
2 yf
xf
yf
xf
tff nnnnnn α
( )1,11,
11,
1,1
1,12,
1, 4
2++
−++
+−
++
+ −+++Δ+= nji
nji
nji
nji
nji
nji
nji fffff
htff α
hyx =Δ=ΔIf!
( )njinji
nji
nji
nji fffff
ht
,1,1,,1,12 42
−+++Δ+ −+−+α
Computational Fluid Dynamics
Expensive to solve matrix equations. !
Can larger time-step be achieved without having solve the matrix equation resulting from the two-dimensional system?!
The break through came with the Alternation-Direction-Implicit (ADI) method (Peaceman & Rachford-mid1950ʼs)!
ADI consists of first treating one row implicitly with backward Euler and then reversing roles and treating the other by backwards Euler. !
Peaceman, D., and Rachford, M. (1955). The numerical solution of parabolic and elliptic differential equations, J. SIAM 3, 28-41!
Computational Fluid Dynamics
Fractional Step:!
Alternating Direction Implicit (ADI)!
�
f n+1/ 2 − f n = αΔt2h2
fi+1, jn+1/ 2 − 2 f i, j
n+1/ 2 + f i−1, jn+1/ 2( ) + f i, j+1
n − 2 f i, jn + f i, j−1
n( )[ ]
( )hyx =Δ=Δ
�
f n+1 − f n+1/ 2 = αΔt2h2
fi+1, jn+1/ 2 − 2 f i, j
n+1/ 2 + f i−1, jn+1/ 2( ) + f i, j+1
n+1 − 2 f i, jn+1 + f i, j−1
n+1( )[ ]
Step 1:!
Step 2:!
⎥⎦
⎤⎢⎣
⎡⎟⎟⎠
⎞⎜⎜⎝
⎛∂∂+
∂∂+
∂∂Δ=−
+++
2
2
2
12
2
2/121
21
2 yf
yf
xftff
nnnnn α
Combining the two becomes equivalent to:!
Midpoint! Trapisodial!
Computational Fluid Dynamics
Computational Molecules for the ADI Method!
n
n+1/2
n+1
i i+1
i-1
j+1
j-1
j
Computational Fluid Dynamics
Instead of solving one set of linear equations for the two-dimensional system, solve 1D equations for each grid line.!
The directions can be alternated to prevent any bias!
Computational Fluid Dynamics
In matrix form, for each row!
fi,1n+1/ 2
fi,2n+1/ 2
fi,N
n+1/ 2
⎡
⎣
⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥
=
fi,1n
fi,2n
fi,N
n
⎡
⎣
⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥
+αΔth2
−2 1 01 −2 10 1 −2
⎡
⎣
⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥
fi,1n+1/ 2
fi,2n+1/ 2
fi,N
n+1/ 2
⎡
⎣
⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥
+ source
This equation is easily solved by forward elimination and back-substitution!