The Center for Astrophysical Thermonuclear Flashes FLASH Hydrodynamics Jonathan Dursi (CITA), Alan Calder (FLASH) B. Fryxell, T. Linde, A. Mignone, G. Wiers Many others! Mar 23, 2005 An Advanced Simulation and Computing (ASC) Academic Strategic Alliances Program (ASAP) Center at
What does the FLASH Centre Study?
What does the FLASH Centre Study? 1992, Bill Waterson
The Three Kablooies Supernovae Ia Courtesy Hubble STScI Novae X ray burst Courtesy Chandra X Ray Observatory Courtesy Hubble STScI
FLASH Hydrodynamics Original FLASH problems: Classical Novae X-Ray Burst Type Ia Supernovae FLASH hydrodynamics solvers chosen for flows which are Highly compressible Complex EOS Solvers selected that are Robust Well-tested
FLASH Hydrodynamics FLASH contains a number of hydrodynamic solvers (and can plug in more) Approach of existing solvers: Operator Split Finite Volume Godunov Central Explicit Dimensionally Split `Hydro' physics includes Classical hydro MHD (Special) Relativistic Hydro
Hydrodynamics: Equations Solved Operator Split
Operator Splitting If have operators H for hydro and B for burning, second-order accurate in time, H 1/2 B 1/2 B 1/2 H 1/2 also second-order. Strang splitting (1968) Much easier (possible!) to have general multi-physics code Higher-order time accuracy very hard
Finite Difference Solution discretized as point values Build approximation to PDEs based on divided difference approximation to differentials Can be made very highorder Higher accuracy Faster convergence to PDEs as go to lower resolution
Finite Volume Solution discretized on control volumes Value is cell average For conservation eqn, t Q F Q =0 equation is updated as fluxes through interfaces. FU FL FR FD Guaranteed conservation!
Finite Volume Slightly harder to make very high order Conservation may mean more than naïve order of accuracy Shock speed wrong with non-conservative discretization; can alter simulation results That one converges faster with resolution not a good indicator of accuracy with a given resolution
Explicit New value of solution requires only value at neighboring cells at current time Very efficient Parallelizes very well Very accurate for high- speed flows Limits timestep Neighbors must contain all regions causally connected within that timestep Extremely distant `neighbors' not so efficient, doesn't parallelize so well Or small timestep
Guard Cells Because only require current values at neighboring cells, communication with other processors / boundaries done through guardcells Values outside computational domain filled in to represent boundary conditions Larger block size better communication / computation ratio
Directional Splitting Like Operator Splitting If have operators X for xhydro and Y for y-hydro, second-order accurate in time, X 1/2 Y 1/2 Y 1/2 X 1/2 also second-order accurate. Directional sweeps Vectorizable Easier, smaller codes Higher-order time, space accuracy much harder Can be problematic for some areas (flame instability)
Solving the Euler Equations Low-order simple methods of solving the Euler equations result in substantial numerical diffusion of flow features. Higher-order simple methods can result in numerical dispersion of flow features 1st order upwind 2nd order Lax-Wendroff Particularly a problem around sharp features But hydro equations allow discontinuities (shocks, contacts) LeVeque, http://www.amath.washington.edu/~claw/
Discretizing the Euler Equations Artificial `viscosity' can stabilize (not eliminate) oscillations, but not general solution 2nd order Lax-Wendroff Great improvement can be made by limiting slopes implied by methods disallow new min/max Best handling of shocks numerical methods that `know' detailed structure of hydro solutions LeVeque, http://www.amath.washington.edu/~claw/
Riemann Problem Simplest non-trivial hydrodynamics problem. `Shock tube' Infinite 1d domain Initial conditions discontinuous at x=0,t=0 What happens?
Hydrodynamic Waves Consider 1d Euler equation in nonconservative form `Eigenvalue' problem Look at structure of matrix Jumps in density and nothing else propagate with fluid Coherent variations in pressure, density propagate with the sound speed w/rt the fluid Any jump can be expressed in terms of `r' basis
Riemann Problem Waves propagate outwards from discontinuity Wave strengths given by decomposition of jump Problem completely solved once know states on interior of Riemann fan. Self-similar Fewer Riemann invariants across each wave than state variables. Need jump conditions
Riemann Problem Jump conditions come from how neighboring characteristics behave Characteristics pile up Shock Shock jump condition completes problem. Characteristics diverge Rarefaction wave Rarefaction `jump' condition completes problem. Can have RCR SCS RCS/SCR
Riemann Solvers Given invariants, jump conditions, can find an intermediate state which connects left, right states In (p,u) plane, intersection of two curves gives (p*,u*), because contact discontinuity supports arbitrary density jump Even for ideal gas, correct solution an iterative process Dai & Woodward, (1994)
Godunov Method Conservative, FV method Assumes data piecewise constant in cells Solves Riemann problem at cell interfaces Riemann problem used to calculate fluxes.
Approximate Riemann Solvers Riemann solver is expensive, particularly for general EOS Detailed structure unnecessary for fluxes Several approximate approaches: Two-shock HLL(E) Roe Dai & Woodward, (1994)
Two shock solver Assumes shocks on both sides If a wave is a rarefaction wave, ends up using shock jump across a rarefaction Poor for determining structure, not bad for determining fluxes Main Riemann solver for hydro in FLASH
HLL Solver Assumes only one interior state Uses estimates for minimum and maximum wave speeds Very fast, less accurate Diffusive (esp. contact discontinuities) Results very robust Used only in very specific situations where diffusion is a benefit (near-aligned shock instability)
Roe Solver Not used in FLASH classical hydro Instead of approximate solution to exact problem, exact solution to approximate problem Linearized Riemann problem Linearized around weighted average (`Roe average') of left and right states Inexpensive, works very well except in extremely strong shocks/rarefactions
Higher Order Godunov Methods Godunov method very robust, but expensive, and not very accurate (diffusive) Only 1st order accurate! (piecewise constant) Can achieve much higher accuracy for little extra cost by using higher-order (conservative) interpolants
Higher Order Godunov Methods Diffusive vs. Dispersive Cost of higher-order interpolants is that they behave badly near discontinuities Unphysical max/min oscillations Slopes must be limited to prevent new extrema. Reduces to Godunov at shocks
PPM Piecewise Parabolic Method Defines an upwinded parabola at each point with correct cell average Very aggressive `flattening' to enforce a very strict measure of monotonicity Also flattens at contact discontinuities Long history in compressible astrophysical flows
PPM Parabolas improve space accuracy To improve time accuracy, must modify how left,right states are chosen for Riemann solve Estimate characteristic speeds in cell and find region which is connected to interface in timestep Average over reconstruction in that region Those are left, right states for Riemann solve
PPM Construct interpolant Detect shocks, contacts Flatten for monotonicity Construct left, right states for Riemann Solve Find domain of dependance of interface over timestep Integrate reconstruction polynomial over doman of dependance Perform Riemann Solve Update cells with Fluxes from Riemann Solve States, Riemann solve similar cost
Central Methods PPM Very good shock resolution Very expensive If resolution of shock less important, many nonriemann-solve methods available Recent series of methods based on very simple approach Lax-Friedrichs with staggered mesh Avoids solving detailed Riemann problem by notionally integrating over entire Riemann fan. Nessyahu & Tadmor (1990)
Central Methods Only very recently that examined extending this to higher order Same caveats must limit slopes but results in very simple, inexpensive scheme Very accurate, smears out shocks more than Riemann-based methods Nessyahu & Tadmor (1990)
Central Methods Staggered mesh not very handy Method very diffusive at small timesteps Kurganov began developing methods with fixed mesh Fiendishly difficult derivations Result in very simple semidiscrete schemes Kurganov & Tadmor (2000) Building the accurate interpolation much more complicated than the actual flux calculation/update
Central Methods 2nd order dimensionally split Kurganov method implemented in FLASH Not yet integrated with other operators because of different update approach Accurate, fast Kurganov & Tadmor (2000)
Relativistic Hydro SR hydrodynamics has same structure as classical hydro Equations shown: 1d Cartesian co-ordinates Minkowski space Lab frame Ideal gas Conversion between primitive and conserved variables much more complicated: Lorentz factor
Relativistic Hydro Riemann problem maintains same structure as classical hydro 3 waves shocks, rarefactions Biggest change: tangential velocity now plays dynamic role in 1d Riemann solution Couples through W Makes full Riemann solution more difficult, much more costly, even for ideal gas http://relativity.livingreviews.org/articles/lrr-2003-7/
Relativistic Hydro FLASH implements a PPM for SR hydro Based on Marti & Muller (1995), Mignone & Bodo (2003) Riemann Solvers: Two-shock HLLE Requires ideal gas Time scaled to `c', so limits interaction with other physics modules for now Mignone & Bodo (2003)
MHD FLASH implements a MHD solver of the same general nature as non-magnetic hydro Explicit Dimensionally Split Finite Volume Godunov-type method
MHD Method by Powell et al (1999) Use MHD equations in slightly unusual form Symmetrized (Godunov) Gallilean invariance 8 eqns, 8 waves with non-zero velocities One is the `div-b' wave; divb advected with the flow. Cannot pile up in one place and begin to grow
MHD 8 waves: u +/- C, where C is speed of: Alfven wave (incompressible magnetic wave) Fast magnetosonic wave (compressible, magnetic field & pressure coupled) Slow magnetosonic wave (ditto) u ( two waves ) Contact discontinuity Magnetic flux jump Makes Riemann solver much harder
MHD Riemann solver much harder with 8 waves Even with only ideal gas Roe-type Riemann solver (requires ideal gas) Harder to compute a unique `Roe average', but same approach can be used
Divergence Constraint Difficult to maintain divergence constraint on adaptive mesh This method doesn't attempt to `divb' wave prevents pileup Divergence cleaning every user-settable number of timesteps Diffusion Projection (via multigrid solver)
FLASH hydrodynamcs Questions?