Part 1: Numerical Modeling for Compressible Plasma Flows Dongwook Lee Applied Mathematics & Statistics University of California, Santa Cruz AMS 280C Seminar October 17, 2014 MIRA, BG/Q, Argonne National Lab 49,152 nodes, 786,432 cores FLASH Simulation of a 3D Core-collapse Supernova Courtesy of S. Couch
Scientific Goal To develop solution accurate, efficient, and stable numerical algorithms for a wide range of astrophysical regimes using high-performance computer simulations Type Ia SN Mira, BG/Q at ALCF Core Collapse SN
First Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Preliminaries Astrophysical flows are highly compressible for many purposes, involving shocks and discontinuities. It is fair to say that 99% of the readily observed universe is in plasma state. The interstellar medium, stars, and exotic compact objects are all composed of or surrounded by ionized matter. Knowledge of compressible plasmas and their relevant numerical treatments are essential to understand the universe. The gained knowledge extends to understand high-energy-density physics (a.k.a., laboratory astrophysics).
Plasma A plasma is a macroscopically electrically neutral substance containing many interacting free electrons and ions which exhibit collective behavior due to the long-range Coulomb forces. The interactions of a magnetic field with a plasma play crucial roles in plasma physics.
Plasma Our Sun emits a highly conducting tenuous plasma, called solar wind, a consequence of the hot corona (1~2 million K). Solar wind Ongoing researches for safe controlled thermonuclear fusion energies such as tokomak, z-pinch, laser inertial confinement fusion, are all based on plasma physics. tokomak
Two Ways to Model Plasma Kinetic Theory (microscopic): a. adopts a kinetic description with distribution functions f to represent particles, governed by the Boltzmann equations in the phase space and time: b. fully kinetic, PIC; gyrokinetic Fluid Description (macroscopic): a. multi-fluid theory (e.g., two-fluid considers electrons and ions) b. single-fluid theory (MHD treats plasma as a whole)
MHD Flow Regimes Given the generalized Ohm s law: For typical large-scale, low-frequency plasma condition, one can approximate: (1) ideal MHD: (2) resistive MHD: (3) Hall MHD: (4) BBT MHD: (see the next talk!)
Divergence-free B-fields One very important property in MHD is to satisfy: r B =0 Consider the Lorentz force per unit volume: If the solenoidal constraint holds, then the Lorentz force becomes conservative: Otherwise, the Lorentz force is not conservative and MHD equations violate conservation laws!
Compressible Solvers Godunov-type formulation, based on solving Riemann problems (RP), is a very good numerical method to model compressible flows. Godunov-type techniques are based on the finite volume (FV) scheme, which describes PDEs in integral forms. The integral form of FV discretization allows weak solutions (i.e., discontinuous solutions such as shocks and discontinuities), and hence automatically satisfies the conservation property. Note, in general, the Lax equivalence theorem (LET: convergence iff stability + consistency) is only valid for smooth solutions, meaning that, not all numerical schemes (e.g., FD, FE) could correctly approximate weak solutions. But LET holds for FV.
Second Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Scientific Tasks Science Problem (IC, BC, ODE/PDE) Simulator (code, computer) Results (Validation, verification, analysis)
1. Mathematical Models Hydrodynamics (gas dynamics) @ @t + r ( v) =0 mass eqn @ v @t @ E @t + r ( vv)+rp = g momentum eqn + r [( E + P )v] = v g total energy eqn @ @t + r [( + P )v] v rp =0 Equation of State P =( 1) E = + 1 2 v 2
2. Mathematical Models Magnetohydrodynamics (MHD) @ @t @ v @t @ E @t + r ( v) =0 mass eqn + r ( vv BB)+rP = g + r momentum eqn + r [v( E + P ) B(v B)] = g v + r (v + rt )+r (B ( r B)) total energy eqn @B @t + r (vb Bv) = r ( r B) induction eqn E = v2 2 + + B2 2 P = p + B2 2 Equation of State = µ[(rv)+(rv) T 2 (r v)i] 3 viscosity solenodidal constraint r B =0
Divergence-free B-fields Different numerical MHD schemes depending on how you control r B =0condition. This is a big research field in MHD. Ignore! Erroneous plasma transport orthogonal to B-field (Brackbill and Barnes, 1980); Eigenvector degeneracy (Crockett et al., 2005) 8-wave (Powell et al., 1999) Projection (Brackbill and Barnes, 1980; Ryu et al., 1995; Balsara 1998; Crockett et al., 2005) Hyperbolic/parabolic cleaning (Dedner et al., 2002) Constrained-transport (Evans and Hawely, 1988; Balsara and Spicer, 1999; Gardiner and Stone, 2005; Lee and Deane, 2009)
3. Mathematical Models HEDP: Separate energy eqns for ion, electron, radiation ( 3-temperature, or 3T ) @ @t ( ion)+r ( ion v)+p ion r v = c v,ele ei (T ele T ion ) ion energy @ @t ( ele)+r ( ele v)+p ele r v = c v,ele ei (T ion T ele ) r q ele + Q abs Q emis + Q las electron energy @ @t ( rad)+r ( rad v)+p rad r v = r q rad Q abs + Q emis radiation energy tot = ion + ele + rad P tot,t ion,t ele,t rad = EoS(, ion, ele, rad ) 3T EoS Compare 3T with a simple 1T EoS! @ @t ( tot)+r ( tot v)+p tot r v =0 P tot = EoS(, tot ) T ion = T ele = T rad, or T ele = T ion,t rad =0
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Finite Volume Formulations Integral form of PDE: Z xi+1/2 x i 1/2 u(x, t n+1 )dx Z xi+1/2 x i 1/2 u(x, t n )dx = Z tn+1 t n f(u(x i 1/2,t))dt Z tn+1 t n f(u(x i+1/2,t))dt Volume averaged, cell-centered quantity & time averaged flux: U n i = 1 x Z xi+1/2 and x i 1/2 u(x, t n )dx F n i 1/2 = 1 t Finite wave speed in hyperbolic system: Z tn+1 t n f(u(x i 1/2,t))dt F n i 1/2 = F(U n i 1,U n i ) * High-order reconstruction in space & time * Riemann problem at each cell-interface, i-1/2 General discrete difference equation in conservation form in 1D: U n+1 i = U n i t x (F n i+1/2 F n i 1/2 )
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
High-Order Polynomial Reconstruction FOG PLM PPM Godunov s order-barrier theorem (1959) Monotonicity-preserving advection schemes are at most first-order! (Oh no ) Only true for linear PDE theory (YES!) High-order polynomial schemes became available using non-linear slope limiters (70 s and 80 s: Boris, van Leer, Zalesak, Colella, Harten, Shu, Engquist, etc) Can t avoid oscillations completely (non-tvd) Instability grows (numerical INSTABILITY!)
Low vs. High order Reconstructions
Traditional High-Order Schemes Traditional approaches to get Nth high-order schemes take (N-1)th degree polynomial for interpolation/reconstruction only for normal direction (e.g., PLM, PPM, ENO, WENO, etc) with monotonicity controls (e.g., slope limiters, artificial viscosity) High-order in FV is tricky (when compared to FD) volume-averaged quantities (quadrature rules) preserving conservation w/o losing accuracy higher the order, larger the stencil high-order temporal update (ODE solvers, e.g., RK3, RK4, etc.) 2D stencil for 2nd order PLM 2D stencil for 3rd order PPM
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Riemann Problem & Godunov Method The Riemann problem: Two cases: PDEs: U t + AU x =0, 1 <x<1,t>0 ( IC : U(x, t = 0) = U 0 U L if x<0, (x) = if x>0. U R Shock solution Rarefaction solution
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
A Discrete World of FV U(x, t n ) x i 1 x i x i+1
A Discrete World of FV piecewise polynomial reconstruction on each cell u(x i,t n )=P i (x),x2 (x i 1/2,x i 1/2 ) x i 1 x i x i+1 u R = P i (x i+1/2 ) u L = P i+1 (x i+1/2 )
A Discrete World of FV At each interface we solve a RP and obtain F i+1/2 x i 1 x i x i+1
A Discrete World of FV We are ready to advance our solution in time and get new volume-averaged states U n+1 i = U n i t x (F i+1/2 F i 1/2 )
Various Reconstructions Low-order 1st scheme 1st on 400 cells 2nd 3rd High-order scheme 5th 1st on 800 cells 200 cells
Various Reconstructions
Various Reconstructions PLM PPM WENO-5 WENO-Z PLM+Roe
Various Riemann Solvers HLLC: 3rd most diffusive Roe: least diffusive LLF: most diffusive HLL: 2nd most diffusive
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Multidimensional Formulation 2D discrete difference equation in conservation form: U n+1 i,j = U n i,j t x (F n i+1/2,j F n i 1/2,j ) t y (Gn i,j+1/2 G n i,j 1/2 ) Two different approaches: directionally split formulation update each spatial direction separately, easy to implement, robust always good? directionally unsplit formulation update both spatial directions at the same time, harder to implement you gain extra from what you pay for
Unsplit FV Formulation 2D discrete difference equation in conservation form: U n+1 i,j = U n i,j (a) 1st order donor cell t x (F i+1/2,j n Fi n 1/2,j ) t y (Gn i,j+1/2 G n i,j 1/2 ) (b) 2nd order corner-transport-upwind (CTU) (i, j) (i, j) U n+1 i,j = U n i,j u t x [U n i,j U n i 1,j] v t y [U i,j n Ui,j n 1] U n+1 i,j + t2 2 = U n i,j n u v x y (U i,j n Ui,j n 1) + v v y y (U i,j n Ui n 1,j) u t x [U i,j n Ui n v t 1,j] y [U i,j n Ui,j n 1] vy (U i n 1,j Ui n 1,j 1) v y (U n i,j 1 U n i 1,j 1) o Extra cost for corner coupling!
Unsplit FV Formulation 2D discrete difference equation in conservation form: U n+1 i,j = U n i,j (a) 1st order donor cell t x (F i+1/2,j n Fi n 1/2,j ) t y (Gn i,j+1/2 G n i,j 1/2 ) (b) 2nd order corner-transport-upwind (CTU) (i, j) (i, j) u t x + v t u t y apple 1 max x, v t y Smaller stability region apple 1 Gain: Extended stability region
Unsplit vs. Split Split PPM Single-mode RT instability (Almgren et al. ApJ, 2010) Split solver: High-wavenumber instabilities grow due to experiencing high compression and expansion in each directional sweep Unsplit PPM Unsplit solver: High-wavenumber instabilities are suppressed and do not grow For MHD, it is more crucial to use unsplit in order to preserve divergence-free solenoidal constraint (Lee & Deane, 2009; Lee, 2013): r B = @B x @x + @B y @y + @B z @z =0
Unsplit vs. Split unsplit PPM split PPM
Unsplit vs. Split: MHD @B z @t + B z @u @x B x @w @x w @B x @x + u@b z @x B z @v @y B y @w @y w @B y @y + v @B z @y =0 w( B x x + B y y )=wr B Situation is more critical in MHD (Gardiner & Stone, 2005; Lee & Deane, 2009) Split solver: Simply fails to preserve the solenoidal constraint of magnetic fields because one cannot balance the cancellation from separate sweeps of x and y. The error will increase Bz in time if w is not zero. Unsplit solver: Dynamics of in-plane magnetic fields satisfy the divergence-free constraint IF correctly implemented (Lee & Deane, 2009; Lee 2013)
Third Episode 1. Plasma & MHD 2. Governing Equations 3. Finite Volume MHD (a) Reconstruction (b) Riemann Problem (c) Unsplit vs. Split (d) divb=0
Constrained Transport MHD Solves induction equations on staggered grid (duality relation should be mentioned with the picture) early time Div B = 0 to machine accuracy Finite volume Godunov algorithms gives electric fields at face centers later time 1. arithmetic averaging (Balsara & Spicer, 1999) 2. plane-parallel, grid-aligned reconstruction (Gardiner & Stone, 2005) Bad oscillations! 3. high-order interpolation (Lee & Deane, 2009) B n+1 x,i+1/2,j = Bn x,i+1/2,j t n E n+1/2 y z,i+1/2,j+1/2 o E n+1/2 z,i+1/2,j 1/2, B n+1 y,i,j+1/2 = Bn y,i,j+1/2 t n x E n+1/2 z,i+1/2,j+1/2 + En+1/2 z,i 1/2,j+1/2 o.
1. Arithmetic averaging CT Consider u>0; v 0 Weakly magnetized field loop advection test Gardiner & Stone (2005); Lee & Deane (2009); Lee (2013) for small angle advection Balsara & Spicer, 1999, JCP
2. Contact-Mode-Upwind CT Lack of numerical dissipations generate unphysical instabilities! Gardiner & Stone, JCP, 2005
Consider u>0; v 0 3. Improved Upwind CT only upwind! Lee, JCP, 2013
3. Improved Upwind CT Important to advect magnetized flow in a stable manner Upwind-biased scheme improves numerical stability in FL advection (Lee, JCP, 2013)
Summary Proper numerical schemes need to be carefully chosen for different set of physics for accuracy, efficiency and stability. Do not blindly believe numerics unless you know what you do with them. Different numerical approaches can give very different results on a given problem.