Escolar Documentos
Profissional Documentos
Cultura Documentos
AdvectionAdvection-Diffusion Equations
Linear advection-diffusion equations
T x 2T xT x !E u 2 1 x 2J xJ xJ t xx x xx u ! 2 xt xx Pe xx 2 x C u xC ! D x C t x xx xx 2
AdvectionAdvection-Diffusion Equations
Convective transport equations
xJ xJ 1 x 2J u ! xt xx Pe xx 2
Both convection and diffusion are present Second-order diffusion term is symmetric But the first-order convective term is directional When Pe or Re becomes large, diffusion is small compared to convection For convective-dominated problems, the equation remains elliptic (or parabolic for unsteady problems), but the hyperbolic behavior due to convection may exhibit strong propagation behavior for most of the flow domain
Theory of Characteristics
Hyperbolic equation
\ ! x ut T (\ ) ! const TB ( x 1, t 1 ) ! T A ( x 1 ut 1 ,0 )
Pure Convection
xT xT u !0 xt xx T ! F ( x ut ) ! F (\ )
T(x,t) can be determined from initial conditions T(x,0) = F(x) at t = 0 t = t3 t = t2 t = t1 t=0
Wave Equation
The convective transport equation is related to the wave equation
Tt uT x ! 0
Tt ! uT x
Ttt ! ( uT x ) t ! u(Tt ) x ! u( uT x ) x ! u 2 T xx
Convective transport equation: Tt + uTx = 0 One characteristic: \ = x ut Wave equation: Ttt = u2Txx Two characteristics: \ = x ut, L = x + ut
n j
(T jn 1
T
(t T
n 1 j n j
u
(t n n T j 1 T j 1 2 (x
n j 1
uL x T ! 0
n j
!0
! T 0.5 c T
T
n j 1
u( t ; c! (x
Unconditionally unstable
G ! 1 c 2 sin 2 U u 1 for all U
The propagation behavior must be carefully treated. The discretization must reflect the propagation behavior due to directional derivative!
T jn 1 T jn (t
u
T jn 1 T jn 1 2 (x
n
!0
n
1 E ! La (T ) ! (tTt (t
u (x 2 u 3 (t 2 6 6
Txxx
n j
.
Numerical Diffusion
La (T ) ! Tt
n j
uT x
n j
u 2 (t T xx 2
n j
u( x 2 u 3 ( t 3 6 6
T xxx
n j
.
j-1
j u < 0 j+1
n 1 n n n Tj Tj T j T j 1 u !0 u "0: (t (x n 1 n n n Tj Tj T j 1 T j u !0 u 0: (t (x
Upwind Scheme
Upwind differencing
" 0 : T jn 1 ! ( 1 c )T jn cT jn 1 c c 0 : T jn 1 ! (1 c )T jn cT jn 1 c c n c c n n 1 n Tj ! T j 1 ( 1 c )T j T j1 2 2
Consistent with the original hyperbolic equation, O((t, (x), or Consistent with the parabolic equation
u( x artificial Tt uT x E d ! 0 ; E d T xx ! (1 c ) diffusion 2
Phase Plot
Amplification factor G Phase angle J /Je (phase lead or lag)
theta1=0.0001*pi; theta2=0.9999*pi; theta=theta1:0.01*(theta2-theta1):theta2; c=1.25; re=1-c+c*cos(theta); im=-c*sin(theta); amp=sqrt(re.^2+im.^2); xamp=amp.*cos(theta); yamp=amp.*sin(theta); phin=atan2(im,re); phie=-c*theta; phi=phin./phie; xphi=phi.*cos(theta); yphi=phi.*sin(theta);
0.75
c = 0.5
G ! (1 c c cosU ) 2 ( c sin U ) 2
phase lead
c = 0.75
phase lag
c=1 & 0.5 c = 1.25 c = 0.25
J Je
U
! J (c ,U ) ; J e ! cU
CFL Condition
Courant-Friedrichs-Lewy (CFL) stability condition
G ! (1 c c cosU ) 2 ( c sin U ) 2 ! 1 2 c(1 c )(1 cosU ) e 1 1 e 1 2c (1 c )(1 cosU ) e 1 2 U 0 e 4 c(1 c ) sin e 2 0 e c(1 c ) e 1 / 2 2
Right inequality automatically satisfied Left inequality c e 1 u(t < (x A fluid particle should not travel more than one spatial step size in one time increment
CFL Condition
Courant-Friedrichs-Lewy (CFL) stability condition
c = u(t / (x e 1: within the Domain of influenece (point Q)
P n+1
j1
j+1
n1 j
T
n 1 j
2 (t 2 (x T jn 1 ! T jn 1 c(T jn 1 T jn 1 )
u
n j 1
T
n j 1
!0
Amplification factor
2 sin 2 U e 1 G ! ( c sin U ) 2 ( 1 c 2 sin 2 U ) ! 1 for all U c 2 c sin 2 U " 1 G ! c sin U s c 2 sin 2 U 1 u 1 for all U
Pick the same sign as c sinU for worst possible combination
Leapfrog Scheme
Phase plot for amplification factor
unit circle
ce1
! J ( c ,U ) ; J e ! cU
J Je
LaxLax-Wendroff Scheme
A popular algorithm for inviscid, compressible flow Coincide with Leiths method for convective equation
n u 2 (t (t Tt $ Txx j Ttt j ! 2 2 (t (t T jn 1 T jn T jn 1 T jn 1 u 2 (t ( T jn 1 2T jn T jn 1 ) u !0 2 2 (x (t 2 (x T jn 1 ! T jn 0.5 c T jn 1 T jn 1 0.5 c 2 ( T jn 1 2T jn T jn 1 ) n
T jn 1 T jn
T jn 1 T jn
Bring in Ttt = u2Txx term to cancel the anti-diffusion (negative) term in the FTCS scheme
FTCS : T jn 1 ! T jn 0.5 c T jn 1 T jn 1 numerical diffusion W : T n 1 ! T n 0.5 c T n T n 0.5 c 2 (T n 2T n T n ) L j j j 1 j 1 j 1 j j1
Stability of Lax-Wendroff Scheme LaxAdd artificial diffusion to cancel the antidiffusion term in FTCS scheme
T jn 1 ! T jn 0.5 c(T jn 1 T jn 1 ) 0.5 c 2 (T jn 1 2T jn T jn 1 ) \ jn 1 ! \ jn 0.5 c(\ jn 1 \ jn1 ) 0.5 c 2 (\ jn 1 2\ jn \ jn 1 ) G n 1 e iU j ! G n e iU j 0.5 cG n e iU j (e iU e iU ) 0.5 c 2 G n e iU j (e iU 2 e iU ) G ! 1 ic sin U c 2 (1 cosU ) ! (1 2c 2 sin 2 U ) ic sin U 2
Lax-Wendroff reduces real part of G
LaxLax-Wendroff Scheme
Phase plot for amplification factor
U 2 G ! ( 1 2c sin ) ( c sin U ) 2 2
2 2
LaxLax-Wendroff Scheme
Relative phase error
J ! tan
1
c sin U 1 2c 2 sin 2 U 2
! J (c ,U ) ; J e ! cU
unit circle
J Je
(t c n 1 T j 1 4
T jn 1 T jn 1 T jn 1 T jn 1 u 1 1 !0 2 2 (x 2 (x c n c n 1 c n n 1 n T j T j 1 ! T j 1 T j T j 1 4 4 4
1 c/4 n+1
c/4
c/4 j1
1 j
c/4 j+1
G !
t = 8.0
u( t c! ! 0.8 (x
Pure Convection
Hyperbolic equation
Truncation error determined by the modified equation approach
Pure Convection
Hyperbolic equations contain no dissipation a good approximation for some physical processes such as propagation of ocean waves
Physical dispersion
xT xT x 3T u F !0 3 xt xx xx
Wave Propagation
Consider the propagation of a plane wave subjected to dissipation and dispersion
T ! Rl Tamp e
p( m )t
im ?x q ( m ) t A
Real part
Linear convection equation: p(m) = 0, q(m) = u No attenuation or dispersion Dissipative wave: p(m) > 0 Dispersive wave: q(m){ u
! im T
3
? p Em
(m ) ! E m 2 p q ( m ) ! u
im ( u q ) T ! 0
Attenuation: amplitude reduction No phase change
q(m) = u, propagation speed remains the same, no wave dispersion p(m) > 0, exponential decay in amplitude Long wave small m, very little decay Short wave large m, strong damping / decay Distortion of wave profile
time t
? p im(u F m
q) T ! 0
u = 1.1
time t
AdvectionAdvection-Diffusion Equation
Convective transport equation
p=0 q=1
p = 0.1, q = 0.9
AdvectionAdvection-Diffusion Equation
2 2 2 2 T ! A1 exp(Em 1 ) cos x ( u1 Fm 1 )t A2 exp(Em 2 ) cos x ( u 2 Fm 2 )t
A1 = 1, A2 = 0.6, u1 = 1, u2 = 0.6, m1 = 1, m2 = 2, E = 0, F = 0
Amplitude Ratio
Fourier components
Gm ! T ( x j , t n (t ) T ( x j,t n ) ! Tm e
p ( m )( t n (t ) p( m ) tn
e e
im x j q ( m )( t n (t ) im x j q ( m ) t n
_ _
Tm e
Gm ! T
n j1 n j
T jn 1 T
n j
!e
_p ( m ) imq ( m )a t (
Tm e
p ( m ) tn
im x j (x q ( m ) tn
a
G!
Tm e
p ( m ) tn
im x j q ( m ) tn
T jn 1 T jn
G n 1 e iU j ! n iU j G e
! e im(x ! e iU ( ! m(x )
Fourier Analysis
Amplification factor and phase angle
Gm ! e !e
_p ( m ) imq ( m )a t ( p ( m ) (t
Upwind Scheme
Amplification factor
T jn 1 ! ( 1 c )T jn cT jn 1 Gm ! T jn 1 T
n j
! 1c c
T jn 1 T jn
U = m(x
m (x ! 1 4 c(1 c ) sin e1 2
ce1
Upwind Scheme
Phase angle
u( t Exact solution : J e ! mu (t ! mc (x (3 c ! ) (x c sin( m (x ) 1 Numerical : J m ! mq ( m )(t ! tan 1 c? cos( m (x )A 1 J m mq ( m )(t q( m ) 1 c sin( m (x ) 1 ! ! ! tan Je mu (t u cm (x 1 c?1 cos( m (x )A
F T xxx
n j
K T xxxx
n j
H T xxxxx
n j
.
(m ) ! E m 2 K m 4 . p q( m ) ! u F m 2 H m 4 .
Upwind Scheme
Original Error Analysis
(t (x La (T ) ! L(T ) E n (T ) ! E n (T ) { 0 j j E (T ) ! La (T ) !
n j
La (T ) !
T jn 1 T jn
u
T jn T jn 1
!0
T jn 1 T j n
n j
1 ! (tTt (t
(t (t 2 Ttt 2!
n j
u
n j
T j n T jn 1 (x
n j
(t 3 Tttt 3!
n j
.
n j
u ( xT x (x ! ? t uT x A j T
n
(x 2 T xx 2!
n j
(x 3 T xxx 3!
n j
(x 4 T xxxx 4!
n j
(t Ttt 2
u( x Txx 2
(t 2 Tttt 6
. j u( x 2 Txxx 6
n
n j
.
u(x 2 u 3 (t 2 6 6
T xxx
n j
.
Upwind Scheme
Modified Equation Approach
(t (x (t u(x (t 2 u(x 2 La (T ) ! Tt uT x Ttt T xx Tttt T xxx . ! 0 2 2 6 6 La (T ) ! T jn 1 T jn u T jn T jn 1 !0 (u " 0 )
Infinite series
(t (t 2 u (x u (x 2 Tt ! uT x Ttt T xx Tttt T xxx . 2 2 6 6 (t (t 2 u (x u( x 2 Ttttt Txxxt . Ttt ! uT xt Tttt T xxt 6 6 2 2 NOTE : Ttt ! u 2 Txx But Ttt ! infinite series
Upwind Scheme
Modified Equation : La (T ) ! L(T ) E (T ) ! 0 (t (t 2 u( x u( x 2 La (T ) ! Tt uT x Ttt T xx Tttt T xxx . ! 0 2 2 6 6 L( T ) { 0
E ( T ) infinite series
Upwind Scheme
Eliminate pure and mixed time derivatives in La(T) = 0
coefficient ( 1) (t v ( 2) 2 u (t v ( 3) 2 (t 2 v (4 ) 12 u(t 2 v (5 ) 3 u 2 (t 2 u(x(t 3 4 v (6 ) 1 u Tt 1 Tx u Ttt (t 2 (t 2 Ttx 0 u (t 2 u (t 2 T xx u(x 2 0 u 2 (t 2 Tttt (t 2 6 (t 2 4 0 (t 2 12 Tttx 0 0 u(t 2 4 u(t 2 12 u(t 2 3 Ttxx 0 u(x(t 4 0 0 u 2 (t 2 3 2 2 u (t u(x(t 3 4 0 T xxx u (x 2 6 0 u 2 (x(t 4 0 0 u 3 (t 2 u 2 (x(t 3 4 u(x 2 ( 2c 2 3c 1) 6
u (x ( c 1) 2
Modified equation
LaxLax-Wendroff Scheme
Truncation error (original equation)
1 u u 2 (t n n 1 n n n La (T ) ! Tj Tj T j 1 T j 1 T j 1 2T jn T jn 1 2 (x (t 2 (x 2 n n n 1 (t 2 (t 3 Ttt j Tttt j . ! (tTt j 2! 3! (t
2u ( xT x 2 (x
n j
(x 3 T xxx 3!
n j
n j
.
n
2 u 2 (t x 2 ( T xx 2 2 (x 2!
n
(x 4 T xxxx 4!
. j n u 2 (t (t 2 T xx j Tttt 2 6
n j
n j
u( x 2 T xxx 6
n j
.
LaxLax-Wendroff Scheme
Modified Equation Approach
(t (t 2 (t 3 u 2 (t(x 2 u(x 2 u 2 (t Txxxx . ! 0 Ttttt Txxx Tttt Txx ( 1) La ! Tt uTx Ttt 24 24 6 6 2 2 xLa u(x 2 u 2 (t (t (t 2 Ttxxx . ! 0 Ttttt Ttxx ! Ttt uTtx Tttt ( 2) 6 6 2 2 xt u 2 (t u(x 2 xLa (t (t 2 Txxx Ttttx Txxxx . ! 0 ! Ttx uTxx Tttx ( 3) 2 2 6 6 xx u 2 (t x 2 La (t Tttxx . ! 0 ! Tttt uTttx Ttttt (4) 2 2 x t2 x 2 La (t u 2 (t Ttxxx . ! 0 ! Tttx uTtxx Ttttx (5 ) xtxx 2 2 x 2 La (t u 2 (t ! Ttxx uTxxx Tttxx Txxxx . ! 0 (6 ) 2 2 x x2 x 3 La ! Ttttt uTtttx . ! 0 (7 ) x t3 x 3 La ! Ttttx uTttxx . ! 0 (8 ) x t 2x x x 3 La ! Tttxx uTtxxx . ! 0 (9 ) x tx x 2 x 3 La ! Ttxxx uTxxxx . ! 0 ( 10 ) x x3
LaxLax-Wendroff Scheme
Eliminate pure and mixed time derivatives in La(T) = 0
coefficient (1) (t v (2) 2 u(t v ( 3) 2 (t 2 v (4 ) 12 u(t 2 v (5 ) 3 u 2 (t 2 v (6 ) 12 0 v (7 ) u(t 3 v (8 ) 12 2 3 u (t v (9 ) 12 u(t(x 2 u 3 (t 3 12 12 v (10 ) 1 u 0 0 0 0 0 0 u(x 2 (1 c 2 ) 6 0 0 0 Tt 1 Tx u Ttt (t 2 (t 2 Ttx 0 u(t 2 u(t 2 T xx u 2 (t 2 0 u 2 (t 2 Tttt (t 2 6 (t 2 4 0 (t 2 12 Tttx 0 0 u(t 2 4 u(t 2 12 u(t 2 3 Ttxx 0 u 2 (t 2 4 0 0 u (t 3 u 2 (t 2 12
2 2
T xxx u(x 2 6 0 u 3 (t 2 4 0 0 u 3 (t 2 12
Ttttt (t 3 24 (t 3 12 0 (t 3 24 0 0 0
Tttxx 0 0 0 u 2 (t 3 24
Ttxxx 0 u(t(x 2 12 0 0 u (t 6 0 0 0 u (t 12
3 3 3 3
0 u 2 (t 3 24 0 u 2 (t 3 12 u 2 (t 3 12
u(t(x 2 u 3 (t 3 12 12
Modified equation