Constrained Transport Method for the Finite Volume Evolution Galerkin Schemes with Application in Astrophysics

Similar documents
On the Comparison of the Finite Volume and Discontinuous Galerkin Methods

Macroscopic plasma description

Applying Asymptotic Approximations to the Full Two-Fluid Plasma System to Study Reduced Fluid Models

ON THE COMPARISON OF EVOLUTION GALERKIN AND DISCONTINUOUS GALERKIN SCHEMES

Well-balanced central finite volume methods for the Ripa system

Computational Astrophysics

Recapitulation: Questions on Chaps. 1 and 2 #A

Finite Volume Evolution Galerkin (FVEG) Methods for Hyperbolic Systems

Multi-D MHD and B = 0

Finite volume schemes for multidimensional hyperbolic systems based on the use of bicharacteristics

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

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

A Central Compact-Reconstruction WENO Method for Hyperbolic Conservation Laws

Finite Volume Method

SW103: Lecture 2. Magnetohydrodynamics and MHD models

Finite volume evolution Galerkin method for hyperbolic conservation laws with spatially varying flux functions

High-resolution finite volume methods for hyperbolic PDEs on manifolds

Scientific Computing I

The RAMSES code and related techniques I. Hydro solvers

PROBLEM 1 (15 points) In a Cartesian coordinate system, assume the magnetic flux density

A Space-Time Expansion Discontinuous Galerkin Scheme with Local Time-Stepping for the Ideal and Viscous MHD Equations

A Hybrid Method for the Wave Equation. beilina

The RAMSES code and related techniques 2- MHD solvers

Sistemas Hiperbólicos no Lineales: Un Nuevo Método para Calcular Flujos Relativistas

On divergence-free reconstruction schemes for CED and MHD

Solving the Euler Equations!

On limiting for higher order discontinuous Galerkin method for 2D Euler equations

Ideal Magnetohydrodynamics (MHD)

AA214B: NUMERICAL METHODS FOR COMPRESSIBLE FLOWS

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Finite Volume Evolution Galerkin Methods A Survey

Vortex stretching in incompressible and compressible fluids

is given in Section 5. Finally in Section 6 numerical tests, which demonstrate third order behaviour of our scheme, are presented. General Theory In t

Fluid equations, magnetohydrodynamics

Rankine-Hugoniot-Riemann solver for steady multidimensional conservation laws with source terms

Waves in plasma. Denis Gialis

Webster s horn model on Bernoulli flow

Numerical Solutions to Partial Differential Equations

Characteristics for IBVP. Notes: Notes: Periodic boundary conditions. Boundary conditions. Notes: In x t plane for the case u > 0: Solution:

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

The Divergence Theorem Stokes Theorem Applications of Vector Calculus. Calculus. Vector Calculus (III)

A Comparison between the Two-fluid Plasma Model and Hall-MHD for Captured Physics and Computational Effort 1

A Brief Revision of Vector Calculus and Maxwell s Equations

X i t react. ~min i max i. R ij smallest. X j. Physical processes by characteristic timescale. largest. t diff ~ L2 D. t sound. ~ L a. t flow.

Introduction to Partial Differential Equations

Wave propagation methods for hyperbolic problems on mapped grids

1. INTRODUCTION TO CFD SPRING 2018

Linear Hyperbolic Systems

The Sun: A Star of Our Own ASTR 2110 Sarazin

Riemann Solvers and Numerical Methods for Fluid Dynamics

Two-scale numerical solution of the electromagnetic two-fluid plasma-maxwell equations: Shock and soliton simulation

PLASMA ASTROPHYSICS. ElisaBete M. de Gouveia Dal Pino IAG-USP. NOTES: (references therein)

ALGEBRAIC FLUX CORRECTION FOR FINITE ELEMENT DISCRETIZATIONS OF COUPLED SYSTEMS

CapSel Roe Roe solver.

PDE Solvers for Fluid Flow

We briefly discuss two examples for solving wave propagation type problems with finite differences, the acoustic and the seismic problem.

Stable Semi-Discrete Schemes for the 2D Incompressible Euler Equations

CHAPTER 7 ELECTRODYNAMICS

xkcd.com It IS about physics. It ALL is.

Hyperbolic Systems of Conservation Laws. in One Space Dimension. I - Basic concepts. Alberto Bressan. Department of Mathematics, Penn State University

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

On the entropy stability of Roe-type finite volume methods

Magnetohydrodynamic waves in a plasma

A Finite Volume Code for 1D Gas Dynamics

Electrodynamics Qualifier Examination

Matrices and Deformation

Local discontinuous Galerkin methods for elliptic problems

Antennas and Propagation. Chapter 2: Basic Electromagnetic Analysis

While the Gauss law forms for the static electric and steady magnetic field equations

Notes: Outline. Diffusive flux. Notes: Notes: Advection-diffusion

Introduction to Magnetohydrodynamics (MHD)

Cache Oblivious Stencil Computations

Conservation Laws in Ideal MHD

APPENDIX 2.1 LINE AND SURFACE INTEGRALS

A High Order Conservative Semi-Lagrangian Discontinuous Galerkin Method for Two-Dimensional Transport Simulations

Part 1: Numerical Modeling for Compressible Plasma Flows

Positivity-preserving high order schemes for convection dominated equations

The Center for Astrophysical Thermonuclear Flashes. FLASH Hydrodynamics

18.02 Multivariable Calculus Fall 2007

A Multi-Dimensional Limiter for Hybrid Grid

Solving the Generalized Poisson Equation Using the Finite-Difference Method (FDM)

An Overview of Fluid Animation. Christopher Batty March 11, 2014

CLASSICAL ELECTRICITY

Shock-capturing Schemes for a Collisionless Two-fluid Plasma Model

Partitioned Methods for Multifield Problems

A Bound-Preserving Fourth Order Compact Finite Difference Scheme for Scalar Convection Diffusion Equations

Worked Examples Set 2

Electromagnetic Theory Prof. D. K. Ghosh Department of Physics Indian Institute of Technology, Bombay

Space Physics. An Introduction to Plasmas and Particles in the Heliosphere and Magnetospheres. May-Britt Kallenrode. Springer

Numerical Methods for Modern Traffic Flow Models. Alexander Kurganov

EQUADIFF 9. Mária Lukáčová-Medviďová Numerical solution of compressible flow. Terms of use:

Sung-Ik Sohn and Jun Yong Shin

The Convergence of Mimetic Discretization

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

What is a flux? The Things We Does Know

Conductors and Dielectrics

1. INTRODUCTION TO CFD SPRING 2019

Notes: Outline. Shallow water equations. Notes: Shallow water equations. Notes:

Finite Volume Method for Scalar Advection in 2D

The Physics of Fluids and Plasmas

Transcription:

Project work at the Department of Mathematics, TUHH Constrained Transport Method for the Finite Volume Evolution Galerkin Schemes with Application in Astrophysics Katja Baumbach April 4, 005 Supervisor: Prof. Dr. M. Lukáčová -Medvid ová

Contents Introduction ii Conservation Laws and Finite Volume Methods. Hyperbolic Systems and Conservations Laws.................. Finite Volume Methods for Hyperbolic Conservation Laws......... 3 The SMHD Equations 9. Mathematical Formulation........................... 9. Application in Astrophysics.......................... 3 The Evolution Operator 5 3. Evolution Galerkin Methods for General Hyperbolic Systems........ 5 3. Exact Evolution Operator for General Two-Dimensional Hyperbolic Systems 5 3.3 A Finite Volume Evolution Galerkin Method................. 8 4 Application of the FVEG Method to the SMHD Equations 0 5 The Constrained Transport Method 3 6 Numerical Experiments 3 6. One-Dimensional Riemann Problem...................... 3 6. Two-Dimensional Rotor-Like Problem..................... 34 6.3 Two-Dimensional Explosion Problem..................... 39 7 Conclusions 44 Bibliography 45 i

Introduction Hyperbolic problems occur in many scientific fields, such as fluid dynamics, elastodynamics, biomechanics and geophysics. Especially in fluid dynamics, there are many phenomena which can be described by hyperbolic partial differential equations, including aerodynamics, the physics of waves which can be found among other things in acoustics, in optics and in electromagnetics, but also transport phenomena which comprise the transport of heat or some chemical substances as well as the modeling of traffic flows. In this work we will be concerned with the shallow water magnetohydrodynamic (SMHD) equation system, which can be taken as a mathematical model for astrophysical phenomena. M. Lukáčová -Medvid ová and T. Kröger have obtained good numerical solutions when applying a truly multi-dimensional finite volume evolution Galerkin (FVEG) method to the SMHD system, as described in [5]. In this work the numerical solution is further improved by combining the FVEG scheme with a constrained transport method which enforces the preservation of a divergence-free condition. More precisely, this is the condition that forces the divergence of the magnetic field flux to be equal to zero. ii

Chapter Conservation Laws and Finite Volume Methods. Hyperbolic Systems and Conservations Laws A general homogeneous strictly hyperbolic system of partial differential equations has the form d q (x, t) + A i (x, t) q (x, t) = 0, (.) t x i where the matrix pencil i= A = d n i A i (.) i= is diagonalizable having real eigenvalues for all n R d. Here d denotes the dimension. In two space dimensions, i.e. d =, a general homogeneous hyperbolic system takes the form t q (x, t) + A (x, t) x q (x, t) + A (x, t) q (x, t) = 0. (.3) y A conservation law in two space dimensions is a hyperbolic system of equations that can be written in the form q (x, t) + t x f (q (x, t)) + f (q (x, t)) = 0. (.4) y A conservation law can be understood more intuitively if it is written in integral form which reads d q (x, t) dω = n f (q (x, t)) ds. (.5) dt Ω Ω We say that q is conserved in the spatial domain Ω if changes to the integral of q over Ω occur only due to a flux through the boundary of Ω. In two space dimensions x = (x, y) T (.6)

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS and f = (f, g) T, (.7) where f and g denote the flux of the conserved quantity q in x- and y-direction, respectively. By n (x, t) we denote the outer normal to the surface Ω of the considered domain Ω. This integral form of a conservation law can be easily transformed into differential form. With the help of the Gauss theorem the surface integral can be replaced by a volume integral n f (q (x, t)) ds = div f (q (x, t)) dx dy Ω Ω = x f (q (x, t)) + (.8) y g (q (x, t)) dx dy. Ω We consider a domain that does not change in time, so at the LHS of the conservation law we can exchange integration over Ω and derivation with respect to time and we get [ q (x, t) + t x f (q (x, t)) + ] g (q (x, t)) dx dy = 0 (.9) y Ω which yields the differential formulation of the conservation law q (x, t) + t x f (q (x, t)) + g (q (x, t)) = 0. y The conservation law is strictly hyperbolic if the Jacobians A = df dq, A = dg dq (.0) of the flux functions f, g and all their linear combinations are diagonalizable with real eigenvalues. The matrices A, A are called flux Jacobians. Written in the form of a general homogeneous hyperbolic equation the conservation law reads t q (x, t) + A x q (x, t) + A q (x, t) = 0. (.) y The advection equation As an example for a hyperbolic conservation law we will now consider the linear advection equation with constant coefficients. In two space dimensions it reads q (x, t) + u t x q (x, t) + v q (x, t) = 0. (.) y

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 3 This equation describes the transport of a quantity q with a flow of velocity u = (u, v) T, where u, v denote the velocity components in x- and y-direction respectively. In a constant coefficient advection equation the velocities do not depend on space or time and neither on the quantity q. The transported quantity does not influence the flow. The hyperbolic equation can be transformed into conservation form where the fluxes in x- and y-direction are given as q (x, t) + t x f (x, t) + g (x, t) = 0, (.3) y f (x, t) = uq (x, t), g (x, t) = v q (x, t). (.4) If, on the contrary, the velocities are not independent of space the advection equation reads q (x, t) + u (x) t x q (x, t) + v (x) q (x, t) = 0. (.5) y This equation is not in conservation form. When introducing the flux functions f (x, t) = u (x) q (x, t), g (x, t) = v (x) q (x, t) (.6) in order to transform the equation into the form of a conservation law an additional source term has to be added that arises from the space dependency of the velocities. After applying the product rule to the derivatives in x- and y-direction the advection equation becomes q (x, t) + t x f (x, t) + g (x, t) = q (x, t) u (x) + q (x, t) v (x). (.7) y x x The additional source term is a non-conservative term, because it induces a change in the quantity q that is not due to fluxes through the cell interfaces.. Finite Volume Methods for Hyperbolic Conservation Laws The methods we will now consider are based on the integral form of a conservation law in two space dimensions: d q (x, t) dω = n f (q (x, t)) ds. (.8) dt Ω Ω To construct a discretized version of this equation, the considered domain is subdivided into a finite number of control volumes and the solution is updated on each such volume

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 4 Figure.: An arbitrary cell Ω ij in a uniform cartesian grid. according to (.8). Since we concentrate ourselves on problems in two space dimensions on regular domains the control volumes will be quadrilateral. In a uniform cartesian grid the grid lines follow the coordinate axes, so that the outer normal vectors to the grid interfaces either point in x- or in y-direction. In such a grid it holds that x = x i+ x i, y = y j+ Ω ij = x y, y j and the conservation law for the cell Ω ij therefore reads:, (.9) d dt yj+ y j xi+ q (x, y, t) dx dy = x i yj+ ( ( f q y j + xi+ x i x i+ ( ( g q )), y, t x, y j+ dy )), t yj+ y j dx f xi+ x i ( ( q x i ( ( g q )), y, t x, y j dy )), t dx. (.0) If we divide (.0) by the area of Ω ij, i.e. by x y, and integrate over the time interval [t n, t n+ ] we get

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 5 yj+ xi+ q ( x, y, t n+) dx dy x y y j x i x y yj+ xi+ y j x y x y + x y x i q (x, y, t n ) dx dy = tn+ yj+ f t n y j tn+ yj+ t n y j tn+ xi+ t n x i ( ( q f x i+ ( ( q ( ( g q )), y, t x i tn+ xi+ ( ( g q x y t n x i x, y j+ dy dt )), y, t x, y j )), t )), t dy dt dx dt dx dt. (.) Now the LHS represents the change of the cell average of the conserved quantity q. The four integrals on the RHS represent averaged fluxes on the cell interfaces of Ω ij. In most cases, it will not be possible to calculate these integrals exactly since q varies along the cell interface and in time. In fact, the approximation of q will be discontinuous over Ω ij. If these integrals are approximated in some way, an approximate update of the cell averaged solution can be calculated. Let F i,j, F i+,j, G i,j fluxes: and G i,j+ F n tn+ yj+ ( ( f q i,j t y t n y j F n tn+ i+,j t y t n G n i,j G n i,j+ t x t x be suitable approximations for the integral averaged yj+ y j tn+ xi+ t n x i tn+ xi+ t n x i f ( ( q ( ( g q ( ( g q x i x i+ x, y j x, y j+ )), y, t )), y, t )), t )), t dy dt, dy dt, dx dt, dx dt. (.) By Q n ij we denote a piecewise constant approximation of the cell averaged conserved quantity, i.e. Q n ij = yj+ xi+ q (x, y, t n ) dx dy. (.3) x y y j x i

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 6 We can now formulate the finite volume discretization of the conservation law (.8) Q n+ ij = Q n ij t ] [F ni+ x,j Fni t [ ] G n G n. (.4),j i,j+ y i,j Depending on how the average fluxes are approximated different methods can be derived. A detailed description of different finite volume schemes can be found in []. The Upwind Method The upwind method makes use of the fact that in a hyperbolic problem information propagates along characteristics. The slope of the characteristics and thus the direction in which the information propagates depends on the eigenvalues of the hyperbolic system. The idea of this method is to approximate the fluxes through the cell interfaces according to the eigenvalues of the system i.e. according to the direction from which the data should come. The numerical approximation of the flux function is chosen constant along the cell interfaces on each time level. The upwind method for the linear scalar advection equation We consider the scalar constant coefficient advection equation in two space dimensions t q + u x q (x, y, t) + v q (x, y, t) = 0. (.5) y As u and v are constant, the equation can be written in conservation form t q + x f (q (x, y, t)) + g (q (x, y, t)) = 0, (.6) y with the fluxes in x- and y-direction given as f (x, y, t) = uq (x, y, t), g (x, y, t) = v q (x, y, t). (.7) The exact update for the conserved quantity q (x, t) therefore reads x y yj+ y j xi+ x i q ( x, y, t n+) dx dy yj+ xi+ q (x, y, t n ) dx dy = x y y j x i

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 7 x y x y + x y tn+ yj+ ( uq t n y j tn+ yj+ t n y j tn+ xi+ t n x i x i+ ( uq ( vq ), y, t x i tn+ xi+ ( vq x y t n x i x, y j+ dy dt ), y, t ), t x, y j ), t dy dt dx dt dx dt. (.8) For the scalar advection equation (.5) the characteristics (ξ (t), ξ (t), t) are defined as follows dξ dt = u, dξ dt = v. (.9) Therefore the direction of propagation of the information is given by the coefficients u and v which are the flow velocities. We can therefore determine the fluxes on the cell interfaces by looking in the opposite direction of the flow. Thus, if we approximate the average fluxes through the boundary of an arbitrary cell Ω i,j we get the following finite volume update for the averaged quantity in that cell Q n+ i,j [ ( ) = Q n i,j t F n i+ x F n + ( ) ] G n G n (.30),j i,j i,j+ y i,j with the flux functions in horizontal direction given by { F n = ui+ i+,j,jqn i,j, if u i+,j > 0 and F n i,j = u i+,jqn i+,j, else { ui,jqn i,j, if u i u i Qn,j i,j, else.,j > 0 } } (.3) (.3) Analogously the fluxes in vertical direction are given by and G n i,j+ G n i,j = = { vi,j+ v i,j+ { vi,j v i,j Q n i,j, if v i,j+ Q n i,j+, else Q n i,j, if v i,j Q n i,j, else. > 0 > 0 } } (.33) (.34)

CHAPTER. CONSERVATION LAWS AND FINITE VOLUME METHODS 8 If we introduce the following notation ( ) u + = max u n+ i+,j i+,j, 0, ( ) u = min u n+ i+,j i+,j, 0, v i,j+ v i,j+ = max = min ( v n+ i,j+ ( v n+, 0 i,j+ ), 0, ) (.35) the approximate fluxes can be compactly written as F n i+,j = u+ i+,jqn i,j + u i+,jqn i+,j, F n i,j = u+ i,jqn i,j + u i,jqn i,j (.36) and G n i,j+ G n i,j = v + Q n i,j+ i,j + v Q n i,j+ i,j+, = v + Q n i,j i,j + v Q n i,j i,j. (.37)

Chapter The SMHD Equations. Mathematical Formulation The governing equations in magnetohydrodynamics describe the interaction of a magnetic field and an electrically conducting non-magnetic fluid. Such fluids are liquid metals and plasmas. Plasmas are hot ionised gases. The physics of liquid metals interacting with a magnetic field have applications in industrial metal processing but also in geophysics. The terrestrial magnetic field is maintained by liquid metals in the interior of the earth. In this work we will only be concerned with the magnetohydrodynamics of plasmas. We will in particular assume the fluid to be a perfect conductor i.e. its electrical conductivity is assumed to be infinitely large. Under this assumption the so called ideal magnetohydrodynamic (MHD) equations can be derived. These equations can be taken as a mathematical model for phenomena in astrophysics. The solar as well as the galactic magnetic field are interacting with the motion of electrically conducting fluids. In the case of the solar magnetic field this interaction gives rise to the generation of sun spots, which will be explained in the next section. The ideal MHD equations are based on the Maxwell equations combined with the equations of conservation of mass, momentum and energy and the thermodynamical state equation. The quantities describing the coupled behaviour of magnetic field and velocity field are q = (ρ, ρu, E, B) T (.) where ρ is the mass density of the fluid, u is the velocity field, E denotes the total energy and B is the magnetic field. The coupling between magnetic field and fluid motion will only take place if there is a relative movement between them, which induces an electric current in the conducting fluid. Now there are two phenomena which counteract the relative movement. A second magnetic field, induced by that current, is superimposed on the magnetic field and influences its motion. Additionally the Lorentz force counteracts the relative movement of the magnetic field and the fluid. For a perfectly conducting fluid this has the effect that the magnetic field 9

CHAPTER. THE SMHD EQUATIONS 0 seems to be anchored into the fluid. These phenomena can be mathematically formulated using the laws of Faraday, Ampère and Ohm and the equation for the Lorentz force. The induction of an electric current is given by Faraday s law. Denoting by Ω the electric field, Faraday s law in the differential form is given by Ω = B t. (.) Ampère s law on the other hand is an equation for the magnetic field induced by the current in the conducting fluid B = J. (.3) Here J denotes the current density which is given by Ohm s law J = σ(ω + u B), (.4) where σ is the electrical conductivity. These three formula can be combined to yield a transport equation for the magnetic field, which reads B t + (u B) = B. (.5) σ Assuming the fluid to be an ideal conductor, i.e. σ, this equation simplifies to B t + (u B) = 0. (.6) Equation (.6) is called induction equation and it describes the coupled behaviour of the magnetic field and the velocity field. We still have to consider the Lorentz force which counteracts the relative movement of the magnetic field and fluid. The Lorentz force is given by Again using Ampère s law the Lorentz force becomes F = J B. (.7) F = J B B. (.8) In the equation of momentum, which states that the rate of change of momentum in the fluid is equal to the sum over all forces acting on the fluid, the Lorentz force has to be taken into account. Adding the equations of conservation of mass and energy and the divergence free constraint div (B) = 0, (.9)

CHAPTER. THE SMHD EQUATIONS which follows from Faraday s law, the system of ideal magnetohydrodynamic equations is completed. In three space dimensions it reads ρ ρu ρu ρu + p B ρu ρu 3 t E + ρu u B B ρu u 3 B B 3 x u (E + p) B (u B) B 0 B u B u B B 3 u B 3 u 3 B (.0) ρu ρu 3 ρu u B B ρu u 3 B B 3 + ρu + p B ρu u 3 B B 3 y u (E + p) B (u B) + ρu u 3 B B 3 ρu 3 + p B 3 y u 3 (E + p) B 3 (u B) = 0, u B u B u 3 B u B 3 0 u 3 B u B 3 u B 3 u 3 B 0 B x + B y + B 3 z where p denotes the total pressure and it is given by = 0, (.) p = gh. (.) A detailed derivation of the ideal MHD equations can be found in Rossmanith []. In our work we will be concerned with the shallow water magnetohydrodynamic (SMHD) equations, which can be derived by integrating the three dimensional ideal MHD system (.0), (.) in vertical direction, i.e. in z-direction. The SMHD equations are a mathematical model of the magnetohydrodynamic behaviour of free surface flows in large scales with constant mass density, where the horizontal scale is much larger than the vertical scale. Among these flows which can be modeled with the SMHD equations there is e.g. the plasma flow on the surface of the sun, that is described in the next section. The advantage of the SMHD equations is that their hyperbolic structure is simpler than that of the full MHD equations so that the construction of a numerical solver is less complicated. The detailed derivation of these equations can be found in Rossmanith [], too. We will only list the assumptions that are necessary to convert the MHD equations into the SMHD system by integrating them in the vertical direction. These assumptions are as follows. The mass density is constant.

CHAPTER. THE SMHD EQUATIONS The equation for the magnetohydrostatic balance is fulfilled, cf. (.3). The magnetohydrostatic pressure is constant at the surface. The equation for the magnetohydrostatic balance can be derived from the equation of conservation of the vertical momentum, by assuming the vertical component of velocity and magnetic field to be negligible. It reads z (p + ρ B ) = ρg. (.3) For the integration of the MHD system in vertical direction, the following boundary conditions at the free surface and the bottom are used. The vertical component of the velocity is determined by the rate of displacement of these surfaces. The vertical component of the magnetic field is parallel to these surfaces. By integrating the three-dimensional ideal MHD equations the SMHD system can be derived. It can be written in the following way h hu hu 0 hu t hu hb + hu hb + p x hu u B 0 + hu u hb B y hu hb + p hu B hu B = gh b x gh b y 0, (.4) hb hu B hu B 0 0 with the unknown quantities (hb ) x + (hb ) y = 0, (.5) q = (h, hu, hu, hb, hb ) T. (.6) Here b(x, y) denotes the position of the bottom in vertical direction. The induction equation comprising the last two equations of the SMHD system reads now [ ] hb + [ ] 0 + [ ] hu B hu B = 0. (.7) t hb x hu B hu B y 0. Application in Astrophysics An astrophysical phenomenon that can be modeled by the SMHD equations is the formation of sun spots on the surface of the sun. This process is mainly determined by the induction equation for the magnetic field. The plasma that covers the surface of the sun has a very high electrical conductivity, so that the assumption of a perfect conductor is

CHAPTER. THE SMHD EQUATIONS 3 justified. For a perfect conductor the induction equation reads B t + (B u) = 0. (.8) From this equation two important statements can be derived, the conjunction of which is generally known as Alfvén s theorem. These two statements are as follows.. The magnetic field lines are frozen into the fluid, i.e. the relative movement of the fluid and the magnetic field is nearly eliminated.. If we consider a flux tube, i.e. a number of succeeding loops connected by the magnetic flux that traverses them, and if this tube moves with the fluid, than the magnetic flux through the tube will remain constant. The combination of these two statements is the explanation of how tubes of very strong magnetic fields come about on the surface of the sun. These tubes are the cause of the formation of sun spots. The plasma on the sun surface is in a state of turbulent convection, in fact there is a convective plasma layer in which heat is transported to the surface, making the sun appear bright. The solar magnetic field is frozen into the plasma and it is thus deformed because of the turbulent movements in this layer. Now the second statement of Alfvén s theorem tells us that the magnetic flux through a flux tube is constant. From this it follows that in regions of stretched field lines B increases. The strength of the solar magnetic field is comparable with that of the terrestrial magnetic field, but in these stretched tubes it can reach considerable strengths. Due to buoyancy forces the stretched tubes can rise to the surface of the convective zone and even burst into the atmosphere of the sun. If such a tube breaks through the surface of the convective layer, the strong magnetic field prevents the heat transfer, the surface cools down and dark sun spots appear. The dynamic of this complex astrophysical phenomenon can be mathematically modeled by the SMHD equations. More precisely, the SMHD equations describe the activity in the solar tachocline, which is a thin layer between the convective zone and the radiative zone of the sun.

CHAPTER. THE SMHD EQUATIONS 4 Figure.: Magnetic activity in the solar atmosphere (Encyclopaedia Britannica).

Chapter 3 The Evolution Operator 3. Evolution Galerkin Methods for General Hyperbolic Systems An Evolution Galerkin Method is given by an approximate evolution operator E and a projection P h. The method maps the approximate solution U n at time t n to the solution U n+ at time t n+, starting from some initial data U 0 in the following way: U n+ = P h E U n. (3.) Here E approximates the exact evolution operator of the hyperbolic system, that describes the time evolution of the exact solution of the partial differential equation. P h projects the solution at the new time-level obtained by application of E to an appropriate space S h of piecewise polynomials of order r. In our case this is the space of piecewise constant functions. 3. Exact Evolution Operator for General Two-Dimensional Hyperbolic Systems As mentioned in Chapter a general two-dimensional hyperbolic conservation law can be written in the following form: U t + A (U) U x + A (U) U y = 0, (3.) where U R m is the vector of dependent variables and the A k R m m, k =, are the flux Jacobians of the hyperbolic system. Let us linearize (3.) by freezing the Jacobian matrices A (U), A (U) at some suitable point Ũ. This yields a linear system in the form U t + A U x + A U y 5 = 0. (3.3)

CHAPTER 3. THE EVOLUTION OPERATOR 6 We now denote by n an arbitrary unit vector in R. Since the system (3.3) is hyperbolic, its matrix pencil A (n) = n A + n A (3.4) has m real eigenvalues λ,.., λ m and corresponding linearly independent eigenvectors r (n),.., r m (n). Following Ostkamp [7], [8] and Lukáčová -Medvid ová, Morton, Warnecke [4] we briefly rewrite the procedure of deriving the exact evolution operator for linearized hyperbolic conservation laws. In order to obtain a quasi-diagonalised system, we multiply (3.) by the matrix R (n), where R is the matrix of right eigenvectors of the matrix pencil. We thus get U R t + U R A x + U R A y = 0. (3.5) We can replace R U, using the definition of the characteristic variables W R U = W. (3.6) In the special case of constant flux Jacobian, which is our case now, this can be integrated to yield W = R U, U = RW. (3.7) We introduce the matrix and make use of the fact that These transformations result in the following equation B k = R A k R, k =, (3.8) R A k R R U = R A k R W. (3.9) W t W + B x + B W y = 0. (3.0) In one space dimension this transformation would yield a diagonal system. As we are in two space dimensions all that can be done, is to decompose the B k into a diagonal part Λ k and a rest matrix B k B k = Λ k + B k. (3.) Thus, we obtain the quasi-diagonalised system with W t W + Λ x + Λ W y = S, (3.) S = B W x B W y. (3.3)

CHAPTER 3. THE EVOLUTION OPERATOR 7 We are looking for an exact evolution operator, i.e. an operator that maps U (x, t) to U (x, t + t). This operator is found by considering the behaviour of U along the bicharacteristics defined by dx dt = b (n) = ( ) b, b T, (3.4) dy dt = b (n) = ( ) b, b T. (3.5) We integrate the j-th equation of the quasi-diagonalised system (3.) along the bicharacteristics. From the LHS we obtain t+ t [ ] wj (x (t), t) + b w j (x (t), t) jj + b w j (x (t), t) jj dt t t x y t+ t [ wj (x (t), t) = + dx w j (x (t), t) + dy ] w j (x (t), t) dt t t dt x dt y t+ t [ ] (3.6) dwj (x (t), t) = dt dt t = w j (x (t + t), t + t, n) w j (x (t), t, n) = w j (P, n) w j (Q j (n), n), j {, }. Here P denotes the point, where all bicharacteristics reach the time level t + t. The Q j are the points where the bicharacteristics start at time level t. We denote by S the integral over the RHS: S j (n) = t+ t t S j (x j (τ, n), τ, n) dτ, j {, }. (3.7) We will later approximate these integrals by the rectangle rule in time. We have thus mapped the solution w j (Q j, n) to the solution w j (P, n): w (P, n) w (Q, n) = S (n), w (P, n) w (Q, n) = S (n), (3.8) where n is an arbitrary unit vector in R. As we are looking for the solution U at the new time level, we have to transform this equation back to the original variables. To this aim we multiply (3.8) by R and integrate over n which is equal to integrating over the unit sphere O. Note that we can write n in the form n = (cos θ, sin θ) T. (3.9) Thus integration over O yields U (P) = O = π O π 0 R (n) W (P, n) do R (n (θ)) W (P, n (θ)) dθ. (3.0)

CHAPTER 3. THE EVOLUTION OPERATOR 8 Applying these transformations to the rest terms in (3.8) yields where π ( w (Q R (n), n) π 0 w (Q, n) S = O = π ) O π t+ t 0 dθ + S = π π 0 R (n) S (n) do = π t r j (n) w j (Q j, n) dθ + S, (3.) j=, π R (n) S (τ, n) dτ. 0 R (n) S (n) dθ (3.) We have now found the exact evolution operator for a linear hyperbolic system in two space dimensions. This operator maps the solution U n at time t n to the solution U n+ at time t n+ in the following way U n+ (P) = π π 0 r n j (n) wj n (Q j, n) dθ + S n. (3.3) j=, The exact evolution operator (3.3) is an implicit representation in time. In order to derive a time explicit scheme we need to approximate time integrals in S. Details about how to approximate the evolution operator in an appropriate way as well as stability analysis and numerical results concerning the application of an evolution Galerkin method to the wave equation system and the Euler equations of gas dynamics can be found in [3], [4]. 3.3 A Finite Volume Evolution Galerkin Method As described in Chapter a finite volume method applied to a two-dimensional conservation law in the form t U + x f (U) + g (U) = 0 (3.4) y updates the solution in a control volume by making a balance of the fluxes over the interfaces of the control volume. The idea of the finite volume evolution Galerkin method is to approximate the averaged fluxes in the formula for the finite volume update with the help of the approximate evolution Galerkin operator. To this end the solution at time level t n+ is calculated in one or several points on each cell interface. This is done with the evolution Galerkin method, i.e. by applying the approximate operator to the solution at the old time level. Evaluation of the flux function and application of a numerical quadrature rule for the flux integrals on the cell interfaces yields the approximate average fluxes which are used in the finite volume update U n+ ij = U n ij t ] [F ni+ x,j Fni t [ ] G n G n, (3.5),j i,j+ y i,j

CHAPTER 3. THE EVOLUTION OPERATOR 9 where the fluxes are computed as follows F n i,j = y F n i+,j = y G n i,j G n i,j+ = x = x yj+ y j yj+ y j xi+ x i xi+ x i f f ( E i t/ Un ) ( E i+ t/ Un ) ( ) g E j t/ Un ( ) g E j+ t/ Un dy, dy, dx, dx. (3.6) This gives the following algorithm to calculate the quantity U n+ from the known data U n by the FVEG method.. The system in primitive variables is linearized at the old time level.. The hyperbolic structure of the linearized system is calculated. This includes the quasi-diagonalized flux Jacobians, the matrix of right eigenvectors and the eigenvalues. 3. According to the eigenvalues which determine the slope of the bicharacteristics the points Q j (θ), θ = 0,.., π are computed at the old time level t n. 4. The data at time t n is evaluated in the points Q j (θ), θ = 0,.., π. 5. The approximate evolution operator is applied to determine the solution at time t n+ in one or several points P of each cell interface, e.g. in the midpoints or the vertices. 6. The flux function is evaluated to compute the flux in these points. 7. The projection P h is applied to construct a piecewise constant flux through the cell interfaces. For the projection e.g. the Simpson rule or the trapezoidal rule can be used. 8. The approximated fluxes through the cell interfaces are inserted into the formula (3.5) for the finite volume update, and the solution at the time level t n+ is computed accordingly. The derivation and analysis of a multi-dimensional, high-resolution finite volume evolution Galerkin scheme can be found in [4] and [6].

Chapter 4 Application of the FVEG Method to the SMHD Equations The conservative form of the SMHD equations reads as follows h hu hu 0 hu t hu hb + hu hb + p x hu u B 0 + hu u hb B y hu hb + p hu B hu B = gh b x gh b y 0. hb hu B hu B 0 0 Before the approximate evolution operator is applied to this system of equations, we will transform it into a system for the primitive variables (h, u, u, B, B ) T and then modify it further in order to get a system with a simpler structure. In primitive variables the SMHD equations can be written in the following form h + (u )h + h( u) = 0, t u t + g h x h B (B )h + (u )u B ( B) (B )B = 0, u t + g h y h B (B )h + (u )u B ( B) (B )B = 0, B t h u (B )h (B )u + (u )B u ( B) = 0, B t h u (B )h (B )u + (u )B u ( B) = 0. (4.) As described in [5] the so called Powell-like form of the SMHD system can be derived and used in the FVEG scheme. This modified system has a simpler hyperbolic structure and its exact solution is equal to that of the original SMHD system in the case that it is smooth and fulfills the divergence-free constraint div(hb) = 0. 0

CHAPTER 4. APPLICATION OF THE FVEG METHOD TO THE SMHD EQUATIONS The Powell-like form of the SMHD system reads It can be derived by adding a multiple of h + (u )h + h( u) = 0, t u t + g h x + (u )u (B )B = 0, u t + g h y + (u )u (B )B = 0, B (B )u + (u )B = 0, t B (B )u + (u )B = 0. t (4.) (hb) = (B )h + h( B) (4.3) to the SMHD system. The derivation of the evolution operator requires the knowledge of the hyperbolic structure of the equation system. In analogy with Chapter 3 we denote by n = (n, n ) T an arbitrary non-zero unit vector in R and by A(n) the matrix pencil of the hyperbolic system A(n) = n A + n A. (4.4) For the Powell-like form of the SMHD systems A(n) has the following form u n hn hn 0 0 gn u n 0 B n 0 A(n) = gn 0 u n 0 B n 0 B n 0 u n 0. (4.5) 0 0 B n 0 u n Using the abbreviation we get the following representation for the eigenvalues W = (B n) + gh(n n) (4.6) λ (n) = u n + B n, λ (n) = u n B n, λ 3 (n) = u n + W, λ 4 (n) = u n W, λ 5 (n) = u n. (4.7)

CHAPTER 4. APPLICATION OF THE FVEG METHOD TO THE SMHD EQUATIONS The right eigenvectors of A(n) are given by 0 n r (n) = (n n) n n, r (n) = n r 3 (n) = W (n n) (B n) 0 r 5 (n) = 0 gn, gn l 3 (n) = h (n n) n W n W n (B n) n (B n) (n n), r 4(n) = W (n n) 0 n n n, n and the left eigenvectors have the following form. 0 0 n l (n) = n n, l n (n) = n n, n n g(n n) g(n n) n W n W n W n W n (B n) n (B n) (B n) 0 l 5 (n) = 0 hn. hn, l 4(n) = n (B n) n (B n) h (n n) n W n W n (B n) n (B n),, (4.8) (4.9) If the hyperbolic structure is known the approximate evolution operator can be derived analogously to (3.3). The finite volume update of the SMHD system can be computed according to (3.6).

Chapter 5 The Constrained Transport Method The last equation div (hb) = 0 (5.) of the SMHD equations needs special attention, because, if it is not fulfilled exactly, it can produce non-physical solutions, such as e.g. negative heights. Especially near discontinuities, the error due to the numerical discretization can cause very large divergences. To avoid this, an additional transport equation has been introduced into the FVEG code, by means of which the divergence-free condition can be enforced. This additional equation is a relation for the magnetic potential A. It can be derived from the induction equation. As stated in Chapter the induction equation for the magnetic flux reads t This is equal to [ ] hb hb + x t [ ] 0 + [ ] hu B hu B = 0. (5.) hu B hu B y 0 [ ] hb hb x [ ] 0 + Ω y with Ω defined according to Ohm s law for a perfect conductor as In component form we get [ ] Ω = 0, (5.3) 0 Ω = u hb + u hb. (5.4) (hb ) t (hb ) t + Ω y = 0, Ω x = 0. (5.5) We want to convert this equation into an equation for the magnetic potential A. The existence of such an potential follows from the fact, that the divergence of the exact magnetic field flux hb is equal to zero. The magnetic flux and its potential are related as follows hb = A. (5.6) 3

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 4 In two space dimensions, this is equal to hb = y A, hb = x A. (5.7) With the help of this relation we can convert equation (5.5) into an equation for the magnetic potential A A t y + Ω y = 0, A t x Ω x = 0 (5.8) and thus A + Ω = 0. (5.9) t The idea of the constrained transport method is to use this equation in order to get a corrected magnetic field flux. This corrected flux should fulfill a discrete version of the divergence-free condition. In each time step, after the SMHD equations have been approximated by the FVEG method (3.5), (3.6), the additional equation (5.9) is used to calculate the update for the potential A. Relation (5.7) yields the corrected magnetic flux. It is the discretization of the derivatives in this relation that enforces the divergence free constraint. Thus, the computed magnetic fluxes will differ only slightly from the magnetic fluxes obtained by the FVEG method. The induction equation is used in both cases to calculate the magnetic field. It is a part of the SMHD system and it is used again in the constrained transport method. Only here, it has been transformed into an equation for the magnetic potential A, the spatial derivatives of which yield the magnetic flux. The decisive point is how to approximate the derivatives in this relation in order to obtain a divergence-free solution. We will follow the proceding described by Rossmanith in his dissertation []. He proposes to use a staggered grid and to arrange the variables on the grids as depicted in Figure 5.. The potential A is computed at the midpoints of the staggered grid which coincide with the corners of the original grid. The first component hb of the corrected magnetic flux lies at the north and south edges of the staggered grid, which are the east and west edges of the original grid. The second component hb of the corrected magnetic flux lies at the east and west edges of the staggered grid, which are the north and south edges of the original grid. The velocity u in x-direction is set on the north and south edges of the staggered grid. The velocity u in y-direction is set on the east and west edges of the staggered grid.

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 5 Figure 5.: Arrangement of the variables in the grids. With this arrangement, the derivatives of the potential in the equation (5.7) can be approximated by central differences and the corrected magnetic field flux is obtained as [hb ] n+ = ( ) A n+ A n+, i,j y i,j+ i,j [hb ] n+ i,j = x ( A n+ A n+ i,j i+,j ). (5.0) We now consider a cell of the original grid. The corrected fluxes lie on the edges of that cell. The desired corrected flux in the cell center can be obtained by averaging. In the discrete formula for the divergence, the derivatives are approximated by central differences of the hb values on the edges of that cell: [div (hb)] n+ ij = [hb ] n+ [hb i+ ] n+,j i,j x + [hb ] n+ [hb i,j+ ] n+ i,j. (5.) y

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 6 The discrete divergence given by (5.) is now equal to zero. This can be seen by replacing the hb- values on the cell edges according to (5.0). One gets ( ) ( ) A n+ A n+ A n+ A n+ y i+,j+ i+,j y i,j+ i,j [div (hb)] n+ ij = + x) ( A n+ A n+ x i,j+ i+,j+ ( ) x A n+ i,j A n+ i+,j y = ( A n+ A n+ A n+ + A n+ x y i+,j+ i+,j i,j+ i,j = 0. + A n+ A n+ A n+ + A n+ i,j+ i+,j+ i,j i+,j ) (5.) The predictor step, i.e. the approximate evolution operator E, works with primitive variables. We therefore have to divide the corrected magnetic fluxes at the cell centers by the height, in order to obtain the magnetic field values. We have now deduced a way to calculate the magnetic field flux in such a way that its discrete divergence given by (5.) equals zero. An algorithm, in which the solution of the SMHD equations calculated with the FVEG method is corrected accordingly in each time step, can be written in the following form. The SMHD equations are solved with the FVEG method, yielding the values of the quantities (ρ, u, u, B, B ) T at the new time level. The magnetic field is not yet divergence free. It will be corrected in the next steps. The potential A is updated, according to (5.9). The spatial derivatives of the potential A/ x, A/ y are calculated and the values of the corrected magnetic flux hb, hb are obtained on the staggered grid [hb ] n+ = ( ) A n+ A n+, i,j y i,j+ i,j [hb ] n+ i,j = x ( A n+ A n+ i,j i+,j The magnetic flux values hb are averaged, to get the corrected magnetic field at the cell centers of the original grid. The discrete divergence is now equal to zero [B ] n+ i,j [B ] n+ i,j = ( [hb ] n+ h + [hb i ] n+,j = ( [hb ] n+ + [hb h i,j ] n+ i,j+ i+,j ), ). ).

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 7 It remains to be discussed how to approximate equation (5.9) in order to calculate an update for the magnetic potential A in each time step. There are several different constrained transport methods calculating the update in a different way. In this work we will be concerned with the MPACT scheme developed by Rossmanith[]. The name MPACT means Magnetic Potential Advection Constrained Transport, which indicates that the method is based on the advection of the magnetic potential. In fact, equation (5.9) can be transformed into an advection equation for the potential A. If we replace in (5.9) the electric field Ω according to (5.4), we get A t u hb + u hb = 0. (5.3) Using the relation (5.7) we get a transport equation for the potential A A t + u A x + u A y = 0. (5.4) This equation is linear and strictly hyperbolic and can therefore be solved with little expense, using an upwind scheme. Care has to be taken only on the staggered arrangement of the velocity components. Considering the advection equation for an arbitrary grid cell C ij of the staggered grid, the velocity components, i.e. the coefficients of the equation, cannot be assumed to be constant, because they are stored on the edges of that grid cell. In order to discretize the advection equation with the upwind scheme, we must therefore introduce a non-conservative source term as described in Chapter of this work. Thus rewriting the advection equation we get A t + u A x + u A y = A u x A u y. (5.5) We can now discretize this equation with the upwind scheme, using central differences for the approximation of the derivatives in the source term [ ( ) A n+ i,j = A n i,j t F n i+ x F n + ( ) G n G n,j i,j i,j+ y i,j ( ) ( )] (5.6) A n i,j u n+ u n+ x i+ A n,j i i,j u n+ u n+,j y i,j+. i,j Using the same notation as in Chapter, the flux functions in horizontal direction read and in vertical direction we get F n i+,j = [u+ ] n+ i+,jan i,j + [u ] n+ i+,jan i+,j, F n i,j = [u+ ] n+ i,jan i,j + [u ] ] n+ i,jan i,j, G n i,j+ G n i,j = [u + ] n+ A n i,j+ i,j + [u ] n+ A n i,j+ i,j+, = [u + ] n+ A n i,j i,j + [u ] n+ A n i,j i,j. (5.7) (5.8)

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 8 For the calculation of the fluxes the velocities on the cell interfaces at the new time level have been used. They will be situated as depicted in Figure 5. and can be obtained by averaging the cell centered velocity values. If we insert the averaging of the velocities and the discretized transport equation into the constrained transport algorithm, we get the following algorithm. Constrained Transport Algorithm All quantities on the original grid are initialized according to the problem. On the staggered grid, the potential A is initialized in such a way, that relation (5.7) is fulfilled. Now, in each time step, the following steps are executed.. The SMHD equations are solved with the FVEG method, yielding the values of the quantities (ρ, u, u, B, B ) T at the new time level. The magnetic field at the cell centers is not yet divergence free. It will be corrected in the next steps.. The velocity components on the staggered grid are computed, by averaging the data on the original grid ( [u ] n+ i,j [u ] n+ i,j + [u ) ] n+ i,j, = [u ] n+ i,j = ( [u ] n+ i,j + [u ) ] n+ i,j. 3. The potential is updated with the upwind method [ ( ) A n+ i,j = A n i,j t F n i+ x F n + ( ) G n G n,j i,j i,j+ y i,j ( ) ( )] A n i,j u n+ u n+ x i+ A n,j i i,j u n+ u n+,j y i,j+. i,j 4. The spatial derivatives of the potential are calculated and the values of the corrected magnetic flux on the staggered grid are obtained [hb ] n+ = ( ) A n+ A n+, i,j y i,j+ i,j [hb ] n+ i,j = x ( A n+ A n+ i,j i+,j 5. The values of the magnetic flux hb are averaged to get the corrected magnetic field at the cell centers of the original grid. The discrete divergence of the magnetic field values equals now zero [B ] n+ i,j [B ] n+ i,j = ( [hb ] n+ h + [hb i ] n+,j = ( [hb ] n+ + [hb h i,j ] n+ i,j+ i+,j ), ). ).

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 9 It should be pointed out that without the constrained transport method the discrete divergence was zero only at the vertices, cf. [5]. By the presented approach we force the solution to be divergence free at the cell centers of the original grid. Boundary and Initial Conditions To complete the algorithm, the initialization of the data on both grids has been added. In order to obtain good solutions, it is important to chose appropriate initial conditions and boundary conditions for all quantities. The initialization of the data on the original grid can be adopted from the original implementation of the FVEG method without the constrained transport method. Only the initial data for the magnetic field needs special attention, because it has to fulfill the divergence free constraint. From Faraday s law it can only be deduced, that the divergence of the exact magnetic field flux will remain zero, if it was so initially. Thus the magnetic field has to be initialized in such a way, that the divergence of the flux hb equals zero in each grid cell. On the staggered grid, only the potential A needs to be initialized. Here care has to be taken, because the potential has to be initialized in such a way, that relation (5.7) is fulfilled. There is no need to initialize the velocity and magnetic flux components on the staggered grid. If the algorithm starts with the FVEG method, it can procede to calculate the velocities on the staggered grid by means of averaging and after the update for the potential A has taken place, the magnetic flux on the staggered grid can be calculated. The data in the boundary cells of the staggered grid needs special attention, too. The staggered grid is at each side half a cell larger than the original grid. Therefore some sort of boundary condition has to be implemented in order to be able to calculate the data in the boundary cells of the staggered grid. There are two possible ways of proceding. Either a ghost cell layer boundary condition for the potential A is implemented. In this case the magnetic flux can be calculated according to equation (5.0) in all points where it is needed. This has the advantage that the discrete divergence given by (5.) equals zero in the boundary cells of the grid, too. However, when the ghost cell layer boundary condition is implemented, the values in the boundary cells of the grid are copied values of the neighbouring grid cells. Consequently the derivatives of the potential A with respect to space will be zero at the boundary. This means that the magnetic flux given by (5.7) will be zero, too, at the boundary, independently of its physically exact value. This produces oscillations in the solution. We can alternatively implement a boundary condition for the magnetic flux. This can be a ghost cell boundary condition or a periodic boundary condition, depending on the problem. In this case the potential A need not be calculated in the boundary cells, at all, and the boundary values of the magnetic flux will be much more conform with those that are physically correct. Only now, (5.0) is no longer used to calculate the flux in these cells, so that the divergence free constraint is no longer enforced at the boundary. However, the discrete divergence will be zero in the interior of the grid and there are no oscillations due to boundary conditions if this alternative is chosen.

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 30 There is no need to implement a boundary condition for the velocity components, as can be seen in Figure 5.. All values that are necessary to update the potential A in the interior of the staggered grid, can be computed by averaging the data in the original grid.

Chapter 6 Numerical Experiments In the following we study the effect of the constrained transport method on the FVEG solution of the SMHD equations. To this end we will analyze the numerical results of three test problems, to which the FVEG method has been applied with and without enforced divergence-free constraint. All computations have been executed with a CFL number of 0.45 and a gravitational constant of.0 in a computational domain of size [, ] [, ]. For the calculation of the numerical fluxes through the cell interfaces the numerical quadrature rule has been chosen analogously to [5], i.e. the Simpson rule has been used for the flow equations which are the first three equations of (4.) and the trapezoidal rule for the magnetic field equations which are the last two equations of (4.). At the boundaries a ghost cell layer boundary condition has been implemented for all data on the original grid and for the magnetic flux on the staggered grid. The discrete divergence given by [div(hb)] n+ ij = [hb ] n+ [hb i+ ] n+,j i,j x + [hb ] n+ [hb i,j+ ] n+ i,j y has only been plotted in the interior of the original grid where the divergence-free condition is enforced. Here the divergence has the magnitude of the machine accuracy. 6. One-Dimensional Riemann Problem We first consider a one-dimensional Riemann Problem, which can be interpreted as being a SMHD variant of the dam break test problem for the shallow water equations. The initialization at t = 0 of the Riemann-Problem consists of a shock in the magnetic field and height at x = 0 and constant initial values for the velocities x < 0 : h =, u = 0, u = 0, B =, B = 0, x > 0 : h =, u = 0, u = 0, B = 0.5, B =. (6.) 3

CHAPTER 6. NUMERICAL EXPERIMENTS 3 h div(hb) 0 4 u u B B Figure 6.: Constrained Transport, 00x0 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 33 h u u B B Figure 6.: Without Constrained Transport, 00x0 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 34 The magnetic flux at t = 0 has thus the following form x < 0 : hb =, hb = 0, x > 0 : hb =, hb =. (6.) If we consider relation (5.7) hb = A, y hb = x we can see that a reasonable initialization for the potential A is given by x < 0 : A = y +, x > 0 : A = y x +. (6.3) Away from the shock both components of the initial magnetic flux are constant, so that its exact divergence will be zero. At the shock the first component of the initial flux is constant, but the second is not, so that the exact divergence is not equal to zero. However, this is a one-dimensional problem, and therefore this discrepancy with equation (.9) due to the initialization in y-direction is of no consequence. The cell centered discrete divergence at y = 0 can be seen in Figure 6.. The numerical solution has been computed with a grid size of 00 0 cells at time t = 0.4. The FVEG scheme without the new approach produces slight oscillations in the solution, which arise because the divergence is not equal to zero. The FVEG solution without constrained transport can be seen in Figure 6.. The oscillations are smoothed out when the MPACT scheme is used, as can be seen in Figure 6.. 6. Two-Dimensional Rotor-Like Problem A truly two-dimensional problem is given by the following initialization x < 0. : h = 0, u = x, u = x, B = 0., B = 0, x > 0. : h =, u = 0, u = 0, B =, B = 0. (6.4) This test problem can be taken as mathematical model of a circular membrane which separates plasma of the same mass density but different height and magnetic field. There is no flow of the plasma outside of the membrane. Inside, the plasma is moved circularly. This test problem has been chosen in analogy to the magnetic rotor test problem for the ideal MHD equations, which considers plasmas with different density inside and outside of the membrane. According to the initialization the magnetic flux at t = 0 has the following form x < 0. : hb =, hb = 0, (6.5) x > 0. : hb =, hb = 0. Taking again account of (5.7) the potential A can be initialized as follows A = y +, x. (6.6)

CHAPTER 6. NUMERICAL EXPERIMENTS 35 h u u B B Figure 6.3: Constrained Transport, 00x00 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 36 h div(hb) 0 4 u u B B Figure 6.4: Constrained Transport, 00x00 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 37 h u u B B Figure 6.5: Without Constrained Transport, 00x00 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 38 h u u B B Figure 6.6: Without Constrained Transport, 00x00 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 39 The initial magnetic flux is constant everywhere in the computational domain. Consequently its exact divergence is equal to zero. The discrete divergence of the solution has been plotted in Figure 6.4. For this problem the FVEG scheme has been tested against the FVEG scheme with constrained transport for a grid size of 00 00 cells at time t = 0.. For both cases we demonstrate contour plots as well as plots at y = 0. In the plots, it can be seen that for this test case the MPACT scheme produces oscillations near the origin of the considered domain. These oscillations are particularly evident in the plots at y = 0, which differ strongly from those without the constrained transport method, cf. Figures 6.4, 6.6. 6.3 Two-Dimensional Explosion Problem As a last test problem we will consider the two-dimensional explosion problem, with the data initialized as follows x < 0.3 : h =, u = 0, u = 0, B = 0., B = 0, x > 0.3 : h = 0., u = 0, u = 0, B =, B = 0. (6.7) Again, we can consider this as model for a circular membrane separating plasmas of different height and magnetic field inside and outside of it. In this case the membrane is removed at time t = 0, so that we have again the analogy to the dam break problem as in the first test problem. As can be seen, the initial magnetic flux is constant and thus it fulfills the divergence-free constraint. The potential A can be initialized as follows hb = 0., hb = 0, x (6.8) A = y +, x. (6.9) The grid size has been chosen as 300 300, the computation time as t = 0.5. Again, we compare the contour-plots as well as plots at y = 0 of the FVEG scheme with those obtained when the FVEG scheme is embedded in the constrained transport algorithm. This test problem again shows the advantage of the new approach. The contour plots in Figure 6.9 show slight oscillations in the second component of the magnetic field. These contour plots are improved due to the constrained transport scheme, as can be seen in Figure 6.7, and the cell centered divergence is reduced to the magnitude of the machine accuracy.