Master’s Thesis

The C-MUSCL Scheme, a High Order 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 ...... 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˙ · ∇ F +p ˙ · ∇ 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

∇qi and ∇qi 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 · ∇f + Fext · ∇pf = . (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)

∂ρ + ∇ · (ρu) = 0 (1.5a) ∂t ∂(ρu) + ∇ · (ρuu) + ∇p = f (1.5b) ∂t ext ∂e + ∇ · ((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 |w| 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. They represent the conservation of mass, momentum, and energy. In addition to the equations (1.5a)-(1.5c), a further relation, known as Equation of State, is needed that connects the pressure p to the dynamic variables, i.e. eth = eth(p, ρ), and closes the system.

The term on the right-hand side of the momentum equation (1.5b) represents external force densities, given by Z fext = Fext f(x, p, t) dp . (1.8)

In the case of an ionised gas or plasma, this term also includes electromagnetic forces between the moving particles. In the absence of other external forces, the force term is then determined by the Lorentz force and reads

fext = ρ q(E + u × B) (1.9) where q denotes the charge of the particle. As a result, the motion of the fluid is coupled to the dynamics of the electric field E and magnetic field B via Maxwell’s equations

ρ ∇ · E = c (1.10a) ε0 ∇ · B = 0 (1.10b) ∂B ∇ × E = − (1.10c) ∂t ∂E ∇ × B = µ j + µ ε (1.10d) 0 c 0 0 ∂t where the electromagnetic fields are induced by the electric charge density ρc and current density jc of the fluid itself.

9 1. From Kinetic Theory to Magnetohydrodynamics

Until now, it has been assumed that the particles are identical, i.e. each particle has the same mass m and charge q. However, usually a plasma consists of electrons and ions. Hence, we get a set of equations for each particle species. As a further simplification, we do not distinguish between different particle species, denoted by α. We only consider the sum of the corresponding mass- and momentum densities, i.e. ρα and ραuα, and denote them with ρ and ρu, respectively X X ρ = ρα, ρu = ραuα (1.11) α α and use the same temperature for all species.

Naturally, the charged particles align in such a way, that the net force exerted on the particles is zero. In such a configuration small fluctuations in the charge density result in a counter motion of particles and, consequently, the particles oscillate around the resulting equilibrium position. Thus from a macroscopic point of view, the net charge in the fluid can be considered as zero. In this approximation, the particles are only affected by magnetic forces. For non-relativistic flows, the dynamics of the magnetic field is dominated by the current and therefore the displacement current ∂E/∂t in equation (1.10d) can be ignored. When the conductivity of the plasma is extremely high, which is the case for many astrophysical plasmas, the resistivity of the plasma is negligible and as a result, we obtain the equations of ideal magneto-hydrodynamics (MHD) (see e.g. [13] for a more detailed derivation)

∂ρ + ∇ · (ρu) = 0 (1.12a) ∂t ∂(ρu) 1 + ∇ · (ρuu) + ∇p + B × (∇ × B) = fext (1.12b) ∂t µ0 ∂B = −∇ × E = ∇ × (u × B) (1.12c) ∂t ∂e  B2  1  + ∇ · e + + p u − (u · B)B = u · fext (1.12d) ∂t 2µ0 µ0

The equations (1.12) are a system of 8 coupled partial differential equations (PDEs) for the dynamic variables (ρ, ρu, B, e), where ρ denotes the mass density, ρu = (ρux, ρuy, ρuz) the vector momentum density, B = (Bx,By,Bz) the magnetic induction and e the total energy density with

2 1 2 B e = ρu + eth + . (1.13) 2 2µ0 In the following, we assume that the plasma can be described as an ideal gas, where the equation of state is simply given by p e = , (1.14) th γ − 1

10 1. From Kinetic Theory to Magnetohydrodynamics with the adiabatic index γ. Additional, external (non-electromagnetic) forces are de- noted by fext and are for the sake of simplicity omitted in this study.

The equations of ideal MHD (1.12) describe the motion of a highly conductive plasma in a non-relativistic scenario, where effects like heat transfer and viscosity are neglected. Together with other physically motivated assumptions, these equations provide a simpli- fied model for a highly complex system. However, for many astrophysical systems [1–9] these simplification are indeed justified: Whenever the focus is on large scale plasma dynamics, the equations provide results in the same quality as the Boltzmann equation (1.4) while being computationally far less expensive. Because a mesoscopic description via the Boltzmann equation employs a six-dimensional phase space while the dynamic variables in the macroscopic fluid description are functions solely of the three spatial dimensions. The reduced dimensionality allows a higher resolution and therefore better accuracy when dealing with large scale flows and is still able to resolve small scale phe- nomena, while at the same time neglecting diffusive effects.

Before we discuss the methods to solve these equations numerically, we study some properties of the underlying equations. As already mentioned, the equations of ideal MHD describe the conservation of certain quantities. Deriving numerical schemes for these conservation laws will be the main focus of the following part. For as the remaining part of this chapter is concerned, we will provide all necessary formulas and definitions that are needed to explicitly apply the numerical schemes to the ideal MHD equations.

11 2. Equations and Notations

Conservation laws are mathematically expressed as continuity equations, which describe the transport of the conserved quantity. In one spatial dimension, such a continuity equation can be written in the following form

ut(x, t) + Fx(u(x, t)) = 0, (2.1) where the vector u is the density of the conserved quantity and F(u(x, t)) describes the transport or flux of these quantities. Equation (2.1) relates the time derivate (denoted by the subscript t) of dynamic quantities ut with the rate of change in space of its flux Fx. A more intuitive understanding is provided by the integral form of the conservation law. Therefore, we integrate equation (2.1) between any two points x1, x2 in space and obtain

∂ Z x2 u(x, t) dx = F(u(x1, t)) − F(u(x2, t)). (2.2) ∂t x1 As each component of u represents the density of some conserved quantity, equation (2.2) simply states that the total quantity (i.e. the mass) inside the volume [x1, x2] only changes due to the flux through the boundaries x1, x2 of the volume. To put it differ- ently, since conservation of e.g. mass states that particles can be neither created nor destroyed, all particles must either remain in the volume or leave it through the left or right boundary points. Therefore, the rate of change of the number of particles inside the volume is given by the net flux difference at the boundaries.

The concepts can be easily extended to multiple space dimensions, where the conserva- tion law reads

ut + ∇ · Ftot(u) = 0 . (2.3) In applications it is sometimes more convenient to treat each direction individually and therefore split up the total flux Ftot component-wise according to

ut + Fx(u) + Gy(u) + Hz(u) = 0, (2.4) where F, G, H are the fluxes in x, y, z-directions, respectively.

For as the equations of ideal MHD (1.12) are concerned, the system of equations can be broken into two sub-systems. The first one involves the fluid-related variables, referred to as Euler system, whereas the second one involves the magnetic induction and is thus called induction system.

12 2. Equations and Notations

2.1. Euler System

The first sub-system describes the dynamics of the fluid-related, conserved quantities

 ρ  u =  ρu  , (2.5) e where the physical fluxes F, G, H in (2.4) are given by

  ρux  ρu2 + p + B2/2 − B2   x x  F =  ρuxuy − BxBy  , (2.6)    ρuxuz − BxBz  2 (e + B /2 + p) ux − (B · u)Bx

  ρuy  ρuxuy − BxBy    G =  ρu2 + p + B2/2 − B2  , (2.7)  y y   ρuyuz − ByBz  2 (e + B /2 + p) uy − (B · u)By

  ρuz  ρuxuz − BxBz    H =  ρuyuz − ByBz  . (2.8)  2 2 2   ρuz + p + B /2 − Bz  2 (e + B /2 + p) uz − (B · u)Bz

2.1.1. Alternative Formulation Instead of using the momentum density ρu as the dynamic variable in the momentum equation (1.12b), we can use the product rule together with (1.12a) and obtain an equation for the time evolution of the mean fluid velocity u. Similarly, the energy equation (1.12d) for the total energy density e can be expressed in terms of the pressure p via the equation of state (1.14). As a result, we obtain a system of equations in quasi-linear form

Wt + A(W)Wx + B(W)Wy + C(W)Wz = SLorentz (2.9) for the dynamic variables

 ρ  W =  u  , (2.10) p where the coefficient matrices A(W), B(W), C(W) are given by

13 2. Equations and Notations

  ux ρ 0 0 0  0 ux 0 0 1/ρ    A(W) =  0 0 ux 0 0  , (2.11)    0 0 0 ux 0  2 0 ρcs 0 0 ux   uy 0 ρ 0 0  0 uy 0 0 0    B(W) =  0 0 uy 0 1/ρ  , (2.12)    0 0 0 uy 0  2 0 ρcs 0 0 uy   uz 0 0 ρ 0  0 uz 0 0 0    C(W) =  0 0 uz 0 0  (2.13)    0 0 0 uz 1/ρ  2 0 ρcs 0 0 uz and cs denotes the speed of sound rγp c = . (2.14) s ρ In this case, the Lorentz force term on the right hand-side is given as

 0  1 S = (∇ × B) × B . (2.15) Lorentz ρ   0 The dynamic variables (2.10) are called primitive variables or physical variables and are more commonly used for practical applications than the conservative variables u (2.5). In fact, these dynamical variables can be directly observed in nature, however result in a non-conservative formulation of the evolution equation.

Whether one choose conservative or primitive variables, the underlying equations are called Euler system, as for the case B = 0 they reduce to the Euler equations of gas dynamics.

2.2. Induction System

The remaining equation, the induction equation (1.12c), is then often referred to as induction system. In principle, the induction equation can be transformed into a similar form as (2.3) by using the identity

14 2. Equations and Notations

∇ × (u × B) = u(∇ · B) − B(∇ · u) − (u · ∇)B + (B · ∇)u = = −∇ · (uB − Bu). (2.16)

Then, the induction equation can be expressed as ∂B + ∇ · (uB − Bu) = 0 (2.17) ∂t and thus, can be treated numerically in the exact same way as the Euler system. In contrast to equation (1.12c), the above formulation does not explicitly imply that the magnetic field is divergence free (1.10b), which is the mathematical translation of the non-existence of magnetic monopoles. Therefore, the constraint

∇ · B = 0 (2.18) has to be enforces additionally and hence, justifies the separation into two subsystems, as constraint (6.1) solely has to be fulfilled for the magnetic field variables and not for the hydrodynamic variables.

15 Part II.

Numerical Methods

16 3. Introduction

So far, we have seen that astrophysical plasmas can be described as magnetohydro- dynamical fluids, where the underlying equations (1.12) can be written as a system of conservation laws. Furthermore, the related physical fluxes are essentially nonlin- ear functions of the dynamic variables. This non-linearity of the flux-functions implies mathematical difficulties that have to be dealt with both theoretically and numerically, such as the possibility to develop discontinuities even for initially smooth functions. In general, these types of partial differential equations (PDEs) can be numerically solved in various ways. Among the most popular ones are finite difference and finite volume schemes. In the first, the continuous variables are discretised as point values on a nu- merical grid. Then, if the solution is sufficiently smooth, the derivatives appearing in the PDE can be approximated as finite differences resulting in a system of linear equa- tions. In practice, however, discontinuities arise, e.g., when modelling rapid changes (explosions) or even as a result of continuous initial data (shock waves) when the con- servation law is non-linear. Since discontinuous functions are not differentiable, finite difference approximations fail to produce valid results and thus are not suited for these type of equations. In contrast to finite differences, finite volume methods are based on the integral form of the conservation law, where one divides the domain into a discrete set of cells, called finite volumes. The integral form is a more fundamental form of the differential equation providing a weaker solution concept that also includes discontinu- ous functions. Therefore, finite volume methods are a natural choice for shock-capturing schemes for non-linear conservation laws.

Historically, many of the fundamental ideas for finite volume schemes were first devel- oped for the special case of aerodynamics, i.e. the Euler equations. During the Cold War, the development was then further enhanced by the Space Race between the Soviet Union and the United States and their need to engineer high-speed vehicles for space- flights [14]. As a result, a broad theory of shock-capturing, high-resolution methods emerged that was quite well understood at the time. With the increasing computational performance and the wish to study highly complex astrophysical systems, the extension of these schemes to the system of ideal MHD has been a matter of intensive research for the last couple of decades.

Since the ideal MHD equations can be broken down into two sub-systems (see Chapter 2), we follow a similar structure for this part and sub-divide it into two chapters: The first chapter is dedicated to the study of numerical methods for conservation laws, i.e. in case of ideal MHD can be applied to the Euler system, but is kept as general as possible. Therefore, a solid theoretical understanding of the underlying equations is fundamental

17 3. Introduction to develop the numerical methods. Hence, an additional, whole chapter is dedicated to the theoretical study of non-linear conservation laws. Then in the second chapter, we study numerical methods explicitly for the induction system of ideal MHD. Specifically, we focus on how to enforce the solenoidal constraint

∇ · B = 0 (3.1) in every time step to avoid artificial forces from unphysical magnetic monopoles.

18 4. Theory of Hyperbolic Conservation Laws

Before we address the numerical solution techniques for non-linear conservation laws of the form

ut + ∇ · F(u) = 0 (4.1) we will first study some elementary properties and solution strategies of such conser- vation laws. As a matter of fact, there is no general way to solve a conservation law with arbitrary flux function F. Instead, the focus of this chapter is to solve so-called Riemann problems, which are a special type of initial value problem, where the initial conditions consist of a piecewise constant function with a single discontinuity. We will see in the next chapter that these Riemann problems arise in the derivation of finite volume schemes, and thus their solution strategy plays an important role in the develop- ment of finite volume methods. The goal is to understand the typical time evolution of a Riemann problem, rather than derive an explicit, analytical solution. It turns out that this knowledge is sufficient for the discussion of finite volume methods, since Riemann problems in finite volume methods are mostly not solved exactly, but rather approxi- mately. However, when deriving these approximate solutions to a Riemann problem, the solution structure is essential. Apart from that, it is impossible to find a closed expres- sion for a general flux function. Whether an analytical solution to the Riemann problem is available, strongly depends on the underlying system. For example, there is no ana- lytical solution to the Riemann problem for MHD at hand, while for hydrodynamics it is.

We start our discussion with the simplest conservation law, the advection equation in one spatial dimension. Gradually increasing the complexity, we will extend the linear scalar case to vector functions and systems of linear equations in the next step. Then, we will discuss scalar non-linear conservation laws, especially to address the formation of shock-waves. Ultimately, we will study systems of non-linear conservation laws by the example of the Euler equations.

4.1. Linear Conservation Laws

4.1.1. Linear Scalar Advection The advection equation is one of the simplest examples of a conservation law. However, the typically applied solution technique is fundamental to solve general conservation

19 4. Theory of Hyperbolic Conservation Laws laws. The advection equation is the special case of Eq. (4.1), where we consider a linear flux function F = a·u(x, t) and a = const. Considering one spatial dimension, we obtain the scalar case, i.e. variation solely in x-direction

ut + aux = 0 (4.2) where the scalar quantity u is advected, i.e. translated, with constant speed a. The general solution of this equation can be easily determined. For this, it can be easily verified by differentiation, that any smooth function of the form

u(x, t) = u(x − at) (4.3) is a solution of the advection equation (4.2). Thus, given some initial conditions

u(x, 0) = u0(x) (4.4) we obtain the unique solution

u(x, t) = u0(x − at). (4.5)

If the initial condition u0(x) is smooth, we call the differential equation together with the initial data a Cauchy problem. In contrast, in the Riemann problem, where the initial condition is given by two piecewise constant states separated by a single discontinuity, for example ( 1 x < 0 u0(x) = (4.6) 0 x > 0 we argue based on physical intuition that the solution of Eq. (4.2) is ( 1 x − at < 0 u(x, t) = u0(x − at) = (4.7) 0 x − at > 0 even if the initial condition is not smooth. However, since u0(x) is not continuous at x = 0 and therefore not differentiable, we cannot verify the solution by inserting it in equation (4.2). Thus, we need a more suitable definition for the solution concept. This is provided by the so-called methods of characteristics.

Methods of Characteristics Note that solution (4.5) is constant along any curve in the x − t plane with x − at = const. This is a fundamental property of the solution of (homogeneous) hyperbolic PDEs and can be understood by looking at the PDE as a geometrical object. The idea of solving hyperbolic PDEs using geometrical arguments is the essential building block of the method of characteristics. In a few words, the solution strategy of the method of characteristics is to reduce the underlying PDE to an ordinary differential equation (ODE) on specific curves, called characteristic curves. Let us denote a curve in the x − t

20 4. Theory of Hyperbolic Conservation Laws

t

x = x0 + at

t = 0 x x0

Figure 4.1.: Characteristic curves of the homogeneous advection equation with propagation speed a. Each point in the x − t plane is passed by a characteristic curve that originates on the x-axis, where the initial condition at time t = 0 is given. plane as Γ(s) = (x(s), t(s)), where s is some parametrisation. On any such curve Γ(s) that satisfies

x0(s) = a, t0(s) = 1 (4.8) it can be shown by using the chain rule for the derivative of u and inserting PDE (4.2), that the solution u is constant along the curve Γ(s):

d ∂u dx ∂u dt ∂u ∂u (4.2) u(Γ(s)) = + = a + = 0 . (4.9) ds ∂x ds ∂t ds ∂x ∂t d Such a curve with ds u(Γ(s)) = 0 is called a characteristic curve. The parametrisation of these curves is obtained by integrating the ODEs (4.8) that result from the coefficients in front of the derivatives in the PDE. For example, in the case of the advection equation (4.2), the characteristic curves are straight, parallel lines with slope 1/a parametrised by (see Figure 4.1)

x(t) = x0 + at. (4.10) The unique solution at any point (x, t) is then obtained by tracing back the charac- teristic that passes through (x, t) to the point (x0, 0), where u is given by the initial conditions u(x0, 0) = u0(x0). Then, we make use of the solution being constant along the characteristic curve and we obtain the solution by using the parametrisation of the characteristic (4.10):

u(x, t) = u(x0, 0) = u(x − at, 0) = u0(x − at). (4.11)

Remark that the quantity u at the point (x0, 0), i.e. the value u0(x0), travels with fi- nite propagation speed a to the point (x, t) along the characteristic. Because of this

21 4. Theory of Hyperbolic Conservation Laws behaviour, information cannot propagate faster than the characteristic velocity a. Cer- tainly, this also needs to be true in the discrete case. As a consequence, the choice of time steps in the time discretisation will be restricted by the characteristic velocity and will set an upper limit for the step size.

Note that the characteristic curves are well defined, even if the initial value u0 is discon- tinuous. If the solution is not sufficiently often differentiable (i.e. a classical solution) but the method of characteristics is still well defined, we call the resulting u(x, t) a solu- tion in the sense of the method of characteristics. This is a generalisation of the classical solution concept. It is also worth mentioning, that in the derivation of the solution of the advection equation (4.2), we made use of the solution being constant along the char- acteristic. This is only valid for homogeneous hyperbolic PDEs, where no source-terms occur.

Riemann Problem As we have seen, the method of characteristics provides a more general solution concept since no smoothness of the initial condition is required. That allows us to study problems with discontinuous initial data, where especially problems with a piecewise constant initial function play an important role in the theory of finite volume methods. In this context, a conservation law, i.e. the advection equation (4.2), together with piecewise constant initial data is called Riemann problem ( uL x < 0 u0(x) = (4.12) uR x > 0 .

Here uL, uR denote constant values that are separated by a discontinuity at x = 0, as shown in Fig. 4.2.

From the previous discussion about the solution structure of the advection equation we expect the initial condition to be propagated with constant speed a ( uL x − at < 0 u(x, t) = u0(x − at) = (4.13) uR x − at > 0 . In terms of the methods of characteristics, one characteristic curve is of major impor- tance, namely the one that separates the constant initial states. In other words, the characteristic with x = at contains the information about the position of the disconti- nuity and is the only characteristic curve across which the solution changes, as Fig. 4.3 illustrates.

4.1.2. Linear Hyperbolic Systems In the previous section we discussed the scalar advection equation, where the dynamic, scalar quantity is translated with a constant velocity. The propagation of information

22 4. Theory of Hyperbolic Conservation Laws

u0(x)

uL

uR

x x = 0

Figure 4.2.: Typical piecewise constant initial data of a Riemann problem where uL > uR. The constant values uL, uR are separated by a discontinuity at x = 0.

t

x − at = 0 x − at < 0

uL x − at > 0

uR

x 0

Figure 4.3.: Characteristic curves of the Riemann problem of the advection equation. On the left-hand side of the characteristic x = at the solution u(x, t) is equal to uL, on the right-hand side it is equal to uR, respectively.

23 4. Theory of Hyperbolic Conservation Laws along the characteristic curve with characteristic velocity is a fundamental concept of hyperbolic PDEs and can be easily extended to linear systems of the form

ut + Aux = 0, (4.14) where u is a vector and A matrix with constant coefficients. More specific, let u be a n-dimensional vector u ∈ Rn and A a diagonalizable n × n matrix with constant coefficients and real eigenvalues. Under these assumptions, the linear conservation law of the form (4.14) is called hyperbolic. In addition, let us denote the ordered eigenvalues of A as λi such that

λ1 ≤ λ2 ≤ · · · ≤ λn (4.15) and R the matrix whose columns are the right eigenvectors ri of A

R = [r1, . . . , rn] with Ari = λiri . (4.16) As a next step, the linear system can be expressed in a new set of dependent variables w, called of the characteristic variables, via the transformation

w = R−1u . (4.17) Then, the linear system in terms of the new variables w reads

wt + Λwx = 0 , (4.18) where Λ is the diagonal matrix with the sorted eigenvalues

−1 Λ = R AR = diag(λ1, . . . , λn) (4.19) The transformation (4.17) into the characteristic variables decouples the linear system into n independent advection equations with the eigenvalues λi as the characteristic velocities, i.e. the i-th component reads ∂ ∂ w + λ w = 0 . (4.20) ∂t i i ∂x i Thus, to solve the initial value problem, the initial conditions

u(x, 0) = u(0)(x) (4.21) are transformed into characteristic form w(0)(x) via

w(0)(x) = R−1u(0)(x) , (4.22) where the solution of the individual components is easy to determine

(0) wi(x, t) = wi (x − λit) . (4.23)

24 4. Theory of Hyperbolic Conservation Laws

t t

λi (x, t) λ2

λ1 λn

λ1 λn

λi

x x 0 x − λ1t x − λit x − λnt (a) (b)

Figure 4.4.: Characteristics of an n-dimensional linear system with distinct eigenvalues λi: (a) From each point in the x−t plane start n characteristic curves with characteristic velocities λi. (b) The solution at any given point (x, t) depends on the initial values at n different points on the x-axis.

The general solution is obtained by transforming back into the original variables, which is equivalent to express the solution u(x, t) in the eigenbasis of the system

n n X X (0) u(x, t) = Rw(x, t) = wi(x, t) ri = wi (x − λit) ri (4.24) i=1 i=1 Hence, for any point (x, t) in the x − t plane, the solution u(x, t) depends on the n points where the i-th characteristic intersects with the x-axis and can be interpreted as a superposition of n independent waves wi(x, t)ri, that are advected with speed λi (see Fig. 4.4).

4.2. Non-linear Conservation Laws

The previous analysis of linear conservation laws has shown that their solution structure is quite simple and easy to determine, as the dynamic quantities are translated uniformly at every point in space. As a consequence, the different characteristic curves related to an eigenvalue λi are straight, parallel lines in the x − t plane. In the non-linear case, however, due to the non-linear dependence of the flux on the dynamic quantities, the quantities might be advected with a different velocity at each point in space (but are still conserved). Hence, the structure of the solution will be distorted as it evolves, and shock waves can be formed. In terms of the characteristic curves this means, that the characteristics are not parallel anymore. Consequently, characteristic curves relating to the same eigenvalue can intersect with each other and thus the solution is not unique at the intersection point, i.e. a discontinuity. Certainly, at the discontinuity the solution is not differentiable and therefore does not fulfil the requirement of a classic solution of a PDE, i.e. being sufficiently differentiable. However, for conservation laws the governing

25 4. Theory of Hyperbolic Conservation Laws

PDEs can be derived from the more fundamental integral form, where discontinuous functions are still valid solutions. The occurrence of discontinuities such as shock waves even for initially smooth data makes their understanding a fundamental building block when studying non-linear conservation laws. As in the previous section, we will begin with the one-dimensional, scalar case, in particular studying Burgers’ equation, a simple test equation that illustrates the key features of non-linear conservation laws: Wave- steeping and shock formation. After an intensive study, we finally extend the analysis to systems of non-linear conservation, the class our governing equations belong to.

4.2.1. Burgers’ Equation The Burgers’ equation is a prototype of a non-linear conservation law

ut + f(u)x = 0 (4.25) that is used to study basic principles pertaining to non-linear advection phenomena. The scalar, one-dimensional inviscid Burgers’ equation reads

1  u + ∂ u2 = 0 , (4.26) t x 2 1 2 where the flux function f(u) = 2 u is quadratic. In contrast to the advection equation (4.2), where the conserved quantity u is advected with constant velocity a, the quantity u here is translated with velocity u itself. This essential non-linearity also occurs in the momentum equation of the ideal MHD equations (1.12b), where the velocity or momen- tum is advected in the fluid with the fluids’ velocity describing convection processes in fluids and gases.

To apply the methods of characteristics to a non-linear conservation law, we explicitely carry out the differentiation of the flux function in (4.25), which results in the quasi-linear form of the conservation law

0 ut + f (u)ux = 0 . (4.27) Equ. (4.27) is then expressed in a similar form as the advection equation (4.2). Hence, we can apply the method of characteristics to Equ. (4.27) as described in Section 4.1.1. The characteristic curves are the solutions of the differential equation

x0(s) = f 0(u(x(s), t)) . (4.28) It turns out, for any conservation law (4.25) the solution is constant along the the characteristic curves, which are straight lines in the x − t plane (see e.g. [14] for more details)

0 x(t) = x0 + f (u(x(t), t))t (4.29) In case of Burgers’ equation we have

26 4. Theory of Hyperbolic Conservation Laws

u0(x)

(a)

x

t

(b)

x 1 2 3 4 5 6 x0 x0 x0 x0 x0 x0

Figure 4.5.: Characteristic curves (b) of Burger’s equation with smooth initial conditions (a): i The slope of the characteristic is the inverse value of u0, i.e. 1/u0(x0)

f 0(u(x(t), t)) = u(x(t), t) (4.30) and, since the solution is constant along the characteristic, we obtain for the following parametrization of the curve

x(t) = x0 + u0(x0)t . (4.31) We see that in fact, for nonlinear conservation laws (4.25) the characteristic velocities λ are not constant anymore, but depend on the solution u itself, as seen in Equ. (4.28). Consequently, the slope of the characteristic curves depends on the initial value u0(x0) and, thus, the characteristics are not parallel anymore. As a result, characteristics can intersect with each other. At the intersection point, the solution is not unique anymore, i.e. discontinuous, as the value of the solution is given by the values on the intersecting characteristics. Fig. 4.5 shows the characteristic curves of Burger’s equation together with the initial data.

Thus, discontinuous solutions play a fundamental role in the analysis of non-linear con- servation laws, not only as a modelling assumption for discontinuous initial conditions, but also as they can evolve from initially smooth functions. Therefore, a weaker solution concept has to be introduced.

27 4. Theory of Hyperbolic Conservation Laws

Integral Form By applying the methods of characteristics, we can understand, why smooth initial conditions can develop discontinuities. In order to obtain the solution across the discon- tinuity, we need a weaker solution concept that is not restricted to smooth functions. For this purpose, we integrate the conservation law over an arbitrary space-time interval [xa, xe] × [ta, te]

Z te Z xe ut + f(u)x dx dt = 0 (4.32) ta xa After carrying out one integration explicitly, we obtain the integral form of the conser- vation law

Z xe Z te u(x, te) − u(x, ta) dx + f(u(xe, t)) − f(u(xa, t)) dt = 0 (4.33) xa ta

Then, any function u(x, t) that solves (4.33) for arbitrary xa < xe and ta < te is called a weak solution of (4.25). A mathematical precise formulation involves the theory of distributions, see e.g [15] for more details. In fact, in finite volume schemes the updating formula is based on the integral form. Apparently, we need to evaluate the flux at the cell boundaries, where the solution is not unique. To obtain the solution across a discontinuity, the Rankine-Hugoniot jump conditions relate the separated constant states.

Rankine-Hugoniot Jump Conditions In Section 4.1.1, where we have studied the Riemann problem for the advection equation, we have seen that the conserved quantity u is uniformly translated with constant velocity a. In particular, the discontinuity separating the two constant states is translated with characteristic velocity a as well. The corresponding characteristic curve is particularly relevant, since it is the only characteristic across which the value of the solution changes, see again Fig. 4.3. In contrast, the propagating speed of the quantity u in the non- linear case may differ at any point in space. Consequently, to obtain the solution of the Riemann problem for a non-linear conservation law, one needs to determine the propagation speed s of the discontinuity. Therefore, we use the integral form of the conservation law over a sufficiently small space-time interval [x, x + ∆x] × [t, t + ∆t], where the speed of the discontinuity s is essentially constant (see Fig. 4.6)

Z x+∆x Z t+∆t u(x, t + ∆t) − u(x, t) dx + f(u(x + ∆x, t)) − f(u(x, t)) dt = 0 . (4.34) x t Since the solution u is constant along each edge, carrying out the integrals simply yields

∆x uL − ∆x uR = ∆t f(uL) − ∆t f(uR). (4.35)

28 4. Theory of Hyperbolic Conservation Laws

x = st t + ∆t

uL

uR

t x x + ∆x

Figure 4.6.: Infinitesimal space-time interval to derive the Rankine-Hugoniot jump conditions: Above the characteristic x = st describing the movement of the discontinuity, the value of solution is uL, below the characteristic curve it is uR, respectively.

Then, by using ∆x = s∆t, we obtain the so-called Rankine-Hugoniot jump condition for the speed s of the discontinuity

s (uL − uR) = f(uL) − f(uR) . (4.36) As a result, every function ( u x − st < 0 u(x, t) = L (4.37) uR x − st > 0, which satisfies the jump conditions (4.36) is a weak solution of the non-linear conserva- tion law (4.25).

In the present case, we obtain the shock speed s by dividing through the scalar difference (uL − uR). In the case of Burger’s equation, the Rankine-Hugoniot condition yields 1 s = 2 (uL + uR) and defines a weak solution u(x, t) of the Riemann problem. In fact, any similarity function ( u x/t < s u(x, t) = L (4.38) uR x/t > s with s given by (4.36) is a weak solution of the Riemann problem. As a consequence, the weak solution to a conservation law is not necessarily unique. Therefore, we have to decide which one is the physically correct one. To see this, we distinguish between two cases.

First, assume uL ≥ uR for a convex flux function f(u). Then, the characteristics on the right-hand side of x = st are steeper than those on the left-hand side. Consequently, the characteristics of both sides collide with each other and form a shock wave. To

29 4. Theory of Hyperbolic Conservation Laws justify, whether this solution is the physically correct one, additional criteria have to be imposed, such as introducing an artificial entropy [16] that must be a nondecreasing function similar to the thermodynamic entropy or introducing a viscous source term defining a parabolic equation with a unique solution that converges in the limit to the weak solution of the conservation law (method of vanishing-viscosity [16]). In either way, it can be shown, that the shock-wave (4.37) with (4.36) is the physically correct solution to the Riemann problem with uL ≥ uR.

Then, consider uL < uR and again a convex flux function f(u). In this case, the char- acteristics divergence from the discontinuity with x = st. The shock is no longer stable under perturbations. The physically correct and stable solution forexpansive initial data uL < uR is the rarefraction wave  u x < u t  L L u(x, t) = x/t uLt < x < uRt (4.39)  uR uRt < x . In contrast to the shock wave (4.37), the rarefraction wave (4.39) shows a smooth tran- sition between the two constant states.

4.2.2. Non-linear Systems To solve the Riemann problem for systems of nonlinear conservation laws, we combine the concepts introduced in the previous sections. A system of nonlinear conservation laws

ut + Fx(u) = 0 (4.40) can be written in quasi-linear form

ut + A(u)u = 0 (4.41) where A(u) denotes the Jacobian matrix of the flux function F(u). For the non-linear conservation law (4.40) to be solvable, the eigenvalues λi of the Jacobian matrix of the flux function F(u) have to be real and distinct, similar to the linear system. Then, the same methods as for the linear systems can be applied, with the difference that the eigenvalues depend on the solution u itself. Hence, for an n-dimensional non-linear conservation law, each point in the x − t plane is the starting point of n characteristic curves, one corresponding to each eigenvalue of the Jacobian matrix. As a result, the solution to the Riemann problem of an n-dimensional, non-linear conservation law, con- sists of n + 1 different constant states separated by n waves. The resulting structure is often referred to as Riemann fan. The waves appearing in the Riemann fan determine the type of transition between the two adjected constant states. For linear systems with constant coefficients, we found each wave to be a discontinuity with the corresponding

30 4. Theory of Hyperbolic Conservation Laws eigenvalue as characteristic speed of the wave. Then, across each wave, the Rankine- Hugoniot jump conditions are applied to find the solution. In contrast, for non-linear conservation laws there are more possible types of waves that connect two neighbouring states. The type of waves that occur in the solution to the Riemann problem strongly depend on the underlying conservation law. For example, for the one-dimensional Euler equations, where the dynamic variables in (4.40) are given by (2.5) and the flux by (2.6) with B = 0, the eigenvalues are

λ1 = ux − cs, λ2 = ux, λ3 = ux + cs, (4.42) where cs denotes the speed of sound (2.14). As a result, the solution to the Riemann problem consists of four different, constant states (uL, u∗L, u∗R, uR), where uL, uR are given by the initial conditions and u∗L, u∗R have to be determined. These constant states are separated by three waves indicated by the corresponding eigenvalues (4.42). The possible wave types are either shock waves, (discontinuities in all components), con- tact discontinuities (discontinuity in a single component) or rarefraction waves (smooth, linear transition between the states). It turns out, that the outer two waves are either shock waves or rarefraction waves, while the middle one is always a contact discontinuity with a jump in density. Figure 4.7 shows one possibly solution structure.

t ux ux − cs ux + cs

u∗L u∗R

uL uR x 0

Figure 4.7.: Possible structure of the Riemann fan for the one-dimensional Euler equations: The right wave, indicated by the solid line, is a shock wave, the middle wave (dashed line) is a contact discontinuity and the left one (filled) is a rarefraction wave.

In contrast, the solution structure to the Riemann problem in practical applications, e.g., for the multi-dimensional Euler equations or the full ideal MHD equations, is more complicated, as some of the eigenvalues are not strictly distinct, but degenerated. As a result, the intermediate waves of the Riemann fan are not easily identified with a particular wave family. The study of the internal structure of the MHD Riemann fan is currently an active field of research and goes beyond the scope of this work (for further reading, see e.g. [17]). Apart from that, we will see, that we do not necessarily need

31 4. Theory of Hyperbolic Conservation Laws to study the full structure of the Riemann problem. We will present in Section 5.3 an approximation to the true solution of the Riemann problem, so-called approximate Riemann solvers, in which the internal structure of the Riemann fan is ignored.

32 5. Finite Volume Methods

The ideal MHD equations are a system of non-linear conservation laws. One of the chal- lenges in developing numerical methods for non-linear conservation laws is the correct reproduction of the solution across discontinuities. Many numerical methods cannot resolve these sharp, discontinuous changes in value correctly. Instead, the transition is smeared out or physically wrong, unstable solutions are produced. One class of numer- ical methods that provide stable, shock-capturing solutions are finite volume schemes. The idea of finite volume schemes is to sub-divide the computational domain into small control volumes, referred to as cells. Integration of the conservation law over such a cell translates to an evolution equation of cell-averages, that represents the integral formu- lation of the conservation law: The rate of change of the cell-averaged values is given by flux differences at the cell interfaces. Hence, these cell averages are the natural choice of variables in a finite volume scheme. In this context, these schemes are naturally called conservative schemes, as they mimic the behaviour of the conservation law. Understand- ing their basic properties is fundamental to developed specific schemes and therefore, are discussed in the first section of this chapter. In order to obtain a specific update formula for the cell-averaged variables, one needs to compute the time-averages of the intercell fluxes that include the solution for future times for which we would like to compute it. Hence, some approximations have to be made. Godunov first proposed in [18] to assume that the exact solution is constant within a cell. Then, for a sufficiently small time step, the solution at the cell interfaces can be computed analytically by solving a Riemann problem defined by two adjacent cell averages and the time-averaged intercell fluxes can be evaluated exactly. Numerical schemes based on this approach are often called Godunov schemes. Due to the rather poor approximation of the true solution within a cell, higher order versions of Godunov’s method have been developed that yield more accurate approximations. Developing stable high-order methods will be the topic of the remaining chapter. In doing so, the basic principles of the numerical methods will be shown for one spatial dimension. At the end, the ideas will be extended to multiple space dimension.

5.1. Conservative Schemes

As a first step, we replace the domain of the conservation law, say the interval [a, b], by a finite set of values, i.e. we discretise the continuous interval with N + 1 point values xi given by

a = x0 , x1, x2, . . . , xN , xN+1 = b . (5.1)

33 5. Finite Volume Methods

The idea of finite volume methods is based on subdividing the computational domain into smaller volumes Ci (the finite volumes) referred to as cells. In one spatial dimension, these cells are N intervals given by

Ci = [x 1 , x 1 ] (5.2) i− 2 i+ 2 where the centre of the cells are located at positions xi. For simplicity we will assume a uniform grid, i.e. the length ∆x = xi+1/2−xi−1/2 of every interval is constant. Integrating the conservation law

ut + F(u)x = 0 (5.3) over a grid cell Ci and introducing the cell average u¯i(t) of the dynamic variables as the volume integral over a cell divided by its volume, i.e.

xi+1/2 1 Z 1 Z u¯ (t) = u(x, t) = u(x, t) dx, (5.4) i ∆x ∆x Ci xi−1/2 we can express the conservation law in terms of the cell average, i.e.

d F(u(x , t)) − F(u(x , t)) u¯ (t) = i−1/2 i+1/2 . (5.5) dt i ∆x

As a result, the dynamical variables u(x, t) are represented by the cell averages u¯i(t), where their evolution is given by (5.5). Considering a discrete set of timesteps tn+1 = tn + ∆t with stepsize ∆t, we integrate (5.5) in time from tn to tn+1 analytically and we obtain

tn+1 Z F(u(x , t)) − F(u(x , t)) u¯ (t ) = u¯ (t ) − i+1/2 i−1/2 dt . (5.6) i n+1 i n ∆x tn

The resulting scheme to obtain u¯i(tn+1) from u¯i(tn) is still an analytical expression without any mathematical approximations and thus exact. However, in general we cannot evaluate the time integral of the fluxes on the right hand-side exactly, as they implicitly depend on the cell averages for later times that we would like to compute. n+1 Therefore, we try to find suitable approximation u¯i to the cell average at time tn+1

xi+1/2 1 Z u¯n+1 ≈ u¯ (t ) = u(x, t ) dx . (5.7) i i n+1 ∆x n+1 xi−1/2 by approximating the time-averaged fluxes

t Zn+1 n 1 Fi+ 1 ≈ F(u(xi+1/2, t)) dt . (5.8) 2 ∆t tn

34 5. Finite Volume Methods

n+1 u¯i tn+1

n n F 1 F 1 i− 2 i+ 2

tn n n n u¯i−1 u¯i u¯i+1

n Figure 5.1.: Conservative finite volume scheme for updating the cell average ui by the time- averaged fluxes at the cell edges.

In doing so, we obtain an explicit numerical scheme for the cell averages

n+1 n ∆t  n n  u¯i = u¯i − Fi+ 1 − Fi− 1 . (5.9) ∆x 2 2 By using cell averages, the numerical scheme (5.9) mimics the physical character of the conservation law. In fact, it ensures that the total quantity related to the density u¯ (i.e. the mass of density u) is conserved across the whole computational domain [a, b] and only changes due to the fluxes at the boundaries of the domain. The reason is that PN n the discrete sum i=1 u¯i ∆x approximates the integral form of the conservation law over the entire spatial domain [a, b]. Therefore, one might expect that approximative discontinuous solutions converge to a true weak solution of the conservation law as the grid is refined1, i.e. ∆t, ∆x → 0. As a consequence, numerical schemes of the form (5.9) are often called conservative schemes. Figure 5.1 illustrates the updating process of a conservative scheme in the x − t plane.

Note that the accuracy of the conservative scheme strongly depends on the quality of the approximation of time-averaged intercell fluxes (5.8). For non-linear conservation laws in particular, the solution at the cell interfaces, where the fluxes are evaluated, cannot be computed analytically in general. However, by assuming the exact solution to be spatially constant in each cell, adjacent cell averages define a Riemann problem at every cell interface and as we have seen in Chapter 4, these Riemann problems can be solved exactly even for nonlinear systems. Consequently, the time-averaged intercell fluxes can be computed exactly as well. A conservative scheme, where the exact solution is assumed to be spatially constant in each cell, is called Godunov’s method.

1In addition, we need to ensure that the conservative scheme is consistent, then Lax and Wendroff [19] showed that this is indeed true.

35 5. Finite Volume Methods

n n F 1 F 1 i− 2 i+ 2

n u¯i n u¯i+1 n u¯i−1

xi−1 xi xi+1

Figure 5.2.: Riemann problem in Godunov’s method: As the solution is assumed to be n constant within a cell, the time-averaged intercell fluxes F 1 can be computed analytically i+ 2 n n by solving the Riemann problem defined by the two adjacent cell averages u¯i , u¯i+1.

5.2. Godunov’s Method

The computation of the numerical solution in a conservative scheme (5.9) require an approximation to the time-averaged intercell fluxes (5.8). Therefore, Godunov [18] first proposed to assume that the solution u(x, t) is spatially constant in each cell. Thus, n in each cell u(x, tn) coincide with the the cell averages u¯i and therefore, no averaging process (5.4) is necessary. As a result, there is a jump in the value of u at each cell interface, where the fluxes need to be evaluated, see Figure 5.2.

In order to obtain the solution u(xi+1/2, t) at the position of cell interface xi+1/2, one has to solve a Riemann problem, where the initial condition is defined by the two neigh- n n bouring cell averages u¯i , u¯i+1. Since the solution u(x, t) is assumed to be constant in each cell, the characteristics passing the cell interface at xi+1/2 are parallel lines in the x−t plane even for non-linear conservation laws. If the time step ∆t is sufficiently small, these characteristics originate solely from the two adjacent cells Ci and Ci+1 and thus, the solution u(xi+1/2, t) in the time interval [tn, tn+1], over which the flux is averaged, n n depends only on the values u¯i and u¯i+1. In this case, the Riemann problems for each cell are independent of each other and can be studied individually. By assuming a constant solution in space for a sufficient small time step, the fluxes at the cell interfaces not only n n just depend on the two values u¯i and u¯i+1, but are also constant in time. Thus, the time average (5.8) reduces to

n F 1 ≈ F(u(xi+ 1 , tn)) . (5.10) i+ 2 2 n+1 The solution to the Riemann problem at time tn can be used to compute u¯i at the next time step, where the length of the time step ∆t is restricted by the CFL condition [20] ∆t max|λj| ≤ Ccfl (5.11) j ∆x that ensures information propagates at the correct physical speeds and no interaction

36 5. Finite Volume Methods

tn+1

tn+1

tn n n n tn n n n u¯i−1 u¯i u¯i+1 u¯i−1 u¯i u¯i+1 (a) (b)

Figure 5.3.: Interpretation of the CFL condition for the scalar advection equation: (a) If the time step is small enough, the true intercell flux at xi+1/2 only depends on the values of the n neighbouring cell u¯i (b) For a larger time step, the flux depends on more distant values as n well, i.e.u ¯i−1. between neighbouring Riemann problems takes place, as Figure 5.3 illustrates for the scalar advection equation. For Godunov’s method Ccfl = 1 and the λi are the character- istic velocities which are given by the eigenvalues of the flux Jacobian f 0(u) (see [14]). If the time step is too large, the physical flux depends on cell-averages in more distant cells (see Fig. 5.3). Therefore, the physical fluxes are not represented correctly by the numerical fluxes (5.10) and consequently produces invalid, unstable solutions.

To apply Godunov’s scheme, one has to solve the following Riemann problem at every cell interface xi+1/2

ut + F(u)x = 0 (5.12)

( n u¯i , x < xi+ 1 u (x) = 2 (5.13) 0 n u¯ , x > x 1 i+1 i+ 2 in order to calculate the numerical fluxes (5.10) and then update the solution via (5.9). In principle, one can use the concepts introduced in Chapter 4 to solve the Riemann problem for the Euler equations analytically. While for hydrodynamics we could cal- culate the exact solution, a computation that is numerically rather expensive, there is no general solution to the Riemann problem for MHD available. After all, we are only interested in the solution at a certain position, so there is no need to calculate the entire structure of the Riemann problem considering this is a very ambitious (and computationally expensive) task to do. Especially for multidimensional problems, the number of Riemann problems to be solved every time step increases rapidly with the number of cells. Thus, the evaluation of the Riemann problem should be as efficient as possible. Hence, a wide variety of approximate Riemann solvers were proposed, which use simplified solutions that are computationally less expensive and are still able to produce similarly good results in many cases. There are many approximate Riemann

37 5. Finite Volume Methods solvers available. Here, we study the approximate Riemann solver of Harten, Lax and van Leer [21] known as the HLL solver.

5.3. The HLL Approximate Riemann Solver

Godunov schemes require to solve a Riemann problem at every cell interface. As a result, the amount of Riemann problems to be solved in applications is huge. Therefore, these Riemann solvers should be as efficient as possible. In addition, as very little informa- tion of the actual solution to the Riemann problem is needed to evaluate the Godunov fluxes, one can speed up the process by using approximative solution. For that matter, approximative Riemann solvers such as the HLL solver have been proposed.

In Section 4.2.2 we have seen that the solution of the Riemann fan usually consists of multiple states each of them separated by a wave associated with an eigenvalue of the flux’ Jacobian. The essential idea of the HLL solver is to ignore the internal structure of the Riemann fan and assume a single constant state between the fastest left- and right-handed wave speeds. The resulting configuration consists of three states separated by to waves. Application of the integral form of the conservation law and using the Rankine-Hugoniot jump conditions shows, that the HLL flux at the cell interface is given by   FL if 0 ≤ SL  hll SRFL−SLFR+SLSR(uR−uL) F 1 = if SL ≤ 0 ≤ SR (5.14) i+ 2 SR−SL   FR if 0 ≥ SR, where SL,SR denote the slowest and fastest wave speeds and uL, uR the values to the left and right of the cell interface, respectively.

One remaining task is to compute the bounds for the minimum and maximum wave velocities SL,SR of the Riemann fan. The most common approach is to simply compute the maximum and minimum characteristic speeds from the left and right states and then take the corresponding maximum and minimum values, i.e.

 ∂F    ∂F   SR = max λN (u) , 0 ,SL = min λ1 (u) , 0 , (5.15) u∈{uR,uL} ∂u u∈{uR,uL} ∂u where λi are the sorted eigenvalues of the Jacobian of the flux function. The HLL solver is a straight-forward, but robust approximate Riemann solver that can be applied to a wide range of problems. In fact, Riemann problems in both hydrodynamics and magneto- hydrodynamics can be solved with the HLL solver. Nevertheless, the essential idea of the HLL solver reveals the main problem of the solver as well: Since the intermediate states are averaged out, the true states are in fact poorly represented. For hydrodynamics this means, for example, that contact discontinuities and shear waves are smeared out and are not correctly represented.

38 5. Finite Volume Methods

5.4. High-Order Godunov-type Methods

The method of Godunov discussed in the previous chapter is a fully discrete, explicit finite volume scheme that is based on the integral form of the conservation law. Thereby, the spatial domain is sub-divided into cells and cell-averaged values are introduced as new dynamic variables. Then, the evolution of these averages is naturally given by the conservation law, namely the flux difference at the cell interfaces. As a result, an updat- ing formula for the cell averages requires the time-averaged fluxes at the cell interfaces. In case of Godunov’s method, where the solution is assumed to be constant in each cell, the fluxes are constant in time and their time averages evaluated using only the current cell averages. The consequence of assuming the solution to be constant within each cell is that Godunov’s method is only of first order in space. Furthermore, the evaluation of of the time-averaged flux using only the values at the current time step implies that the approximation to the exact time integral is only of first order, too. Numerical methods of first order are not recommended for practical purposes, since they are highly dissipa- tive [18]. Consequently, we seek to improve the accuracy of Godunov’s method. Clearly, the problem lies in the rather poor approximation of the solution within the cell. A Taylor expansion around the cell centre suggests a piecewise polynomial reconstruction of the true solution, while the value of the cell average remains unchanged, but improves the accuracy in space. Since the solution within a cell is not constant anymore, the char- acteristics emitted from a single cell are not parallel lines anymore. As a consequence, the solution at the cell interface, where the flux is evaluated, is not constant in time any- more. Therefore, approximations to the time integral of the fluxes (5.8) have to be made.

In this section, we will study two different approaches to achieve second order accuracy in both space and time: In the first class of schemes higher order methods are constructed using a semi-discrete approach, where one considers the discretisation of space and time as two separate processes. The idea is to discretise the space dimension first, while leav- ing the problem continuous in time. As a result, the original system of PDEs is reduced to a system of ordinary differential equations (ODE), which then can be solved by any standard ODE integrator, for example a Runge-Kutta method. In fact, this approach is not limited to second order methods and thus, in particular useful to construct very high order methods as well.

The second approach is the Monotone Upstream Scheme for Conservation Laws (MUSCL) developed by van Leer [22] and modified by S. Hancock, hence generally referred to as MUSCL-Hancock method [23]. The MUSCL-Hancock method is a predictor-corrector- type scheme, meaning that at first a less accurate approximation to the numerical solu- tion is computed, which is then corrected by a different numerical method.

Both approaches yield second order accuracy in smooth parts of the solution, but will produce spurious (unphysical) oscillations around steep gradients when not being mod- ified. This is a well-known issue regarding high order schemes that was first discovered by Godunov [18]. To avoid spurious or non-physical oscillations in the vicinity of large

39 5. Finite Volume Methods gradients, the above schemes are modified in such way, that they mimic the Total Vari- ation Diminishing (TVD) character of the exact solution of a scalar conservation law. The resulting schemes are second order in both space and time in smooth parts of the solution and are free from unphysical oscillations while still achieving high accuracy around shocks and discontinuities.

5.4.1. Reconstruction In order to compute the numerical fluxes for any conservative scheme (5.9), one needs to know the point values of the solution at the cell interfaces. Since the original method of Godunov assumes a constant solution u(x, t) within a cell, the value at the cell interface is then identical to the value of the cell average. This rather poor approximation of the exact solution yields a numerical method of order one in space and is too dissipative for practical purposes.

To improve the order and hence the accuracy of the scheme, we approximate the solution around the cell centre via a Taylor series taking higher order Taylor polynomials into account. For second order accuracy, the resulting polynomial is a linear function

n n ui(x) = u¯ + (x − xi)σ , for x ∈ [x 1 , x 1 ] (5.16) i i i− 2 i+ 2 n where the spatial derivative is approximated by a suitably chosen slope σi . A linear representation around the cell centre like the one in (5.16) does not change the value of the cell average, while at the same time yielding a more accurate solution at the cell interface, see Fig. 5.4.

The polynomial ui(x) is evaluated at the cell interfaces x = x 1 and x = x 1 and the i− 2 i+ 2 resulting boundary extrapolated values

L n ∆x n R n ∆x n ui = ui(xi− 1 ) = u¯i − σi , ui = ui(xi+ 1 ) = u¯i + σi (5.17) 2 2 2 2 are used as new input states for the Riemann problem (see Fig. 5.4)

ut + F(u)x = 0 (5.18)

( R ui , x < xi+ 1 u (x) = 2 (5.19) 0 L u , x > x 1 i+1 i+ 2 to guarantee second order accuracy in space.

Spurious Oscillations and Total Variation Diminishing

n As we will see, the choice of the slope σi is crucial for the stability of the scheme in n the presence of shocks. In general, the slope σi should be chosen in such a way, that it

40 5. Finite Volume Methods

ui(x)

ui+1(x)

ui−1(x)

xi−1 xi xi+1

Figure 5.4.: Piecewise linear reconstruction (solid black line) for three adjacent cells: The resulting approximation does not change the cell average, but improves the accuracy at the cell boundaries, where the flux is evaluated. approximates the spatial derivative over the i-th cell. For a uniform grid with constant spacing ∆x, possible choices are the forward, backward or centred finite difference, i.e.

u¯n − u¯n forward differences: σn = i+1 i (5.20) i;+ ∆x u¯n − u¯n centred differences: σn = i+1 i−1 (5.21) i;0 2∆x u¯n − u¯n backward differences: σn = i i−1 (5.22) i;− ∆x One might expect the centred difference in every cell to yield the best results, since it is a second order approximation of the spatial derivative. This is, however, only true for smooth parts of the solution. Since the order of the Taylor polynomial and hence the order of the spatial reconstruction is limited by the regularity of the underlying function, n the above reconstruction (5.16) with a nonzero slope σi is not valid for discontinuous functions. At the discontinuity, the derivative does not exist, therefore we cannot expect that the reconstruction (5.16) is a more accurate approximation to the true solution than the piecewise constant approximation in Godunov’s method. In fact, a high order n approximation with some nonzero slope σi over- or underestimates the solution across a discontinuity. Then, the error in the cell average accumulates resulting in unphysical oscillations and ultimately in an unstable solution. This behaviour can be illustrated by considering the scalar advection equation (see, e.g. [14]).

The discussion above might suggest that using a non-zero slope in every cell becomes problematic. In contrast, setting the slope to zero in every cell, results again in the original first order Godunov scheme and does not improve the accuracy of the scheme at all. Therefore, we might want to adapt the slope locally based on the behaviour of the solution. In particular, we want to limit the slope near a discontinuity so that spurious oscillations are avoided. For smooth parts of the solution, however, we choose a finite difference from (5.20) - (5.22) to obtain second order accuracy. Numerical methods

41 5. Finite Volume Methods based on this idea are called slope-limiter methods. To quantify the oscillations in the solution, the so-called total variation (TV) of a function u

Z ∞ TV(u(t)) = |u0(x, t)| dx (5.23) −∞ is an adequate measure2. In fact, Harten [25] could show that for any scalar conservation law the total variation of the exact solution does not increase as a function of time, i.e.

TV(u(t2)) ≤ TV(u(t1)) ∀t2 ≥ t1 . (5.24) which is equivalent to saying no new local extrema in x are created and the magnitude of the existing extrema does not increase. So if in contrast e.g. new extrema are created, which is certainly the case when instabilities arise, the TV increases over time. Therefore, an increasing TV corresponds to the formation of instabilities. Hence, the numerical scheme should somewhat mimic this Total Variation Diminishing (TVD) character of the exact solution. Consequently, a numerical scheme is free from spurious oscillations if

TV(un+1) ≤ TV(un) ∀n, (5.25) is fulfilled, where TV(un) is the discrete version of (5.23):

∞ n X n n TV(u ) = |ui+1 − ui | . (5.26) i=−∞ It turns out that first order conservative methods are always TVD (5.25), while high order methods are not (see again [14]). A variety of slope limiters have been proven to guarantee that, when applied to high order conservative schemes, the resulting schemes are also TVD. As these methods are based on the idea to limit the slope of the re- construction, the dissipation of the resulting numerical scheme depends on the specific limiter as well. A popular choice among those slope limiters is the minmod limiter

n n n n σi = minmod(σi;+, σi;0, σi;−), (5.27) where  min(a, b, c) if a > 0 and ac > 0,  minmod(a, b, c) = max(a, b, c) if a < 0 and ac > 0, (5.28) 0 else . The minmod slope limiter compares the three slopes (5.20) - (5.22) and chooses the smallest one in magnitude. If forward difference and backward difference have opposite signs, then there is a local extremum and thus, the slope is set to zero in order not to

2Note that this definition is still correct for discontinuous functions in the sense of Distribution Theory, i.e. if we interpret u0(x) as the distribution derivative (see e.g. [24] for further reading)

42 5. Finite Volume Methods increase the TV.

Remark that, in theory, TVD based schemes are only applicable to scalar conservation laws in one spatial dimension. For systems of nonlinear conservation laws, the theory lacks of strict mathematical proofs that guarantee convergence to the true solution [16]. Nevertheless, numerical experiments have shown the effectiveness of TVD schemes and justify their usage so that an oscillation-free conservative method of order two in space is obtained (see again [14] for further reading).

The consequence of improving the spatial accuracy of the scheme is that the character- istics of a single cell are not parallel lines anymore. Therefore, the solution at the cell interface, where the fluxes (5.8) are evaluated, is not constant anymore, but depends on time. Consequently, the approximation of Godunov’s method (5.10) to the time- averaged flux (5.8) is not valid anymore. We see that increasing the spatial accuracy of the Godunov scheme is directly related to increasing the accuracy in time as well. Hence, we need a more suitable approximation to the time integral of the fluxes (5.8) as well. This can be done by considering the space and time discretisation as two sepa- rate processes. Schemes based on this idea are called semi-discrete schemes and will be discussed in the following section.

5.4.2. Semi-Discrete Schemes In the semi-discrete approach one separates the discretisation in time from the discretisa- tion in space. For the latter, we follow the same methodology as before and subdivide the computational space into cells, leaving the problem continuous in time. By replacing the spatial derivative with its corresponding discrete form, the resulting system (5.5) can be seen as a coupled system of ordinary differential equations (ODE) in time, which can be solved numerically by any standard numerical methods for ODEs like e.g. Runge-Kutta methods. A second order Runge-Kutta type and oscillation-free scheme for solving (5.5) is the one proposed by Shu & Osher [26]

∗ n ∆t  n n  u¯i = u¯i − Fi+ 1 − Fi− 1 (5.29) ∆x 2 2

n+1 1 n ∗ 1 ∆t  ∗ ∗  u¯i = u¯i + u¯i − Fi+ 1 − Fi− 1 (5.30) 2 2 ∆x 2 2 that uses Heun’s method for the time discretisation.

∗ In the present case, the time discretisation is a two-stage process, where u¯i denotes the solution computed at an intermediate time step t∗. In the first step, the reconstruction n of u¯i (5.16) is done using slope limiters (5.27). Next, the boundary extrapolated values (5.17) are computed and used as input states for the Riemann problem at each cell inter- face (5.38) to compute the numerical fluxes. Afterwards, the cell averages are updated ∗ via (5.29) to obtain an intermediate solution u¯i . These intermediate values are then

43 5. Finite Volume Methods reconstructed and with their boundary extrapolated values a second Riemann problem is solved to compute the corresponding fluxes and finally, update the cell averages to time tn+1 (5.30). Then, the process is repeated for the next time step.

Similar to the original Godunov scheme, the length of the time step ∆t is chosen in such a way that the characteristics from neighbouring cells cannot interact with each other. For the above scheme, Pareschi [27] showed that this is ensured, when ∆t Sn ≤ 0.42, (5.31) max ∆x n with the largest characteristic velocity Smax given by

n n o Smax = max | SR |, | SL | , (5.32) i where SR,SL denote the maximum and minimum characteristic velocities at the cell interface x 1 , i.e. i+ 2

 ∂F    ∂F   SR = max λN (u) , 0 ,SL = min λ1 (u) , 0 , (5.33) u∈{uR,uL} ∂u u∈{uR,uL} ∂u respectively.

n+1 In order to compute the solution u¯i at a given time step tn+1, two Riemann problems n have to be solved at every cell interface, namely one to compute the flux F 1 at time tn i+ 2 ∗ and one to compute the flux F 1 at time t∗. While the versatility of the semi-discrete i+ 2 approach allows enormous flexibility when it comes to the development of very-high order methods, it comes at the cost of solving multiple Riemann problems per time step. In case of an order two method, one has to solve two Riemann problems each time step, which is certainly computationally more expensive than solving only one as in Godunov’s method. Of course, the increase in accuracy justifies the increase in computational resources. For constructing order two methods, van Leer [22] [23] proposed a different approach that requires solving only one Riemann problem per interface per time step, while still being of second order in both space and time. This approach has become known as the Monotone Upstream Scheme for Conservation Laws (MUSCL), which was later modified by S. Hancock and hence, the name MUSCL-Hancock-Method (MHM) was adopted.

5.4.3. MUSCL-Hancock-Method The MUSCL-Hancock-Method (MHM) is a TVD second order extension of Godunov’s method that can be written as a predictor-corrector type scheme. A predictor-corrector scheme first computes in a so-called predictor step a less accurate approximation to the numerical solution, that is then corrected by a different numerical method. The essential idea of the MHM is to not use a conservative update formula in the intermediate step

44 5. Finite Volume Methods to predict a solution, but rather use a Taylor expansion of the underlying hyperbolic 1 system to evolve the cell averages half a time step 2 ∆t. The final update is then done using a conservative scheme to preserve the conservative character of the overall scheme. In detail, this is usually done the following way: In the first step, the predictor step, the n dynamic variables u¯i are spatially reconstructed from the cell centre to the cell faces. As in the previous case, we use a local, linear reconstruction based on TVD slope limiters. The corresponding boundary extrapolated values ∆x ∆x uL = u¯n − σn, uR = u¯n + σn (5.34) i i 2 i i i 2 i are then advanced in time up to tn+1/2 = tn + ∆t/2 using a Taylor expansion of the conservation law (5.3) according to

n+ 1 ,L 1 ∆t   u 2 = uL + F(uL) − F(uR) , (5.35) i i 2 ∆x i i

n+ 1 ,R 1 ∆t   u 2 = uR + F(uL) − F(uR) , (5.36) i i 2 ∆x i i where the spatial derivative of the flux in the cell is approximated using the boundary extrapolated values. For the final step, these point values (5.35), (5.36) are used as input states for the Riemann problem to obtain the fluxes at the cell interfaces

ut + F(u)x = 0 (5.37)

 1 n+ 2 ,R u , x < x 1 i i+ 2 u0(x) = 1 (5.38) n+ 2 ,L u , x > x 1 i+1 i+ 2 The fluxes are evaluated in the exact same way as in Godunov’s method, i.e. using the left and right-handed data at the given time:

1 n+ 2 F 1 ≈ F(u(xi+ 1 , tn+ 1 )). (5.39) i+ 2 2 2 In contrast to the original method proposed by Godunov, the time integral of the fluxes is evaluated in the middle of the interval, i.e. at t 1 , guaranteeing second order time n+ 2 3 accuracy . Finally, cell averages are updated to tn+1 with a conservative update formula

∆t  n+ 1 n+ 1  un+1 = u¯n − F 2 − F 2 . (5.40) i i i+ 1 i− 1 ∆x 2 2 n+1 Then, the process is repeated with the new cell averages u¯i .

In comparison to the semi-discrete second order scheme of Section 5.4.2, the MHM achieves second order in space and time while still solving only a single Riemann problem

3This is essentially using the midpoint rule to approximate the time integral of the intercell fluxes.

45 5. Finite Volume Methods per cell interface per time step. The key point is that the intermediate step does not necessarily have to be conservative, as long as the final step is (see [16]). In fact, the PN n+1 conservation of i=1 u¯i ∆x in the MHM is achieved by updating cell averages in the corrector step, rather than using point values as in the predictor step. As a consequence, the predictor step does not have to be performed on the conservative variables either, which is in particular useful when dealing with problems in fluid dynamics, as their underlying equations can be described in another set of variables, the primitive variables w.

Predictor Step for Primitive Variables As the evolution in the predictor step does not need to be done in terms of the conserved variables, we may choose another set of non-conservative variables for this part of the scheme. In fluid dynamics in particular, we can formulate the conservation law (5.3) in terms of the primitive variables w

wt + A(w)wx = 0, (5.41) where A(w) is a coefficient matrix (see Chapter 2.1.1). For this, we may reconstruct the primitive variables from the cell centre to the cell interfaces as well using a polyno- mial representation with slope limiters. Following the MHM methodology, the primitive values at the cell interfaces ∆x ∆x wL = wn − σn, wR = wn + σn (5.42) i i 2 i i i 2 i 1 are then evolved up to time 2 ∆t, this time using the non-conservative, semi-linear form of the conservation law (5.41)

n+ 1 ,L ∆t w 2 = wL − A(wn) σn , (5.43) i i 2 i i

n+ 1 ,R ∆t w 2 = wR − A(wn) σn , (5.44) i i 2 i i where the spatial derivative of the primitive variables in (5.41) is approximated employ- ing same the TVD slope limiters used before. The predicted, primitive values at the 1 1 n+ 2 ,L n+ 2 ,R boundaries wi , wi are then transformed to conservative variables. Afterwards, the same final, conservative step from the original MHM is applied, i.e. solving the local Riemann problem (5.38), computing the numerical fluxes (5.39) and updating the solution to tn+1 with the conservative method (5.40). Then the process is repeated with n+1 the new cell averages u¯i .

Naturally, the question arises, which of the second-order schemes, semi-discrete or MHM, is computational more efficient. This question will be covered in Chapter 8.

46 5. Finite Volume Methods

5.5. Finite Volume Methods in Three Dimensions

So far, we have discussed all numerical methods in a simple one-dimensional setting to emphasise the basic concepts. In this section, we extend the methods to three space dimensions, which is mostly a straight-forward generalisation of the previously studied 1D schemes. Therefore, we will not cover all details, but just highlight crucial steps and state the most important formulas (see [14] or [16] for further reading).

5.5.1. Conservative Schemes In three spatial dimensions one may write the conservation law as

ut + F(u)x + G(u)y + H(u)z = 0 (5.45) where F(u), G(u), H(u) denote the fluxes in x, y, z directions respectively. Finite volume methods refer to discretising the spatial domain with finite control volumes, known as cells. In three spatial dimensions such a cell is defined by

Ci,j,k = [x 1 , x 1 ] × [y 1 , y 1 ] × [z 1 , z 1 ] . (5.46) i− 2 i+ 2 j− 2 j+ 2 k− 2 k+ 2 Written in integral form over the cell volumes, the conservation law translates into the semi-discrete evolution equation for cell-averages

¯ ¯ ¯ ¯ ¯ ¯ d Fi+ 1 ,j,k − Fi− 1 ,j,k Gi,j+ 1 ,k − Gi,j− 1 ,k Hi,j,k+ 1 − Hi,j,k− 1 u¯ (t) + 2 2 + 2 2 + 2 2 = 0 , (5.47) dt i,j,k ∆x ∆y ∆z where u¯i,j,k denotes the average of the dynamic quantities over the cell volume

x 1 y 1 z 1 i+ 2 j+ 2 k+ 2 1 Z Z Z u¯ (t) = ux, y, z, t dx dy dz (5.48) i,j,k ∆x∆y∆z x 1 y 1 z 1 i− 2 j− 2 k− 2 and the fluxes appearing in (5.47) are averaged over cell surfaces, i.e.

y z j+ 1 k+ 1 Z 2 Z 2 ¯ 1  Fi+ 1 ,j,k = F u(xi+ 1 , y, z, t) dy dz . (5.49) 2 ∆y∆z 2 y 1 z 1 j− 2 k− 2 The evolution of the cell averages is determined by the directive fluxes that pass through the cell interfaces (see Fig. 5.5). To obtain an explicit scheme, where we compute the n+1 n averages u¯i,j,k at time tn+1 based on the given averages u¯i,j,k at time tn, we integrate over the corresponding time interval

47 5. Finite Volume Methods

tn+1 ¯ ¯ ¯ ¯ ¯ ¯ ! Z Fi+ 1 ,j,k − Fi− 1 ,j,k Gi,j+ 1 ,k − Gi,j− 1 ,k Hi,j,k+ 1 − Hi,j,k− 1 u¯n+1 = u¯n − 2 2 + 2 2 + 2 2 dt i,j,k i,j,k ∆x ∆y ∆z tn (5.50) and approximate the time-averaged intercell fluxes. This can be done by treating each direction individually and applying the Godunov method in each direction in exactly the same way as we discussed for the 1D case. Consequently, the multi-dimensional problem reduces to solving one-dimensional Riemann problems perpendicular to the cell surface. In doing so, we only ignore the coupling at the cell corners, which is still a good approximation.

5.5.2. High-Order Schemes in Multiple Space Dimensions Since each spatial dimension is treated independently, deriving high-order methods for multiple space dimensions relies on the study of high-order methods for one space dimen- sion. Specifically, this means that the reconstruction in each space direction is carried out individually and as described as in Section 5.4.1. As for semi-discrete finite volume schemes the time discretisation is separated from the space discretisation, we can apply the same time integrator introduced in Section 5.4.2 to the 3D problem and obtain a second-order accurate scheme in both space and time. As for the MUSCL approach, however, the predictor step relies on the Taylor expansion of the conservation law and therefore explicitly depend on the number of spatial dimensions. For three-dimensional conservation laws (5.45) the predictor step of the MUSCL-Hancock-method discussed in Section 5.4.3 is given by

n+ 1 ,d ∆t ∆t u 2 = ud + F u−x  − F u+x  + G u−y  − G u+y  (5.51) i,j,k i,j,k 2∆x i,j,k i,j,k 2∆y i,j,k i,j,k ∆t + H u−z  − H u+z  2∆z i,j,k i,j,k and evolves the extrapolated values at each intercell boundary up to time tn+1/2, where the superscript d = −x, +x, −y, +y, −z, +z indicates the point values at the specific cell face, i.e. ∆x ∆x u−x = u¯n − σn, u+x = u¯n + σn . (5.52) i,j,k i,j,k 2 i i,j,k i,j,k 2 i In a similar way, the predictor step for the primitive variables can be generalised to three space-dimensions using the Taylor expansion of the primitive form of the conservation law in three space-dimensions.

In terms of the corrector step, the cell averages are updated using (5.50), where the time-averaged directional fluxes are approximated by solving a 1D Riemann problem defined by the predicted values (5.51) at the corresponding cell interface.

48 5. Finite Volume Methods

H¯ 1 i,j,k+ 2

u¯i,j,k F¯ 1 i+ 2 ,j,k

G¯ 1 i,j+ 2 ,k

Figure 5.5.: Finite volume scheme in 3D: The dynamical variables u¯i,j,k are given as volume averages and defined in the centre of the cell, whereas the fluxes are averaged over the cell surfaces.

In doing so, we are capable of solving general conservation laws in multiple space dimen- sions with second order accuracy in space and time. A prominent example of a system of conservation laws are the Euler equations of hydrodynamics, which can be solved by one of the above finite volume methods. In contrast, to solve the equations of ideal MHD, we have to consider the absence of magnetic monopoles, which implies an additional equation to the system of conservation laws, namely that the divergence of the magnetic field has to be zero everywhere at all times. This condition, also known as solenoidality constraint, has to be enforced by an additional algorithm. Otherwise the overall scheme produces unphysical solutions.

49 6. Treatment of the Magnetic Field

The previously discussed finite-volume methods can be applied to the Euler system of the ideal MHD equations. While pure hydrodynamical problems can be solved without any further adjustments, additional details have to be taken into account when dealing with the induction system, specifically regarding the absence of magnetic monopoles. Mathematically, the absence of magnetic monopoles translates to the following condition

∇ · B = 0 , (6.1) that has to be imposed for the system of conservation laws all times. While the analyti- cal solution of the MHD equations maintains the solenoidal constraint (6.1) for all times exactly (provided it is satisfied by the initial data) this condition may not be satisfied by the numerical solution. Even if it is satisfied by the initial conditions, condition (6.1) may not be conserved for later times anymore. Brackbill and Barnes [28] observed that even very small errors in satisfying the solenoidal constraint can have a severe impact on the numerical solution by implying instabilities or even producing physically wrong solutions. Since then, a variety of different methods have been suggested, by which the numerical value of ∇ · B can be sufficiently controlled for all times.

Brackbill and Barnes in the same paper [28] proposed a scheme, that uses a correction of the magnetic field by some additional algorithm after the time step is completed. The resulting scheme is often referred to as projection scheme. The name comes from the fact that the magnetic field is projected onto a divergence free magnetic field, which is as close as possible the the original magnetic field. To achieve this, a Poisson equation has to be solved every time step, which is usually done by additional, relatively expensive solvers. Other approaches modify the MHD equations by adding specific source terms (see Powell [29]) or additional equations to the system (see Dedner [30]), both of which are coupled to the divergence constraint (6.1). These additions result in damping and advecting the non-zero ∇ · B outside of the computational domain.

All of the above methods correct a non-zero divergence of the magnetic field. Another approach first introduced by Ewans and Hawley [31] is to use a specific discretisation for the magnetic field components such that constraint (6.1) is inherently fulfilled up to machine precision at least in a specific discrete form. In order to do so, the dynamic magnetic-field components are represented on a staggered grid, where all magnetic field components are located at different positions on the grid. Schemes based on this ap- proach are usually referred to as Constrained Transport schemes and are discussed in detail in the remaining part of this chapter.

50 6. Treatment of the Magnetic Field

6.1. Constrained Transport

The essential idea of the Constrained Transport (CT) method is to use a discretisation for the magnetic field such that constraint (6.1) is inherently conserved in that particu- lar discretisation. This particular discretisation is found by computing the cell-averaged value of the divergence of the magnetic field (6.1), which translates to a difference equa- tion for area-averaged magnetic field components

x 1 y 1 z 1 i+ 2 j+ 2 k+ 2 1 Z Z Z ∇ · B(x, y, z) dx dy dz = ∆x∆y∆z x 1 y 1 z 1 i− 2 j− 2 k− 2 ¯ ¯ ¯ ¯ ¯ ¯ Bx,i+ 1 ,j,k − Bx,i− 1 ,j,k By,i,j+ 1 ,k − By,i,j− 1 ,k Bz,i,j,k+ 1 − Bz,i,j,k− 1 = 2 2 + 2 2 + 2 2 = 0 , (6.2) ∆x ∆y ∆z where the area-averages of the magnetic field components are computed by integrating the respective B-field component over the corresponding cell face, i.e

y z j+ 1 k+ 1 Z 2 Z 2 ¯ 1   Bx,i+ 1 ,j,k = Bx xi+ 1 , y, z dy dz , (6.3) 2 ∆y∆z 2 y 1 z 1 j− 2 k− 2

x z i+ 1 k+ 1 Z 2 Z 2 ¯ 1   By,i,j+ 1 ,k = By x, yj+ 1 , z dx dz , (6.4) 2 ∆x∆z 2 x 1 z 1 i− 2 k− 2

x y i+ 1 j+ 1 Z 2 Z 2 ¯ 1   Bz,i,j,k+ 1 = Bz x, y, zk+ 1 dx dy (6.5) 2 ∆x∆y 2 x 1 y 1 i− 2 j− 2

The discrete form of the cell-averaged divergence (6.2) motivates the use of cell-face averages for the magnetic field variables instead of previously used cell-volume aver- ages. This results in a staggered grid configuration, where the volume-averaged hydro- dynamical variables (mass, momentum and energy) are given at the cell centres and the surface-averaged magnetic field variables are given at cell interfaces, see Fig. 6.1 (a). In addition to the surface-averages of the magnetic field, the cell-centred values have to be computed as well, since they are needed for intermediate computations, i.e. the physical fluxes of the Euler system or transformations between conservative and prim- itive variables. This is usually done via linear interpolation of the two corresponding face-averaged components, i.e. the x-component of the magnetic field at the cell centre is computed by

51 6. Treatment of the Magnetic Field

  n 1 ¯n ¯n Bx,i,j,k = Bx,i+ 1 ,j,k + Bx,i− 1 ,j,k (6.6) 2 2 2 n n and likewise By,i,j,k and Bz,i,j,k.

The evolution of the surface-averaged magnetic field variables are given by the induc- tion equation (1.12c) integrated over the corresponding cell interface. For example, the evolution of the face-average of Bx at x 1 is given by i+ 2 ¯ ¯ ¯ ¯ d Ez,i+ 1 ,j+ 1 ,k − Ez,i+ 1 ,j− 1 ,k Ey,i+ 1 ,j,k+ 1 − Ey,i+ 1 ,j,k− 1 ¯ 2 2 2 2 2 2 2 2 Bx,i+ 1 ,j,k = − + . (6.7) dt 2 ∆y ∆z As a consequence, the curl of the electric field in (1.12c) translates to a difference equation for line-averaged electric field components. These line-averages are evaluated at the corners of the cell, i.e.

z k+ 1 Z 2 ¯ 1 Ez,i+ 1 ,j+ 1 ,k = Ez(xi+ 1 , yj+ 1 , z) dz (6.8) 2 2 ∆z 2 2 z 1 k− 2 ¯ ¯ and similar expressions for Ex and Ey. The resulting semi-discrete equation is of similar form to the one derived in the finite volume approach (5.5). Therefore the CT method (6.7) can be seen as a natural extension of the finite volume approach to the induction equation (1.12c), where instead of approximating the fluxes through the cell interfaces one needs to find an approximation of the electric field E = −u × B at the cell edges (see Fig. 6.1).

This implies two fundamental differences between the CT method and the original finite volume approach: The reconstruction of the magnetic field components only needs to be computed in the two directions perpendicular to the corresponding cell face, as they are in fact defined at interfaces between the two cells in the parallel direction. Since the solenoidality constraint in one spatial dimension enforces the parallel B-field com- ponent to be continuous, there is no jump in value in the parallel direction. However, there may be a jump in the two perpendicular directions. Hence, in order to obtain the line-averaged electric field components at the cell edges, a two-dimensional Riemann problem has to be solved, as Fig. 6.2 illustrates. There are several ways to solve the two- dimensional Riemann problem for the MHD equations. One possibility is to extend the approximate HLL Riemann solver, which was used to solve the 1D Riemann problems in the finite volume method, up to two dimensions (see Londrillo and del Zanna [32], Kissmann et. al. [33]). Then, once a time discretisation for the semi discrete equation (6.7) is specified, the magnetic field components can be evolved via the fully discrete update formula by solving 2D Riemann problems to obtain the numerical electric field values at the cell edges.

52 6. Treatment of the Magnetic Field

B¯ 1 z,i,j,k+ 2

E¯ 1 1 y,i+ 2 ,j,k+ 2

E¯ 1 1 z,i+ 2 ,j+ 2 ,k u¯i,j,k ¯ ¯ Bx,i+ 1 ,j,k Bx,i+ 1 ,j,k 2 ¯ 2 Ez,i+ 1 ,j+ 1 ,k z 2 2

B¯ 1 y,i,j+ 2 ,k x E¯ 1 1 y,i+ 2 ,j,k− 2 y

(a) (b)

Figure 6.1.: (a) Position of the dynamic variables in the Constrained Transport scheme: The hydrodynamic variables U are cell-averaged and are located at the centre of the cell while the magnetic field components are surface-averaged and are given at the corresponding cell interfaces. (b) The evolution of the surface-averages is determined by differences of the line- averaged electric field components over the corresponding edges.

NW NE

B¯ 1 x,i+ 2 ,j+1,k u¯i,j+1,k u¯i+1,j+1,k

E¯ 1 1 z,i+ 2 ,j+ 2 ,k

B¯ 1 B¯ 1 y,i,j+ 2 ,k y,i+1,j+ 2 ,k

u¯i,j,k u¯i+1,j,k

B¯ 1 x,i+ 2 ,j,k

SW SE

Figure 6.2.: Illustration of the 2D Riemann problem in the x − y plane to calculate the line- average of Ez. At the position of the cell edge, Ez = −(u × B)z may be given by four different values calculated from reconstructed B and u components adjacent to the cell edge. These values are labelled after their corresponding orientation NE, NW, SW, SE.

53 6. Treatment of the Magnetic Field

By inserting the fully discrete update formula in the numerical divergence constraint (6.2), it can be shown that numerical divergence does not change, due to perfect cancel- lation of the terms. Hence, if the initial conditions satisfy the solenoidal constraint, i.e. ∇ · B0 = 0, then constraint (6.1) is conserved up to machine round-off precision for all future time steps.

6.1.1. High-Order Variation We have seen that by using cell-face averages (6.3)-(6.5) as dynamic variables for the magnetic field components, an explicit scheme derived from (6.7) maintains the solenoidal constraint up to round-off errors. In order to obtain an overall scheme that is consis- tent with the high-order, semi-discrete approach of the hydrodynamical components (see Section 5.4.2), we may want to improve the accuracy of the time evolution of the mag- netic field variables as well. To do so, the magnetic field variables and the velocity variables have to be spatially reconstructed to the edges of the cell, where the electric field components in (6.7) are evaluated. For a second-order, oscillation-free solution, the reconstruction process is based on a linear polynomial and the spatial derivatives are approximated using TVD slope limiters. For example, to compute Ez = −(u × B)z at x 1 , y 1 from the values in the cell Ci,j,k, we reconstruct the corresponding variables i+ 2 j+ 2 to the upper right corner of the cell (see Fig. 6.2), i.e.

n n SW n ∆x∂u ∆y ∂u ui,j,k = u¯i,j,k + + , (6.9) 2 ∂x i,j,k 2 ∂y i,j,k  n SW ¯n ∆y ∂Bx Bx,i+ 1 ,j,k = Bx,i,j,k + , (6.10) 2 2 ∂y i,j,k  n SW ¯n ∆x ∂By By,i,j+ 1 ,k = By,i,j,k + . (6.11) 2 2 ∂x i,j,k The superscript SW indicates the input state to the Riemann problem at the South-West edge of the cell, i.e. at x 1 , y 1 , zk. Similar expressions can be derived for the other i− 2 j− 2 input states surrounding a cell edge. These are naturally labelled as North-East (NE), North-West (NW) and South-East (SE), respectively. The corresponding cell labels are illustrated in Fig. 6.2 for the computation of E¯ 1 1 . Once the edge-values are re- z,i+ 2 ,j+ 2 ,k constructed, the corresponding electric field components are computed, which are then used as input states for the 2D Riemann problem. Then the solution is updated via a fully discretised version of (6.7). The semi-discrete nature of (6.7) suggests the use of a semi-discrete finite volume scheme for the cell-centred HD variables as well. Then the entire system can be written as a system of semi-discrete equations, where we use the same time discretisation for the face-centred magnetic field variables and the cell-centred HD variables (see 5.4.2). Thus, to achieve second order accuracy, we discretise equation (6.7) in time similar to (5.29) and (5.30).

54 6. Treatment of the Magnetic Field

The resulting scheme can be seen as an extension of the semi-discrete finite-volume method to the full MHD equations. Thus it suffers from the same drawback, that the Riemann solver has to be applied twice per time step. In recent years, attempts have been made to extend the MUSCL-Hancock-Method, previously introduced for the cell- centred variables, to the induction equation as well. In the following section we study the C-MUSCL scheme, an extension of the MUSCL-Hancock-Method based on Constrained Transport.

6.2. C-MUSCL Scheme

The basic idea of the MUSCL-Hancock-Method is to replace the conservative, interme- diate step of a second-order Godunov scheme by a non-conservative one. The key point is that the predictor step does not necessarily have to be conservative. Recall that in the predictor step a solution at an intermediate time step is computed, which is then corrected by a conservative method to preserve the overall conservative character of the scheme. As a consequence, there are multiple possibilities to perform the prediction step. When applied to the Euler equations for example, this is usually done using a Taylor expansion of the underlying conservation law in either conservative or primitive form. The reconstructed, dynamic variables are so advanced up to time tn+1/2, on which the conventional Godunov scheme is applied. Then the resulting scheme is second order accurate in both space and time.

The same methodology can be applied to the induction equation as well, where we use a predictor-corrector type scheme based on the CT algorithm, which can be seen as the straight-forward extension of the Godunov methodology that in addition satis- fies the solenoidal constraint. Similar to the MUSCL approach for the Euler equations where the predictor step does not necessarily have to be conservative, it is a priori not necessary for the predictor step of the induction equation to satisfy the solenoidal constraint [34]. Consequently, the predictor step can be performed in various ways, as Teyssier et al. [34] demonstrated for the kinematic dynamo problem. One of them is the Conservative-MUSCL scheme, or C-MUSCL for short, which maintains the solenoidal constraint in the predictor step and has also been extended to the full MHD equations (see [35]).

The essential idea of the C-MUSCL predictor step is to use the Constrained Transport algorithm to evolve the magnetic field variables from time tn to tn+1/2, where the vector components of the electric field at the cell edges are computed from spatially interpolated magnetic field and velocity components. For example, the x-component of the magnetic field is advanced up to tn+1/2 via

55 6. Treatment of the Magnetic Field

¯n ¯n ¯n ¯n ! 1 Ez,i+ 1 ,j+ 1 ,k − Ez,i+ 1 ,j− 1 ,k Ey,i+ 1 ,j,k+ 1 − Ey,i+ 1 ,j,k− 1 n+ 2 n ∆t 2 2 2 2 2 2 2 2 B¯ = B¯ 1 + − + x,i+ 1 ,j,k x,i+ ,j,k 2 2 2 ∆y ∆z (6.12) where the electric field components at the corresponding cell edges are computed using some arithmetic averages of magnetic field and velocity components, i.e.

¯n E 1 1 = huxihByi − huyihBxi . (6.13) z,i+ 2 ,j+ 2 ,k In order to achieve overall second order accuracy in space, the predictor step needs to be second order accurate in space as well. Hence, the averages occurring in (6.13) are linearly interpolated on the cell edges, where the electric field is evaluated:

1 hu i = u¯n +u ¯n +u ¯n +u ¯n  , (6.14) x 4 x,i,j,k x,i+1,j,k x,i,j+1,k x,i+1,j+1,k 1 hu i = u¯n +u ¯n +u ¯n +u ¯n  , (6.15) y 4 y,i,j,k y,i+1,j,k y,i,j+1,k y,i+1,j+1,k   1 ¯n ¯n hBxi = Bx,i+ 1 ,j,k + Bx,i+ 1 ,j+1,k , (6.16) 2 2 2   1 ¯n ¯n hByi = By,i,j+ 1 ,k + By,i+1,j+ 1 ,k . (6.17) 2 2 2 Similar expressions can be derived for the other E-components as well. Note that the resulting reconstruction to the cell edges is second order in space, even though no spatial reconstruction with TVD slopes has been applied. Moreover, as the computation with interpolated values results in a single value for the electric field components at each cell edge, the corresponding, predicted magnetic field by construction satisfies the solenoidal constraint, i.e. ∇ · Bn+1/2 = 0. Hence, the resulting predictor step is conservative in a sense that the predicted magnetic field satisfies the solenoidal constraint.

In the corrector step, we use the conventional Constrained Transport algorithm in order to update the magnetic field to tn+1. Specifically, we reconstruct the predicted magnetic field and velocity variables to the cell edges, similar as described in Section 6.1.1. Then these edge-reconstructed values are used to define a 2D Riemann problem for the dif- ferent electric field components located at the corresponding cell edges. Once numerical estimates for the line-averaged electric field components are obtained, the magnetic field variables can be updated according to

n+ 1 n+ 1 n+ 1 n+ 1 E¯ 2 − E¯ 2 E¯ 2 − E¯ 2 ! n+ 1 z,i+ 1 ,j+ 1 ,k z,i+ 1 ,j− 1 ,k y,i+ 1 ,j,k+ 1 y,i+ 1 ,j,k− 1 B¯n+1 = B¯ 2 + ∆t − 2 2 2 2 + 2 2 2 2 . x,i+ 1 ,j,k x,i+ 1 ,j,k 2 2 ∆y ∆z (6.18) with similar expressions for the other components.

56 6. Treatment of the Magnetic Field

In this part, we have thoroughly studied numerical methods to solve the equations of ideal MHD. For the Euler system, i.e. the hydrodynamical variables, we use a finite volume method, and for the induction system, i.e. the magnetic field components, we use the CT algorithm. In doing so, we are able to produce stable, shock-capturing solutions for the ideal MHD equations. In the need of higher accuracy versions for practical applications, we have also presented two different approaches to increase the order of the schemes: On the one hand, we have the semi-discrete schemes, a very general approach suited to derive schemes of arbitrary order. On the other hand, we have the MUSCL-Hancock approach, specifically developed for the Euler equations and limited to order two, together with the C-MUSCL scheme, a CT-based extension of the MUSCL scheme to the induction system. With both approaches, semi-discrete and (C- )MUSCL, we are able to obtain numerical solutions that are second order accurate in space and time. Naturally, the question arises which of the two second-order schemes is computationally more efficient and better suited for applications. Hence, as a next step we will compare the performance of the two methods. This will be done in the framework of the Cronos-Code [10], a high performance C++ code optimised for (M)HD problems. In Cronos, the previously discussed semi-discrete scheme has already been implemented and tested extensively (for further details, see [10]). Hence, we have adapted the code and implemented the C-MUSCL scheme. The next part gives a brief overview of the implementation.

57 Part III.

Implementation

58 7. The CRONOS-Code

7.1. Code Structure

In this part, we describe the Cronos code, the code that is used as a framework for the numerical schemes investigated in this thesis. The Cronos code is a high-performance C++ code that has been designed to study astrophysical problems that can be described via hydrodynamics or MHD. The code is based on a semi-discrete finite-volume descrip- tion, uses the constrained transport algorithm for the magnetic field variables and is therefore well-suited for our purposes. Currently, second- and third-order schemes with different approximate Riemann solvers are implemented, where the second-order scheme is the one we have studied in Section 5.4.2. Cronos has been tested extensively and applied to various research problems in space- and astrophysics. The implementation of the here relevant semi-discrete second-order solver has already been verified (see [10]).

Therefore, what is left, is the implementation of the MUSCL and C-MUSCL schemes. As we will see, the implementation of the current solver cannot be adapted for this pur- pose. Hence, an alternative implementation of the semi-discrete solver has been used, which was - at the beginning of this project - only capable of solving hydrodynamical problems. For this reason, we have extended the solver to MHD and implemented both the MUSCL and C-MUSCL schemes.

Before that, we will discuss, why the architecture of the current solver in Cronos is not suitable for the implementation of a MUSCL-based scheme. In Section 5.5 discussing fi- nite volume schemes in multiple space dimensions we have concluded, that treating each space direction individually is a good approximation which only ignores the coupling at the corners of the cells. As a result, applying finite volume methods to multi-dimensional conservation laws reduces to computing differences of directional fluxes and ultimately to solving a one-dimensional Riemann problem at each cell interface. In the main solver of Cronos this is implemented in such a way, that first, the flux difference in the x-direction is computed for every cell, before repeating the procedure for the y- and z-directions. As a consequence, the reconstruction of the cell-averaged variables in x, y, z-direction to the corresponding interfaces are computed at three different stages in the code, as Fig. 7.1 illustrates. However, as we have seen in Section 5.5.2, where we have extended one-dimensional high-order schemes to multiple space dimensions, the predictor step in the MUSCL-Hancock approach depends on the dimensionality of the underlying con- servation law. More specifically, it couples the evolution of a reconstructed value at a specific interface to the reconstructed values at all other interfaces, since the directive

59 7. The CRONOS-Code

fluxes used in the predictor step (5.51) are evaluated at the cell faces.

As a result, for an efficient implementation of the MUSCL scheme, treating the recon- struction in all directions individually and at different stages of the code is not rec- ommended. This is true, whether one performs the predictor step in conservative or primitive variables. Consequently, the code had to be adapted.

initialise singlestep RKstep = 1

compute flux diff. ∆F¯ in x-dir. ±x ¯ hll ¯ u¯i,j,k → u¯i,j,k → F 1 → ∆F i+ 2 ,j,k

compute flux diff. ∆G¯ in y-dir. ±y ¯ hll ¯ u¯i,j,k → u¯i,j,k → G 1 → ∆G i,j+ 2 ,k

compute flux diff. ∆H¯ in z-dir. Constrained Transport RKstep += 1 ±z ¯ hll ¯ ¯ ¯ ¯ u¯i,j,k → u¯i,j,k → H 1 → ∆H get EMF diff. ∆Ex, ∆Ey, ∆Ez i,j,k+ 2

¯ ¯ ¯ update u¯i,j,k update B 1 , B 1 , B 1 x,i+ 2 ,j,k y,i,j+ 2 ,k z,i,j,k+ 2

RKstep = 2? no

yes

store data, repeat for next time-step

Figure 7.1.: Flow chart of the semi-discrete, second-order solver used in the Cronos code to illustrate the updating process of a single time-step, i.e. advancing the solution from time tn to tn+1.

60 7. The CRONOS-Code

7.2. Adapting the Code

The structure of the main solver in Cronos is not suited for an efficient implementation of the MUSCL scheme. Originally developed for semi-discrete finite-volume schemes, the code treats each direction individually, i.e. it computes the changes of the dynamic variables in the different directions consecutively. Fig. 7.1 schematically shows the up- dating procedure of this implementation of the second-order semi-discrete scheme used in Cronos. In contrast, the evolution of the cell-averaged value in the MUSCL predictor step requires a collective reconstruction process for all space dimensions, as the spatial derivatives appearing in the Taylor expansion are approximated using the same slopes as in the reconstruction (5.51). Hence, for multidimensional problems, the reconstruc- tion process of the individual space dimensions, more specifically the computation of the slopes, cannot be treated in different stages of the code. Therefore, a MUSCL-based scheme cannot be implemented effectively in the current code structure of Cronos.

In recent years, attempts have been made to develop an alternative implementation for the solver in Cronos that is compatible with the Adaptive Mesh Refinement (AMR) algorithm [36]. The fundamental concept behind AMR is to compute the numerical solu- tion in different rectangular patches of the computational domain with different spatial resolutions [37, 38]. It turns out, that a local block-structured code, where the changes within a cell are computed simultaneously in all directions, is particularly efficient for both AMR and MUSCL-type schemes. In contrast to the approach illustrated in Fig. 7.1, where the intercell fluxes in a given direction are computed for the entire grid before repeating the process for the next direction, the block-structured version of the code uses a local, cell-focused structure. This means, that all sub-routines of the updating process are performed simultaneously for all directions (see Fig. 7.2). In particular, this version of the code allows updating only local patches of the grid, as it is also done in the block-structured AMR.

Being still under development, the previous implementation of the block-structured code has only included solvers for hydrodynamical problems. Therefore, we have extended the block-structured code to MHD and implemented the MUSCL and C-MUSCL schemes. In Section 5.4.3 we have introduced two versions of the predictor step in the MUSCL- Hancock-Method. Since Cronos employs the reconstruction on the primitive variables, we have decided to implement the non-conservative predictor-step (see (5.44), (5.43) for 1D). Hence we are consistent with the approach proposed in [35]. Fig. 7.2 illustrates the structure of the (C-)MUSCL scheme used in the block code.

What is left, is the verification of the implementation, which will be covered in the following chapter. As for many astrophysical codes, this will be done through a series of test problems. These include numerical simulations for both one- and multi-dimensional problems using either HD or MHD. At last, we compare the performance of the C- MUSCL scheme with the current second-order semi-discrete scheme.

61 7. The CRONOS-Code

initialise singlestep

MUSCL predictor-step C-MUSCL predictor-step ∗ ¯ ¯∗ u¯i,j,k → u¯ Bx,i+ 1 ,j,k → B 1 i,j,k 2 x,i+ 2 ,j,k

reconst. of pred. values to cell-faces ∗ ±x ±y ±z u¯i,j,k → u¯i,j,k, u¯i,j,k, u¯i,j,k

compute num. fluxes ±x ¯ hll u¯i,j,k → F 1 i+ 2 ,j,k ±y ¯ hll u¯i,j,k → G 1 i,j+ 2 ,k ±z ¯ hll u¯i,j,k → H 1 i,j,k+ 2

compute flux diff. ¯ hll ¯ F 1 → ∆F i+ 2 ,j,k Constrained Transport ¯ hll ¯ ¯ ¯ ¯ G 1 → ∆G compute EMF diff. ∆Ex, ∆Ey, ∆Ez i,j+ 2 ,k ¯ hll ¯ H 1 → ∆H i,j,k+ 2

¯ ¯ ¯ update u¯i,j,k update B 1 , B 1 , B 1 x,i+ 2 ,j,k y,i,j+ 2 ,k z,i,j,k+ 2

store data, repeat for next time-step

Figure 7.2.: Flow chart of (C-)MUSCL scheme in the block-structured solver used in Cronos to illustrate the updating process of a single time-step.

62 8. Verification & Results

8.1. One-dimensional Tests

In this chapter, we verify the implementation of the (C-)MUSCL scheme. For this, we run a series of numerical tests, where each test examines certain capabilities of the code. Usually, this is done by comparing the numerical solution to the analytical solution of the corresponding test problem. However, while there exists an analytical solution for the applied hydrodynamical tests, there are no analytical solutions for the following MHD tests available. Nevertheless, the MHD tests used in this chapter are well-established in the literature and thus, allow a consistent comparison between different code frameworks. To begin with, we study two one-dimensional Riemann problems, one for the equations of hydrodynamics and for the equations of MHD, respectively. These tests show, whether the structure of the corresponding Riemann fans are correctly recovered.

8.1.1. Sod Shock-Tube As a first test, we study a special Riemann problem for the one-dimensional Euler equa- tions, the so-called shock-tube problem. Together with the ideal Equation of State (1.14), it describes the dynamics of an ideal gas in a one-dimensional tube, in which the gas is divided by a thin membrane into two regions with different thermodynamic parameters. The Riemann-like initial data of the thermodynamic parameters idealise an instanta- neous removal of the membrane. The time evolution of the Riemann problem for the one-dimensional Euler equations was studied in Section 4.2.2, where we have seen that the solution profile consists of different constant states separated by specific transitions, referred to as waves. Since there exists an analytical solution for this specific type of Rie- mann problem, one can test the code’s numerical solution against the analytical solution and thus reveal, whether the resulting Riemann-fan is correctly recovered, all wave types are sufficiently resolved, and in addition, whether the code produces spurious oscillations.

The initial data of the shock-tube problem is usually given in terms of primitive variables ( [ρL, uL, pL] x < x0 [ρ0, u0, p0] = (8.1) [ρR, uR, pR] x > x0 , and studied on the unit interval [0, 1], where the discontinuity is initially located at x0. Additionally, we use an adiabatic index of γ = 1.4 for all following shock-tube tests. Moreover, any of the following data is generated by the block-structured code together

63 8. Verification & Results with the minmod slope-limiter and a CFL number of 0.4.

In accordance to the tests performed in [10], we first investigate a variation of the shock- tube problem introduced by Sod [39], where the left and right-handed initial states are given by ( [10, 0, 100] x < 0.5 [ρ0, u0, p0] = (8.2) [1, 0, 1] x > 0.5 . The solution to the Sod shock-tube test (8.2) consists of a rarefraction wave on the left-hand side, a contact discontinuity in the middle and a shock wave on the right-hand side. The analytical solution at time t = 0.8 is shown in Fig. 8.1 together with the numerical solution for N = 200 grid cells. The results have been computed with the MUSCL-Hancock scheme using the HLL approximate Riemann solver. By comparing the numerical results with the analytical solution, we conclude that the code correctly reproduces the resulting structure of the Riemann fan. In addition, a further comparison with the results produced by the semi-discrete second-order scheme in [10] shows that there is qualitatively no significant difference in the resolution of the different waves. This is mainly because the resolution of the waves in the Riemann fan strongly depend on the applied Riemann solver and slope-limiter, respectively. As we are running the same numerical setup, we expect qualitatively no significant difference.

8.1.2. Brio & Wu Shock-Tube To test, whether a code accurately reproduces different MHD wave types, the Sod shock- tube test has been extended to MHD. In contrast to the the hydrodynamical test, there is no analytical solution for the MHD shock-tube problem available. Nevertheless, the MHD shock-tube test introduced by Brio & Wu [40] is commonly used in literature to evaluate the robustness of MHD codes. The authors proposed to initialise the left and right states as ( [1, 0, 1, 1] x < 0.5 [ρ0, u0,B⊥,0, p0] = (8.3) [0.2, 0, 0, 0.1] x > 0.5, with additional parameters

Bk = 1 and γ = 2 (8.4) where B⊥ and Bk denotes the magnetic field components perpendicular and parallel to the flow direction, respectively. Fig. 8.2 shows the corresponding numerical results for the C-MUSCL scheme. The solution consists, in order from from left to right, of a fast rarefaction, a slow compound wave, a contact discontinuity, a slow shock, and a fast rarefaction wave. A comparison with the results from literature ( [10], [40]) indicates

64 8. Verification & Results

10 4

8 3

6 x 2 v

4 1

2 0

0.2 0.4 0.6 0.8 0.2 0.4 0.6 0.8 x x (a) (b)

250

200

150 h t e 100

50

0

0.2 0.4 0.6 0.8 x (c)

Figure 8.1.: Density ρ (upper left), velocity vx (upper right) and thermal energy eth (bottom) for the Sod shock-tube test [39] at time t = 0.8 computed with N = 200 cell using the MUSCL- Hancock method. The numerical solution (blue points) is compared to the analytical solution (solid line).

65 8. Verification & Results

1.00 0.0

0.75 0.5 y 0.50 v 1.0

0.25 1.5

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 x x (a) (b)

1.0 1.00

0.5 0.75 h y 0.0 t B e 0.50

0.5 0.25

1.0 0.00 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 x x (c) (d)

Figure 8.2.: Numerical results at time t = 0.1 for the MHD shock-tube problem proposed by Brio & Wu [40]: Density ρ (upper left), velocity vy (upper right), magnetic field component in parallel (y-)direction By (lower left) and thermal energy eth (lower right) are shown. The data points are computed using the C-MUSCL scheme with N = 800 cells.

that the code recovers the correct solution.

8.2. Multidimensional Tests

In the following, we investigate the code’s capability to solve problems in multiple space dimensions. Although the majority of codes is designed to solve three-dimensional prob- lems, one usually focuses on two-dimensional problems in a first step. Thus, the numer- ical tests presented here are two-dimensional as well. Similar to the previous section, we study two problems, the Sedov-explosion test to verify the HD sub-scheme, and the Orszag-Tang vortex to test the full MHD scheme, respectively.

66 8. Verification & Results

1.2 4 1.0 3 0.8 v 2 0.6

0.4 1 0.2

0 0.0

0.4 0.2 0.0 0.2 0.4 0.4 0.2 0.0 0.2 0.4 x x (a) (b)

Figure 8.3.: Results for the 2D Sedov explosion test: The density ρ (left) and the absolute value of the velocity v (right) are shown at t = 0.1 for N = 256 cells in each direction. The numerical results are shown as blue data points. For comparison, the analytical solution is given as a solid grey line.

8.2.1. Sedov Explosion First, we validate the HD sub-routine of the code for multidimensional problems. For this, we use the so-called Sedov-explosion test [41], where a large amount of energy is injected into a small volume in a homogeneous medium at rest. In two space dimensions, the injected energy density is given by  einit = 2 , (8.5) πr0 where  denotes the total injected (thermal) energy and r0 denotes the radius of the area into which the energy is injected. The result is a strong spherical shock wave propagating through the medium in a self-similar fashion. This self-similarity allows to express the PDE in terms of a dimensionless variable η with

r5ρ η = 0 , (8.6) t where ρ0 denotes the homogeneous density of the medium and  the total injected energy, respectively. The resulting solution in terms of this similarity variable η can be computed analytically (see e.g. [42] or [43]) and is shown together with the numerical solution in Fig. 8.3 for the two-dimensional case. The numerical results have been computed with the MUSCL-Hancock method using the same setup as described in [10]. A comparison with the analytical solution reveals excellent agreement with the analytical solution.

67 8. Verification & Results

8.2.2. Orszag-Tang Vortex The second multidimensional test is the Orszag-Tang vortex [44], a standard 2D MHD problem to test the code’s ability to handle turbulences. While there is no exact solution available, this numerical test is well-established in the literature and has been used in many previous studies. Thus, it allows a consistent comparison of different code frameworks. The initial state is given by a homogeneous density and pressure, where turbulence is initiated by periodic fluctuations in velocity and magnetic field components via

B B 5 ρ = γp , u = (− sin 2πy, sin 2πx),A = 0 cos(4πx) + 0 cos(2πy), p = 0 0 0 0,z 4π 2π 0 12π (8.7) √ with parameters B0 = 1/ 4π and γ = 5/3. Note that the initialisation of a vector potential A naturally results in a magnetic field B = ∇ × A that guarantee ∇ · B = 0 initially. In case of the Orszag-Tang vortex, the corresponding magnetic field to the vector potential in (8.7) is given by

B0 = B0(− sin 2πx, sin 4πy) . (8.8) In addition, the problem is studied in a quadratic box of uniform length with periodic boundary conditions. Numerical results are shown in Fig 8.4 at time t = 0.5 using N = 192 grid cells in each direction. The resulting solution structure is a complex pattern of interacting MHD waves. Thus, the code’s ability at handling formation and interaction of these waves can be investigated by comparing the results to the ones in literature. Since the solenoidal constraint ∇ · B = 0 is fulfilled by the initial conditions, any problems with numerically maintaining the divergence constraint would become apparent as well. A visual comparison shows excellent qualitative agreement between our results and the ones in the literature (i.e. [10], [45], [35]). The complex solution structure is accurately recovered.

8.3. Verification of the Order

8.3.1. Order of the HD Solver As a final test, we verify the order of the (C-)MUSCL scheme [46, 47]. Ryu et. al. proposed a series of numerical tests, where the order of the scheme can be determined by computing artificial Reynolds numbers.

Similar to the previously performed tests, we first focus on the hydrodynamical sub- routine and verify the order of the HD-solver, i.e. we show that the MUSCL-Hancock method is second order accurate. This is done by determining the decay rate Γ of 2D sound waves as proposed in [46]. For this, we study the long-term evolution of a small-amplitude sound wave in a stationary background with initial perturbation

68 8. Verification & Results

0.8 0.4 0.8 0.6

0.6 0.6 0.32 0.4

0.4 0.4 0.24

0.2 0.2 0.2 0.16

0.2 0.4 0.6 0.8 0.2 0.4 0.6 0.8 (a) (b)

Figure 8.4.: Numerical results for the Orszag-Tang vortex [44] for the density (left) and absolute value of the magnetic field (right). The results are computed using N = 192 cells in each direction.

δvx = δvy = δv0cs sin (kxx + kyy) , δρ = δp = 0 (8.9) and wavenumbers kx = ky = 2π/L in a square box with length L in each direction. In doing so, the sound wave propagates diagonally through the quadratic domain and by imposing periodical boundary conditions, the damping of its amplitude is only caused by numerical dissipation. To measure this numerical viscosity, the decay rate Γ of the 2D sound wave is compared with the predicted rate in a viscous fluid. As a result, the decay rate can be used to compute an artificial Reynolds number

4π2c 1 R = s . (8.10) S L Γ In a next step, this Reynolds number can be plotted as a function of the number of grid cells to determine the order of the scheme. To compute a representative value for the decay rate, we choose the parameters in such a way, that the wave performs one full oscillation per unit time and then simulate up to t = 10 (see [10] for more details on the setup). Fig. 8.5 illustrates the exponential decay of the wave’s amplitude for a 32 × 32 grid and a simulation time of t = 5. The figure shows the exponential decay of the spatial root-mean-square average of the velocity on a logarithmic axis. From the exponential de- crease of the decay rate Γ, the corresponding Reynolds number (8.10) can be determined.

Fig. 8.6 shows the corresponding Reynolds number RS as a function of the number of grid cells N for the MUSCL-Hancock-Method using either the HLL or HLLC ap- proximate Riemann solver. For comparison, the data obtained by the semi-discrete

69 8. Verification & Results

vrms(t)

6 × 10 5

4 × 10 5

3 × 10 5

0 1 2 3 4 5 time t

Figure 8.5.: Evolution of the spatial root-mean-square average of the velocity vrms of a 2D sound wave. Numerical results (black line) are shown on a logarithmic axis up to time t = 5 for a 32×32 grid. The decay rate Γ of the sound wave is determined by a linear fit (red-dashed line) through the local extrema (red data points).

SeDi HLL 9 10 SeDi HLLC MHM HLL MHM HLLC

8 s 10 R

107

3 × 101 4 × 101 6 × 101 102 2 × 102 N

Figure 8.6.: Reynolds number RS as a function of the number of grid cells N for the sound wave decay test for different numerical schemes: Semi-discrete second-order scheme (SeDi) or MUSCL-Hancock-Method (MHM) using either HLL or HLLC approximate Riemann solver; 2 For comparison, additional lines with RS ∝ N (light grey, dash-dotted) and RS ∝ N (dark grey, dashed) are plotted.

70 8. Verification & Results second-order scheme and additional lines indicating order one (light grey, dash-dotted) and two (dark grey, dashed) accuracy are shown as well. The Reynolds numbers of both numerical schemes follow a N 2-dependency, which confirms the second-order nature of the schemes. As expected, the HLLC approximate Riemann solver is less dissipative compared to the HLL solver. Overall, the MUSCL-Hancock-Method shows less dis- sipation than the semi-discrete second-order scheme, presumably because we use the approximate Riemann solver in the semi-discrete approach twice per cell-interface and time-step.

8.3.2. Order of the MHD Solver A similar test configuration for MHD codes has been proposed in [47]. In the MHD case, we initialise a shear Alfv´enwave via

δvz = δv0 cA,k sin (kxx + kyy) , (8.11)

δρ = δp = δvx = δvy = δBx = δBy = δBz = 0 . (8.12) on a homogeneous background with ρ0 = 1, p0 = 1 and B = B0eˆx with B0 = 1. Furthermore, the simulations are run in a periodic quadratic box of size L = 1. Again, the parameters are chosen to lead to one full oscillation per unit time (see [10]). In a similar fashion to the HD order test (Section 8.3.1), we measure the decay rate of the shear Alfv´en waves and plot the Reynolds numbers

8π2c 1 R = A,k (8.13) A L Γ as a function of the grid resolution N. Corresponding results for both the C-MUSCL and the semi-discrete second-order scheme are shown in Fig. 8.7. Both numerical schemes in the block-structured code are apparently second-order accurate. Apparently, the differ- ence in numerical dissipation between the C-MUSCL and the semi-discrete second-order scheme is not as significant as in their HD variations. This seems rather unexpected, as the semi-discrete CT scheme uses an approximate (2D) Riemann solver twice per cell edge and per time step, whereas the C-MUSCL scheme uses the approximate Riemann solver only once per time step.

8.4. Performance Analysis

One remaining question is, which one of the numerical methods is computationally most efficient. To answer this question, we plot the artificial Reynolds numbers as a function of the run-time and obtain an estimate for the computational performance of the schemes. The corresponding results are shown in Fig. 8.8 for different HD (a) and MHD (b) schemes available in Cronos. In addition, the data computed with the semi-discrete

71 8. Verification & Results

SeDi C-MUSCL

108 A R

107

3 × 101 4 × 101 6 × 101 102 2 × 102 N

Figure 8.7.: Reynolds number RA as a function of the number of cells N computed with the HLL solver and the C-MUSCL scheme and the semi-discrete second order scheme (SeDi). For 2 comparison, lines with RA ∝ N (light grey, dash-dotted) and RA ∝ N (dark grey, dashed) are illustrated to guide the eye. second-order scheme of the directional code is shown as well. The comparison of the different HD schemes reveals that the MUSCL-Hancock method outperforms the semi- discrete second-order scheme of both the directional and the block-structured codes. In fact, the MUSCL-Hancock method shows less dissipation and shorter runtimes. As far as the MHD codes are concerned, the C-MUSCL scheme requires, as expected, less computational resources than the semi-discrete scheme that is implemented in the block- structured code. Still being in an early stage of development, the MHD routine of the block-structured code cannot compete against the directional code, as the semi-discrete second-order method in the directional scheme apparently outperforms both of the block- structured schemes.

72 8. Verification & Results

SeDi dir HLL SeDi dir 9 10 SeDi dir HLLC SeDi block SeDi block HLL C-MUSCL SeDi block HLLC MHM HLL MHM HLLC s A 8 R 10 R 108

107

101 102 103 101 102 103 104 time [s] time [s] (a) (b)

Figure 8.8.: Reynolds numbers as a function of the runtime for several second-order HD (left) and MHD (right) schemes: Semi-discrete scheme of the directional code (SeDi dir), semi-discrete scheme of the block code (SeDi block) and MUSCL-Hancock method (MHM) or C-MUSCL. The HD simulations employ either HLL or HLLC Riemann solver; the MHD simulations ran the MHD extension of the HLL approximate Riemann solver. The data points produced by the semi-discrete scheme with HLL solver (light green, light blue) in (a) are identical for both types of code architectures.

73 Summary

In this thesis, we have presented the C-MUSCL scheme, a numerical method to effi- ciently solve the equations of magneto-hydrodynamics (MHD). These equations describe the conservation of mass, momentum and energy in a perfectly conducting, astrophysical plasma. To ensure the conservation of these quantities over the entire computational domain, the scheme is based on the finite-volume approach. Furthermore, it combines the ideas of the MUSCL-Hancock-method, a robust scheme originally developed for hydrodynamical problems, with the Constrained Transport algorithm that assures the ∇ · B = 0 constraint. Consequently, with the C-MUSCL scheme one is able to produce stable, high-resolution solutions for MHD problems.

The algorithm has been implemented in the Cronos code and several tests have been performed to validate the correctness of its implementation and illustrate the schemes’ potential. In comparison to the previously implemented, semi-discrete schemes, the per- formance of the HD sub-solver is outstanding, even though the new version of the code is still in an early stage of development. Consequently, the new scheme does not reach its full potential yet. Apparently, the performance of the C-MUSCL scheme is in the same magnitude as the standard scheme of Cronos, which is mostly attributed to the code’s intrinsic structure. In sum, the C-MUSCL is still a robust alternative to the standard code while being compatible with state-of-the-art algorithms (Adaptive Mesh Refinement), where the standard scheme reaches its limits.

Beyond the scope of this thesis is the verification of the code on non-linear grids and the test of three-dimensional problems. In addition, future improvements of the code may include the extension to spherical or cylindrical coordinates, which is particularly in- teresting for astrophysical applications. Furthermore, additional approximate Riemann solvers such as the HLLC [48] could be implemented. Ultimately, the implementation of the AMR algorithm will be necessary to meet the constantly increasing demands on computational resources in astrophysical research areas.

74 Bibliography

[1] Tobias Wiengarten, Jens Kleimann, H Fichtner, Robert Cameron, J Jiang, R Kiss- mann, and K Scherer. MHD Simulation of the Inner-Heliospheric Magnetic Field. Journal of Geophysical Research (Space Physics), 118:29–44, 03 2013.

[2] T. Wiengarten, J. Kleimann, H. Fichtner, P. Kuhl,¨ A. Kopp, B. Heber, and R. Kiss- mann. Cosmic Ray Transport in heliospheric magnetic structures. i. Modeling back- ground solar wind using the CRONOS magnetohydrodynamic code. The Astrophys- ical Journal, 788(1):80, May 2014.

[3] Scherer, K., van der Schyff, A., Bomans, D. J., Ferreira, S. E. S., Fichtner, H., Kleimann, J., Strauss, R. D., Weis, K., Wiengarten, T., and Wodzinski, T. Cosmic Rays in Astrospheres. A&A, 576:A97, 2015.

[4] R. Kissmann, J. Kleimann, H. Fichtner, and R. Grauer. Local Turbulence Simula- tions for the Multiphase ISM. Monthly Notices of the Royal Astronomical Society, 391(4):1577–1588, 12 2008.

[5] M. Wisniewski, F. Spanier, and R. Kissmann. Diffusion of energetic particles in turbulent magnetohydrodynamic plasmas. The Astrophysical Journal, 750(2):150, Apr 2012.

[6] Martina Wisniewski, Ralf Kissmann, and Felix Spanier. Turbulence Evolution in MHD Plasmas. Journal of Plasma Physics, 79(5):597–612, 2013.

[7] K. Reitberger, R. Kissmann, A. Reimer, O. Reimer, and G. Dubus. High energy Particle Transport in Three-dimensional Hydrodynamic Models of Colliding-wind Binaries. Apj, 782(2):96, Feb 2014.

[8] R. Kissmann, K. Reitberger, O. Reimer, A. Reimer, and E. Grimaldo. Colliding- wind Binaries with strong magnetic fields. The Astrophysical Journal, 831(2):121, Nov 2016.

[9] Emanuele Grimaldo, Anita Reimer, Ralf Kissmann, Felix Niederwanger, and Klaus Reitberger. Proton Acceleration in Colliding Stellar Wind Binaries. The Astrophys- ical Journal, 871(1):55, Jan 2019.

[10] R. Kissmann, J. Kleimann, B. Krebl, and T. Wiengarten. The CRONOS Code for Astrophysical Magnetohydrodynamics. ApJS, 236(2):53, Jun 2018.

75 Bibliography

[11] Frank H. Shu. The Physics of Astrophysics: Gas dynamics. University Science Books, Sausalito, California, 1991.

[12] Matthias Bartelmann. Theoretical Astrophysics - An Introduction. John Wiley & Sons, New York, 1. aufl. edition, 2013.

[13] Cathie Clarke and Bob Carswell. Principles of Astrophysical Fluid Dynamics. Cam- bridge University Press, 2007.

[14] Randall J. Leveque. Finite Volume Methods for Hyperbolic Problems (Cambridge Texts in Applied Mathematics). Cambridge University Press, 2002.

[15] Lawrence C. Evans. Partial Differential Equations (Graduate Studies in Mathemat- ics). Amer Mathematical Society, 2010.

[16] Elewterio F Toro. Riemann Solvers and Numerical Methods for Fluid Dynamics : A Practical Introduction. 3. ed.. edition, 2009.

[17] Randall J. LeVeque, Dimitri Mihalas, E.A. Dorfi, and Ewald Muller.¨ Computational Methods for Astrophysical Fluid Flow. Springer, 1998.

[18] S. K. Godunov. A Difference Method for Numerical Calculation of Discontinuous Solutions of the Equations of Hydrodynamics. Mat. Sb., Nov. Ser., 47:271–306, 1959.

[19] Peter Lax and Burton Wendroff. Systems of Conservation Laws. Communications on Pure and Applied Mathematics, 13(2):217–237, 1960.

[20] R. Courant, K. Friedrichs, and H. Lewy. Uber¨ die Partiellen Differenzengleichungen der Mathematischen Physik. Mathematische Annalen, 100:32–74, 1928.

[21] Amiram Harten, Peter D. Lax, and Bram van Leer. On Upstream Differencing and Godunov-Type Schemes for Hyperbolic Conservation Laws. SIAM Rev, 25:35–61, 01 1983.

[22] Bram van Leer. Towards the Ultimate Conservative Difference Scheme. V. A Second-Order Sequel to Godunov’s Method. Journal of Computational Physics, 32(1):101 – 136, 1979.

[23] Bram van Leer. On the Relation Between the Upwind-Differencing Schemes of Godunov, Engquist–Osher and Roe. SIAM Journal on Scientific and Statistical Computing, 5:1–20, 03 1984.

[24] J. Smoller. Shock Waves and Reaction—Diffusion Equations. Springer Verlag, 1994.

[25] Ami Harten. High Resolution Schemes for Hyperbolic Conservation Laws. Journal of Computational Physics, 49(3):357 – 393, 1983.

76 Bibliography

[26] Chi-Wang Shu and Stanley Osher. Efficient Implementation of Essentially Non- Oscillatory Shock-Capturing Schemes. Journal of Computational Physics, 77(2):439 – 471, 1988. [27] Lorenzo Pareschi, Gabriella Puppo, and Giovanni Russo. Central Runge–Kutta Schemes for Conservation Laws. SIAM J. Sci. Comput., 26:979–999, 03 2005.

[28] J.U Brackbill and D.C Barnes. The Effect of Nonzero ∇ · B on the Numerical So- lution of the Magnetohydrodynamic Equations. Journal of Computational Physics, 35(3):426 – 430, 1980. [29] Kenneth Powell. An Approximate Riemann Solver for Magnetohydrodynamics (That Works More Than One Dimension). ICASE Rep. No 94-24, 05 1994. [30] A. Dedner, F. Kemm, D. Kr¨oner, C.-D. Munz, T. Schnitzer, and M. Wesenberg. Hyperbolic Divergence Cleaning for the MHD Equations. Journal of Computational Physics, 175(2):645 – 673, 2002. [31] C. R. Evans and J. F. Hawley. Simulation of Magnetohydrodynamic Flows - A Constrained Transport Method. ApJ, 332:659–677, Sep 1988. [32] P. Londrillo and L. del Zanna. On the Divergence-free Condition in Godunov- type Schemes for Ideal Magnetohydrodynamics: the Upwind Constrained Transport Method. Journal of Computational Physics, 195:17–48, Mar 2004. [33] R. Kissmann, J. Pomoell, and W. Kley. A Central Conservative Scheme for General Rectangular Grids. Journal of Computational Physics, 228(6):2119 – 2131, 2009. [34] Romain Teyssier, S´ebastien Fromang, and Emmanuel Dormy. Kinematic Dynamos using Constrained Transport with High Order Godunov Schemes and Adaptive Mesh Refinement. Journal of Computational Physics, 218(1):44–67, Oct 2006. [35] S. Fromang, P. Hennebelle, and R. Teyssier. A High Order Godunov Scheme with Constrained Transport and Adaptive Mesh Refinement for Astrophysical Magneto- hydrodynamics. AAP, 457(2):371–384, Oct 2006. [36] M.J. Berger and P. Colella. Local Adaptive Mesh Refinement for Shock Hydrody- namics. Journal of Computational Physics, 82(1):64 – 84, 1989. [37] Marsha J Berger and Joseph Oliger. Adaptive Mesh Refinement for Hyperbolic Partial Differential Equations. Journal of Computational Physics, 53(3):484 – 512, 1984. [38] A.M Khokhlov. Fully Threaded Tree Algorithms for Adaptive Refinement Fluid Dynamics Simulations. Journal of Computational Physics, 143(2):519 – 543, 1998. [39] Gary A Sod. A Survey of Several Finite Difference Methods for Systems of Nonlinear Hyperbolic conservation Laws. Journal of Computational Physics, 27(1):1 – 31, 1978.

77 Bibliography

[40] M. Brio and C. C. Wu. An Upwind Differencing Scheme for the Equations of Ideal Magnetohydrodynamics. Journal of Computational Physics, 75:400–422, Apr 1988.

[41] L I Sedov. Similarity & Dimensional Methods in Mechanics, volume 13. 01 1959.

[42] Geoffrey Taylor. The Formation of a Blast Wave by a Very Intense Explosion. I. Theoretical Discussion. Proceedings of the Royal Society of London Series A, 201(1065):159–174, Mar 1950.

[43] Richard Latter. Similarity Solution for a Spherical Shock Wave. Journal of Applied Physics, 26(8):954–960, 1955.

[44] S. A. Orszag and C.-M. Tang. Small-Scale Structure of Two-Dimensional Magne- tohydrodynamic Turbulence. Journal of Fluid Mechanics, 90:129–143, Jan 1979.

[45] P. Londrillo and L. Del Zanna. High-Order Upwind Schemes for Multidimensional Magnetohydrodynamics. The Astrophysical Journal, 530(1):508–524, Feb 2000.

[46] Dongsu Ryu and Jeremy Goodman. Nonlinear Evolution of Tidally Distorted Ac- cretion Disks: Two-dimensional Simulations. The Astrophysical Journal, 422:269, Feb 1994.

[47] Dongsu Ryu, T. W. Jones, and Adam Frank. Numerical Magnetohydrodynamics in Astrophysics: Algorithm and Tests for Multidimensional Flow. The Astrophysical Journal, 452:785, Oct 1995.

[48] T. Miyoshi and K. Kusano. A Multi-State HLL Approximate Riemann Solver for Ideal Magnetohydrodynamics. Journal of Computational Physics, 208:315–344, Sep 2005.

78