Professional Documents
Culture Documents
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
Romain Teyssier 2
Romain Teyssier 3
Kinetic energy
Internal energy
Equation of state
Romain Teyssier 4
t
t1
t2 x1 x2
x
Romain Teyssier 5
Romain Teyssier 6
Sound speed:
Eigenvectors:
Romain Teyssier 7
t>0 t=0
x
5th JETSET School Romain Teyssier 8
u uL
uR
Solution:
Romain Teyssier 9
Romain Teyssier 10
Romain Teyssier 12
Thickness increases as
Romain Teyssier 14
Romain Teyssier 15
Romain Teyssier 16
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
The time average flux function is computed using the self-similar solution of the inter-cell Riemann problem:
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
Romain Teyssier 19
The flux function is given by the linear Riemann solution. where A simple example, the upwind Riemann solver:
Romain Teyssier 20
UL
UR x
Romain Teyssier 21
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
Romain Teyssier 22
Romain Teyssier 23
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:
Romain Teyssier 24
Second order predicted states are the new initial conditions for the Riemann solver:
Romain Teyssier 25
Romain Teyssier 26
Romain Teyssier 27
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:
Romain Teyssier 29
No local extrema
We define 3 local slopes: left, right and central slopes and New maximum ! ui ui-1 ui+1
Romain Teyssier 31
Romain Teyssier 32
Romain Teyssier 33
Romain Teyssier 34
minmod
moncen
superbee
ultrabee
Romain Teyssier 35
If else
Romain Teyssier 36
Even at first order, self-similarity does not apply to the flux functions anymore. Predictor-corrector schemes ?
5th JETSET School Romain Teyssier 37
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
Romain Teyssier 40