You are on page 1of 40

Numerical Solutions for Hyperbolic Systems of Conservation Laws: from Godunov Method to Adaptive Mesh Refinement

Romain Teyssier CEA Saclay

5th JETSET School

Romain Teyssier 1

Outline
- Euler equations, MHD, waves, hyperbolic systems of conservation laws, primitive form, conservative form, integral form - Advection equation, exact solution, characteristic curve, Riemann invariant, finite difference scheme, modified equation, Von Neuman analysis, upwind scheme, Courant condition, Second order scheme - Finite volume scheme, Godunov method, Riemann problem, approximate Riemann solver, Second order scheme, Slope limiters, Characteristic tracing - Multidimensional scheme, directional splitting, Godunov, RungeKutta, CTU, 3D slope limiting - AMR, patch-based versus cell-based, octree structure, graded octree, flux correction, EMF correction, restriction and prolongation, divB conserving interpolation - Parallel computing with the RAMSES code

5th JETSET School

Romain Teyssier 2

The Euler equations


Lagrangian form: fluid element of unit mass - Mass conservation: - Euler equation: - First law of thermodynamics: Chain rule: from Lagrange derivative to Euler derivative Volume expansion rate:

5th JETSET School

Romain Teyssier 3

The Euler equations


Eulerian form: fixed volume element - Mass conservation - Momentum conservation - Energy conservation

Kinetic energy

Internal energy

Equation of state

5th JETSET School

Romain Teyssier 4

The Euler equations


System of conservation laws

- Vector of conservative variables - Flux function Integral form

t
t1

t2 x1 x2

x
Romain Teyssier 5

5th JETSET School

The Euler equations


Primitive form of the Euler equations:

- Vector of primitive variables - Quasi-linear form

5th JETSET School

Romain Teyssier 6

The Euler equations


Hyperbolic system: J and A have real eigenvalues. Eigenvectors are travelling waves. Perturbation of an equilibrium state: Wave equation: Eigenvalues: A=

Sound speed:

Eigenvectors:

5th JETSET School

Romain Teyssier 7

The advection equation


Linear scalar partial differential equation: Initial conditions: Defining and using the chain rule, we get:

Along the characteristic curve we have the Riemann invariant u


axt

t>0 t=0

x
5th JETSET School Romain Teyssier 8

The Riemann problem


Piecewise constant initial states:

u uL

uR

Solution:

5th JETSET School

Romain Teyssier 9

Finite difference scheme

Finite difference approximation of the advection equation

5th JETSET School

Romain Teyssier 10

The Modified Equation

Taylor expansion in time up to second order

Taylor expansion in space up to second order

The advection equation becomes the advection-diffusion equation

Negative diffusion coefficient: the scheme is unconditionally unstable


5th JETSET School Romain Teyssier 11

The Upwind scheme

a>0: use only upwind values, discard downwind variables

Taylor expansion up to second order:

Upwind scheme is stable if C<1, with

5th JETSET School

Romain Teyssier 12

Von Neumann analysis


Fourier transform the current solution: Evaluate the amplification factor of the 2 schemes. Fromm scheme:

>1: the scheme is unconditionally unstable Upwind scheme:

<1 if C<1: the scheme is stable under the Courant condition.


5th JETSET School Romain Teyssier 13

The advection-diffusion equation


Finite difference approximation of the advection equation:

Central differencing unstable: Upwind differencing is stable:

Smearing of initial discontinuity: numerical diffusion

Thickness increases as

5th JETSET School

Romain Teyssier 14

Finite volume scheme

Finite volume approximation of the advection equation:

Use integral form of the conservation law:

Exact evolution of volume averaged quantities:

Time averaged flux function:

5th JETSET School

Romain Teyssier 15

Sergei Konstantinovich Godunov

5th JETSET School

Romain Teyssier 16

Godunov scheme for the advection equation


The time averaged flux function: is computed using the solution of the Riemann problem defined at cell interfaces with piecewise constant initial data. ui

ui+1

For all t>0: The Godunov scheme for the advection equation is identical to the upwind finite difference scheme.
5th JETSET School Romain Teyssier 17

Godunov scheme for hyperbolic systems


The system of conservation laws is discretized using the following integral form: Piecewise constant initial data

The time average flux function is computed using the self-similar solution of the inter-cell Riemann problem:

This defines the Godunov flux:

Advection: 1 wave, Euler: 3 waves, MHD: 7 waves


5th JETSET School Romain Teyssier 18

Riemann solvers
Exact Riemann solution is costly: involves Raphson-Newton iterations and complex non-linear functions.

Approximate Riemann solvers are more useful. Two broad classes: - Linear solvers - HLL solvers

5th JETSET School

Romain Teyssier 19

Linear Riemann solvers


Define a reference state as the arithmetic average or the Roe average

Evaluate the Jacobian matrix at this reference state.

Compute eignevalues and (left and right) eigenvectors

The flux function is given by the linear Riemann solution. where A simple example, the upwind Riemann solver:

5th JETSET School

Romain Teyssier 20

HLL Riemann solver


Approximate the true Riemann fan by 2 waves and 1 intermediate state: t U*

UL

UR x

Compute U* using the integral form between SLt and SRt

Compute F* using the integral form between SLt and 0.

5th JETSET School

Romain Teyssier 21

Other HLL-type Riemann solvers


Lax-Friedrich Riemann solver:

HLLC Riemann solver: add a third wave for the contact (entropy) wave. SL U*L UL See Toro (1997) for details. t S* U*R UR x SR

5th JETSET School

Romain Teyssier 22

Higher Order Godunov schemes


Godunov method is stable but very diffusive. It was abandoned for two decades, until

Bram Van Leer

5th JETSET School

Romain Teyssier 23

Second Order Godunov scheme


ui

Piecewise linear approximation of the solution:

ui+1

The linear profile introduces a length scale: the Riemann solution is not self-similar anymore: The flux function is approximated using a predictor-corrector scheme:

The corrected Riemann solver has now predicted states as initial data:

5th JETSET School

Romain Teyssier 24

Predictor Step for the advection equation


The predicted states are computed using a Taylor expansion in space and time: ui ui+1

Second order predicted states are the new initial conditions for the Riemann solver:

The corrected flux function is the upwind predicted state:

5th JETSET School

Romain Teyssier 25

Modified equation for the second order scheme

Taylor expansion in space and time up to third order:

We obtain a dispersive term and the scheme is stable for C<1.

5th JETSET School

Romain Teyssier 26

Summary: the MUSCL scheme for systems


Compute second order predicted states using a Taylor expansion:

Update conservative variables using corrected Godunov fluxes

5th JETSET School

Romain Teyssier 27

Monotonicity preserving schemes


We use the central finite difference approximation for the slope: Second order linear scheme. In this case, the solution is oscillatory, and therefore non physical.
first order second order

Oscillations are due to the non monotonicity of the numerical scheme. A scheme is monotonicity preserving if: - No new local extrema are created in the solution - Local minimum (maximum) non decreasing (increasing) function of time. Godunov theorem: only first order linear schemes are monotonicity preserving !
5th JETSET School Romain Teyssier 28

Slope limiters
Harten introduced the Total Variation of the numerical solution:

Hartens theorem: a Total Variation Diminishing (TVD) scheme is monotonicity preserving. Design non-linear TVD second order scheme using slope limiters:

where the slope limiter is a non-linear function satisfying:

5th JETSET School

Romain Teyssier 29

No local extrema

We define 3 local slopes: left, right and central slopes and New maximum ! ui ui-1 ui+1

For all slope limiters:


5th JETSET School Romain Teyssier 30

The minmod slope


ui+1 ui ui-1

x Linear reconstruction is monotone at time tn

Slope limiting is never truly second order !

5th JETSET School

Romain Teyssier 31

The moncen slope


ui+1 ui ui-1

x Extreme values dont overshoot initial average states.

5th JETSET School

Romain Teyssier 32

The superbee slope


Predicted states dont overshoot initial average states.

TVD constraint is preserved by the Riemann solver.

The Courant factor now enters the slope definition.

5th JETSET School

Romain Teyssier 33

The ultrabee slope


Use the final state to compute the slope limiter.

Upwind Total Variation constraint.

Strict Total Variation preserving limiter.

5th JETSET School

Romain Teyssier 34

Summary: slope limiters


first order

minmod

moncen

superbee

ultrabee

5th JETSET School

Romain Teyssier 35

Non linear systems: characteristics tracing.


ui+1 ui Non-linear Riemann problems: waves speeds depend on the input states. TVD schemes are not necessary monotone. Modify the predictor step according to the local Riemann solution: Piecewise Linear Method (PLM) and Piecewise Parabolic Method (PPM). If else

If else

5th JETSET School

Romain Teyssier 36

Multidimensional Godunov schemes


2D Euler equations in integral (conservative) form

Flux functions are now time and space average.

2D Riemann problems interact along cell edges:

Even at first order, self-similarity does not apply to the flux functions anymore. Predictor-corrector schemes ?
5th JETSET School Romain Teyssier 37

Directional (Strang) splitting

Perform 1D Godunov scheme along each direction in sequence. X step: Y step: Change direction at the next step using the same time step. Compute t, X step, Y step, t=t+t Y step, X step t=t+t Courant factor per direction: Courant condition: Cost: 2 Riemann solves per time step. Second order based on corresponding 1D higher order method.
5th JETSET School Romain Teyssier 38

Unsplit schemes
Godunov scheme No predictor step. Flux functions computed using 1D Riemann problem at time tn in each normal direction. 2 Riemann solves per step. Courant condition: Runge-Kutta scheme Predictor step using the Godunov scheme and t/2. Flux functions computed using 1D Riemann problem at time tn+1/2 in each normal direction. 4 Riemann solves per step. Courant condition: Corner Transport Upwind Predictor step in transverse direction only using the 1D Godunov scheme. Flux functions computed using 1D Riemann problem at time tn+1/2 in each normal direction. 4 Riemann solves per step. Courant condition:

Second order schemes: multidimensional Taylor expansions and multidimensional slope limiters.
5th JETSET School Romain Teyssier 39

Beyond second order Godunov schemes ?


Smooth regions of the flow More efficient to go to higher order. Spectral methods can show exponential convergence. More flexible approaches: use ultra-high-order shockcapturing schemes: WENO, discontinuous Galerkin and discontinuous element methods Discontinuity in the flow More efficient to refine the mesh, since higher order schemes drop to first order. Adaptive Mesh Refinement is the most appealing approach. What about the future ? Combine the 2 approaches. Usually referred to as h-p adaptivity.

5th JETSET School

Romain Teyssier 40

You might also like