The C-MUSCL Scheme, a High Order Finite Volume Method with Constrained Transport for Astrophysical MHD
Total Page:16
File Type:pdf, Size:1020Kb
Master's Thesis The C-MUSCL Scheme, a High Order Finite Volume Method with Constrained Transport for astrophysical MHD Lukas Knosp September 23, 2019 Supervisor: Associate Professor Dr. Ralf Kissmann Institute for Astro- and Particle Physics Contents Statutory Declaration4 I. Astrophysical Plasmas6 1. From Kinetic Theory to Magnetohydrodynamics7 2. Equations and Notations 12 2.1. Euler System . 13 2.1.1. Alternative Formulation . 13 2.2. Induction System . 14 II. Numerical Methods 16 3. Introduction 17 4. Theory of Hyperbolic Conservation Laws 19 4.1. Linear Conservation Laws . 19 4.1.1. Linear Scalar Advection . 19 4.1.2. Linear Hyperbolic Systems . 22 4.2. Non-linear Conservation Laws . 25 4.2.1. Burgers' Equation . 26 4.2.2. Non-linear Systems . 30 5. Finite Volume Methods 33 5.1. Conservative Schemes . 33 5.2. Godunov'sMethod .............................. 36 5.3. The HLL Approximate Riemann Solver . 38 5.4. High-Order Godunov-type Methods . 39 5.4.1. Reconstruction . 40 5.4.2. Semi-Discrete Schemes . 43 5.4.3. MUSCL-Hancock-Method . 44 5.5. Finite Volume Methods in Three Dimensions . 47 5.5.1. Conservative Schemes . 47 5.5.2. High-Order Schemes in Multiple Space Dimensions . 48 2 6. Treatment of the Magnetic Field 50 6.1. Constrained Transport . 51 6.1.1. High-Order Variation . 54 6.2. C-MUSCL Scheme . 55 III. Implementation 58 7. The CRONOS-Code 59 7.1. CodeStructure ................................ 59 7.2. Adapting the Code . 61 8. Verification & Results 63 8.1. One-dimensional Tests . 63 8.1.1. SodShock-Tube............................ 63 8.1.2. Brio&WuShock-Tube. 64 8.2. Multidimensional Tests . 66 8.2.1. Sedov Explosion . 67 8.2.2. Orszag-Tang Vortex . 68 8.3. Verification of the Order . 68 8.3.1. Order of the HD Solver . 68 8.3.2. Order of the MHD Solver . 71 8.4. Performance Analysis . 71 Summary 74 3 Statutory Declaration Leopold-Franzens-Universit¨at Innsbruck Statutory Declaration (Eidesstattliche Erkl¨arung) I declare that I have authored this thesis independently, that I have not used other than the declared sources / resources, and that I have explicitly marked all material which has been quoted either literally or by content from the used sources. I also agree with the archiving of this Master's thesis. Date Signature 4 Introduction The majority of astrophysical objects in the observed universe consists of matter in the plasma state. In this state, the temperature is so high that atoms and molecules break up into their constituent particles, negatively charged electrons and positively charged ions, and form an ionised gas. As such, these gas particles can both generate and interact with electromagnetic fields resulting in a variety of complex phenomena. In astrophysics, these phenomena include turbulence and particle acceleration processes in places such as the atmospheres of stars [1{3], the interstellar medium [4{6] and accretion disks around black holes [7{9]. As astrophysical experiments usually impose high costs and the ability to obtain relevant data can be very limited, computational modelling has become a very important component of astrophysical research. Among the different mathematical descriptions, astrophysical plasmas are typically modelled as magneto- hydrodynamical (MHD) fluids, as the underlying set of partial differential equations can be efficiently solved by numerical methods. In doing so, a popular approach is to use numerical methods based on finite volumes for the hydrodynamical (HD) components and the Constrained Transport (CT) algorithm for the magnetic field components. In the last decades, a variety of different methods have been proposed to further improve the accuracy of these schemes. In recent years, attempts have been made to extend the well-known MUSCL-Hancock method, originally designed for the HD equations, to the full set of MHD equations. In this thesis, we present the C-MUSCL scheme, an extension of the MUSCL-Hancock method based on CT. The aim of this thesis is to analyse the computational performance of the C-MUSCL scheme. Therefore, we implement the scheme in the framework of the Cronos [10] code, verify its implementation through a series of test problems and compare it to the numerical scheme previously implemented in Cronos. The plan of the thesis is as follows: In the first part (Part I) we derive the equations of MHD and study some properties of the equations. Afterwards, we present in detail the numerical schemes for the governing equations (Part II). Then in Part III, we discuss all the peculiarities of our implementation in Cronos, verify the implementation by running a series of numerical tests and compare the performance to the previously implemented scheme. 5 Part I. Astrophysical Plasmas 6 1. From Kinetic Theory to Magnetohydrodynamics Astrophysical systems mainly consist of ionised matter. In such systems, the motion of the particles is affected by electromagnetic fields. These electromagnetic fields create a flow of charged particles, which in turn induce currents that alter the electromagnetic field itself. In principle, the motion of the charged particles can be determined by New- ton's second law. Yet the large number of particles together with the lack of knowledge of the initial conditions for each individual particle, make this approach infeasible. In addition, the state of every individual particle is usually not of interest. Instead, one is interested in measurable, macroscopic quantities. Thus, to derive the equations of motion, one is following a statistical approach, where the positions and momenta of in- dividual particles are replaced by a distribution function. The most fundamental equation to describe the time evolution of such a N-particle distribution function F in phase space is the Liouville equation. For a single particle species, it is given by N @F X + q_ · r F +p _ · r F = 0; (1.1) @t i qi i pi i=1 where F = F (t; q1; : : : ; qN ; p1; : : : ; pN ) denotes the probability of finding particle 1 at po- sition q1 with momentum p1, particle 2 at position q2 with momentum p2;::: and particle N at position qN with momentum pN . Here, qi and pi are 3-dimensional variables and rqi and rqi are the Nabla operators with respect to the position and momentum vari- ables of the ith particle, respectively. Equation (1.1) is too complicated to solve, as it contains the full state of the system, i.e., the information on all particles in a single equation. One way to reduce the complexity is to introduce the k-particle function (or reduced density function) F (k) with Z Z (k) (N) F (t; q1; : : : ; qk; p1; : : : ; pk) = dqk+1 ::: dqN dpk+1 ::: dpN F (t; q; p) (1.2) that only considers the first k particle states. After integrating (1.1) over the remaining (N − k) positions and momenta, we obtain a system of partial differential equations, where the evolution of the k-particle function F (k) depends on the (k + 1)-particle func- tion F (k+1). This resulting hierarchy of equations contains an infinite number of equa- 7 1. From Kinetic Theory to Magnetohydrodynamics tions. Thus, a common simplification is to truncate the hierarchy using some physically motivated assumptions. For the one-particle-function (1) F (t; q1; p1) ≡ f(t; x; p) (1.3) the result is called Boltzmann equation and can be written in the following form @f @f + v · rf + Fext · rpf = : (1.4) @t @t coll In this context, v denotes the velocity of the particle and Fext the external forces, whereas the right-hand side of the equation contains the two-particle-distribution and describes internal forces, i.e. the effect of collisions between particles. The Boltzmann equation (1.4) describes particle systems, where only uncorrelated collisions between two particles are taken into account. Under this assumption, no nett momentum is exchanged and therefore the collision term vanishes when integrating over momentum space. Furthermore, if the system is in thermodynamic equilibrium, which is a reason- able assumption for many astrophysical systems, the velocities of the particles v follow a Maxwell-Boltzmann distribution with some mean velocity u. Then the particle's ve- locity is given by u plus a statistical component w representing random motion, i.e. v = u + w. If the microscopic behaviour is negligible, i.e. the number of particles is sufficiently high and their mean free path is much smaller than the system size, and the only internal forces are short-range interactions between particles (or otherwise denoted as external forces), then the system of particles can be modelled as a continuum: Each infinitesimal volume element - called fluid element - contains a finite number of particles which on average move with mean velocity u. If this is the case, we refer to the particle system as a fluid. By taking the first three velocity moments of the Boltzmann equation (1.4), we obtain the following system of equations (see [11] or [12] for more details) @ρ + r · (ρu) = 0 (1.5a) @t @(ρu) + r · (ρuu) + rp = f (1.5b) @t ext @e + r · ((e + p) u) = u · f (1.5c) @t ext 8 1. From Kinetic Theory to Magnetohydrodynamics for the macroscopic quantities Z mass density: ρ = m f(x; p; t) dp (1.6a) Z momentum density: ρu = mv f(x; p; t) dp (1.6b) 1 total energy density: e = ρu2 + e (1.6c) 2 th where eth denotes the thermal energy density given by Z jwj 2 e = m f(x; p; t) dp : (1.7) th 2 Equations (1.5a)-(1.5c) are called Euler equations and describe the dynamics of the macroscopic fluids quantities (1.6a)-(1.6c), where effects related to higher velocity mo- ments such as heat transfer and friction between particles (viscosity) are neglected.