The RAMSES code and related techniques I. Hydro solvers

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

The RAMSES code and related techniques 2- MHD solvers

Riemann Solvers and Numerical Methods for Fluid Dynamics

NUMERICAL SOLUTION OF HYPERBOLIC PARTIAL DIFFERENTIAL EQUATIONS

A Finite Volume Code for 1D Gas Dynamics

Finite Volume Schemes: an introduction

Comparison of Approximate Riemann Solvers

A New Fourth-Order Non-Oscillatory Central Scheme For Hyperbolic Conservation Laws

Advection / Hyperbolic PDEs. PHY 604: Computational Methods in Physics and Astrophysics II

ENO and WENO schemes. Further topics and time Integration

Computational Fluid Dynamics. PHY 688: Numerical Methods for (Astro)Physics

Chapter 1. Introduction

Computational Astrophysics 7 Hydrodynamics with source terms

RESEARCH HIGHLIGHTS. WAF: Weighted Average Flux Method

The RAMSES code and related techniques 4. Source terms

The Center for Astrophysical Thermonuclear Flashes. FLASH Hydrodynamics

A numerical study of SSP time integration methods for hyperbolic conservation laws

Extremum-Preserving Limiters for MUSCL and PPM

Approximate Harten-Lax-Van Leer (HLL) Riemann Solvers for Relativistic hydrodynamics and MHD

International Engineering Research Journal

The one-dimensional equations for the fluid dynamics of a gas can be written in conservation form as follows:

Solving the Euler Equations!

Hierarchical Reconstruction with up to Second Degree Remainder for Solving Nonlinear Conservation Laws

CapSel Roe Roe solver.

FDM for wave equations

Chp 4: Non-linear Conservation Laws; the Scalar Case. By Prof. Dinshaw S. Balsara

A NUMERICAL STUDY FOR THE PERFORMANCE OF THE RUNGE-KUTTA FINITE DIFFERENCE METHOD BASED ON DIFFERENT NUMERICAL HAMILTONIANS

State of the Art MHD Methods for Astrophysical Applications p.1/32

Positivity-preserving high order schemes for convection dominated equations

A Fourth-Order Central Runge-Kutta Scheme for Hyperbolic Conservation Laws

Art Checklist. Journal Code: Article No: 6959

Part 1: Numerical Modeling for Compressible Plasma Flows

Sung-Ik Sohn and Jun Yong Shin

CapSel Euler The Euler equations. conservation laws for 1D dynamics of compressible gas. = 0 m t + (m v + p) x

A Central Rankine Hugoniot Solver for Hyperbolic Conservation Laws

Computational Astrophysics

An Improved Non-linear Weights for Seventh-Order WENO Scheme

Spatial Discretization

c 2003 Society for Industrial and Applied Mathematics

Numerical Methods for Conservation Laws WPI, January 2006 C. Ringhofer C2 b 2

Godunov methods in GANDALF

A Very Brief Introduction to Conservation Laws

Non-linear Methods for Scalar Equations

The PLUTO code for astrophysical gasdynamics

The multi-stage centred-scheme approach applied to a drift-flux two-phase flow model

Entropy stable high order discontinuous Galerkin methods. for hyperbolic conservation laws

Bound-preserving high order schemes in computational fluid dynamics Chi-Wang Shu

Hierarchical Reconstruction with up to Second Degree Remainder for Solving Nonlinear Conservation Laws

Journal of Computational Physics

ARTICLE IN PRESS Mathematical and Computer Modelling ( )

Comparison of (Some) Algorithms for Edge Gyrokinetics

Math 660-Lecture 23: Gudonov s method and some theories for FVM schemes

Dedicated to the 70th birthday of Professor Lin Qun

Strong Stability-Preserving (SSP) High-Order Time Discretization Methods

Notes: Outline. Shock formation. Notes: Notes: Shocks in traffic flow

TOTAL VARIATION DIMINISHING RUNGE-KUTTA SCHEMES

Discontinuous Galerkin Method for 1D Shallow Water Flow with Water Surface Slope Limiter

The Discontinuous Galerkin (dg) method is a popular numerical method that has received much attention

Anti-diffusive finite difference WENO methods for shallow water with. transport of pollutant

Lecture 6) Multidimensional Schemes for Hyperbolic Conservation Laws: Bringing it Together

COMPUTATIONAL METHODS AND ALGORITHMS Vol II - Computational Methods for Compressible Flow Problems - Remi Abgrall

Improvement of convergence to steady state solutions of Euler equations with. the WENO schemes. Abstract

arxiv: v2 [math.na] 4 Mar 2014

Application of a Laser Induced Fluorescence Model to the Numerical Simulation of Detonation Waves in Hydrogen-Oxygen-Diluent Mixtures

FUNDAMENTALS OF LAX-WENDROFF TYPE APPROACH TO HYPERBOLIC PROBLEMS WITH DISCONTINUITIES

A parametrized maximum principle preserving flux limiter for finite difference RK-WENO schemes with applications in incompressible flows.

DEVELOPMENT AND APPLICATION OF GENERALIZED MUSTA SCHEMES

Two-Dimensional Riemann Solver for Euler Equations of Gas Dynamics

A Central Compact-Reconstruction WENO Method for Hyperbolic Conservation Laws

GODUNOV-TYPE SOLUTIONS FOR TWO-PHASE WATER HAMMER FLOWS

An Assessment of Semi-Discrete Central Schemes for Hyperbolic Conservation Laws

Research Article A New Flux Splitting Scheme Based on Toro-Vazquez and HLL Schemes for the Euler Equations

Large Time Step Scheme Behaviour with Different Entropy Fix

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

HFVS: An Arbitrary High Order Flux Vector Splitting Method

MAS. Modelling, Analysis and Simulation. Modelling, Analysis and Simulation. Building your own shock tube. J. Naber

Weighted Essentially Non-Oscillatory limiters for Runge-Kutta Discontinuous Galerkin Methods

Fourier analysis for discontinuous Galerkin and related methods. Abstract

Numerical Simulations. Duncan Christie

Solution of Two-Dimensional Riemann Problems for Gas Dynamics without Riemann Problem Solvers

NUMERICAL METHODS IN ASTROPHYSICS An Introduction

Lecture 5.7 Compressible Euler Equations

MATHEMATICAL ASPECTS OF NUMERICAL SOLUTION OF HYPERBOLIC SYSTEMS

arxiv: v3 [math.na] 10 Mar 2015

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

Definition and Construction of Entropy Satisfying Multiresolution Analysis (MRA)

High Order ADER FV/DG Numerical Methods for Hyperbolic Equations

A class of the fourth order finite volume Hermite weighted essentially non-oscillatory schemes

Convex ENO Schemes for Hamilton-Jacobi Equations

Outline of lectures. Adding more physics. Doing Better: source terms in CTU unsplit integrator

The Euler Equations! Advection! λ 1. λ 2. λ 3. ρ ρu. c 2 = γp/ρ. E = e + u 2 /2 H = h + u 2 /2; h = e + p/ρ. 0 u 1/ρ. u p. t + A f.

Applied Mathematics and Mechanics (English Edition) Transversal effects of high order numerical schemes for compressible fluid flows

Advanced numerical methods for nonlinear advectiondiffusion-reaction. Peter Frolkovič, University of Heidelberg

On the entropy stability of Roe-type finite volume methods

A method for avoiding the acoustic time step restriction in compressible flow

AMath 574 February 11, 2011

YINGJIE LIU, CHI-WANG SHU, EITAN TADMOR, AND MENGPING ZHANG

Adaptive TVD-RK Discontinuous Galerkin Algorithms for Shallow Water Equations

A Higher-Order Finite Volume Method for Non-Conservative Equations on 2D Unstructured Quadrilateral Grids

Adjoint-based optimization for optimal control problems governed by nonlinear hyperbolic conservation laws

Transcription:

The RAMSES code and related techniques I. Hydro solvers

Outline - The Euler equations - Systems of conservation laws - The Riemann problem - The Godunov Method - Riemann solvers - 2D Godunov schemes - Second-order scheme with MUSCL - Slope limiters and TVD schemes - 2D slope limiter.

The Euler equations in conservative form A system of 3 conservation laws The vector of conservative variables

The Euler equations in primitive form A non-linear system of PDE (quasi-linear form) The vector of primitive variables We restrict our analysis to perfect gases

The isothermal Euler equations Conservative form with conservative variables Primitive form with primitive variables a is the isothermal sound speed

Systems of conservation laws General system of conservation laws with F flux vector. Examples: 1- Isothermal Euler equations 2- Euler equation 3- Ideal MHD equations

Primitive variables and quasi-linear form We define the Jacobian of the flux function as: The system writes in the quasi-linear (non-conservative) form We define the primitive variables and the Jacobian of the transformation The system writes in the primitive (non-conservative) form The matrix A is obtained by The system is hyperbolic if A or J have real eigenvalues.

The advection equation Scalar (one variable) linear (u=constant) partial differential equation (PDE) Initial conditions: Define the function: Using the chain rule, we have: is a Riemann Invariant along the characteristic curves defined by t x

The isothermal wave equation We linearize the isothermal Euler equation around some equilibrium state. Using the system in primitive form, we get the linear system: where the constant matrix has 2 real eigenvalues and 2 eigenvectors The previous system is equivalent to 2 independent scalar linear PDEs. ( ) is a Riemann invariant along characteristic curves moving with velocity ( )

Linear Riemann problem for isothermal waves Initial conditions are defined by 2 semi-infinite regions with pieceweise constant initial states and t Mixed state x Left state Right state Star state is obtained using the 2 Riemann invariants.

The adiabatic wave equation We define the adiabatic sound speed: The system is equivalent to the 3 independent scalar PDEs:, and are 3 Riemann invariants along characteristic curves moving with velocity, and.

Linear Riemann problem for adiabatic waves Initial conditions are defined by 2 semi-infinite regions with pieceweise constant initial states and. t 2 mixed states x Left state Right state Left star state: (-,0,+)=(R,L,L) and right star state: (-,0,+)=(R,R,L).

Non-linear case: shocks and the RH relations t t2 St t1 x1 x2 x Integral form of the conservation law Rankine-Hugoniot relations: Bürger s equation: gives

Riemann invariants for non-linear waves Define the 3 differential forms: These are Riemann invariants along the characteristic curves (u+a, u-a, u) Exercise: using and the Euler system in primitive form, show that the previous forms are invariants along their characteristic curve. Right-going waves satisfy 0 Left-going waves satisfy 0 Entropy waves satisfy 0

Non-linear case: rarefaction waves t x The entropy is conserved across the fan 0 across the fan, which gives Writing we get

The Sod shock tube Analytical solution: we match the pressure and the velocity at the tip of the rarefaction wave with the pressure and velocity after the shock.

Outline - The Euler equations - Systems of conservation laws - The Riemann problem - The Godunov Method - Riemann solvers - 2D Godunov schemes - Second-order scheme with MUSCL - Slope limiters and TVD schemes - 2D slope limiter.

The Godunov method

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:

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. u i u i+1 x For all t>0: The Godunov scheme for the advection equation is identical to the upwind finite difference scheme.

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

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

Linear Riemann solvers Define a reference state as the arithmetic average or the Roe average Evaluate the Jacobian matrix at this reference state. Compute eigenvalues and (left and right) eigenvectors The interface state is obtained by combining all upwind waves where Non-linear flux function with a linear diffusive term. A simple example, the upwind Riemann solver:

HLL Riemann solver Approximate the true Riemann fan by 2 waves and 1 intermediate state: U * t U L U R x Compute U* using the integral form between S L t and S R t Compute F* using the integral form between S L t and 0.

Other HLL-type Riemann solvers Lax-Friedrich Riemann solver: HLLC Riemann solver: add a third wave for the contact (entropy) wave. S L t S * S R U * L U * R U L See Toro (1997) for details. U R x

riemann= llf Sod test with the Godunov scheme Lax-Friedrich Riemann solver 128 cells

riemann= hllc Sod test with the Godunov scheme HLLC Riemann solver 128 cells

riemann= exact Sod test with the Godunov scheme Exact Riemann solver 128 cells

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?

A simple alternative: directional 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. Used in the FLASH code: be careful with AMR!

Various 2D unsplit schemes Godunov scheme No predictor step. RAMSES Flux functions computed using 1D Riemann problem at time t n 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 t n+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 t n+1/2 in each normal direction. 4 Riemann solves per step. Courant condition: ATHENA

Advection of a square with Godunov scheme

Advection of a square with Godunov scheme

Second-order Godunov scheme

Outline - The Euler equations - Systems of conservation laws - The Riemann problem - The Godunov Method - Riemann solvers - 2D Godunov schemes - Second-order scheme with MUSCL - Slope limiters and TVD schemes - Characteristics tracing and 2D slopes.

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

Higher Order Godunov schemes Godunov method is stable but very diffusive. It was abandoned for two decades, until Bram Van Leer

Second Order Godunov scheme u i Piecewise linear approximation of the solution: u i+1 x 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:

Summary: the MUSCL scheme for systems Compute second order predicted states using a Taylor expansion: { { Update conservative variables using corrected Godunov fluxes

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!

Slope limiters Harten introduced the Total Variation of the numerical solution: Harten s 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:

No local extrema We define 3 local slopes: left, right and central slopes and New maximum! u i u i-1 u i+1 x For all slope limiters:

The minmod slope Initial reconstructed solution must be monotonous. u i+1 u i u i-1 x Linear reconstruction is monotone at time t n slope_type=1 Minmod slope limiting is never truly second order!

The moncen slope Initial reconstructed states must be bounded by the initial average states. u i+1 u i u i-1 Extreme values must be bounded by the initial average states. x slope_type=2

The superbee slope Predicted states must be bounded by the initial average states. TVD constraint is preserved by the Riemann solver. The Courant factor now enters the slope definition.

The ultrabee slope Final complete solution must be bounded by the initial average states. Use the final state to compute the slope limiter. Upwind Total Variation constraint. Strict Total Variation preserving limiter.

Summary: slope limiters first order slope_type=0 minmod moncen slope_type=1 slope_type=2 superbee ultrabee

Summary: slope limiters The previous analysis is valid only for the advection equation. Non-linear systems: the wave speeds depend on the initial states (L and R). u i+1 u i x MinMod is the only monotone slope limiter before the Riemann solver! Superbee and Ultrabee must not be used for non-linear systems! MonCen can be used, but with care: the characteristics tracing method.

2D slope limiter for unsplit MUSCL scheme If 1D slope limiters are used, 2D schemes may become oscillatory. Predicted states involve 2D neighboring cells. 2D moncen slope: corner values must be bounded by the 8 neighboring initial values. slope_type=3 Surech, Ambady, Positivity Preserving Schemes in Multidimensions, SIAM J. Sci. Comput., 22, 1184-1198 (2000).

Sod test with HLLC first order slope_type=0 128 cells

Sod test with HLLC and MinMod slope_type=1 128 cells

Sod test with HLLC and MonCen slope_type=2 128 cells

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: 4th order scheme, ENO, 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.