Transcript
Page 1: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Numerical Methods!for Hyperbolic!Equations—IV!

Grétar Tryggvason !Spring 2009!

http://users.wpi.edu/~gretar/me612.html!Computational Fluid Dynamics I

Flows with shocks. Solutions to Burgers eqn. Entropy condition!

Conservation and shock speed!

Computational Fluid Dynamics I

Discontinuous!solutions—shocks!

Computational Fluid Dynamics I

∂f∂t

+U ∂f∂x

= 0

The analytic solution is obtained by characteristics!

dxdt

=U; dfdt

= 0;

Consider the linear Advection Equation!

t

f

f

x Discontinuity of solution is allowed!

( )RLR

L ffxxfxxf

xf >⎩⎨⎧

><

=0

0)0,(

dxdt

=U

Computational Fluid Dynamics I

( )RLR

L ffxxfxxf

xf >⎩⎨⎧

><

=0

0)0,(0=∂∂+

∂∂

xff

tf

;0; ==dtdff

dtdx

Inviscid Burgersʼ Equation!

t

x

Characteristics!

0x

Lf

Rf

??=dtdx

0x

Shock Wave!

Computational Fluid Dynamics I

( ) ( ) axa

axfaxffff

axf

xf

R

RLRL

L

<<−

⎪⎪⎩

⎪⎪⎨

>

⎥⎦⎤

⎢⎣⎡ −−+

−<

=21)0,(

A slight variation of the initial condition – formation of shock!

t

x

Shock Wave!

a− a

Lf

Rf 0=t

RL ffat−

= 2

Page 2: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

0=∂∂+

∂∂

xff

tf

Inviscid Burgersʼ Equation!

The transformation!

t

x 0x

x→−x; t→−tLeaves the equation unchanged but results in an unphysical solution.!

The entropy condition is used to select the correct solution!

t

x 0x

Computational Fluid Dynamics I

( )RLR

L ffxxfxxf

xf <⎩⎨⎧

><

=0

0)0,(0=∂∂+

∂∂

xff

tf

;0; ==dtdff

dtdx

Reverse Shock (?)!

Characteristics!

0x

Lf

Rf t

x 0x

Unstable, entropy-violating!solution!

Computational Fluid Dynamics I

( )RLR

L ffxxfxxf

xf <⎩⎨⎧

><

=0

0)0,(0=∂∂+

∂∂

xff

tf

;0; ==dtdff

dtdx

Rarefaction Wave (physically correct solution)!

Characteristics!

0x

Lf

Rf t

x 0x

Computational Fluid Dynamics I

Weak solutions to hyperbolic equations may not be unique.!

How can we find a physical solution out of many weak!solutions?!

In fluid mechanics, the actual physics always includes !dissipation, i.e. in the form of viscous Burgersʼ equation:!

2

2

xf

xff

tf

∂∂=

∂∂+

∂∂ ε

Therefore, what we are truly seeking is the solution to !the viscous Burgersʼ equation in the limit of! 0→ε

Computational Fluid Dynamics I

Entropy Condition:!A discontinuity propagating with speed C satisfies the !entropy condition if!

For a conservation equation!

)()( RL fFCfF ′>>′

( ) ( ) ( ) ( )R

R

L

L

fffFfFC

fffFfF

−−≥≥

−−

0)( =∂

∂+∂∂

xfF

tf

Version I:!

Version II:!

And some others…!

Entropy Condition!

t

x

Shock Wave!

for!

fL ≥ f ≥ fR

Computational Fluid Dynamics I

The Entropy Condition states that the characteristics must “enter” the discontinuity. Thus, its speed C satisfies must satisfy!

Consider a conservation equation!

)()( RL fFCfF ′>>′

0)( =∂

∂+∂∂

xfF

tf

Entropy Condition!

t

x

Shock Wave!

∂f∂t

+ ∂F∂f

∂f∂x

= 0

dxdt

= ∂F∂f

= ′ F ( f )

Rewrite in “characteristic” form!

where:!

dtds

=1; dxds

= ∂F∂f

or:!

Page 3: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Similarly, the shock speed is given by!

( ) ( ) ( ) ( )R

R

L

L

fffFfFC

fffFfF

−−≥≥

−−

Thus!

Entropy Condition!

t

x

Shock Wave!

C =FR − FLfR − fL

fL ≥ f ≥ fRfor!

Means that the hypothetical shock speed for values of f between the left and the right state must give shock speeds that are larger on the left and smaller on the right.!

Computational Fluid Dynamics I

Shock Speed!

Computational Fluid Dynamics I

x

∂f∂t

=∂f∂t

+∂f∂x'

∂x'∂t

∂f∂t

+∂F∂x

= 0

∂f∂t

− C ∂f∂x'

+∂F∂x'

= 0

x' = x − Ct

∂x'∂t

= C

x’ The speed of the shock! Write:!

Substitute into:!

where!

∂f∂t

− C ∂f∂x'

+∂F∂x'

⎛ ⎝

⎞ ⎠

Δ→ 0∫ dx = 0

∂f∂t

⎛ ⎝ ⎜

⎞ ⎠ ⎟

Δ→0∫ dx − C ∂f

∂x'⎛ ⎝ ⎜

⎞ ⎠ ⎟

Δ→0∫ dx + ∂F

∂x'⎛ ⎝ ⎜

⎞ ⎠ ⎟

Δ→0∫ dx = 0

0

Computational Fluid Dynamics I

− C ∂f∂x'

⎛ ⎝ ⎜

⎞ ⎠ ⎟

Δ→0∫ dx + ∂F

∂x'⎛ ⎝ ⎜

⎞ ⎠ ⎟

Δ→0∫ dx = 0

−C fR − fL( ) + FR − FL( ) = 0

C =FR − FLfR − fL

x

x’

Rankine-Hugoniot relations!

Computational Fluid Dynamics I

∂f∂t

+ f ∂f∂x

= 0

Example!

F =12f 2

C =FR − FLfR − fL

=12fR2 − fL2

fR − fL=12

fR − fL( ) fR + fL( )fR − fL

C =12fR + fL( )

Computational Fluid Dynamics I

Numerical Methods!for Hyperbolic!Equations—V!

http://users.wpi.edu/~gretar/me612.html!

Grétar Tryggvason !Spring 2009!

Page 4: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Flows with shocks. Solutions to Burgers eqn. Entropy condition!

Conservation and shock speed!

Advecting a shock with several schemes!

Godunovʼs Theorem!

Godunovʼs Method!

Higher Order Upwind schemes!

Artificial Viscosity!

Computational Fluid Dynamics I

Advecting a shock with!several schemes!

Computational Fluid Dynamics I

Example Problem: Linear Wave Equation!

0,,0 ≥∞<<∞−=∂∂+

∂∂ tx

xfU

tf

⎩⎨⎧

><

=0001

)0,(xx

xf

Exact Solution:! )( Utxf −

Apply various numerical methods!

Computational Fluid Dynamics I

fjn+1 = fj

n −ΔthU ( fj

n − fj−1n )

f jn+1 = f j

n −UΔt2h

f j+1n − f j−1

n( ) + U2Δt 2

2h2f j+1n − 2 f j

n + f j−1n( )

f jn+1 = f j

n−1 −UΔth

f j+1n − f j−1

n( )

( )njnj

nj

tj ff

htUff −Δ−= +1

( )⎥⎦⎤

⎢⎣⎡ −Δ−+= −

+ tj

tj

tj

nj

nj ff

htUfff 1

1

21

Upwind!

Leap-frog!

Lax-Wendroff!

MacCormack!

Computational Fluid Dynamics I

Comparison:! h=0.1; dt= 0.05;n=41, time=2.75

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

Leap-frog

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

Upwind

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

Lax-Wendroff

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

MacCormack

Computational Fluid Dynamics I

Comparison:! h=0.05; dt= 0.025;n=81, time=2.75

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

Lax-Wendroff

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

Upwind

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

Leap-frog

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

MacCormack

Page 5: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Comparison:! n=41 and n=81, time=2.75

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

Upwind

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

MacCormack

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

Upwind

5 10 15 20 25 30 35 40-0.5

0

0.5

1

1.5

MacCormack

Computational Fluid Dynamics I

First-Order Methods and Diffusion!

Upwind:!

( ) ( ) xxxxx fUhfUhxfU

tf 132

61

22

2

+−−−=∂∂+

∂∂ λλλ

Lax-Wendroff:!

( ) ( ) xxxxxxx fUhfUhxfU

tf 2

32

2

18

12

λλλ −−−−=∂∂+

∂∂

Dispersive = Wiggles!

Dissipative = Smearing!

λ = UΔth

Computational Fluid Dynamics I

Observation 1:!Second-order methods tends to capture shaper solution !(better accuracy), but they produce wiggly solutions.!

Observation 2:!First-order methods are dissipative and less accurate, !but the solution does not oscillate. !(preserves monotonicity).!

Computational Fluid Dynamics I

Godunov Theorem!

Computational Fluid Dynamics I

Question: How can we avoid oscillatory behavior?!(How can we preserve monotonicity)!

Godunov Theorem (1959):!

“Monotone behavior of a numerical solution cannot be assured for linear finite-difference methods with more than first-order accuracy.”!

Computational Fluid Dynamics I Godunov Theorem - 1!

0=∂∂+

∂∂

xfU

tf

For linear equation!

which yields:!2

22

2

2

;xfU

tf

xfU

tf

∂∂=

∂∂

∂∂−=

∂∂

A general linear scheme can be written as:!

∑ ++ =

k

nkjk

nj fcf 1

Expanding in Taylor series around!nkjf +

njf

)(2

32

222

hOxfhk

xfkhff n

jnkj +

∂∂+

∂∂+=+

Page 6: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I Godunov Theorem - 2!

Substituting!

Also, can be Taylor expanded in time around!

∑ ∑∑ +∂∂+

∂∂+=+

k kk

kkk

nj

nj hOck

xfhkc

xfhcff )(

232

2

221

(a)=(b) (2nd order accurate):!2

2;;1 ⎟⎠⎞⎜

⎝⎛ Δ=Δ−== ∑∑∑ h

tUckhtUkcc

kk

kk

kk

1+njf

njf

)(2

32

221 tO

tft

tftff n

jnj Δ+

∂∂Δ+

∂∂Δ+=+

)(2

32

222 tO

xftU

xftUf nj Δ+

∂∂Δ+

∂∂Δ−=

(a)!

(b)!

Computational Fluid Dynamics I Godunov Theorem - 3!

Condition for monotonicity:!11

11 then,If ++++ >> n

jnj

nj

nj ffff

Since! ∑ ++ =

k

nkjk

nj fcf 1

( )∑ +++++

+ −=−k

nkj

nkjk

nj

nj ffcff 1

111

> 0 The above should be valid for arbitrary!

00 111 >−⇔> ++

+nj

njk ffc

njf

Is it possible?!

Computational Fluid Dynamics I Godunov Theorem - 4!

Hence we get:!

22;;1 ⎟

⎠⎞⎜

⎝⎛ Δ=Δ−== ∑∑∑ h

tUckhtUkcc

kk

kk

kk

ckk∑⎛⎝⎜

⎞⎠⎟

k2ckk∑⎛⎝⎜

⎞⎠⎟= kck

k∑⎛⎝⎜

⎞⎠⎟

2

ek2

k∑⎛⎝⎜

⎞⎠⎟

k2ek2

k∑⎛⎝⎜

⎞⎠⎟= kek

2

k∑⎛⎝⎜

⎞⎠⎟

2

Define:! )0(2 >= kkk cec

This violates Cauchy inequality! a ⋅a( ) b ⋅b( ) ≥ a ⋅b( )2

Monotone 2nd Order scheme is impossible! !

a

b

Computational Fluid Dynamics I

The key word in Godunovʼs theorem is linear. To overcome its limitations, look for nonlinear scheames:!

1.  Use central differencing and introduce numerical!!viscosity where needed (Artificial viscosity)!

2. Limit the fluxes in such a way that oscillations are avoided (high-order Godunov methods, flux-corrected transport, TVD shemes, etc.)!

Computational Fluid Dynamics I

Godunovʼs Method!

Computational Fluid Dynamics I

Godunov Method – Finite Volume Method + Riemann solver!

∂f∂t

+∂∂x

F( f )[ ] = 0

Consider a 1-D Conservation Eq:!

Integrating across the j-th cell:!

Godunov Method!

Fj-1/2 Fj+1/2 !

1+jff j−1

jf

x!j ! j+1 !j-1 !

0)()( 2/12/1

2/1

2/1=−+

∂∂

−+∫+

−jj

x

xxFxFfdx

tj

j

Define the cell-average:! fav =1Δx j

f dxxj−1/2

x j+1/2∫Δx j

∂fav∂t

+ F(x j+1/2 ) − F(x j−1/2 ) = 0

Δx j = x j+1/2 − x j−1/2

Page 7: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Integrating over time!

where the time integration is done by solving !Riemann Problem for each cell boundary:!

favn+1 = fav

n −ΔtΔx j

1Δt

Fj+1/2 dt −1Δt

Fj−1/2 dtt

t+Δt

∫t

t+Δt

∫⎡⎣⎢

⎤⎦⎥

[ ] 0)( =∂∂+

∂∂ fF

xtf

⎪⎩

⎪⎨⎧

>≤

=++

+

2/11

2/1)0,(jj

jj

xxfxxf

xf 1+jfjf

x!j ! j+1 !

t!

2/1+= jcdtdx

t+Δt !

Godunov Method!Computational Fluid Dynamics I

Wave Diagram: !

1+jff j−1

jf

j ! j+1 !j-1 !

Shock!Shock!Rarefaction!

Wave!

Godunov Method!

Computational Fluid Dynamics I

Godunov Method: The Procedure !

1. Construct a cell average value !

fav =1Δx j

f dxxj−1/2

x j+1/2∫2. Solve a Riemann problem to find the time ! integration of fluxes!

3. Construct new!

4. Go to 1. !

avf

ttt Δ+=

Godunov Method!Computational Fluid Dynamics I

Special Case: Linear Advection Equation!

0,0 >=∂∂+

∂∂ U

xfU

tf

for which the Riemann problem is trivial and we get!

( )nj

nj

njav

njav ff

htUff 1,

1, −+ −Δ−=

jj UfF =+ 2/1

1st Order Upwind Scheme!

Godunov Method!

Computational Fluid Dynamics I

fi+1

Consider the following initial conditions:!

1f j−1 fi

Fj−1 / 2 = Ufj−1n = U

Fj+1 / 2 = Ufjn = 0

f jn+1 = fj

n −Δth(Fj+1 / 2

n − Fj−1 / 2n )

Godunov Method!Computational Fluid Dynamics I Godunov Method!

Advect—Average—Advect—Average—etc!

The averaging leads to numerical diffusion, even though the advection is exact!!

Page 8: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I Godunov Method!

Numerical versus exact solution!

Computational Fluid Dynamics I

In its basic form upwind schemes are limited to relatively simple problems. !

By using Flux Vector Splitting or Gudonovʼs method, upwinding can be applied to nonlinear systems of hyperbolic equations.!

These methods are, however, only first order accurate in time and space.!

Godunov Method!

Computational Fluid Dynamics I

For nonlinear equations and systems the full Rieman problem must be solved!Since only the fluxes are needed, often approximate solvers are used!

Computational Fluid Dynamics I

Numerical Methods!for Hyperbolic!Equations—VI!

http://users.wpi.edu/~gretar/me612.html!

Grétar Tryggvason !Spring 2009!

Computational Fluid Dynamics I

Flows with shocks. Solutions to Burgers eqn. Entropy condition!

Conservation and shock speed!

Advecting a shock with several schemes!

Godunovʼs Theorem!

Godunovʼs Method!

Higher Order Upwind schemes!

Artificial Viscosity!

Computational Fluid Dynamics I

Higher Order Upwind schemes!

Page 9: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

To get a second order time integration, use a half-step predictor to give second order accuracy in time: !

f jn+1/ 2 = f j

n − Δt2h

Fj+1/ 2n − Fj−1/ 2

n( )

f jn+1 = f j

n − Δth

Fj+1/ 2n+1/ 2 − Fj−1/ 2

n+1/ 2( )Then correct by a midpoint rule:!

where the fluxes are found at the half step!

j-1 j j+1

Computational Fluid Dynamics I

For first order accuracy in space the fluxes are found at the cell boundaries!

Fj+1/ 2n = F f j

n, f j+1n( )

at the beginning of the step.!

And!

at the half step. Here, the variables have been extrapolated to the cell boundaries to give higher order fluxes.!�

Fj+1/ 2n+1/ 2 = F f L( ) j+1/ 2

n+1/ 2, f R( ) j+1/ 2

n+1/ 2( )

Computational Fluid Dynamics I

For the first order spatial fluxes, the value in each cell was assumed to be a constant. For higher order computations of the spatial fluxes, the slope inside each cell is found!

Fj+1/ 2n+1/ 2 = F f L( ) j+1/ 2

n+1/ 2, f R( ) j+1/ 2

n+1/ 2( )

Once the value at the cell boundary has been found, the flux is found using these values!

Computational Fluid Dynamics I Higher Order Upwind!

j ! j+1 !j-1 ! j+2 !

1+jf 2+jf

jf1−jf

Ljf 2/1+

f j+1/2L = f j +

h2

1−κ2

⎛⎝⎜

⎞⎠⎟S− +

1+κ2

⎛⎝⎜

⎞⎠⎟S+⎡

⎣⎢⎤⎦⎥

Higher order fluxes!

f j+1/ 2L = f j + h

2S

S+ =f j+1 − f j

hS− =

f j − f j−1h

Define slopes:!

Define a weighted average:!

k = 0 use 12 S

+ + S−( )k =1 use S+ onlyk = −1 use S− only

Computational Fluid Dynamics I Higher Order Upwind!

f j+1/2L = f j +

h2

1−κ2

⎛⎝⎜

⎞⎠⎟S− +

1+κ2

⎛⎝⎜

⎞⎠⎟S+⎡

⎣⎢⎤⎦⎥

= f j +h2

1−κ2

⎛⎝⎜

⎞⎠⎟

f j − f j−1h

⎛⎝⎜

⎞⎠⎟+1+κ2

⎛⎝⎜

⎞⎠⎟

f j+1 − f jh

⎛⎝⎜

⎞⎠⎟

⎣⎢

⎦⎥

= f j +1−κ4

f j − f j−1( ) + 1+κ4 f j+1 − f j( )

Using!

S+ =f j+1 − f j

hS− =

f j − f j−1h

We find!

Computational Fluid Dynamics I Higher Order Upwind!

Rjf 2/1+

f j+1/ 2R = f j+1 −

1−κ4

f j+1 − f j( ) − 1+ κ4

f j+2 − f j+1( )

Similarly!

f j+1/ 2R = f j+1 −

h2S

S+ =f j+2 − f j+1

hS− =

f j+1 − f jh

j ! j+1 !j-1 ! j+2 !

1+jf 2+jf

jf1−jf

Page 10: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I Higher Order Upwind!

j ! j+1 !j-1 ! j+2 !

1+jf 2+jf

jf1−jf

Ljf 2/1+

Rjf 2/1+

f j+1/ 2L = f j + 1−κ

4f j − f j−1( ) + 1+ κ

4f j+1 − f j( )

f j+1/ 2R = f j+1 −

1−κ4

f j+1 − f j( ) − 1+ κ4

f j+2 − f j+1( )

1for −=κ

Evaluation of the function at the cell boundary:!

Different values of k give different second order schemes!

Computational Fluid Dynamics I

f jn+1/ 2 = f j

n − Δt2h

Fj+1/ 2n − Fj−1/ 2

n( )

f jn+1 = f j

n − Δth

Fj+1/ 2n+1/ 2 − Fj−1/ 2

n+1/ 2( )

Fj+1/ 2n+1/ 2 = F f L( ) j+1/ 2

n+1/ 2, f R( ) j+1/ 2

n+1/ 2( )

Predictor step!

Final step!

where! is a higher order flux!

Can use first order fluxes for the predictor step!

10 20 30 40 50 60 70 80-0.5

0

0.5

1

1.5

upwind!

K=-1!

K=0!

K=1!Example: Linear Advection !

Computational Fluid Dynamics I

Instead of extrapolating the variables to the cell boundaries, we can also extrapolate the fluxes:!

Fj+1/ 2+ = Fj

+ + 1−κ4

Fj+ − Fj−1

+( ) + 1+ κ4

Fj+1+ − Fj

+( )For the positive fluxes:!

Fj+1/ 2− = Fj+1

− − 1−κ4

Fj+1− − Fj

−( ) − 1+ κ4

Fj+2− − Fj+1

−( )

For the negative fluxes:!

Computational Fluid Dynamics I

Summary:!

First-order methods result in a low accuracy and dissipative solution, particularly at a shock. The solution does, however, not oscillate (preserves monotonicity). !

Second-order methods capture shocks better but produce wiggly solutions.!

For the nonlinear advection equation, the first order captures the solution reasonably well, since the characteristics terminate in the shock!

Computational Fluid Dynamics I

Numerical Methods!for Hyperbolic!Equations—VII!

http://users.wpi.edu/~gretar/me612.html!

Grétar Tryggvason !Spring 2009!

Computational Fluid Dynamics I

Flows with shocks. Solutions to Burgers eqn. Entropy condition!

Conservation and shock speed!

Advecting a shock with several schemes!

Godunovʼs Theorem!

Godunovʼs Method!

Higher Order Upwind schemes!

Artificial Viscosity!

Page 11: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

Artificial Viscosity!

Computational Fluid Dynamics I

Use centered difference method (e.g. Lax-Wendroff) !!- Second order accuracy!!- Oscillation near discontinuity!

In order to “damp out” oscillation, we can either!!- Use implicit numerical viscosity (upwind) or!!- Add an explicit numerical viscosity!

Artificial Viscosity !

Computational Fluid Dynamics I

Von Neumann and Richtmyer (1950)!

0=∂∂+

∂∂

xF

tf

xfDh

xfFF

∂∂=

∂∂−=′ 2; αα

Artificial Viscosity!

Replace the flux by:!

∂f∂t

+ ∂F∂x

= − ∂∂x

−α ∂f∂x

⎛ ⎝ ⎜

⎞ ⎠ ⎟ = ∂

∂xDh2 ∂f

∂x∂f∂x

⎛ ⎝ ⎜

⎞ ⎠ ⎟ Giving:!

O(1) coefficient!

0 as h 0 !-  Simulates the effect of the physical viscosity on the grid scale, ! concentrated around discontinuity and negligible elsewhere.!- h2 is necessary to keep the viscous term of higher order.!

Consider:!

Computational Fluid Dynamics I Artificial Viscosity!

∂f∂t

+U ∂f∂x

= ∂∂x

Dh2 ∂f∂x

∂f∂x

⎛ ⎝ ⎜

⎞ ⎠ ⎟

Example: Linear Advection Equation:!

f jn+1 = f j

n −UΔt2h

f j+1n − f j−1

n( ) + 12UΔth

⎛⎝⎜

⎞⎠⎟2

f j+1n − 2 f j

n + f j−1n( )

+Δth

Dh2 ∂f∂x

∂f∂x

⎛⎝⎜

⎞⎠⎟ j+1/2

− Dh2 ∂f∂x

∂f∂x

⎛⎝⎜

⎞⎠⎟ j−1/2

⎣⎢⎢

⎦⎥⎥

Discretization by Lax-Wendroff!

Computational Fluid Dynamics I Artificial Viscosity!

Dh2 ∂f∂x

∂f∂x

⎛⎝⎜

⎞⎠⎟ j+1/2

= D fj+1n − f j

n f j+1n − f j

n( )Approximate:!

f jn+1 = f j

n −UΔt2h

f j+1n − f j−1

n( ) + 12UΔth

⎛⎝⎜

⎞⎠⎟2

f j+1n − 2 f j

n + f j−1n( )

+ D Δth

f j+1n − f j

n f j+1n − f j

n( ) − f jn − f j−1

n f jn − f j−1

n( )⎡⎣ ⎤⎦

gives!

1+jff j−1

jf

x!j ! j+1 !j-1 !

Computational Fluid Dynamics I Artificial Viscosity!

% Artificial Viscosity by LaxWendroff n=161; nstep=250; length=4.0;h=length/(n-1);dt=0.25*h; y=zeros(n,1);f=zeros(n,1);f(1)=1;time=0;

for m=1:nstep,m hold off;plot(f,'linewidt',2); axis([1 n -0.5, 1.5]);hold on; plot([1,dt*(m-1)/h+1.5,dt*(m-1)/h+1.5,n],[1,1,0,0],'r','linewidt',2);pause; y=f; time=time+dt; for i=2:n-1, f(i)=y(i)-(0.5*dt/h)*(y(i+1)-y(i-1))+... (0.5*dt*dt/h/h)*(y(i+1)-2.0*y(i)+y(i-1))+...

+0.5*(dt/h)*(abs(y(i+1)-y(i))*(y(i+1)-y(i))-... abs(y(i)-y(i-1))*(y(i)-y(i-1)) );

end; end;

Page 12: Numerical Methods for Hyperbolic Equations—IVgtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational Fluid Dynamics I! =0 ∂ ∂ + ∂ ∂ x f f t f Inviscid Burgersʼ Equation!

Computational Fluid Dynamics I

20 40 60 80 100 120 140 160-0.5

0

0.5

1

1.5

20 40 60 80 100 120 140 160-0.5

0

0.5

1

1.5

20 40 60 80 100 120 140 160-0.5

0

0.5

1

1.5

upwind!

Lax-Wendroff D=0!

Lax-Wendroff D=0.5!

Artificial Viscosity !Computational Fluid Dynamics I

20 40 60 80-0.5

0

0.5

1

1.5Upwind Lax-Wendroff

Nonlinear advection equation!

Computational Fluid Dynamics I

Artificial viscosity can be used with most other centered difference schemes and was, for a while, THE way aeronautical computations were done. Other types, including higher order, have been used.!


Recommended