constrained transport method for the finite volume ... · 1.2 finite volume methods for hyperbolic...

48
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 14, 2005 Supervisor: Prof. Dr. M. Lukáčová -Medvid’ová

Upload: others

Post on 22-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Project work at the Department ofMathematics, TUHH

Constrained Transport Methodfor the Finite Volume

Evolution Galerkin Schemeswith Application in Astrophysics

Katja Baumbach

April 14, 2005

Supervisor: Prof. Dr. M. Lukáčová -Medvid’ová

Contents

Introduction ii

1 Conservation Laws and Finite Volume Methods 11.1 Hyperbolic Systems and Conservations Laws . . . . . . . . . . . . . . . . . 11.2 Finite Volume Methods for Hyperbolic Conservation Laws . . . . . . . . . 3

2 The SMHD Equations 92.1 Mathematical Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Application in Astrophysics . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3 The Evolution Operator 153.1 Evolution Galerkin Methods for General Hyperbolic Systems . . . . . . . . 153.2 Exact Evolution Operator for General Two-Dimensional Hyperbolic Systems 153.3 A Finite Volume Evolution Galerkin Method . . . . . . . . . . . . . . . . . 18

4 Application of the FVEG Method to the SMHD Equations 20

5 The Constrained Transport Method 23

6 Numerical Experiments 316.1 One-Dimensional Riemann Problem . . . . . . . . . . . . . . . . . . . . . . 316.2 Two-Dimensional Rotor-Like Problem . . . . . . . . . . . . . . . . . . . . . 346.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 phenomenawhich 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 inelectromagnetics, but also transport phenomena which comprise the transport of heat orsome 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 whenapplying a truly multi-dimensional finite volume evolution Galerkin (FVEG) method tothe SMHD system, as described in [5].In this work the numerical solution is further improved by combining the FVEG schemewith a constrained transport method which enforces the preservation of a divergence-freecondition. More precisely, this is the condition that forces the divergence of the magneticfield flux to be equal to zero.

ii

Chapter 1

Conservation Laws and Finite VolumeMethods

1.1 Hyperbolic Systems and Conservations LawsA general homogeneous strictly hyperbolic system of partial differential equations has theform

∂tq (x, t) +

d∑i=1

Ai (x, t)∂

∂xi

q (x, t) = 0, (1.1)

where the matrix pencil

A =d∑

i=1

niAi (1.2)

is diagonalizable having real eigenvalues for all n ∈ Rd. Here d denotes the dimension.In two space dimensions, i.e. d = 2, a general homogeneous hyperbolic system takes theform

∂tq (x, t) + A1 (x, t)

∂xq (x, t) + A2 (x, t)

∂yq (x, t) = 0. (1.3)

A conservation law in two space dimensions is a hyperbolic system of equations that canbe written in the form

∂tq (x, t) +

∂xf (q (x, t)) +

∂yf (q (x, t)) = 0. (1.4)

A conservation law can be understood more intuitively if it is written in integral formwhich reads

d

dt

∫Ω

q (x, t) dΩ = −∫

∂Ω

n · f (q (x, t)) dS. (1.5)

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 (1.6)

1

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 2

andf = (f ,g)T , (1.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 volumeintegral ∫

∂Ω

n · f (q (x, t)) dS =

∫Ω

div f (q (x, t)) dx dy

=

∫Ω

∂xf (q (x, t)) +

∂yg (q (x, t)) dx dy.

(1.8)

We consider a domain that does not change in time, so at the LHS of the conservation lawwe can exchange integration over Ω and derivation with respect to time and we get∫

Ω

[∂

∂tq (x, t) +

∂xf (q (x, t)) +

∂yg (q (x, t))

]dx dy = 0 (1.9)

which yields the differential formulation of the conservation law

∂tq (x, t) +

∂xf (q (x, t)) +

∂yg (q (x, t)) = 0.

The conservation law is strictly hyperbolic if the Jacobians

A1 =df

dq,

A2 =dg

dq

(1.10)

of the flux functions f ,g and all their linear combinations are diagonalizable with realeigenvalues. The matrices A1, A2 are called flux Jacobians.Written in the form of a general homogeneous hyperbolic equation the conservation lawreads

∂tq (x, t) + A1

∂xq (x, t) + A2

∂yq (x, t) = 0. (1.11)

The advection equation

As an example for a hyperbolic conservation law we will now consider the linear advectionequation with constant coefficients.In two space dimensions it reads

∂tq (x, t) + u

∂xq (x, t) + v

∂yq (x, t) = 0. (1.12)

CHAPTER 1. 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 constantcoefficient advection equation the velocities do not depend on space or time and neitheron the quantity q. The transported quantity does not influence the flow. The hyperbolicequation can be transformed into conservation form

∂tq (x, t) +

∂xf (x, t) +

∂yg (x, t) = 0, (1.13)

where the fluxes in x- and y-direction are given as

f (x, t) = uq (x, t) ,

g (x, t) = vq (x, t) .(1.14)

If, on the contrary, the velocities are not independent of space the advection equation reads

∂tq (x, t) + u (x)

∂xq (x, t) + v (x)

∂yq (x, t) = 0. (1.15)

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)(1.16)

in order to transform the equation into the form of a conservation law an additional sourceterm 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 advectionequation becomes

∂tq (x, t) +

∂xf (x, t) +

∂yg (x, t) = q (x, t)

∂xu (x) + q (x, t)

∂xv (x) . (1.17)

The additional source term is a non-conservative term, because it induces a change in thequantity q that is not due to fluxes through the cell interfaces.

1.2 Finite Volume Methods for Hyperbolic Conserva-tion Laws

The methods we will now consider are based on the integral form of a conservation law intwo space dimensions:

d

dt

∫Ω

q (x, t) dΩ = −∫

∂Ω

n · f (q (x, t)) dS. (1.18)

To construct a discretized version of this equation, the considered domain is subdividedinto a finite number of control volumes and the solution is updated on each such volume

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 4

Figure 1.1: An arbitrary cell Ωij in a uniform cartesian grid.

according to (1.18).Since we concentrate ourselves on problems in two space dimensions on regular domainsthe control volumes will be quadrilateral. In a uniform cartesian grid the grid lines followthe coordinate axes, so that the outer normal vectors to the grid interfaces either point inx- or in y-direction.In such a grid it holds that

∆x = xi+ 12− xi− 1

2,

∆y = yj+ 12− yj− 1

2,

|Ωij| = ∆x∆y,

(1.19)

and the conservation law for the cell Ωij therefore reads:

d

dt

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q (x, y, t) dx dy =

∫ yj+1

2

yj− 1

2

f(q

(xi+ 1

2, y, t

))dy −

∫ yj+1

2

yj− 1

2

f(q

(xi− 1

2, y, t

))dy

+

∫ xi+1

2

xi− 1

2

g(q

(x, yj+ 1

2, t

))dx−

∫ xi+1

2

xi− 1

2

g(q

(x, yj− 1

2, t

))dx

.

(1.20)

If we divide (1.20) by the area of Ωij, i.e. by ∆x∆y, and integrate over the time interval[tn, tn+1] we get

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 5

1

∆x∆y

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q(x, y, tn+1

)dx dy −

1

∆x∆y

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q (x, y, tn) dx dy =

1

∆x∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

f(q

(xi+ 1

2, y, t

))dy dt

− 1

∆x∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

f(q

(xi− 1

2, y, t

))dy dt

+1

∆x∆y

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

g(q

(x, yj+ 1

2, t

))dx dt

− 1

∆x∆y

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

g(q

(x, yj− 1

2, t

))dx dt

.

(1.21)

Now the LHS represents the change of the cell average of the conserved quantity q. Thefour 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 alongthe 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 cellaveraged solution can be calculated.Let Fi− 1

2,j,Fi+ 1

2,j,Gi,j− 1

2and Gi,j+ 1

2be suitable approximations for the integral averaged

fluxes:

Fni− 1

2,j≈ 1

∆t∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

f(q

(xi− 1

2, y, t

))dy dt,

Fni+ 1

2,j≈ 1

∆t∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

f(q

(xi+ 1

2, y, t

))dy dt,

Gni,j− 1

2≈ 1

∆t∆x

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

g(q

(x, yj− 1

2, t

))dx dt,

Gni,j+ 1

2≈ 1

∆t∆x

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

g(q

(x, yj+ 1

2, t

))dx dt.

(1.22)

By Qnij we denote a piecewise constant approximation of the cell averaged conserved quan-

tity, i.e.

Qnij =

1

∆x∆y

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q (x, y, tn) dx dy. (1.23)

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 6

We can now formulate the finite volume discretization of the conservation law (1.18)

Qn+1ij = Qn

ij −∆t

∆x

[Fn

i+ 12,j− Fn

i− 12,j

]− ∆t

∆y

[Gn

i,j+ 12−Gn

i,j− 12

]. (1.24)

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 [2].

The Upwind Method

The upwind method makes use of the fact that in a hyperbolic problem information propa-gates along characteristics. The slope of the characteristics and thus the direction in whichthe information propagates depends on the eigenvalues of the hyperbolic system.The idea of this method is to approximate the fluxes through the cell interfaces accordingto the eigenvalues of the system i.e. according to the direction from which the data shouldcome. The numerical approximation of the flux function is chosen constant along the cellinterfaces 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

∂tq + u

∂xq (x, y, t) + v

∂yq (x, y, t) = 0. (1.25)

As u and v are constant, the equation can be written in conservation form

∂tq +

∂xf (q (x, y, t)) +

∂yg (q (x, y, t)) = 0, (1.26)

with the fluxes in x- and y-direction given as

f (x, y, t) = uq (x, y, t) ,

g (x, y, t) = vq (x, y, t) .(1.27)

The exact update for the conserved quantity q (x, t) therefore reads

1

∆x∆y

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q(x, y, tn+1

)dx dy

− 1

∆x∆y

∫ yj+1

2

yj− 1

2

∫ xi+1

2

xi− 1

2

q (x, y, tn) dx dy =

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 7

1

∆x∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

uq(xi+ 1

2, y, t

)dy dt

− 1

∆x∆y

∫ tn+1

tn

∫ yj+1

2

yj− 1

2

uq(xi− 1

2, y, t

)dy dt

+1

∆x∆y

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

vq(x, yj+ 1

2, t

)dx dt

− 1

∆x∆y

∫ tn+1

tn

∫ xi+1

2

xi− 1

2

vq(x, yj− 1

2, t

)dx dt

.

(1.28)

For the scalar advection equation (1.25) the characteristics (ξ1(t), ξ2(t), t) are defined asfollows

dξ1

dt= u,

dξ2

dt= v.

(1.29)

Therefore the direction of propagation of the information is given by the coefficients u andv which are the flow velocities.We can therefore determine the fluxes on the cell interfaces by looking in the oppositedirection of the flow. Thus, if we approximate the average fluxes through the boundary ofan arbitrary cell Ωi,j we get the following finite volume update for the averaged quantityin that cell

Qn+1i,j = Qn

i,j −∆t

[1

∆x

(F n

i+ 12,j− F n

i− 12,j

)+

1

∆y

(Gn

i,j+ 12−Gn

i,j− 12

)](1.30)

with the flux functions in horizontal direction given by

F ni+ 1

2,j

=

ui+ 1

2,jQ

ni,j, if ui+ 1

2,j > 0

ui+ 12,jQ

ni+1,j, else

(1.31)

and

F ni− 1

2,j

=

ui− 1

2,jQ

ni−1,j, if ui− 1

2,j > 0

u1i− 1

2 ,jQn

i,j, else.

(1.32)

Analogously the fluxes in vertical direction are given by

Gni,j+ 1

2=

vi,j+ 1

2Qn

i,j, if vi,j+ 12

> 0

vi,j+ 12Qn

i,j+1, else

(1.33)

and

Gni,j− 1

2=

vi,j− 1

2Qn

i,j−1, if vi,j− 12

> 0

vi,j− 12Qn

i,j, else.

(1.34)

CHAPTER 1. CONSERVATION LAWS AND FINITE VOLUME METHODS 8

If we introduce the following notation

u+i+ 1

2,j

= max(un+1

i+ 12,j, 0

),

u−i+ 1

2,j

= min(un+1

i+ 12,j, 0

),

v−i,j+ 1

2

= max(vn+1

i,j+ 12

, 0)

,

v−i,j+ 1

2

= min(vn+1

i,j+ 12

, 0)

(1.35)

the approximate fluxes can be compactly written as

F ni+ 1

2,j

= u+i+ 1

2,jQn

i,j + u−i+ 1

2,jQn

i+1,j,

F ni− 1

2,j

= u+i− 1

2,jQn

i−1,j + u−i− 1

2,jQn

i,j

(1.36)

and

Gni,j+ 1

2= v+

i,j+ 12

Qni,j + v−

i,j+ 12

Qni,j+1,

Gni,j− 1

2= v+

i,j− 12

Qni,j−1 + v−

i,j− 12

Qni,j.

(1.37)

Chapter 2

The SMHD Equations

2.1 Mathematical FormulationThe governing equations in magnetohydrodynamics describe the interaction of a magneticfield and an electrically conducting non-magnetic fluid. Such fluids are liquid metals andplasmas. Plasmas are hot ionised gases.The physics of liquid metals interacting with a magnetic field have applications in indus-trial metal processing but also in geophysics. The terrestrial magnetic field is maintainedby liquid metals in the interior of the earth.In this work we will only be concerned with the magnetohydrodynamics of plasmas. Wewill in particular assume the fluid to be a perfect conductor i.e. its electrical conductivity isassumed to be infinitely large. Under this assumption the so called ideal magnetohydrody-namic (MHD) equations can be derived. These equations can be taken as a mathematicalmodel for phenomena in astrophysics. The solar as well as the galactic magnetic field areinteracting with the motion of electrically conducting fluids. In the case of the solar mag-netic field this interaction gives rise to the generation of sun spots, which will be explainedin the next section.The ideal MHD equations are based on the Maxwell equations combined with the equationsof 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 (2.1)

where ρ is the mass density of the fluid, u is the velocity field, E denotes the total energyand B is the magnetic field.The coupling between magnetic field and fluid motion will only take place if there is arelative movement between them, which induces an electric current in the conducting fluid.Now there are two phenomena which counteract the relative movement. A second magneticfield, induced by that current, is superimposed on the magnetic field and influences itsmotion. Additionally the Lorentz force counteracts the relative movement of the magneticfield and the fluid. For a perfectly conducting fluid this has the effect that the magnetic field

9

CHAPTER 2. THE SMHD EQUATIONS 10

seems to be anchored into the fluid. These phenomena can be mathematically formulatedusing 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 electricfield, Faraday’s law in the differential form is given by

∇×Ω = −∂B

∂t. (2.2)

Ampère’s law on the other hand is an equation for the magnetic field induced by the currentin the conducting fluid

∇×B = J. (2.3)

Here J denotes the current density which is given by Ohm’s law

J = σ(Ω + u×B), (2.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) =

1

σ∆B. (2.5)

Assuming the fluid to be an ideal conductor, i.e. σ →∞, this equation simplifies to

∂B

∂t+∇× (u×B) = 0. (2.6)

Equation (2.6) is called induction equation and it describes the coupled behaviour ofthe magnetic field and the velocity field.We still have to consider the Lorentz force which counteracts the relative movement of themagnetic field and fluid. The Lorentz force is given by

F = J×B. (2.7)

Again using Ampère’s law the Lorentz force becomes

F = J×B×B. (2.8)

In the equation of momentum, which states that the rate of change of momentum in thefluid is equal to the sum over all forces acting on the fluid, the Lorentz force has to be takeninto account. Adding the equations of conservation of mass and energy and the divergencefree constraint

div (B) = 0, (2.9)

CHAPTER 2. THE SMHD EQUATIONS 11

which follows from Faraday’s law, the system of ideal magnetohydrodynamic equations iscompleted. In three space dimensions it reads

∂t

ρρu1

ρu2

ρu3

EB1

B2

B3

+

∂x

ρu1

ρu21 + p−B2

1

ρu1u2 −B1B2

ρu1u3 −B1B3

u1(E + p)−B1(u ·B)0

u1B2 − u2B1

u1B3 − u3B1

+∂

∂y

ρu2

ρu1u2 −B1B2

ρu22 + p−B2

2

ρu2u3 −B2B3

u2(E + p)−B2(u ·B)u2B1 − u1B2

0u2B3 − u3B2

+

∂y

ρu3

ρu1u3 −B1B3

ρu2u3 −B2B3

ρu23 + p−B2

3

u3(E + p)−B3(u ·B)u3B1 − u1B3

u3B2 − u2B3

0

= 0,

(2.10)

∂B1

∂x+

∂B2

∂y+

∂B3

∂z= 0, (2.11)

where p denotes the total pressure and it is given by

p =1

2gh2. (2.12)

A detailed derivation of the ideal MHD equations can be found in Rossmanith [1].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(2.10), (2.11) in vertical direction, i.e. in z-direction. The SMHD equations are a mathe-matical model of the magnetohydrodynamic behaviour of free surface flows in large scaleswith constant mass density, where the horizontal scale is much larger than the verticalscale. 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 thanthat of the full MHD equations so that the construction of a numerical solver is less com-plicated.The detailed derivation of these equations can be found in Rossmanith [1], too. We willonly list the assumptions that are necessary to convert the MHD equations into the SMHDsystem by integrating them in the vertical direction.These assumptions are as follows.

• The mass density is constant.

CHAPTER 2. THE SMHD EQUATIONS 12

• The equation for the magnetohydrostatic balance is fulfilled, cf. (2.13).

• The magnetohydrostatic pressure is constant at the surface.

The equation for the magnetohydrostatic balance can be derived from the equation ofconservation of the vertical momentum, by assuming the vertical component of velocityand magnetic field to be negligible. It reads

∂z(p +

ρ

2|B|2) = −ρg. (2.13)

For the integration of the MHD system in vertical direction, the following boundary con-ditions at the free surface and the bottom are used.

• The vertical component of the velocity is determined by the rate of displacement ofthese 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 de-rived. It can be written in the following way

∂t

h

hu1

hu2

hB1

hB2

+∂

∂x

hu1

hu21 − hB2

1 + phu1u2 − hB1B2

0hu1B2 − hu2B1

+∂

∂y

hu2

hu1u2 − hB1B2

hu22 − hB2 + p

hu2B1 − hu1B2

0

=

0

−gh ∂b∂x

−gh ∂b∂y

00

, (2.14)

∂(hB1)

∂x+

∂(hB2)

∂y= 0, (2.15)

with the unknown quantities

q = (h, hu1, hu2, hB1, hB2)T . (2.16)

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

∂t

[hB1

hB2

]+

∂x

[0

hu1B2 − hu2B1

]+

∂y

[hu2B1 − hu1B2

0

]= 0. (2.17)

2.2 Application in AstrophysicsAn astrophysical phenomenon that can be modeled by the SMHD equations is the for-mation of sun spots on the surface of the sun. This process is mainly determined by theinduction equation for the magnetic field. The plasma that covers the surface of the sunhas a very high electrical conductivity, so that the assumption of a perfect conductor is

CHAPTER 2. THE SMHD EQUATIONS 13

justified.For a perfect conductor the induction equation reads

∂B

∂t+∇× (B× u) = 0. (2.18)

From this equation two important statements can be derived, the conjunction of which isgenerally known as Alfvén’s theorem. These two statements are as follows.

1. The magnetic field lines are frozen into the fluid, i.e. the relative movement of thefluid and the magnetic field is nearly eliminated.

2. If we consider a flux tube, i.e. a number of succeeding loops connected by themagnetic flux that traverses them, and if this tube moves with the fluid, than themagnetic flux through the tube will remain constant.

The combination of these two statements is the explanation of how tubes of very strongmagnetic fields come about on the surface of the sun. These tubes are the cause of theformation of sun spots.The plasma on the sun surface is in a state of turbulent convection, in fact there is aconvective plasma layer in which heat is transported to the surface, making the sun appearbright. The solar magnetic field is frozen into the plasma and it is thus deformed becauseof the turbulent movements in this layer.Now the second statement of Alfvén’s theorem tells us that the magnetic flux through aflux 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 magneticfield, but in these stretched tubes it can reach considerable strengths. Due to buoyancyforces the stretched tubes can rise to the surface of the convective zone and even burst intothe atmosphere of the sun. If such a tube breaks through the surface of the convectivelayer, the strong magnetic field prevents the heat transfer, the surface cools down and darksun spots appear.The dynamic of this complex astrophysical phenomenon can be mathematically modeledby the SMHD equations. More precisely, the SMHD equations describe the activity in thesolar tachocline, which is a thin layer between the convective zone and the radiative zoneof the sun.

CHAPTER 2. THE SMHD EQUATIONS 14

Figure 2.1: Magnetic activity in the solar atmosphere (Encyclopaedia Britannica).

Chapter 3

The Evolution Operator

3.1 Evolution Galerkin Methods for General HyperbolicSystems

An Evolution Galerkin Method is given by an approximate evolution operator E∆ and aprojection Ph. The method maps the approximate solution Un at time tn to the solutionUn+1 at time tn+1, starting from some initial data U0 in the following way:

Un+1 = PhE∆Un. (3.1)

Here E∆ approximates the exact evolution operator of the hyperbolic system, that describesthe time evolution of the exact solution of the partial differential equation. Ph projectsthe solution at the new time-level obtained by application of E∆ to an appropriate spaceSh of piecewise polynomials of order r. In our case this is the space of piecewise constantfunctions.

3.2 Exact Evolution Operator for General Two-DimensionalHyperbolic Systems

As mentioned in Chapter 1 a general two-dimensional hyperbolic conservation law can bewritten in the following form:

∂U

∂t+ A1 (U)

∂U

∂x+ A2 (U)

∂U

∂y= 0, (3.2)

where U ∈ Rm is the vector of dependent variables and the Ak ∈ Rm×m, k = 1, 2 are theflux Jacobians of the hyperbolic system.Let us linearize (3.2) by freezing the Jacobian matrices A1 (U) , A2 (U) at some suitablepoint U. This yields a linear system in the form

∂U

∂t+ A1

∂U

∂x+ A2

∂U

∂y= 0. (3.3)

15

CHAPTER 3. THE EVOLUTION OPERATOR 16

We now denote by n an arbitrary unit vector in R2. Since the system (3.3) is hyperbolic,its matrix pencil

A (n) = n1A1 + n2A2 (3.4)

has m real eigenvalues λ1, .., λm and corresponding linearly independent eigenvectorsr1 (n) , .., rm (n).

Following Ostkamp [7], [8] and Lukáčová -Medvid’ová, Morton, Warnecke [4] we brieflyrewrite the procedure of deriving the exact evolution operator for linearized hyperbolicconservation laws.In order to obtain a quasi-diagonalised system, we multiply (3.2) by the matrix R−1 (n),where R is the matrix of right eigenvectors of the matrix pencil. We thus get

R−1∂U

∂t+ R−1A1

∂U

∂x+ R−1A2

∂U

∂y= 0. (3.5)

We can replace R−1∂U, using the definition of the characteristic variables W

R−1∂U = ∂W. (3.6)

In the special case of constant flux Jacobian, which is our case now, this can be integratedto yield

W = R−1U, U = RW. (3.7)

We introduce the matrixBk = R−1AkR, k = 1, 2 (3.8)

and make use of the fact that

R−1AkR R−1 ∂U = R−1AkR ∂W. (3.9)

These transformations result in the following equation

∂W

∂t+ B1

∂W

∂x+ B2

∂W

∂y= 0. (3.10)

In one space dimension this transformation would yield a diagonal system. As we are intwo space dimensions all that can be done, is to decompose the Bk into a diagonal part Λk

and a rest matrix B′k

Bk = Λk + B′k. (3.11)

Thus, we obtain the quasi-diagonalised system

∂W

∂t+ Λ1

∂W

∂x+ Λ2

∂W

∂y= S, (3.12)

withS = −B′

1

∂W

∂x− B′

2

∂W

∂y. (3.13)

CHAPTER 3. THE EVOLUTION OPERATOR 17

We are looking for an exact evolution operator, i.e. an operator that maps U (x, t) toU (x, t + ∆t). This operator is found by considering the behaviour of U along the bichar-acteristics defined by

dx

dt= b11 (n) =

(b111, b

211

)T, (3.14)

dy

dt= b22 (n) =

(b122, b

222

)T. (3.15)

We integrate the j-th equation of the quasi-diagonalised system (3.12) along the bicharac-teristics. From the LHS we obtain∫ t+∆t

t

[∂wj (x (t) , t)

∂t+ b1

jj

∂wj (x (t) , t)

∂x+ b2

jj

∂wj (x (t) , t)

∂y

]dt

=

∫ t+∆t

t

[∂wj (x (t) , t)

∂t+

dx

dt

∂wj (x (t) , t)

∂x+

dy

dt

∂wj (x (t) , t)

∂y

]dt

=

∫ t+∆t

t

[dwj (x (t) , t)

dt

]dt

= wj (x (t + ∆t) , t + ∆t,n)− wj (x (t) , t,n)

= wj (P,n)− wj (Qj (n) ,n) , j ∈ 1, 2 .

(3.16)

Here P denotes the point, where all bicharacteristics reach the time level t + ∆t. The Qj

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

Sj (xj (τ,n) , τ,n) dτ, j ∈ 1, 2 . (3.17)

We will later approximate these integrals by the rectangle rule in time.We have thus mapped the solution wj (Qj,n) to the solution wj (P,n):

w1 (P,n)− w1 (Q1,n) = S ′1 (n) ,

w2 (P,n)− w2 (Q2,n) = S ′2 (n) ,

(3.18)

where n is an arbitrary unit vector in R2.As we are looking for the solution U at the new time level, we have to transform thisequation back to the original variables. To this aim we multiply (3.18) by R and integrateover n which is equal to integrating over the unit sphere O. Note that we can write n inthe form

n = (cos θ, sin θ)T . (3.19)

Thus integration over O yields

U (P) =1

O

∫O

R (n)W (P,n) dO

=1

∫ 2π

0

R (n (θ))W (P,n (θ)) dθ.

(3.20)

CHAPTER 3. THE EVOLUTION OPERATOR 18

Applying these transformations to the rest terms in (3.18) yields

1

∫ 2π

0

R (n)

(w1 (Q1,n)w2 (Q2,n)

)dθ + S =

1

∫ 2π

0

∑j=1,2

rj (n) wj (Qj,n) dθ + S, (3.21)

where

S =1

O

∫O

R (n)S′ (n) dO =1

∫ 2π

0

R (n)S′ (n) dθ

=1

∫ 2π

0

∫ t+∆t

t

R (n)S (τ,n) dτ.

(3.22)

We have now found the exact evolution operator for a linear hyperbolic system in twospace dimensions. This operator maps the solution Un at time tn to the solution Un+1 attime tn+1 in the following way

Un+1 (P) =1

∫ 2π

0

∑j=1,2

rnj (n) wn

j (Qj,n) dθ + Sn. (3.23)

The exact evolution operator (3.23) is an implicit representation in time. In order to derivea time explicit scheme we need to approximate time integrals in S. Details about how toapproximate the evolution operator in an appropriate way as well as stability analysis andnumerical results concerning the application of an evolution Galerkin method to the waveequation system and the Euler equations of gas dynamics can be found in [3], [4].

3.3 A Finite Volume Evolution Galerkin MethodAs described in Chapter 1 a finite volume method applied to a two-dimensional conservationlaw in the form

∂tU +

∂xf (U) +

∂yg (U) = 0 (3.24)

updates the solution in a control volume by making a balance of the fluxes over the inter-faces of the control volume. The idea of the finite volume evolution Galerkin method is toapproximate the averaged fluxes in the formula for the finite volume update with the helpof the approximate evolution Galerkin operator. To this end the solution at time level tn+ 1

2

is calculated in one or several points on each cell interface. This is done with the evolutionGalerkin method, i.e. by applying the approximate operator to the solution at the oldtime level. Evaluation of the flux function and application of a numerical quadrature rulefor the flux integrals on the cell interfaces yields the approximate average fluxes which areused in the finite volume update

Un+1ij = Un

ij −∆t

∆x

[Fn

i+ 12,j− Fn

i− 12,j

]− ∆t

∆y

[Gn

i,j+ 12−Gn

i,j− 12

], (3.25)

CHAPTER 3. THE EVOLUTION OPERATOR 19

where the fluxes are computed as follows

Fni− 1

2,j

=1

∆y

∫ yj+1

2

yj− 1

2

f(E

i− 12

∆t/2Un)

dy,

Fni+ 1

2,j

=1

∆y

∫ yj+1

2

yj− 1

2

f(E

i+ 12

∆t/2Un)

dy,

Gni,j− 1

2=

1

∆x

∫ xi+1

2

xi− 1

2

g(E

j− 12

∆t/2Un)

dx,

Gni,j+ 1

2=

1

∆x

∫ xi+1

2

xi− 1

2

g(E

j+ 12

∆t/2Un)

dx.

(3.26)

This gives the following algorithm to calculate the quantity Un+1 from the known data Un

by the FVEG method.

1. The system in primitive variables is linearized at the old time level.

2. The hyperbolic structure of the linearized system is calculated. This includes thequasi-diagonalized flux Jacobians, the matrix of right eigenvectors and the eigenval-ues.

3. According to the eigenvalues which determine the slope of the bicharacteristics thepoints Qj (θ) , θ = 0, .., 2π are computed at the old time level tn.

4. The data at time tn is evaluated in the points Qj (θ) , θ = 0, .., 2π.

5. The approximate evolution operator is applied to determine the solution at time tn+ 12

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 Ph is applied to construct a piecewise constant flux through the cellinterfaces. For the projection e.g. the Simpson rule or the trapezoidal rule can beused.

8. The approximated fluxes through the cell interfaces are inserted into the formula(3.25) for the finite volume update, and the solution at the time level tn+1 is computedaccordingly.

The derivation and analysis of a multi-dimensional, high-resolution finite volume evolutionGalerkin scheme can be found in [4] and [6].

Chapter 4

Application of the FVEG Method tothe SMHD Equations

The conservative form of the SMHD equations reads as follows

∂t

h

hu1

hu2

hB1

hB2

+∂

∂x

hu1

hu21 − hB2

1 + phu1u2 − hB1B2

0hu1B2 − hu2B1

+∂

∂y

hu2

hu1u2 − hB1B2

hu22 − hB2 + p

hu2B1 − hu1B2

0

=

0

−gh ∂b∂x

−gh ∂b∂y

00

.

Before the approximate evolution operator is applied to this system of equations, we willtransform it into a system for the primitive variables (h, u1, u2, B1, B2)

T and then modifyit 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

∂t+ (u · ∇)h + h(∇ · u) = 0,

∂u1

∂t+ g

∂h

∂x− 1

hB1(B · ∇)h + (u · ∇)u1 −B1(∇ ·B)− (B · ∇)B1 = 0,

∂u2

∂t+ g

∂h

∂y− 1

hB2(B · ∇)h + (u · ∇)u2 −B2(∇ ·B)− (B · ∇)B2 = 0,

∂B1

∂t− 1

hu1(B · ∇)h− (B · ∇)u1 + (u · ∇)B1 − u1(∇ ·B) = 0,

∂B2

∂t− 1

hu2(B · ∇)h− (B · ∇)u2 + (u · ∇)B2 − u2(∇ ·B) = 0.

(4.1)

As described in [5] the so called Powell-like form of the SMHD system can be derived andused in the FVEG scheme. This modified system has a simpler hyperbolic structure andits exact solution is equal to that of the original SMHD system in the case that it is smoothand fulfills the divergence-free constraint div(hB) = 0.

20

CHAPTER 4. APPLICATION OF THE FVEG METHOD TO THE SMHD EQUATIONS21

The Powell-like form of the SMHD system reads

∂h

∂t+ (u · ∇)h + h(∇ · u) = 0,

∂u1

∂t+ g

∂h

∂x+ (u · ∇)u1 − (B · ∇)B1 = 0,

∂u2

∂t+ g

∂h

∂y+ (u · ∇)u2 − (B · ∇)B2 = 0,

∂B1

∂t− (B · ∇)u1 + (u · ∇)B1 = 0,

∂B2

∂t− (B · ∇)u2 + (u · ∇)B2 = 0.

(4.2)

It can be derived by adding a multiple of

∇ · (hB) = (B · ∇)h + h(∇ ·B) (4.3)

to the SMHD system.The derivation of the evolution operator requires the knowledge of the hyperbolic structureof the equation system. In analogy with Chapter 3 we denote by n = (n1, n2)

T an arbitrarynon-zero unit vector in R2 and by A(n) the matrix pencil of the hyperbolic system

A(n) = n1A1 + n2A2. (4.4)

For the Powell-like form of the SMHD systems A(n) has the following form

A(n) =

u · n hn1 hn2 0 0gn1 u · n 0 −B · n 0gn2 0 u · n 0 −B · n0 −B · n 0 u · n 00 0 −B · n 0 u · n

. (4.5)

Using the abbreviationW =

√(B · n)2 + gh(n · n) (4.6)

we get the following representation for the eigenvalues

λ1(n) = u · n + B · n,

λ2(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 EQUATIONS22

The right eigenvectors of A(n) are given by

r1(n) = 12(n·n)

0n2

−n1

−n2

n1

, r2(n) = 12(n·n)

0

−n2

n1

−n2

n1

,

r3(n) = 12W 2(n·n)

h2(n · n)

n1Wn2W

−n1(B · n)−n2(B · n)

, r4(n) = 12W 2(n·n)

h2(n · n)−n1W−n2W

n1(B · n)n2(B · n)

,

r5(n) =

(B · n)

00

gn1

gn2

,

(4.8)

and the left eigenvectors have the following form.

l1(n) =

0n2

−n1

−n2

n1

, l2(n) =

0

−n2

n1

−n2

n1

,

l3(n) =

g(n · n)n1Wn2W

−n1(B · n)−n2(B · n)

, l4(n) =

g(n · n)−n1W−n2W

n1(B · n)n2(B · n)

,

l5(n) =

(B · n)

00

hn1

hn2

.

(4.9)

If the hyperbolic structure is known the approximate evolution operator can be derivedanalogously to (3.23). The finite volume update of the SMHD system can be computedaccording to (3.26).

Chapter 5

The Constrained Transport Method

The last equationdiv (hB) = 0 (5.1)

of the SMHD equations needs special attention, because, if it is not fulfilled exactly, it canproduce non-physical solutions, such as e.g. negative heights. Especially near discontinu-ities, 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 fromthe induction equation.As stated in Chapter 2 the induction equation for the magnetic flux reads

∂t

[hB1

hB2

]+

∂x

[0

hu1B2 − hu2B1

]+

∂y

[hu2B1 − hu1B2

0

]= 0. (5.2)

This is equal to∂

∂t

[hB1

hB2

]− ∂

∂x

[0Ω

]+

∂y

[Ω0

]= 0, (5.3)

with Ω defined according to Ohm’s law for a perfect conductor as

Ω = −u1hB2 + u2hB1. (5.4)

In component form we get

∂ (hB1)

∂t+

∂Ω

∂y= 0,

∂ (hB2)

∂t− ∂Ω

∂x= 0.

(5.5)

We want to convert this equation into an equation for the magnetic potential A. The exis-tence of such an potential follows from the fact, that the divergence of the exact magneticfield flux hB is equal to zero. The magnetic flux and its potential are related as follows

hB = ∇× A. (5.6)

23

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 24

In two space dimensions, this is equal to

hB1 = ∂∂y

A,

hB2 = − ∂∂x

A.(5.7)

With the help of this relation we can convert equation (5.5) into an equation for themagnetic potential A

∂2A

∂t∂y+

∂Ω

∂y= 0,

− ∂2A

∂t∂x− ∂Ω

∂x= 0

(5.8)

and thus∂

∂tA + Ω = 0. (5.9)

The idea of the constrained transport method is to use this equation in order to get acorrected magnetic field flux. This corrected flux should fulfill a discrete version of thedivergence-free condition.In each time step, after the SMHD equations have been approximated by the FVEGmethod (3.25), (3.26), the additional equation (5.9) is used to calculate the update for thepotential A. Relation (5.7) yields the corrected magnetic flux. It is the discretization ofthe derivatives in this relation that enforces the divergence free constraint.Thus, the computed magnetic fluxes will differ only slightly from the magnetic fluxesobtained by the FVEG method. The induction equation is used in both cases to calculatethe magnetic field. It is a part of the SMHD system and it is used again in the constrainedtransport method. Only here, it has been transformed into an equation for the magneticpotential 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 obtaina divergence-free solution.We will follow the proceding described by Rossmanith in his dissertation [1]. He proposesto use a staggered grid and to arrange the variables on the grids as depicted in Figure 5.1.

• The potential A is computed at the midpoints of the staggered grid which coincidewith the corners of the original grid.

• The first component hB1 of the corrected magnetic flux lies at the north and southedges of the staggered grid, which are the east and west edges of the original grid.

• The second component hB2 of the corrected magnetic flux lies at the east and westedges of the staggered grid, which are the north and south edges of the original grid.

• The velocity u1 in x-direction is set on the north and south edges of the staggeredgrid.

• The velocity u2 in y-direction is set on the east and west edges of the staggered grid.

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 25

Figure 5.1: Arrangement of the variables in the grids.

With this arrangement, the derivatives of the potential in the equation (5.7) can be ap-proximated by central differences and the corrected magnetic field flux is obtained as

[hB1]n+1i− 1

2,j

=1

∆y

(An+1

i− 12,j+ 1

2

− An+1i− 1

2,j− 1

2

),

[hB2]n+1i,j− 1

2=

1

∆x

(An+1

i− 12,j− 1

2

− An+1i+ 1

2,j− 1

2

).

(5.10)

We now consider a cell of the original grid. The corrected fluxes lie on the edges of thatcell. The desired corrected flux in the cell center can be obtained by averaging. In thediscrete formula for the divergence, the derivatives are approximated by central differencesof the hB values on the edges of that cell:

[div (hB)]n+1ij =

[hB1]n+1i+ 1

2,j− [hB1]

n+1i− 1

2,j

∆x+

[hB2]n+1i,j+ 1

2− [hB2]

n+1i,j− 1

2

∆y. (5.11)

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 26

The discrete divergence given by (5.11) is now equal to zero. This can be seen by replacingthe hB- values on the cell edges according to (5.10). One gets

[div (hB)]n+1ij =

1∆y

(An+1

i+ 12,j+ 1

2

− An+1i+ 1

2,j− 1

2

)− 1

∆y

(An+1

i− 12,j+ 1

2

− An+1i− 1

2,j− 1

2

)∆x

+

1∆x

(An+1

i− 12,j+ 1

2

− An+1i+ 1

2,j+ 1

2

)− 1

∆x

(An+1

i− 12,j− 1

2

− An+1i+ 1

2,j− 1

2

)∆y

=1

∆x∆y

(An+1

i+ 12,j+ 1

2

− An+1i+ 1

2,j− 1

2

− An+1i− 1

2,j+ 1

2

+ An+1i− 1

2,j− 1

2

+ An+1i− 1

2,j+ 1

2

− An+1i+ 1

2,j+ 1

2

− An+1i− 1

2,j− 1

2

+ An+1i+ 1

2,j− 1

2

)= 0.

(5.12)

The predictor step, i.e. the approximate evolution operator E∆, works with primitivevariables. We therefore have to divide the corrected magnetic fluxes at the cell centers bythe 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 itsdiscrete divergence given by (5.11) equals zero.An algorithm, in which the solution of the SMHD equations calculated with the FVEGmethod 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 thequantities (ρ, u1, u2, B1, B2)

T at the new time level. The magnetic field is not yetdivergence 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 valuesof the corrected magnetic flux hB1, hB2 are obtained on the staggered grid

[hB1]n+1i− 1

2,j

=1

∆y

(An+1

i− 12,j+ 1

2

− An+1i− 1

2,j− 1

2

),

[hB2]n+1i,j− 1

2

= − 1

∆x

(An+1

i− 12,j− 1

2

− An+1i+ 1

2,j− 1

2

).

• The magnetic flux values hB are averaged, to get the corrected magnetic field at thecell centers of the original grid. The discrete divergence is now equal to zero

[B1]n+1i,j =

1

h

([hB1]

n+1i− 1

2,j

+ [hB1]n+1i+ 1

2,j

),

[B2]n+1i,j =

1

h

([hB2]

n+1i,j− 1

2

+ [hB2]n+1i,j+ 1

2

).

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 27

It remains to be discussed how to approximate equation (5.9) in order to calculate an updatefor the magnetic potential A in each time step. There are several different constrainedtransport methods calculating the update in a different way. In this work we will beconcerned with the MPACT scheme developed by Rossmanith[1].The name MPACT means Magnetic Potential Advection Constrained Transport, whichindicates 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 wereplace in (5.9) the electric field Ω according to (5.4), we get

∂A

∂t− u1hB2 + u2hB1 = 0. (5.13)

Using the relation (5.7) we get a transport equation for the potential A

∂A

∂t+ u1

∂A

∂x+ u2

∂A

∂y= 0. (5.14)

This equation is linear and strictly hyperbolic and can therefore be solved with little ex-pense, using an upwind scheme.Care has to be taken only on the staggered arrangement of the velocity components. Con-sidering the advection equation for an arbitrary grid cell Cij of the staggered grid, the ve-locity 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 advectionequation with the upwind scheme, we must therefore introduce a non-conservative sourceterm as described in Chapter 1 of this work.Thus rewriting the advection equation we get

∂A

∂t+

∂u1A

∂x+

∂u2A

∂y= −A

∂u1

∂x− A

∂u2

∂y. (5.15)

We can now discretize this equation with the upwind scheme, using central differences forthe approximation of the derivatives in the source term

An+1i,j = An

i,j −∆t

[1

∆x

(F n

i+ 12,j− F n

i− 12,j

)+

1

∆y

(Gn

i,j+ 12−Gn

i,j− 12

)−An

i,j

1

∆x

(un+1

1i+1

2 ,j− un+1

1i− 1

2 ,j

)− An

i,j

1

∆y

(un+1

2i,j+1

2

− un+12

i,j− 12

)].

(5.16)

Using the same notation as in Chapter 1, the flux functions in horizontal direction read

F ni+ 1

2,j

= [u+1 ]n+1

i+ 12,jAn

i,j + [u−1 ]n+1

i+ 12,jAn

i+1,j,

F ni− 1

2,j

= [u+1 ]n+1

i− 12,jAn

i−1,j + [u−]1]n+1i− 1

2,jAn

i,j,(5.17)

and in vertical direction we get

Gni,j+ 1

2= [u+

2 ]n+1i,j+ 1

2

Ani,j + [u−

2 ]n+1i,j+ 1

2

Ani,j+1,

Gni,j− 1

2= [u+

2 ]n+1i,j− 1

2

Ani,j−1 + [u−

2 ]n+1i,j− 1

2

Ani,j.

(5.18)

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 28

For the calculation of the fluxes the velocities on the cell interfaces at the new time levelhave been used. They will be situated as depicted in Figure 5.1 and can be obtained byaveraging the cell centered velocity values. If we insert the averaging of the velocities andthe discretized transport equation into the constrained transport algorithm, we get thefollowing algorithm.

Constrained Transport Algorithm

All quantities on the original grid are initialized according to the problem. On the staggeredgrid, 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.1. The SMHD equations are solved with the FVEG method, yielding the values of the

quantities (ρ, u1, u2, B1, B2)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.

2. The velocity components on the staggered grid are computed, by averaging the dataon the original grid

[u1]n+1i,j− 1

2

=1

2

([u1]

n+1i,j−1 + [u1]

n+1i,j

),

[u2]n+1i− 1

2,j

=1

2

([u2]

n+1i−1,j + [u2]

n+1i,j

).

3. The potential is updated with the upwind method

An+1i,j = An

i,j −∆t

[1

∆x

(F n

i+ 12,j− F n

i− 12,j

)+

1

∆y

(Gn

i,j+ 12−Gn

i,j− 12

)−An

i,j

1

∆x

(un+1

1i+1

2 ,j− un+1

1i− 1

2 ,j

)− An

i,j

1

∆y

(un+1

2i,j+1

2

− un+12

i,j− 12

)].

4. The spatial derivatives of the potential are calculated and the values of the correctedmagnetic flux on the staggered grid are obtained

[hB1]n+1i− 1

2,j

=1

∆y

(An+1

i− 12,j+ 1

2

− An+1i− 1

2,j− 1

2

),

[hB2]n+1i,j− 1

2

= − 1

∆x

(An+1

i− 12,j− 1

2

− An+1i+ 1

2,j− 1

2

).

5. The values of the magnetic flux hB are averaged to get the corrected magnetic fieldat the cell centers of the original grid. The discrete divergence of the magnetic fieldvalues equals now zero

[B1]n+1i,j =

1

h

([hB1]

n+1i− 1

2,j

+ [hB1]n+1i+ 1

2,j

),

[B2]n+1i,j =

1

h

([hB2]

n+1i,j− 1

2

+ [hB2]n+1i,j+ 1

2

).

CHAPTER 5. THE CONSTRAINED TRANSPORT METHOD 29

It should be pointed out that without the constrained transport method the discrete di-vergence was zero only at the vertices, cf. [5]. By the presented approach we force thesolution 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 conditionsand boundary conditions for all quantities.The initialization of the data on the original grid can be adopted from the original im-plementation of the FVEG method without the constrained transport method. Only theinitial data for the magnetic field needs special attention, because it has to fulfill the di-vergence free constraint. From Faraday’s law it can only be deduced, that the divergenceof the exact magnetic field flux will remain zero, if it was so initially. Thus the magneticfield has to be initialized in such a way, that the divergence of the flux hB equals zero ineach grid cell.On the staggered grid, only the potential A needs to be initialized. Here care has to betaken, because the potential has to be initialized in such a way, that relation (5.7) is ful-filled. There is no need to initialize the velocity and magnetic flux components on thestaggered grid. If the algorithm starts with the FVEG method, it can procede to calculatethe velocities on the staggered grid by means of averaging and after the update for thepotential 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. Thestaggered grid is at each side half a cell larger than the original grid. Therefore some sortof boundary condition has to be implemented in order to be able to calculate the data inthe boundary cells of the staggered grid.There are two possible ways of proceding. Either a ghost cell layer boundary condition forthe potential A is implemented. In this case the magnetic flux can be calculated accordingto equation (5.10) in all points where it is needed. This has the advantage that the discretedivergence given by (5.11) equals zero in the boundary cells of the grid, too. However, whenthe ghost cell layer boundary condition is implemented, the values in the boundary cellsof the grid are copied values of the neighbouring grid cells. Consequently the derivativesof the potential A with respect to space will be zero at the boundary. This means thatthe magnetic flux given by (5.7) will be zero, too, at the boundary, independently of itsphysically exact value. This produces oscillations in the solution.We can alternatively implement a boundary condition for the magnetic flux. This can bea ghost cell boundary condition or a periodic boundary condition, depending on the prob-lem. In this case the potential A need not be calculated in the boundary cells, at all, andthe boundary values of the magnetic flux will be much more conform with those that arephysically correct. Only now, (5.10) 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, thediscrete divergence will be zero in the interior of the grid and there are no oscillations dueto 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 beseen in Figure 5.1. All values that are necessary to update the potential A in the interiorof 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 FVEGsolution of the SMHD equations. To this end we will analyze the numerical results of threetest problems, to which the FVEG method has been applied with and without enforceddivergence-free constraint. All computations have been executed with a CFL numberof 0.45 and a gravitational constant of 1.0 in a computational domain of size [−1, 1] ×[−1, 1]. For the calculation of the numerical fluxes through the cell interfaces the numericalquadrature rule has been chosen analogously to [5], i.e. the Simpson rule has been usedfor the flow equations – which are the first three equations of (4.2) – and the trapezoidalrule for the magnetic field equations – which are the last two equations of (4.2).At the boundaries a ghost cell layer boundary condition has been implemented for all dataon the original grid and for the magnetic flux on the staggered grid.The discrete divergence given by

[div(hB)]n+1ij =

[hB1]n+1i+ 1

2,j− [hB1]

n+1i− 1

2,j

∆x+

[hB2]n+1i,j+ 1

2− [hB2]

n+1i,j− 1

2

∆y

has only been plotted in the interior of the original grid where the divergence-free conditionis enforced. Here the divergence has the magnitude of the machine accuracy.

6.1 One-Dimensional Riemann ProblemWe first consider a one-dimensional Riemann Problem, which can be interpreted as beinga 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 magneticfield and height at x = 0 and constant initial values for the velocities

x < 0 : h = 1, u1 = 0, u2 = 0, B1 = 1, B2 = 0,x > 0 : h = 2, u1 = 0, u2 = 0, B1 = 0.5, B2 = 1.

(6.1)

31

CHAPTER 6. NUMERICAL EXPERIMENTS 32

h div(hB) · 10−14

u1 u2

B1 B2

Figure 6.1: Constrained Transport, 100x20 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 33

h

u1 u2

B1 B2

Figure 6.2: Without Constrained Transport, 100x20 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 34

The magnetic flux at t = 0 has thus the following form

x < 0 : hB1 = 1, hB2 = 0,x > 0 : hB1 = 1, hB2 = 2.

(6.2)

If we consider relation (5.7)hB1 = ∂

∂yA,

hB2 = − ∂∂x

A

we can see that a reasonable initialization for the potential A is given by

x < 0 : A = y + 1,x > 0 : A = y − 2x + 1.

(6.3)

Away from the shock both components of the initial magnetic flux are constant, so thatits exact divergence will be zero. At the shock the first component of the initial flux isconstant, 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 (2.9) dueto the initialization in y-direction is of no consequence.The cell centered discrete divergence at y = 0 can be seen in Figure 6.1. The numericalsolution has been computed with a grid size of 100× 20 cells at time t = 0.4. The FVEGscheme without the new approach produces slight oscillations in the solution, which arisebecause the divergence is not equal to zero. The FVEG solution without constrainedtransport can be seen in Figure 6.2. The oscillations are smoothed out when the MPACTscheme is used, as can be seen in Figure 6.1.

6.2 Two-Dimensional Rotor-Like ProblemA truly two-dimensional problem is given by the following initialization

‖x‖ < 0.1 : h = 10, u1 = −x2, u2 = x1, B1 = 0.1, B2 = 0,‖x‖ > 0.1 : h = 1, u1 = 0, u2 = 0, B1 = 1, B2 = 0.

(6.4)

This test problem can be taken as mathematical model of a circular membrane whichseparates plasma of the same mass density but different height and magnetic field. Thereis 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 theideal MHD equations, which considers plasmas with different density inside and outside ofthe membrane. According to the initialization the magnetic flux at t = 0 has the followingform

‖x‖ < 0.1 : hB1 = 1, hB2 = 0,‖x‖ > 0.1 : hB1 = 1, hB2 = 0.

(6.5)

Taking again account of (5.7) the potential A can be initialized as follows

A = y + 1, ∀ ‖x‖ . (6.6)

CHAPTER 6. NUMERICAL EXPERIMENTS 35

h

u1 u2

B1 B2

Figure 6.3: Constrained Transport, 200x200 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 36

h div(hB) · 10−14

u1 u2

B1 B2

Figure 6.4: Constrained Transport, 200x200 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 37

h

u1 u2

B1 B2

Figure 6.5: Without Constrained Transport, 200x200 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 38

h

u1 u2

B1 B2

Figure 6.6: Without Constrained Transport, 200x200 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 39

The initial magnetic flux is constant everywhere in the computational domain. Conse-quently its exact divergence is equal to zero. The discrete divergence of the solution hasbeen plotted in Figure 6.4.For this problem the FVEG scheme has been tested against the FVEG scheme with con-strained transport for a grid size of 200 × 200 cells at time t = 0.2. For both cases wedemonstrate 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 oscillationsnear the origin of the considered domain. These oscillations are particularly evident in theplots at y = 0, which differ strongly from those without the constrained transport method,cf. Figures 6.4, 6.6.

6.3 Two-Dimensional Explosion ProblemAs a last test problem we will consider the two-dimensional explosion problem, with thedata initialized as follows

‖x‖ < 0.3 : h = 1, u1 = 0, u2 = 0, B1 = 0.1, B2 = 0,‖x‖ > 0.3 : h = 0.1, u1 = 0, u2 = 0, B1 = 1, B2 = 0.

(6.7)

Again, we can consider this as model for a circular membrane separating plasmas of dif-ferent height and magnetic field inside and outside of it. In this case the membrane isremoved at time t = 0, so that we have again the analogy to the dam break problem as inthe first test problem.As can be seen, the initial magnetic flux is constant

hB1 = 0.1, hB2 = 0, ∀ ‖x‖ (6.8)

and thus it fulfills the divergence-free constraint.The potential A can be initialized as follows

A = y + 1, ∀ ‖x‖ . (6.9)

The grid size has been chosen as 300 × 300, the computation time as t = 0.25. Again,we compare the contour-plots as well as plots at y = 0 of the FVEG scheme with thoseobtained 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 inFigure 6.9 show slight oscillations in the second component of the magnetic field. Thesecontour plots are improved due to the constrained transport scheme, as can be seen inFigure 6.7, and the cell centered divergence is reduced to the magnitude of the machineaccuracy.

CHAPTER 6. NUMERICAL EXPERIMENTS 40

h

u1 u2

B1 B2

Figure 6.7: Constrained Transport, 300x300 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 41

h div(hB) · 10−14

u1 u2

B1 B2

Figure 6.8: Constrained Transport, 300x300 cells, plots at y=0.

CHAPTER 6. NUMERICAL EXPERIMENTS 42

h

u1 u2

B1 B2

Figure 6.9: Without Constrained Transport, 300x300 cells, contour plots.

CHAPTER 6. NUMERICAL EXPERIMENTS 43

h

u1 u2

B1 B2

Figure 6.10: Without Constrained Transport, 300x300 cells, plots at y=0.

Chapter 7

Conclusions

In this work we applied the constrained transport method in combination with the gen-uinely multi-dimensional FVEG scheme to the SMHD equation system, in order to preservethe divergence-free condition, i.e. div (hB) = 0, of the solution. Apart of its multi-dimensionality, a main difficulty in the numerical treatment of the SMHD system is that ofthe divergence-free constraint. The physically exact solution always fulfills this condition.Due to the new approach the numerical solution reflects this property. In [5] Kröger andLukáčová -Medvid’ová have already analysed the behavior of the solution of the SMHDequations when a FVEG scheme is used and the divergence-free condition is eforced at thevertices of the cells. By embedding the FVEG scheme into the constrained transport algo-rithm the divergence is now of the magnitude of the machine accuracy at the cell centersof the grid, as well.Our extensive numerical treatment shows the effect of the constrained transport method onthe numerical solution. For the one-dimensional Riemann problem and the two-dimensionalexplosion problem the preservation of the additional condition ensures that oscillations inthe solution are smoothed out, and there is a visible improvement in the computed solu-tion.

44

Bibliography

[1] J.A. Rossmanith, A Wave Propagation Method with Constrained Transport for Idealand Shallow Water Magnetohydrodynamics (Dissertation). Washington, 2002.

[2] R. J. LeVeque, Finite Volume Methods for Hyperbolic Problems. Cambridge UniversityPress, 2002.

[3] M. Lukáčová -Medvid’ová, K. W. Morton, and G. Warnecke, Evolution Galerkin Meth-ods for Hyperbolic Systems in Two Space Dimensions. MathCom. 69(232), 2000, 1355-1384.

[4] M. Lukáčová -Medvid’ová, K. W. Morton, and G. Warnecke, Finite Volume EvolutionGalerkin Methods for Hyperbolic Systems. SIAM J. Sci. Comp. 26(1), 2004, 1-30.

[5] T.Kröger, M. Lukáčová -Medvid’ová, An Evolution Galerkin Scheme for the ShallowWater Magnetohydrodynamic (SMHD) Equations in Two Space Dimensions, to appearin J. Comp. Phys., 2005.

[6] M. Lukáčová -Medvid’ová, J. Saibertová , and G. Warnecke, Finite volume evolutionGalerkin methods for nonlinear hyperbolic systems. J. Comp. Phys. 183, 2002, 533-562.

[7] S. Ostkamp, Multidimensional Characteristic Galerkin Schemes and Evolution Oper-ators for Hyperbolic Systems(Dissertation). Hannover, 1995.

[8] S. Ostkamp, Multidimensional characteristic Galerkin methods for hyperbolic systems,Math. Meth. Appl. Sci. 20, no.13, 1997, 1111-1125.

45