Documente Academic
Documente Profesional
Documente Cultură
http://www.nd.edu/~gtryggva/CFD-Course/!
2 f
2 f
c2 2 = 0
t 2
x
Wave Equation!
Grtar Tryggvason!
Spring 2013!
u 2 v
c
=0
t
x
v u
=0
t x
det A T I = det
2
c
= c
1
b b 2 4ac with!
2a
v
u
l1
c2
= 0
t
x
v u
+l2
= 0
t x
2 f 2 f
=
tx xt
dt
1 dt
1
=+ ;
=
dx
c dx
c
dt
1
=+
dx
c
P
dt
1
=
dx
c
b = 0; a = 1; c = c 2
u 2 v
c
=0
t
x
v u
=0
t x
1
2
2
= c =0
f
f
; v= ;
t
x
2
x
0
c
+
=0
1 0 v
u
t
v
t
u=
= c
2
c
l1
=0
l2
Take l1=1!
For! = +c
c l1 l2 = 0 l2 = c
For! = c
+c l1 l2 = 0 l2 = +c
= +c
l1 = 1 l2 = c
u 2 v
v u
1 c
= 0 c = 0
t
t x
u
u v
v
+ c c + c = 0
t
x t
x
du
dv
c
= 0 on
dt
dt
Similarly:!
For! = c
dx
= +c
dt
l1 = 1 l2 = +c
du
dv
dx
+c
= 0 on
= c
dt
dt
dt
Add the
equations!
Relation
between the
total derivative
on the
characteristic!
du
dv
c
= 0 on
dt
dt
dx
= +c
dt
du
dv
+c
= 0 on
dt
dt
dx
= c
dt
f ( x,t ) = r1 ( x ct ) + r2 ( x + ct )
where!
For constant c!
dr1
dx
= 0 on
= +c where r1 = u cv
dt
dt
dr2
dx
= 0 on
= c where r2 = u + cv
dt
dt
f
f
r1 ( x ) = c
t
x t= 0
f
f
r2 ( x ) = + c
t
x t= 0
dt
1 dt
1
=+ ;
=
dx
c dx
c
Domain of !
Influence!
dt
1
=+
dx
c
P
Domain of !
Dependence
Ill-posed
problems!
dt
1
=
dx
c
2 f
2f
2 =
t
x 2
This is simply Laplaces equation!
2 f 2 f
+
=0
t 2 x 2
which has a solution if f/t or f are given on
the boundaries!
d 2 ak
= k 2 ak
dt 2
f ( x,t ) = ak (t)e
ikx
f = ak (t)e ikx
Substitute into:!
2 f 2 f
+
=0
t 2 x 2
to get:!
d 2 ak
= k 2 ak
dt 2
General solution!
ak (t) = Ae kt + Bekt
A, B
ika(0)
as!
Ill-posed Problem!
f
2 f
= D 2 ; D<0
t
x
has solutions with unbounded growth rate for high wave
number modes and is therefore an ill-posed problem!
Classical Methods!
for Hyperbolic!
Equations!
u 2 v
c
=0
t
x
v u
=0
t x
2 f
2 f
c2 2 = 0
t 2
x
Write as:!
In general:!
u
t
v
t
a
a
+ 11 12
a21 a22
u
x
v
x
Forward in Time,
Centered in Space
(FTCS) and
Upwind!
=0
f
f
+U =0
t
x
f
f
+U
=0
t
x
f
f
+U
=0
t
x
dx
= U;
dt
df
= 0;
dt
t
f
fj
n+1
= fj
n
t
n
n
U ( f j +1 f j 1)
2h
n+1
x
n
j-1
j+1
f
f
+U
=0
t
x
n+1
Ut
= 1 i
sin kh
n
2h
Since the amplification
factor has the form 1+i()
the absolute value of this
complex number is always
larger than unity and the
method is unconditionally
unstable for this case.!
n+1
f jn+1 = f jn
Ut
sinkh
2h
Flow direction!
This scheme
is O(t, h)
accurate. !
n+1
n
t
U ( f jn f jn1)
h
j-1
U
+ ( nj nj 1) = 0
t
h
n
n ikx j
Write the error as:! j = e
n+1
j
n
j
n+1 n
n
+ U (1 e ikh ) = 0
t
h
Amplification factor!
Or:! G = 1 + e
ikh
G = 1 + eikh ,
Ut
h
Im(G)
Ut
=
h
Need to find when! G < 1
Ut
1
h
Stable!
kh
1
1-
G = (1 + cos kh ) + 2 sin 2 kh
2
n +1
Ut
= 1
(1 eikh )
n
h
n +1
G = n = 1 (1 eikh ),
Graphically:!
Ut h
Allowable characteristics!
= (1 ) + 2(1 ) cos kh +
2
= 1 2 + 2 + 2(1 ) cos kh
n+1
G = 1 2 (1 )
2
if cos kh = 0
if cos kh = 1
G =1
G = 1 ( 4 3 )
2
Flow direction!
1!
if cos kh = 1
G 1
f jn+1 = f jn
f
f
+U =0
t
x
t
U ( f jn f jn1)
h
n
j-1
O(t, h)
accurate. !
Ut
1
h
cos kh = 1
1!
if
cos kh = 0
j-1
1.5
Although the
upwind
Upwind
method is
1
exceptionally
robust, its low
accuracy in
0.5
space and
time makes it
unsuitable for
0
most serious
computations !
-0.5
20
40
60
80
f jn +1 = f jn
t n
t
n
n
n
(F j +1/ 2 F j1/
U( f jn f j1
)
2) = f j
h
h
n
F j1/ 2=Uf j1
F j +1/ 2=Uf jn
f j 1
fj
f j +1
x!
xj-1/2 xj+1/2 !
Define:! U = (U + U ), U = (U U )
2
2
The two cases can be combined into a single expression:!
t
n
f jn +1 = f jn [U + ( f jn f j1
) + U ( f jn+1 f jn )]
h
+
Or, substituting! U , U
U t n
t
n
n
f jn +1 = f jn U ( f jn+1 f j1
)+
( f j +1 2 f jn + f j1
)
2h
2h
Uh
Dnum =
central difference + numerical viscosity!
2
f jn +1 f jn
t
U n +1
(f j +1 f jn+11 )= 0
2h
- Unconditionally stable!
- 1st order in time, 2nd order in space!
- Forms a tri-diagonal matrix (Thomas algorithm)!
U n +1 1 n +1 U n +1 1 n
f j +1 +
fj
f j 1 =
fj
2h
t
2h
t
a j f jn++11 + d j f jn +1 + b j f jn+11 = C j
Lax-Fredrichs method!
f jn +1
1
2
(f
n
j +1
+ f jn1
)+ U (f
2h
n
j +1
f jn1 = 0
Uh 1
Uh 2
(1 2 )f xxx
f xx +
2
3
Ut
h
h
h2
=
Ut
f n +1 f jn 1
f
= j
+ O(t 2 )
t
2t
Ut n
(f j +1 f jn1 )
f jn +1 = f jn 1
h
Modified equation!
f
f Uh 2 2
( 1)f xxx +
+U
=
t
x
6
Ut
h
f (t + t ) = f (t ) +
f
2 f t 2 3 f t 3
t + 2
+ 3
+
t
t 2
t 6
f
f
= U
t
x
2 f
f
f
f
2 f
= = U = U
=U2 2
t 2 t t
t x
x t
x
Substituting!
f
2 f t 2
f (t + t ) = f (t ) U
t + U 2 2
+ O(t 3 )
x
x 2
Ut n
U t
f jn +1 = f jn
( f j +1 f j1n ) + 2h 2
2h
2
(f
n
j +1
n
2 f jn + f j1
)
Ut
<1
h
n +1
j
=0
=0
Step 1 (Lax)!
Step 2 (Leapfrog)!
n +1 / 2
j 1 / 2
MacCormack Method!
t n
(f j +1 f jn )
h
1
t
f jn +1 = f jn + f jt U (f jt f jt1 )
2
h
+U
n +1 / 2
j +1 / 2
f jn+1 f jn
- Stable for U
! t / h < 1
- Second order accurate in time and space !
f jt = f jn U
n
j
+U
f jt = f jn U
Corrector!
n+1
j
t n
(f j f jn1 )
h
Predictor!
Corrector!
1
t t
t n
= f jn + f jt U
f f jt1 U
f 2 f jn1 + f jn 2
2
h j
h j
1
f jn+1 = f jn f jn f jn1 + ( 1) f jn 2 f jn1 + f jn 2
2
- Stable if! 0 2
- Second-order accurate in time and space !
f t + Uf x = 0
FTCS!
f jn +1 f jn
t
+U
f jn+1 f jn1
Implicit!
f jn +1 f jn
t
+U
+U
(f
f jn f jn1
h
n +1
j +1
t
+U
f jn +1 f jn 1
2t
f jn +1 f jn
Lax-Wendroff I!
t
U t
2
Lax-Wendroff II!
+U
(f
f jn+1 f jn1
+U
n
j +1
2h
(f
t / 2
t
f jt f jn
MacCormack!
t
f
n +1
j
+U
+U
t
j
+U
=0
f jn+1 f jn
(f
n
j +1
f jn )
h
+U
(f
t
j
=0
Uh 2
1 2 f xxx
6
Uh 3
1 2 f xxxx
8
=0
Stable for!
! 1
Same as LW-I!
Stable for!
! 1
Same as LW-I!
Stable for!
! 1
=0
f jt1 )
h
U 2 t
1
1
f xx Uh 2 + U 3 t 2 f xxx
2
3
6
Unconditionally!
Stable!
Uh 1
Uh 2
(1 2 )f xxx
f xx +
2
3
Conditionally
consistent!
Stable for ! 1
f jn+11 )
=0
(f
n
j +1
f jn1 )
2h
=0
Stable for!
!1
=0
(f + f )/ 2
n
j
f jn1 )
2h 2
f jn +1 f jn
n
j +1
2h
2 f jn + f jn1 )
Stable for!
! 1
f t + Uf x = 0
Uh 2 2
( 1)f xxx
6
=0
Uh
(1 )f xx
2
Uh 2
22 3 + 1 f xxx
6
2h
f t + Uf x = 0
Leap Frog!
=0
f jn +1 (f jn+1 + f jn1 )/ 2
Lax-Friedrichs!
Unconditionally
Unstable!
Upwind!
f jn +1 f jn
U2
Uh 2
(1 + 22 )f xxx
f xx
2
6
=0
2h
Beam-Warming! f
n +1
j
n
j
+U
(3 f
n
j
4f
n
j 1
+ f jn 2 )
2h
U t n
(f j 2 f jn1 + f jn2 )= 0
2h 2
2
QUICK!
Uh 2
(1 )(2 )f xxx
6
Uh 3
(1 )2 (2 )f xxxx
f jn +1 f jn
+
t
n
(3 f jn + 6 f j1n f j2
) (3 f jn+1 + 6 f jn f j1n )
U
8h
ENO!
WENO
!
A large
Stable for!
0 ! 2
Stable for!
!