Numerical Methods for Hyperbolic Equations— gtryggva/CFD-Course2010/2010-Lecture-8.pdfComputational…

  • View
    213

  • Download
    0

Embed Size (px)

Transcript

  • Computational Fluid Dynamics I

    Numerical Methods!for Hyperbolic!EquationsIV!

    Grtar 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!solutionsshocks!

    Computational Fluid Dynamics I

    ft

    +U fx

    = 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)( =

    +

    xfF

    tf

    Entropy Condition!

    t

    x

    Shock Wave!

    ft

    + Ff

    fx

    = 0

    dxdt

    = Ff

    = F ( f )

    Rewrite in characteristic form!

    where:!

    dtds

    =1; dxds

    = Ff

    or:!

  • 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

    ft

    =ft

    +fx'

    x't

    ft

    +Fx

    = 0

    ft

    C fx'

    +Fx'

    = 0

    x' = x Ct

    x't

    = C

    x

    The speed of the shock! Write:!

    Substitute into:!

    where!

    ft

    C fx'

    +Fx'

    0 dx = 0

    ft

    0 dx C fx'

    0 dx + Fx'

    0 dx = 0

    0

    Computational Fluid Dynamics I

    C fx'

    0 dx + Fx'

    0 dx = 0

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

    C = FR FLfR fL

    x

    x

    Rankine-Hugoniot relations!

    Computational Fluid Dynamics I

    ft

    + f fx

    = 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!EquationsV!

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

    Grtar 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!

    Godunovs Theorem!

    Godunovs 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

  • 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 2322 1

    81

    2 =

    +

    Dispersive = Wiggles!

    Dissipative = Smearing!

    = Uth

    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 fcf1

    Expanding in Taylor series around!n kjf +njf

    )(2

    32

    222

    hOxfhk

    xfkhff nj

    nkj +

    ++=+

  • Computational Fluid Dynamics I

    Godunov Theorem - 2!

    Substituting!

    Also, can be Taylor expanded in time around!

    ++

    +=+

    k kk

    kkk

    nj

    nj hOckx

    fhkcxfhcff )(

    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 nj

    nj +

    ++=+

    )(2

    32

    222 tO

    xftU

    xftUf nj +

    +=

    (a)!

    (b)!

    Computational Fluid Dynamics I

    Godunov Theorem - 3!

    Condition for monotonicity:!11

    11 then,If++

    ++ >>nj

    nj

    nj

    nj ffff

    Since! ++ =k

    nkjk

    nj fcf1

    ( ) ++++++ =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 Godunovs 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

    Godunovs Method!

    Computational Fluid Dynamics I

    Godunov Method Finite Volume Method + Riemann solver!

    ft

    +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 j1

    jf

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

    0)()( 2/12/12/1

    2/1=+

    ++

    jj

    x

    xxFxFfdx

    tj

    j

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

    f dxxj1/2

    x j+1/2x j

    favt

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

    x j = x j+1/2 x j1/2

  • 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 tx j

    1t

    Fj+1/2 dt 1t

    Fj1/2 dttt+t

    tt+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 j1

    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 =1x j

    f dxxj1/2

    x j+1/22. 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!

    ( )njnjn javn jav ffhtUff 1,

    1, + =

    jj UfF =+ 2/1

    1st Order Upwind Scheme!

    Godunov Method!

    Computational Fluid Dynamics I

    fi+1

    Consider the following initial conditions:!

    1f j1 fi

    Fj1 / 2 = Ufj1n = U

    Fj+1 / 2 = Ufjn = 0

    f jn+1 = fj

    n th(Fj+1 / 2

    n Fj1 / 2n )

    Godunov Method!Computational Fluid Dynamics I

    Godunov Method!

    AdvectAverageAdvectAverageetc!

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

  • 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 Gudonovs 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!EquationsVI!

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

    Grtar Tryggvason !Spring 2009!

    Computational Fluid Dynamics I

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

    Conservation and shock speed!

    Advecti