Você está na página 1de 66

Computational

Magnetohydrodynamics
Ravi Samtaney
Princeton Plasma Physics Laboratory
Princeton University
samtaney@pppl.gov
ii
c 2007
Ravi Samtaney
ALL RIGHTS RESERVED
Contents
Preface v
1 Introduction to Magnetohydrodynamics 1
1.1 Magnetohydrodynamics- Where does it come from? . . . . . . . 1
1.1.1 MHD Equations . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Single-uid Resistive MHD . . . . . . . . . . . . . . . . 5
1.1.3 Ideal MHD . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.4 Extended MHD Models for Magnetized Plasmas . . . . . 7
1.2 Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . 9
1.3 Outline of this book . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Finite Volume Methods 11
2.1 Introduction to nite volume methods . . . . . . . . . . . . . . 11
2.2 Conservative vs. Non-conservative Formulation . . . . . . . . . 12
2.2.1 Godunov Symmetrization . . . . . . . . . . . . . . . . . 13
2.3 Seven vs. Eight Waves . . . . . . . . . . . . . . . . . . . . . . 14
2.4 Riemann Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4.1 Linearized Riemann Solvers . . . . . . . . . . . . . . . . 16
2.4.2 Exact solution to the Riemann problem . . . . . . . . . 17
2.4.3 Degeneracies . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Methods to ensure solenoidal magnetic elds . . . . . . . . . . 18
2.6 Constrained Transport Method . . . . . . . . . . . . . . . . . . 21
2.7 Unsplit Method for Ideal MHD . . . . . . . . . . . . . . . . . . 24
2.7.1 Algorithm Steps . . . . . . . . . . . . . . . . . . . . . . 25
2.8 Verication tests . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.8.1 Linear wave propagation . . . . . . . . . . . . . . . . . 28
2.8.2 Circularly polarized Alfven wave . . . . . . . . . . . . . 28
2.8.3 Shock-tube problem . . . . . . . . . . . . . . . . . . . . 29
2.8.4 The Rotor problem . . . . . . . . . . . . . . . . . . . . 29
iii
iv CONTENTS
2.8.5 MHD shock refraction . . . . . . . . . . . . . . . . . . . 29
3 Semi-implicit and Implicit Methods 31
3.1 Semi-implicit unsplit upwind method for compressible MHD . . 31
3.1.1 Implicit treatment of diusive uxes . . . . . . . . . . . 31
3.2 Rationale for implicit treatment . . . . . . . . . . . . . . . . . . 32
3.3 Implicit treatment of fast compressional wave . . . . . . . . . . 33
3.3.1 A model illustration . . . . . . . . . . . . . . . . . . . . 33
3.3.2 Application to fast compressional wave . . . . . . . . . . 35
3.4 Implicit treatment of the Alfven wave . . . . . . . . . . . . . . 37
3.5 Fully implicit methods for MHD . . . . . . . . . . . . . . . . . 38
3.5.1 Implicit Upwind Method . . . . . . . . . . . . . . . . . 38
3.5.2 Introduction to Newton-Krylov method . . . . . . . . . 41
3.5.2.1 Preconditioners . . . . . . . . . . . . . . . . . 43
3.5.3 JFNK method for resistive MHD . . . . . . . . . . . . . 44
3.5.3.1 A model illustration . . . . . . . . . . . . . . 44
3.5.3.2 Application to resistive MHD . . . . . . . . . . 45
3.5.4 JFNK method for compressible MHD . . . . . . . . . . 46
3.5.4.1 Preconditioning Strategy . . . . . . . . . . . . 48
3.6 Verication Tests for Resistive MHD . . . . . . . . . . . . . . . 50
3.6.1 Magnetic Reconnection in 2D . . . . . . . . . . . . . . . 50
4 Adaptive Mesh Renement 51
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2 Berger-Colella AMR for Hyperbolic Systems . . . . . . . . . . . 51
4.3 Solving Elliptic Systems . . . . . . . . . . . . . . . . . . . . . . 52
4.3.1 MHD on AMR Grids . . . . . . . . . . . . . . . . . . . 53
A Appendix I: Glossary of Acronyms 55
B Bibliography 57
Preface
Computational uid dynamics (CFD) is a very interesting subject which com-
bines numerical analysis, algorithms, applied mathematics with the practical
aim of solving uid ow problems by computational means. The motivations
are many-fold: a desire to understand the physics of uid ow and turbu-
lence, scientic and technological applications, as well as a desire to peek in to
the beautiful structure of solutions nonlinear partial dierential equations. A
large number of books have been written on CFD. On the other hand, there
is precious little for computational plasma dynamics and magnetohydrodynam-
ics. Magnetohydrodynamics is the simplest model for plasma dynamics but
it is, nonetheless, rich in mathematical structure and no less important in the
modeling of several physical phenomenon ranging from MHD turbulent, stellar
dynamics, and modeling at the device-scale of fusion devices such as tokamaks
and stellarators. The focus of this book is computational magnetohydrody-
namics which, in a sense, is a superset of computational gas dynamics because
it combines the equations of hydrodynamics with Maxwells electromagnetic
equations. There is a rather broad spectrum for MHD, too. On one end of
the spectrum is ideal MHD which is a system of hyperbolic conservation laws,
followed by resistive MHD, two-uid and Hall MHD, and extended MHD. The
latter systems are dispersive, generally obeying a quadratic dispersion relation,
and include dispersive waves: whistlers, kinetic Alfven and gyroviscous waves.
This book is geared towards graduate students who have a basic knowledge
of nite dierence methods. The book is focused on nite volume and nite
dierence methods. This rst draft is organized as follows: Chapter 1 presents
an introduction to MHD; Chapter 2 discusses explicit nite volume methods;
Chapter 3 is concerned with semi-implicit and implicit formulations; and Chapter
4 deals with adaptive mesh renement. These chapters are all geared towards
ideal and resistive MHD. This book grew out of the set of ERCOFTAC lectures
presented at ETH Zurich.
We acknowledge the support of the SciDAC program of the U. S. Depart-
ment of Energy for funding this work at the Princeton Plasma Physics Labora-
v
vi PREFACE
tory, Princeton University, under USDOE Contract no. DE-AC020-76-CH03073.
Ravi Samtaney
Princeton, NJ
January 2007
Chapter 1
Introduction to
Magnetohydrodynamics
A true description of plasma motion must rely on kinetic equations for each
plasma species. The Fokker-Planck (or Vlasov if the collision term is neglected)
is the equation which governs the behavior of each species in a plasma.
f

t
+u f

+
q

(E +u B)
f

u
= C
,
(f

), (1.1)
where f

(x, u, t) is the distribution function which represents the num-


ber density of particles of species found in an innitesimal volume of six-
dimensional phase space (x, u); and C

(f) is the collision term between species


and . The term q((E + u B) is the force on a charged particle due to
electric and magnetic forces. Generally for simulation purposes the kinetic ap-
proach is computationally prohibitively expensive. This is one of the reasons, as
well as a desire to have a simpler set of equations in three dimensional physical
space that a uid description of a plasma is undertaken.
1.1 Magnetohydrodynamics- Where does it come from?
A uid description of the plasma is obtained by taking velocity moments of the
kinetic equations (1.1) for electrons and ions (assuming only one ion species)
and employing certain closure assumptions. The oft-used term resistive MHD
is a single-uid model of a plasma in which a single velocity and pressure de-
scribe both the electrons and ions. The resistive MHD model of a magnetized
plasma does not include nite Larmor radius (FLR) eects, and is based on the
simplifying limit in which the particle collision length is small compared with
1
2 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS
Time scales Model

ei
One uid model

ii

ei
Two-uid model

ee

ii
Electron uid; ion particles

ee
Electron and ion particles
Table 1.1: Domain of validity of MHD in term of relaxation times
the macroscopic length scales. A more sophisticated set of models, hereafter
referred to as extended MHD (X-MHD), can be derived from more realistic
closure approximations. Such models allow independent motion of ions and
electrons. The lowest order FLR corrections to resistive MHD result in modi-
cations to the electron momentum equation (generalized Ohms law) and the
ion stress tensor.
Validity regime for MHD: We start by considering component particles
in non-equilibrium moving through a background of component particles.
The time it takes for each species to reach equilibrium, is generally lesser than
the time (dened as

) for thermal equilibrium between the and species.


For electrons and ions:

ee
:
ii
:
ei
= 1 : (m
i
/m
e
)
1
2
: (m
i
/m
e
),
where m
i
and m
e
are the mass of the ion species and electrons, respectively.
The mathematical description of a plasma when dealing with a variety of time-
scales of interest is given by Table 1.1. Furthermore, the uid description of
a plasma is valid when the length scales under investigation are larger than
the Debye length; and the frequencies are smaller than the cyclotron frequency.
The Debye length argument can also be cast in terms of a frequency: namely
the plasma frequency. In addition it is a standard assumption that the speeds
involved are much smaller than the speed of light.
1.1.1 MHD Equations
A general form of the MHD equations for single ion and electron species are the
conservation of mass, momentum and energy coupled with Maxwells equations.
These are written below. In the MHD equations below, we will use the moments
1.1. MAGNETOHYDRODYNAMICS- WHERE DOES IT COME FROM? 3
of the kinetic distribution functions dened as
n

(x, t) =
_
duf

(u, x, t), (1.2)


n

(x, t)v

(x, t), =
_
duuf

(u, x, t), (1.3)


w = v

u, (1.4)
n

< Q > =
_
duQf

(u, x, t), (1.5)


P(x, t) = n

< w
2
>, (1.6)
h

=
1
2
n

< w
2
w >, (1.7)
R
,
(x, t) =
_
dwm

wC

, (1.8)
Q
,
(x, t) =
1
2
_
dwm

w
2

. (1.9)
Furthermore, we use q
i
= q
e
= e.
Conservation of mass: For each plasma species, the conservation of mass
or the continuity equation is:
n

t
+ (n

) = S
n
, (1.10)
where n

is the number density of the species, and S


n
is a source/sink term
due to interaction with neutrals such as ionization.
Conservation of momentum: For each species, momentum conservation
is expressed as
n

t
+ (n

) = P

+n

(E +v

B) +R

(1.11)
where P

is the pressure tensor, and R

is the momentum density transferred


from species to .
Conservation of energy: The energy equation for each species is,

_
1
2
n

v
2

+
3
2
T

_
t
+
__
1
2
n

v
2

+
3
2
T

__
v
+ (v

+h

) q

E = Q

+v

R
,
, (1.12)
where T

is the temperature, h

is the heat ux due to random motion, and


Q

is the heat transfer due to collisions between the dierent species.


4 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS
Quasi-neutrality: Under the assumption of quasi-neutrality, i.e. n
i
n
e

n so that = (n
i
m
i
+ n
e
m
e
) n(m
i
+ m
e
) nm
i
. The charge density
= (n
i
n
e
)e and mass velocity v = (n
i
m
i
v
i
+ n
e
m
e
v
e
)/ (n
i
m
i
v
i
+
n
e
m
e
v
e
)/(m
i
+ m
e
) v
i
+ m
e
/m
i
v
e
. The current density is given by J =
e(n
i
v
i
n
e
v
e
) ne(v
i
v
e
).
Adding the two continuity equations

t
+ (v) = 0, (1.13)
while subtracting them gives the equation for charge density

t
+ (Jv) = 0, (1.14)
The momentum transfer from ions to electrons is expressed as
R
ei
= m
e
n <
ei
> (v
i
v
e
) = neJ (1.15)
Furthermore, the electron inertia is neglected. This reduces the electron mo-
mentum equation into Ohms law, the generalized form of which is written
below.
E +v B =
1
ne
[J B p
e

e
+R
ei
] ,
E +v B = J +
1
ne
[J B p
e

e
] , (1.16)
where p
e
is the isotropic part of the electron pressure tensor, and
e
is the
anisotropic part. The momentum equation includes a term E which is the
contribution to the Lorentz force due to the electric eld. It is estimated that
the magnitude of the electric force compared with the inertial term is negligible
E : v v
0
E
2
/L : u
2
/L
0
B
2
/ << 1
The momentum equation can now be written as
v
t
+ (vv) = p (
i
+
e
) +J B, (1.17)
The energy equations for ions and electrons becomes
d
dt
_
p
i

_
=
1

[Q
i
h
i

i
: v] (1.18)
d
dt
_
p
e

_
=
1

_
Q
e
h
e

e
:
_
v
J
en
__
+
J
en

_
p
e

_
, (1.19)
1.1. MAGNETOHYDRODYNAMICS- WHERE DOES IT COME FROM? 5
where d/dt = /t+v , and the last term above results from the relation
(d/dt)
e
= (d/dt) (J/ne) ,
Maxwells equations: The set of Maxwells equations consists of the in-
duction equation due to Faraday:
B
t
= E. (1.20)
The experimentally observed fact that nature does not exhibit magnetic
monopoles is written as:
B = 0 (1.21)
Amperes law is
B =
0
J +
1
c
2
E
t
, (1.22)
where for the time scales of interest to MHD, the term containing the c
2
term
is neglected, so that B =
0
J.
The equation governing charge density is written as:

0
E = , (1.23)
where is the charge density. Typically under the assumption of quasi-linearity,
the charge density equation is decoupled from the others and one does not
generally solve or evolve .
1.1.2 Single-uid Resistive MHD
The above equations can be reduced by assuming high collisionality which lets
us drop the anistropic portions of the pressure tensors. Furthermore, assuming
a small Larmour radius, the single-uid resistive MHD equations couple the
equations of hydrodynamics and resistive Maxwells equations. The Ohms law
in single uid resistive MHD simplies to E +v B = J. The entire set of
single uid resistive MHD may be written in conservation form as,
U
t
+ F(U) = F
v
(U) (1.24)
where the solution vector U U(x, t) is,
U = {, v, B, e}
T
,
6 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS
and the ux vectors F(U) and F
v
(U) are given by
F(U) =
_
v , vv +
_
p +
1
2
B B
_

I BB,
vB Bv ,
_
e +p +
1
2
B B
_
v B(B v)
_
T
,
F
v
(U) =
_
0 , Re
1

, S
1
_
B (B)
T
_
,
Re
1

v +

1

Re Pr
T +

S
_
1
2
(B B) B(B)
T
__
T
.
In the above equations, is the density, v is the velocity, B is the magnetic
eld, p and T are the pressure and temperature respectively, and e is the total
energy per unit volume of the plasma. The plasma properties are the resistivity
, the thermal conductivity , and the viscosity , which have been normalized,
respectively, by a reference resistivity
R
, a reference conductivity
R
, and a
reference viscosity
R
. The ratio of specic heats is denoted by (= 5/3. The
nondimensional parameters in the above equations are the Reynolds number,
dened as Re
0
U
0
L/
R
, the Lundquist number, dened as S
0
U
0
L/
R
,
and the Prandtl number, denoted by Pr, which is the ratio of momentum to
thermal diusivity. The non-dimensionalization is carried out using a character-
istic length scale, L and the Alfven speed U
0
= B
0
/

0
, where B
0
,
0
, and

0
are the characteristic strength of the magnetic eld, a reference density and
the permeability of free space, respectively. The equations are closed by the
following equation of state
e =
p
1
+

2
v v +
1
2
B B.
The stress tensor is related to the strain as

=
_
v + (v)
T
_

2
3
v

I.
Finally, a consequence of Faradays law is that an initially divergence-free mag-
netic eld must lead to a divergence-free magnetic eld for all times, which
corresponds to the lack of observations of magnetic monopoles in nature. This
solenoidal property is expressed as B = 0.
1.1.3 Ideal MHD
In the limit of zero resistivity, conductivity and viscosity, the equations of resistive
MHD reduced to those of ideal MHD. These equations are similar to those
1.1. MAGNETOHYDRODYNAMICS- WHERE DOES IT COME FROM? 7
written above with = = = 0.
U
t
+ F(U) = 0, (1.25)
where U and F(U) are the same as dened previously.
1.1.4 Extended MHD Models for Magnetized Plasmas
In the case of magnetized plasmas, such as those encountered in fusion devices,
the assumption of high-collisionality is not really valid. In fusion plasmas, for
instance, there is a dominant magnetic eld, and length scales parallel to the
eld are signicantly larger than those perpendicular to it (in the discussion
which follows, we use the || symbol to dene quantities parallel to the magnetic
eld, and for quantities perpendicular to it). In such cases, one can derive the
extended MHD models by considering dierent orderings of the characteristic
frequency and velocities with respect to the ratio of ion gyroradius to the char-
acteristic length scale ( =
i
/L), and the order of accuracy with respect to
as well as the related ratios
s
/L, and d
i
/L, where
s
is the ion sound gyrora-
dius, and d
i
is the ion inertial skin depth. In addition to , we have to concern
ourselves with /
ci
and v
i
/v
thi
orderings for consistency, where
ci
and v
thi
are the ion cyclotron frequency, and the ion thermal velocity, respectively. In
MHD ordering fast dynamics results if /
ci
and v
i
/v
thi
1, whereas in
the so-called drift ordering (slow dynamics near equilibrium), /
ci

2
and
v
i
/v
thi
. Hall and drift MHD represent the lowest order (in ) FLR and two-
uid corrections to the resistive MHD model. In these cases, the gyro-viscous
forces enters at the same order as the pressure gradient.
Some of the extended MHD models [38] are shown in Table 1.2 in which
the generalized drift model for slow dynamics has been omitted. Note that
these generalized MHD models assume quasi-neutrality and ignore electron in-
ertia. The stress tensors are now no longer isotropic. The ion stress tensor is
decomposed as
i
=
||i
+
gv
i
where the parallel component
||i
includes the
neoclassical part describing collisional transport in a toroidal plasma. The cross
component is
gv
i
, the gyro-viscous stress as given by Braginskii [11]; this part
of the stress tensor does not lead to dissipative terms. Recently, a more gen-
eral expression for the gyroviscous force has been derived assuming only small
gyromotion periods and Larmor radius [33]. The dispersive waves ( k
2
) in
the extended MHD models are:
1. Whistler waves (WW): These are dispersive waves arising from the
J B term in Ohms law, and are associated with nite k
||
and the
electron response.
8 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS
Model Momentum Ohms Law WW KAW GVW Slow Dynamics
General mn
dv
dt
= (p
e
+p
i
) E = v B +J Yes Yes Yes Either
J B (
||e
+
||i
)
1
ne
(J B p
e

||e
)

gv
i
Generalized mn
dv
dt
= (p
e
+p
i
) E = v B +J Yes Yes No No
Hall J B (
||e
+
||i
)
1
ne
(J B p
e

||e
)
MHD
Neoclassical mn
dv
dt
= (p
e
+p
i
) E = v B +J No No Yes Yes
MHD J B (
||e
+
||i
)
1
ne

||e

gv
i
Generalized mn
dv
dt
= p E = v B +J No No No No
Resistive J B
||
MHD
Table 1.2: Extended MHD Models
2. Kinetic Alfven Waves (KAW): These are dispersive waves due to the
parallel electron pressure gradient
||
p
e
in Ohms law. These waves are
associated with nite k
||
and k

, as well as both the ion and electron


responses.
3. Gyro-viscous waves (GVW): These are dispersive waves, associated with
the ion response, due to the divergence of the o-diagonal terms in the

gv
i
tensor.
It should be noted that in the extended MHD models the gyro-viscous force
enters (
gv
i
) the momentum equation at the same order in and hence it
is inconsistent to include one but not the other. The gyro-viscous force is not
dissipative because it does not stem from particle collisions. The general form
of the gyroviscous stress tensor is given as

gv
i
=

3
2
_
b (I + 3bb) + (b (I + 3bb))
T
_
(1.26)
where = v+(v)
T
2/3 b is the strain tensor, and
3
nT
i
/2, and
is the ion gyro-frequency. The gyroviscous dispersive modes manifest themselves
as corrections to the whistler modes for the case of parallel propagation. For
perpendicular propagation they appear as corrections to the fast magnetosonic
mode. The perpendicular dispersive waves have generally not been accounted
for in numerical MHD investigations and deserve special attention for implicit
treatment.
1.2. BOUNDARY CONDITIONS 9
Numerical implications: The dispersive modes introduced by the employ-
ment of extended MHD models will have a rather severe CFL restriction due to
t < x
2
for explicit methods. Hence, these dispersive modes will require an
implicit treatment. Furthermore, the neat classication of resistive MHD as a
hyperbolic-parabolic system (ideal MHD leads to a hyperbolic system of PDEs)
is no longer valid. It is not obvious that upwind methods, which have been
successfully applied to ideal and resistive MHD, can be used for these dispersive
systems. Some form of a splitting algorithm which will treat the hyperbolic parts
with upwinding methods and the dispersive modes with an implicit method may
become necessary.
1.2 Boundary Conditions
For ideal MHD, at the perfectly conducting boundary, the following boundary
conditions must be satised.
n E = 0 (Zero tangential electric field) (1.27)
n B = 0 (Zero normal magnetic field) (1.28)
n v = 0 (Zero normal velocity field) (1.29)
More discussion on boundary conditions to be added.
1.3 Outline of this book
The outline of the book is as follows. In Chapter 2, we discuss nite volume
methods with a discussion of Riemann problems, as well as solenoidal preserving
methods. These are done in the context of explicit time integration methods.
In Chapter 3, we discuss semi-implicit and implicit methods. This chapter
includes a general discussion of Jacobian-Free Newton-Krylov method and the
importance of preconditioners. Chapter 4 has a discussion of block structured
adaptive mesh methods. These early chapters focus on ideal and resistive MHD.
Numerical methods for two-uid and extended MHD are presented in subsequent
chapter (to be written).
10 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS
Chapter 2
Finite Volume Methods
In this chapter we will discuss nite volume methods for MHD. The main empha-
sis will be on ideal MHD and methods which preserve the solenoidal property of
the magnetic eld. We begin with a general introduction to high-resolution nite
volume methods, followed by a discussion of conservative vs. non-conservative
formulations. The role of Riemann solvers with an emphasis on linearized Rie-
mann solvers is presented. Finally, we present an extension of Colellas [15] to
ideal MHD.
2.1 Introduction to nite volume methods
The system of ideal MHD equations can be written as:
U
t
= R(U) = F(U) (2.1)
where R(U) is the divergence of the hyperbolic uxes. In nite volume methods,
the physical domain is decomposed into cells. We adopt the following notation
in this book. The domain is decomposed in to cells in such a fashion as to
permit indexing of each cell by an n-tuple index (n=3 for three dimensions and
n=2 for 2D). The indices are labeled (i, j, k) in 3D and (i, j) in 2D. Cell (i, j, k)
is bounded by faces in the x-direction denoted as (i +
1
2
, j, k), (i +
1
2
, j, k) in
3D, or (i +
1
2
, j), (i +
1
2
, j) in 2D. Faces in the other directions are similarly
labeled. The solution U
i,j,k
in each cell represents the average of the conserved
quantities in each of these cells. Thus,
U
i,j,k
=
1
x y z
_
i+
1
2
,j,k
i
1
2
,j,k
_
i,j+
1
2
,k
i,j+
1
2
,k
_
i,j,k+
1
2
i,j,k
1
2
U(x, y, z, t)dxdydz. (2.2)
11
12 CHAPTER 2. FINITE VOLUME METHODS
U
i,j,k
varies in each cell due to the ux of the various conserved quantities
through the cell faces. It is common place to adopt the method of lines to
solve equation 2.1). The quantity R(U) is computed in each cell and an ODE
integrator is then used. One has to, of course, take care that the nal method
is stable, and consistent. There is a vast amount of literature on so-called
high-resolution upwind methods in the CFD literature. In several of these
methods, the ux through each cell face is determined by solving a Riemann
problem which is discussed in detail later. Furthermore, in several of these
methods, the cell averaged values are interpolated to obtain values on either
side of the cell faces. For example, if linear reconstruction is used, the slopes in
each cell are limited in order to preserve monotonicity and avoid introduction
of new extrema into the solution. A widely used limited linear reconstruction
method is the one by Van Leer. Another reconstruction method is the piecewise
parabolic method (PPM) which is a quadratic reconstruction method. These
reconstruction methods are quite popular in the CFD literature, and are not
discussed in this book. So, to summarize, an explicit method of solving the
ideal MHD equations involves the following steps (not necessarily in order).
1. Using the cell averages, interpolate the conserved (or primitive or char-
acteristic variables) the left and right sides of each cell face using one of
the limited reconstruction methods.
2. Using the left and right state, determine the uxes through each cell face.
This may involve solving a Riemann problem at the cell interface.
3. Update the cell averages using a stable ODE integrator.
4. Perform a B preserving step or a divergence cleaning step depending
upon the method chosen to deal with B.
2.2 Conservative vs. Non-conservative Formulation
One may view ideal MHD equations as a system of nonlinear PDEs governing the
motion of a conducting uid in the presence of a magnetic eld. The equations
are then the equations of hydrodynamics coupled with Maxwells equations and
these are written below in non-conservation form:
U
t
+ F(U) = S (2.3)
where the ux vectors F(U) are given by
F(U) =
_
v , vv +p

I , vB Bv , (e +p) v
_
T
, (2.4)
2.2. CONSERVATIVE VS. NON-CONSERVATIVE FORMULATION 13
and the source terms S(U) is given by
S(U) = {0 , J B, 0 , (J E)}
T
, (2.5)
As written above, the total energy is now dened as p/( 1) + 1/2v v.
The source terms occur in the momentum equations in the form of the Lorentz
force and as the Ohmic heating term in the energy equation. These form of
the equations are completely equivalent to the fully conservative form (written
below). The non-conservative form has been used in several instances in the
literature (e.g. in the work of Evans & Hawley [21]). An advantage of this
formulation is seen in for low plasmas ( is the ratio of thermal to magnetic
pressures), in which the pressure computation does not involve the dierence
between two large quantities (total energy and magnetic energy) which is prone
to large error. We denote these form of the equations as a loose-coupling
between the equations of hydrodynamics and the electro-magnetic equations
with the coupling occurring through the aforementioned source terms. In the
presence of shocks it is clearly advantageous to write the ideal MHD equations
in fully conservative form.
U
t
+ F(U) = 0, (2.6)
where ux vector F(U) is given by
F(U) =
_
v , vv +
_
p +
1
2
B B
_

I BB,
vB Bv ,
_
e +p +
1
2
B B
_
v B(B v)
_
T
,
2.2.1 Godunov Symmetrization
It was observed by Godunov [23] that the conservative form of the ideal MHD
equations leads to a eigenvalue degeneracy. This implies that while the ideal
MHD equations are hyperbolic they are not strictly hyperbolic. Adding a source
terms proportional to B i.e.
S
B
(U) = B({0, B
x
, B
y
, B
z
, u
x
, u
y
, u
z
(B u)}
T
), (2.7)
to the conservative equations removes the eigenvalue degeneracy. Adding this
source term also makes the equations Galilean invariant. This is also the the
rationale adopted by Powell et al. for including the non-conservative source
14 CHAPTER 2. FINITE VOLUME METHODS
term in the equations [32]. If the divergence of the induction equation, which
includes the source term, is taken we get the following equation.
B
t
+ (v B) = 0. (2.8)
This implies that B/, if non-zero (presumably due to numerical error), will
get convected along streamlines.
2.3 Seven vs. Eight Waves
Consider the ideal MHD equations in one dimension.
U
t
+
F(U)
x
= 0. (2.9)
These equations can be transformed to the quasilinear form as
W
t
+

A
W
x
= 0, (2.10)
where W = {, u
x
, u
y
, u
z
, B
x
, B
y
, B
z
, p}
T
are known as the primitive vari-
ables. The matrix

A is given by

A
U
W
U
F
W
U (2.11)
=
_

_
u
x
0 0 0 0 0 0
0 u
x
0 0 B
x
/ B
y
/ B
z
/ 1/
0 0 u
x
0 B
y
/ B
x
/ 0 0
0 0 0 u
x
B
z
/ 0 B
x
/ 0
0 0 0 0 0 0 0 0
0 B
y
B
x
0 u
z
u
x
0 0
0 B
x
0 B
x
u

0 u
x
0
0 p 0 0 ( 1)B u 0 0 u
x
_

_
.
When using the non-conservative source term, the quasilinear form is
W
t
+A
W
x
= 0, (2.12)
2.3. SEVEN VS. EIGHT WAVES 15
where
A =
_

_
u
x
0 0 0 0 0 0
0 u
x
0 0 0 B
y
/ B
z
/ 1/
0 0 u
x
0 0 B
x
/ 0 0
0 0 0 u
x
0 0 B
x
/ 0
0 0 0 0 u
x
0 0 0
0 B
y
B
x
0 0 u
x
0 0
0 B
z
0 B
x
0 0 u
x
0
0 p 0 0 0 0 0 u
x
_

_
. (2.13)
While

A has an eigenvalue degeneracy, A does not. Riemann solvers can be
developed based on either

A or A. In the former case, the fth row and column
of

A is dropped to give the following 7 7 matrix:

A =
_

_
u
x
0 0 0 0 0
0 u
x
0 0 B
y
/ B
z
/ 1/
0 0 u
x
0 B
x
/ 0 0
0 0 0 u
x
0 B
x
/ 0
0 B
y
B
x
0 u
x
0 0
0 B
x
0 B
x
0 u
x
0
0 p 0 0 0 0 u
x
_

_
. (2.14)
The eigenvalues of

A are: {u
x
, u
x
c
f
, u
x
c
a
, u
x
c
s
} where c
s
, c
a
, c
f
are, respectively, the slow magnetosonic, Alfven , and fast magnetosonic sound
speeds. These speeds are dened below:
c
a
=
B
x

1
2
(2.15)
c
2
f,s
=
1
2
_
a
2
t

_
a
4
t
4a
2
c
2
a
_1
2
_
, (2.16)
where a is the usual sound speed dened as a
2
= p/, and a
2
t
= (p +(B
2
x
+
B
2
y
+ B
2
z
))/. In the denitions above the plus (minus) sign is for the fast
(slow) magnetosonic sound speeds. Thus, in MHD, disturbances travel at three
dierent characteristic speeds as opposed to gas dynamics in which there is only
one sound speed. Furthermore, in MHD, disturbances propagate anisotropically
depending on the orientation with respect to the magnetic eld.
Here, in passing, we mention the work of Dellar [19]. He derived the MHD
equation which would result if magnetic monopoles actually did exist. He found
that for nonzero B the only source term required is the v B term in
the induction equation. The energy and momentum conservation equations are
unchanged.
16 CHAPTER 2. FINITE VOLUME METHODS
2.4 Riemann Solvers
Several nite volume methods rely on the solution of Riemann problems at cell
faces to determine the uxes of conserved quantities. It should be emphasized
that almost exclusively these Riemann problems are one-dimensional. Further-
more, it is convenient to solve the Riemann problems in terms of the primi-
tive variables. The solution to the one-dimensional Riemann problem satises
eq. 1.25 with the following initial data:
U(x, 0) = constant = U
L
for x 0
U(x, 0) = constant = U
R
for x < 0 (2.17)
The solution to the Riemann problem is self-similar in x/t. The solution con-
tains one contact discontinuity, Alfven shocks, and magnetosonic shocks or
rarefactions.
2.4.1 Linearized Riemann Solvers
We begin by considering approximate solution to the Riemann problem. This is
one in which the following linear system is solved:
W
t
+A
R
W
x
= 0, (2.18)
where A
R
A
R
(W
L
, W
R
) is a matrix which is held constant for the solution
and is constructed using some averaging procedure for W
L
and W
R
(W
L
and
W
R
are primitive variables corresponding to U
L
and U
R
, respectively). For gas
dynamics A
R
should satisfy the following property due to Roe [35]:
F(U
R
) F(U
L
) = A
R
(U
R
U
L
), (2.19)
which ensures that the solution to the Riemann problem is exact for a single
shock. For MHD the above property is satised only if = 2 [12]. In practice
A
R
= A
R
(
1
2
(W
L
+ W
R
)) works out quite satisfactorily. The solution to the
Riemann problem is then given by:
W

= W
L
+

k
<0
(l
k
(W
R
W
L
)) r
k
= W
R

k
>0
(l
k
(W
R
W
L
)) r
k
, (2.20)
2.4. RIEMANN SOLVERS 17
where
k
, l
k
and r
k
are the eigenvalues, left and right eigenvectors, respectively,
of matrix A
R
.
Depending upon whether we use A or

A we get an eight-wave or a seven
wave method. Eigenvectors for the seven-wave method can be found in the
work of Falle et al. [22] and for the eight-wave method in the work of Powell et
al. [32].
The ux can then be computed as follows: F F(W

). This, of course, is
not strictly valid for linearized Riemann solvers, but it is, nonetheless, still used.
Alternatively, following Roes method [35], the ux can be written as:
F =
1
2
_
F
L
+F
R

k
||
k

k
r
k
_
, (2.21)
where
k
= l
k
(U
R
U
L
).
2.4.2 Exact solution to the Riemann problem
For a vast majority of cases, the linearized Riemann solver described above is
fairly adequate. However, for certain cases where strong rarefactions are en-
countered lead to negative pressures and/or densities. There have been certain
ad-hoc cures for this behavior. For example, Balsara and Spicer [4] recom-
mends computing an additional Riemann problem for a system in which the
energy equation is replaced by the entropy equation in which the pressure re-
mains positive. The solution of the second Riemann problems is used where the
pressure from the usual Riemann problem could potentially become negative;
the decision is made via switches in the code. Falle et al. [22] have devel-
oped a robust iterative Newton procedure to compute the exact solution to the
Riemann problem. Another exact Riemann solver was developed by Dai and
Woodward [17] in which rarefactions were approximated by rarefaction shocks.
Ryu and Jones [36] devised an improved version in which the rarefactions are
treated correctly but their solver fails to converge for switch-on or switch-o
waves.
We point out that one has to be at least aware of the fact that solutions
of Riemann problems in nite volume schemes can be contaminated by wave
patterns of irregular Riemann solutions. This was pointed out very convincingly
by Torrihlon [40]. In particular problems associated with convergence arise when
the initial conditions are such that 180

are replaced by an intermediate wave


solution. These problems were observed when regions where the magnetic eld
is undergoing large changes in its directions are inadequately resolved.
18 CHAPTER 2. FINITE VOLUME METHODS
2.4.3 Degeneracies
Without delving into details, we point out that care must be exercised when the
transverse magnetic eld component (B
t
= (B
2
y
+ B
2
z
)
1
2
) is zero. For B
t
= 0,
either c
s
= c
a
if c
a
< a, or c
f
= c
a
if c
a
> a where a is the gas sound speed
dened in the usual manner as a
2
= p/. Thus, if c
a
< a (resp. c
a
> a)
we have slow wave (resp. fast wave) degeneracy. The slow-wave and fast-wave
eigenvectors contain terms proportional to B
y
/B
t
and B
z
/B
t
as B
t
0. It
can be shown that the eigenvectors are still linearly independent irrespective of
the direction of the transverse magnetic eld component as it tends to zero.
For the case of c
a
= a, both the fast and slow waves are degenerate. When
B
x
= 0 the fast waves cannot change the transverse velocity components, and
both the Alfven and the slow wave merge with the contact discontinuity. The
equations then reduce to those of gas dynamics with pressure replaced by the
sum of the gas and the magnetic pressures.
2.5 Methods to ensure solenoidal magnetic elds
A consequence of Faradays induction law is that an initially divergence free mag-
netic eld remains divergence free for all time. However, applying the divergence
operator () to the right hand side of the induction equation (E) does
not ensure that the solenoidal property of the magnetic eld is satised. A non-
zero divergence leads to an anomalous Lorentz force parallel to the magnetic
eld ([10]). The following methods to be, described in detail later, are some
techniques to ensure that some discrete form of the B = 0 is satised.
1. Constrained transport: In this method, the B = 0 is built into the
nite dierence or nite volume method such that a discrete form of the
solenoidal condition is satised. This method will be described in detail
later.
2. Non-conservative source: In this method, the non-conservative source
term (eq. 2.7) is added to the equations. The underlying argument in
using this term is that there is nothing special about a particular dis-
cretized form of B and that other evolution equations suer from
truncation error in any case, so there is truncation error in discrete form
of B. Falle et al. have argued that if indeed B = 0 then adding the
source term to the conservative formulation is necessary to make it exactly
equivalent to the quasilinear form. Furthermore, adding this source term
mitigates some of the bad behavior of conservative schemes which do
not preserve the solenoidal property of the magnetic eld. If in addition,
2.5. METHODS TO ENSURE SOLENOIDAL MAGNETIC FIELDS 19
the eight-wave formulation is used in the Riemann solver, the divergence
errors are convected away along stream lines. In practice, however, there
empirical evidence that the max norm of the error grows with time. A
ltering of the magnetic eld at the end of every time step can lessen the
detrimental eects of this growing error. The ltering is applied as:
B = B +( B), (2.22)
where is appropriately chosen coecient proportional to the square of
the mesh spacing. This lter is tantamount to diusing the divergence
errors.
3. Vector potential formulation: In this method, the magnetic eld is ex-
pressed as B = A so that the condition B = 0 is automatically
satised. However, A A which is a gauge transformation. In
other words, the vector potential is undetermined to within the gradient
of a scalar function. The choice of the particular scalar function is
referred to the as the choice of the gauge. For the vector potential, the
most commonly chosen gauge condition is A = 0 which is called the
Coulomb gauge. Making use of the Coulomb gauge, we get
J = B = (A) =
2
A. (2.23)
Usually, satisfying the gauge conditions requires the solution of an elliptic
equation.
4. Projection: In this method, the magnetic eld at the end of each time
step is projected onto a space of zero divergence. This is accomplished
by solving the following Poisson equation

2
= B, (2.24)
and correcting the magnetic eld as B := B . Toth [41] has
shown that for a uniform Cartesian grid, projection provides the smallest
correction to B. There are interesting questions which arise. The above
Poisson equation is an elliptic equation which implies global coupling.
However, in hyperbolic systems, we expect a nite signal speed. So,
does projection violate hyperbolicity? In other words, will the eects of
projection be felt ahead of a shock, for instance. We leave such questions
unanswered at present. Suce to say that there is empirical evidence that
B errors occurs in pairs with opposite signs. Such dipolar structures
lead to corrections of order 1/r
2
in 2D, and 1/r
3
in 3D where r is the
distance from the dipole.
20 CHAPTER 2. FINITE VOLUME METHODS
5. Hyperbolic divergence cleaning: Dedner et al. [18] developed a mod-
ied system in which the divergence constraint is coupled with the con-
servation laws by introducing a generalized Lagrange multiplier. Consider
the modied induction equation
B
t
+ (uB Bu) + = 0, (2.25)
D() + B = 0. (2.26)
It can be easily shown that
(D( B))
t
( B) = 0, (2.27)
(D())
t
= 0. (2.28)
Thus B and satisfy the same equation for any choice of D. The
following choices are considered
(a) Elliptic: D = 0 which leads to an elliptic system. The modied
induction equation is solved with an operator split approach. First
the usual induction equation is solved to give a predicted value of B
which we denote as B
n+1,
. This is followed by the following step.
B
t
+ = 0. (2.29)
Taking the divergence of this gives.
B
t
+ = 0, (2.30)
which is discretized as

n+1
=
B
n+1,
t
, (2.31)
where we assume that B at time (n+1) is zero. This is a Poisson
equation which is similar to the one used in the projection scheme.
Finally the magnetic eld is obtained as:
B
n+1
= B
n+1,
t (2.32)
(b) Parabolic: In this method, we use
D() =
1
c
2
p
, (2.33)
2.6. CONSTRAINED TRANSPORT METHOD 21
with c
p
(0, ). This leads to the heat equation

t
= c
2
p
, (2.34)
which implies that the divergence errors are dissipated and smoothed
out. Dedner et al. note that the parabolic correction method does
not lead to satisfactory results.
(c) Hyperbolic: In this method, we use
D() =
1
c
2
h

t
(2.35)
with c
h
(0, ). This leads to the wave equation

t
2
= c
2
h
, (2.36)
which implies that divergence errors are propagated to the boundary
with nite speed c
h
> 0. Dedner et al. recommend combining
the parabolic and hyperbolic methods for best results. The nal
extended system obtained can be shown to be hyperbolic and yeilds
a more robust scheme.
2.6 Constrained Transport Method
Brackbill and Barnes used the non-conservative form for the Lorentz force which
signicantly reduces errors in the kinetic energy. The constrained transport
method was introduced by Evans and Hawley [21] in which they used the
non-conservative formulation.
In the CT formulation, a staggered mesh approach is used in which quantities
such as density and pressure are located at cell centers while the velocity and
magnetic eld components are located at the cell faces. Let us consider a two-
dimensional case in which B (B
x
, B
y
) and v (v
x
, v
y
). In the original CT
formulation of Evans & Hawley the cell centers were indexed (i +
1
2
, j +
1
2
) while
the cell corners were indexed (i, j). We will use the more conventional notation
here and rewrite the CT formulation such that the cell centers are indexed
(i, j), and cell corners by (i +
1
2
, j +
1
2
). B
y
, v
x
are located at (i +
1
2
, j) while
B
x
, v
y
are located at (i, j +
1
2
). A forward Euler discretization of the induction
equation gives
B
x,n+1
i,j+
1
2
= B
x,n
i,j+
1
2
t
_
(

v
y
B
x


v
x
B
y
)
i,j+1
(

v
y
B
x


v
x
B
y
)
i,j

,
B
y,n+1
i+
1
2
,j
= B
y,n
i+
1
2
,j
t
_
(

v
x
B
y


v
y
B
x
)
i+1,j
(

v
x
B
y


v
y
B
x
)
i,j

, (2.37)
22 CHAPTER 2. FINITE VOLUME METHODS
where the bar over the variable indicates an averaging procedure. In examining
the above equations, we notice the term v
y
B
x
in the evolution equation for
B
x
. This has the form of a transport term which requires some form of an
upwinding approach. The other term in the equation for B
x
is like a shear
term which typically does not need any special treatment. However, the roles
of these two terms are reversed in the equation for B
y
. Hence, both terms are
computing using some form of upwinding procedure. The terms (

v
y
B
x
)
i,j
acts
like a ux term. Evans & Hawley recommend that these terms be computed
by upwind interpolation using the method of Van Leer or PPM. Consider the
Van Leer method applied to (

v
y
B
x
)
i,j
.

v
x
i,j
=
1
2
_

v
x
i+
1
2
,j
+

v
x
i
1
2
,j
_
(2.38)
The raw slopes for interpolation of B
y
are computed as
B
y
i,j
=
B
y
i+
1
2
,j
B
y
i
1
2
,j
x
, (2.39)
and used to compute the following monotonic slopes:
B
y
i+
1
2
,j
=
2 B
y
i+1,j
B
y
i,j
B
y
i+1,j
+ B
y
i,j
if B
y
i+1,j
B
y
i,j
> 0,
B
y
i+
1
2
,j
= 0 if B
y
i+1,j
B
y
i,j
0. (2.40)
The monotonic interpolations of the magnetic eld are then

B
y
i,j
= B
y
i
1
2
,j
+
1
2
B
y
i
1
2
,j
[x t

v
x
i,j
] if

v
x
i,j
> 0

B
y
i,j
= B
y
i+
1
2
,j

1
2
B
y
i+
1
2
,j
[x + t

v
x
i,j
] if

v
x
i,j
< 0 (2.41)
It is clear that taking the divergence at the cell corners in the following form
is identically zero provided it is zero at t = 0.
( B)
i+
1
2
,j+
1
2
=
B
x
i+1,j+
1
2
B
x
i,j+
1
2
x
+
B
y
i+
1
2
,j+1
B
y
i+
1
2
,j
y
= 0. (2.42)
Note that the Evans & Hawley CT method can also be cast in terms of an
underlying vector potential which is cell centered.
The above idea of using constrained transport was incorporated into nite
volume schemes Godonov-type schemes by several researchers. Noteworthy are
the works by Dai & Woodward [17], Balsara & Spicer [3], and by Toth [41]. In
2.6. CONSTRAINED TRANSPORT METHOD 23
several of these methods, the conserved variables are stored at the cell centers
while the EMF quantities are computed at cell corners, i.e., at (i +
1
2
, j +
1
2
).
Auxiliary variables corresponding to the x- and y-component of the magnetic
elds are also dened. The x-component is dened on the cell faces (i +
1
2
, j),
and y-components on the cell faces (i, j +
1
2
). Toth has shown that it is not
essential to use these face centered elds but they do make matters convenient
and are therefore used here, and we will use lower case b to denote the face
centered magnetic elds. The following two variants can be formulated.
1. Field-interpolated CT scheme: This was the method proposed by Dai
& Woodward. Spatial and temporal averaging are used to compute the
corner magnetic eld components as follows:
B
n+
1
2
i+
1
2
,j+
1
2
=
1
8
_
B
n
i,j
+B
n
i+1,j
+B
n
i,j+1
+B
n
i+1,j+1
+ B

i,j
+B

i+1,j
+B

i,j+1
+B

i+1,j+1
_
, (2.43)
where indicates the updated cell centered magnetic eld using the
upwind Godunov-type scheme. The velocity eld at the cell corners is
similarly determined. The z-component of electric eld is computed using
the above averaged magnetic and velocity components as
E
z
i+
1
2
,j+
1
2
= (v
x
i+
1
2
,j+
1
2
B
y
i+
1
2
,j+
1
2
v
y
i+
1
2
,j+
1
2
B
x
i+
1
2
,j+
1
2
) (2.44)
2. Flux-interpolated CT scheme: This method was originally proposed by
Balsara & Spicer. In this method, the uxes computed in the upwind
Godunov type method at the cell faces are used to compute the EMF
quantities at the cell corners.
E
z
i+
1
2
,j+
1
2
=
1
4
_
f
x
i+
1
2
,j
f
x
i+
1
2
,j+1
+f
y
i,j+
1
2
+f
y
i+1,j+
1
2
_
, (2.45)
where f
x
and f
y
are the uxes through the cell face in the x- and y-
direction, respectively. The f
x
ux is occurs in the evolution equation for
B
y
and equal to (v
x
B
y
v
y
B
x
), while the f
y
ux occurs in the evolution
equation for B
x
and equals (v
x
B
y
v
y
B
x
).
The face centered magnetic eld components are then updated as
b
x,n+1
i+
1
2
,j
= b
x,n
i+
1
2
,j
t
E
z
i+
1
2
,j+
1
2
E
z
i+
1
2
,j
1
2
y
b
y,n+1
i+
1
2
,j
= b
y,n
i+
1
2
,j
+ t
E
z
i+
1
2
,j+
1
2
E
z
i
1
2
,j+
1
2
x
(2.46)
24 CHAPTER 2. FINITE VOLUME METHODS
The cell centered magnetic eld is then obtained by averaging the face
centered eld as
B
x,n+1
i,j
=
b
x,n
i+
1
2
,j
+b
x,n
i
1
2
,j
2
B
y,n+1
i,j
=
b
y,n
i,j+
1
2
+b
y,n
i,j
1
2
2
(2.47)
In these methods the cell centered divergence dened as
( B)
i,j
=
b
x
i+
1
2
,j
b
x
i
1
2
,j
x
+
b
y
i,j+
1
2
b
y
i,j
1
2
y
, (2.48)
is maintained to machine zero provided it is so at t = 0.
Toth has extended the above methods to a central dierence approxima-
tion in which there are no staggered quantities and in which the EMF quantities
are themselves computed at cell centers and not the cell corners. A discussion
of the cell-centered constrained transport schemes is omitted for the sake of
brevity.
2.7 Unsplit Method for Ideal MHD
In this section, we discuss the unsplit method for ideal MHD. The method
developed here has its origins in Colella [15], Saltzman [37] and Crockett et
al. [16]. We begin by rewriting the equation (2.3) as follows.
U
t
+
D1

d=0
F
d
x
d
= S
D
(2.49)
where, where D is the dimensionality of physical space, and S
D
is the di-
vergence of the diusive uxes. We dene a vector of variables called the
primitive variables W W(U). In our implementation we chose W =
{ , u
i
, B
i
, u
i
, p( or p
t
)}
T
, where p
t
= p +
1
2
B
k
B
k
is the total pressure, an
alternative to pressure which proves convenient for certain problems. Rewriting
the equations using W in quasilinear form, we get
W
t
+
D1

d=0
A
d
(W)
W
d
x
d
= S

D
, A
d
=
U
W
U
F
d

W
U, S

D
=
U
WS
D
.
(2.50)
2.7. UNSPLIT METHOD FOR IDEAL MHD 25
A
d
is a singular matrix for MHD with an eigenvector degeneracy. It may be
desingularized if a source term proportional to S B is included. This is
essentially the approach by Powell et al. [32] in which the desingularized matrix
A
d
has an additional eigenvalue equal to the advection speed and corresponds
to an extra wave responsible for advecting away the divergence errors.
The unsplit algorithm [15] is essentially a predictor-corrector method in
which face-centered and time-centered primitive variables are predicted, fol-
lowed by a corrector step in which a Riemann problem is solved using the
predicted values to compute a second order accurate estimate of the uxes:
F
n+
1
2
i+
1
2
e
d
F
d
(x
0
+(i +
1
2
e
d
)h, t
n
+
1
2
t). The predictor step is further divided
into a normal and a transverse predictor steps. Our algorithm is outlined below.
2.7.1 Algorithm Steps
1. Transform to primitive variables, and compute slopes
d
W
i
in each com-
putational cell, which are subsequently limited using Van Leer slope lim-
iting.
2. Normal Predictor: Compute the eect of the normal derivative terms
and the source term on the extrapolation in space and time from cell
centers to faces. In this step we split the primitive variables as follows
W
n
i
=
_

W
n
i
B
n
i,d
_
, (2.51)
For 0 d < D,

W
i,,d
=

W
n
i
+
1
2
(I
t
h

A
d
i
)P

(
d
W
i
), (2.52)

A
d
i
=

A
d
(W
i
), P

(W) =

k
>0
(l
k
W)r
k
,
B
i,,d
= B
i,d
, W
n
i,,d
=
_

W
n
i,,d
B
n
i,,d
_
,
W
i,,d
= W
i,,d
+
t
2

U
W S
n
D,i
, (2.53)
where

A
d
i
is the matrix obtained from A
d
i
after deleting the row and
column corresponding to the normal component of the magnetic eld,
k
are eigenvalues of

A
d
i
, and l
k
and r
k
are the corresponding left and right
eigenvectors.
26 CHAPTER 2. FINITE VOLUME METHODS
Stone Correction: Crockett et al. [16] recommend the use of a correction
called the Stone Correction to the above normal predicted states. This
stems from the fact that in multi-dimensions the derivative of the normal
component of the magnetic eld in the d-direction is not zero. The Stone
Correction is given as

W
i,,d
=

W
i,,d

t
2
_
B
d
x
d
_
i
a
B
, (2.54)
where a
B
= {0, B
k
/, u
d
1
, u
d
2
, ( 1)u
k
B
k
}
T
, and d
l
= mod(d+l, 3);
and the term (
B
d
x
d
)
i
is the derivative of the normal component of the
magnetic eld in the d-direction, computed using a standard second-order
central dierence formula.
3. Transverse Predictor: Compute estimates of F
d
suitable for computing
1D ux derivatives
F
d
x
d
using a Riemann solver. The above normal pre-
dictor step gives us left and right states at each cell interface. We employ
a seven-wave linearized Riemann solver to obtain the primitive variables at
the cell faces, except the normal component of the magnetic eld,which
is taken as the arithmetic mean of the left and right states. The entire so-
lution vector at i +
1
2
e
d
is termed as the solution of the Riemann problem
R(., .). The uxes are then computed from the primitive variables as,
F
1D
i+
1
2
e
d
F
1D
(W
i+
1
2
e
d
), W
1D
i+
1
2
e
d
R(W
i,+,d
, W
i+e
d
,,d
). (2.55)
In 3D, we compute corrections to W
i,,d
corresponding to one set of
transverse derivatives appropriate to obtain (1, 1, 1) diagonal coupling.
W
i,,d
1
,d
2
= W
i,,d
1

t
3h

U
W (F
1D
i+
1
2
e
d
2
F
1D
i
1
2
e
d
2
) (2.56)
Furthermore, in 3D, we compute uxes corresponding to corrections made
in the previous step,
F
i+
1
2
e
d
1,d
2
= R(W
i,+,d
1
,d
2
, W
i+e
d
1,,d
1
,d
2
, d
1
)
d
1
= d
2
, 0 d
1
, d
2
< D. (2.57)
2.8. VERIFICATION TESTS 27
Compute nal corrections to W
i,,d
due to the nal transverse derivatives.
2D : W
n+
1
2
i,,d
= W
i,,d

t
2h

U
W (F
1D
i+
1
2
e
d
1
F
1D
i
1
2
e
d
1
) (2.58)
d = d
1
, 0 d, d
1
< D,
3D : W
n+
1
2
i,,d
= W
i,,d

t
2h

U
W (F
i+
1
2
e
d
1,d
2
F
i
1
2
e
d
1,d
2
)

t
2h

U
W (F
i+
1
2
e
d
2,d
1
F
i
1
2
e
d
2,d
1
)
d = d
1
= d
2
, 0 d, d
1
, d
2
< D.
4. Compute nal estimate of uxes as follows. First compute the solution
to the Riemann problem using the time-centered predicted states,
W
n+
1
2
i+
1
2
e
d
= R(W
n+
1
2
i,+,d
, W
n+
1
2
i+e
d
,,d
, d). (2.59)
Projection: Using the normal component of the magnetic eld at i +
1
2
e
d
compute a cell centered divergence. The following Poisson equation is
solved using a multigrid technique with a Gauss-Seidel Red-Black ordering
smoother, and a BiCGStab bottom solver.

2
=
D1

d=0
B
d
x
d i
(2.60)
Project the magnetic eld as B
i+
1
2
e
d
= B
i+
1
2
e
d
, and replace
the corrected magnetic eld in to W
n+
1
2
i+
1
2
e
d
, and recompute the uxes as
F
n+
1
2
i+
1
2
e
d
= F(W
n+
1
2
i+
1
2
e
d
).
5. Final update: Compute the nal update to the conserved variables.
U
n+1
i
= U
n
i

t
h
D1

d=0
(F
n+
1
2
i+
1
2
e
d
F
n+
1
2
i
1
2
e
d
) (2.61)
2.8 Verication tests
In this section, we will describe a few verication tests for ideal MHD. Clearly,
this list is not exhaustive, but illustrative of the variety of test problems widely
used in the literature.
28 CHAPTER 2. FINITE VOLUME METHODS
2.8.1 Linear wave propagation
The rst verication test for ideal MHD is that of 2D linear wave propagation
problem. In this problem, the domain is dened as the square [0, 2] [0, 2],
having periodic boundary conditions on all sides. The initial conditions are
setup as follows. We write the ideal MHD equations in quasilinear form suitable
for wave propagation along a direction = k
x
x +k
y
y
W
t
+A

= 0,
where W = {, u, v, w, B
x
, B
y
, B
z
, p}
T
. We begin with a constant equilib-
rium state, denoted as W
0
, and project this state on to the characteristic
space by taking the inner product of W
0
with the left eigenvectors of the ma-
trix A

(W
0
). Thus the k-th equilibrium characteristic variable is written as
V
0,k
(W
0
) (l
k
(W
0
), W
0
), where l
k
is the k-th left eigenvector of A

(W
0
). The
l-th wave is then initialized by perturbing only the l-th characteristic variable,
i.e., V
k
(x, y, 0) = V
0,k
(W
0
) +
kl
cos(k
x
x + k
y
y), where
kl
is the Kronecker
delta function. The perturbed characteristic variables are then projected back
to physical space by multiplying V
k
with the right eigenvectors of A

(W
0
). The
amplitude of perturbation is chosen to be small (10
5
), and the l-th wave can
be chosen to be one of the ideal MHD wave (i.e., either an Alfven wave, or a fast
or slow magneto-acoustic wave moving obliquely to the mesh at 45

(k
x
= k
y
)
or along the x-axis k
x
= 1, k
y
= 0 , with the magnetic eld at a certain angle to
the direction of propagation. To mimic wave propagation in a low-beta plasma,
the initial equilibrium beta may be chosen to be small ( 2p/|B|
2
= 0.02).
This system is of interest because under these initial and boundary conditions,
the linearized time-dependent wave propagation problem has a closed-form solu-
tion which can be compared with the computed nonlinear solution. (We hasten
to add that the small perturbation amplitude ensures that the waves propagate
almost linearly, with nonlinear eects of O(
2
).) Hence, we use it to analyze
the order of accuracy of the numerical methods.
2.8.2 Circularly polarized Alfven wave
The circularly polarized Alfven wave is an analytical solution to the compressible
MHD equations. For propagation of this wave an at angle in the 2D plane,
we choose the following initial conditions [41]: = 1, v
||
= 0, p = 0.1, B
||
= 1,
v

= 0.1 sin[2(xcos + y sin ] = B

, v
z
= 0.1 cos[2(xcos + y sin ] =
B
z
. The domain is [0, 1/ cos ] [0, 1 sin ] with periodic boundary conditions
in both directions. In this case, the Alfven speed is c
a
= B
||
/

= 1 so that
2.8. VERIFICATION TESTS 29
at t = 1 the wave returns to its original location. The /2 phase shift between
B

and B
z
ensures a constant magnetic pressure.
2.8.3 Shock-tube problem
In hydrodynamics, the Sod shock-tube problem is quite well known. For ideal
MHD, a number of shock tube problem have been proposed [12, 17, 36]. Dai
& Woodward also give the analytical solution for several shock-tube problems.
Toth recommends the following shock-tube problem in which the shock-tube is
misaligned with the grid.
(, v
||
, v

, p, B
||
, B

) = (1, 10, 0, 20, 5/

4, 5/

4) (Left State)
= (1, 10, 0, 1, 5/

4, 5/

4) (Right) (2.62)
The z-components of the velocity and magnetic eld are zero.
2.8.4 The Rotor problem
In this test problem, the initial conditions consist of a dense rapidly spinning
cylinder embedded in a light ambient uid. This problem, which mimics the
problem of angular momentum loss through torsional Alfven waves in star forma-
tion, was originally proposed by Brackbill at a Los Alamos National Laboratory
workshop [3]. The computational domain in this 2D test is [0, 1] [0, 1]. The
initial pressure and magnetic eld are uniform (p = 1, B
x
= 1, B
y
= 0). The
density is = 10, and velocity is v
x
= v
0
(y
1
2
)/r
0
and v
y
= v
0
(x
1
2
)/r
0
for r < r
0
, where r is the radial distance from the center of the domain, and
r
0
= 0.1. The ambient density is = 1. For, r
0
< r < r
1
, the density and
angular velocity proles are linear in r to avoid large transients. Because the
centrifugal forces are not in balance, there magnetic eld winds up and entrains
the dense uid into an oblate shape.
2.8.5 MHD shock refraction
Two dimensional MHD shock refraction during early stages of the Richtmyer
Meshkov instability was examined in detail by Wheatley et al. [43]. An analytical
solution valid in the vicinity of the quintuple point, where all the nonlinear
waves intersect was obtained. This analytical solution can be compared with
the numerical solution. In this test case, the analytical solution consists of fast
shocks, a slow shock and a 2-4 intermediate shock (permissible in this strongly
planar case), and a contact discontinuity. In this test case, a hydrodynamic
shock of Mach number M = 1.5 propagates and strikes an initially quiescent
30 CHAPTER 2. FINITE VOLUME METHODS
contact discontinuity inclined at 45

to the plane of the shock. The density


ratio across the contact is three, and the initial un-shocked uid is at uniform
pressure. The magnetic eld is in the x-direction and uniform B
x
= 1.
Chapter 3
Semi-implicit and Implicit
Methods
In this chapter we will discuss semi-implicit and implicit methods for resistive
MHD. We rst dispense with the implicit treatment of the diusion terms in
the single uid resistive MHD equations. This is followed by a discussion of the
various waves in ideal MHD followed by techniques which which treat some of
the wave modes implicitly.
3.1 Semi-implicit unsplit upwind method for compress-
ible MHD
In this method, we extend the unsplit upwind method for ideal MHD discussed
in the previous chapter to include diusion terms. The equations are the single-
uid resistive MHD equations written in conservation form (eq. 1.24). Using
operator splitting arguments, we rst compute the hyperbolic uxes at time step
n +
1
2
as discussed in the previous chapter. Then, we stop short of performing
the nal update, and treat the diusive uxes implicitly as described below.
3.1.1 Implicit treatment of diusive uxes
At the end of the above step, the face-centered time-averaged hyperbolic uxes
have been obtained. We can update the density because the continuity equation
contains no diusion terms. The induction equation for the magnetic eld is
rewritten as
B
i
t
= L
B
D
(B
n+1
i
) F
H,n+
1
2
B
i
(3.1)
31
32 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
where L
B
D
S
1
2
x
j
x
j
, and F
H,n+
1
2
B
i
is the divergence of the hyperbolic
uxes for the magnetic eld components, and act as a source term in the above
diusive update step. Similarly, the momentum equation is rewritten as

u
i
t
= L
u
D
(u
n+1
i
) F
H,n+
1
2
u
i
+u
i
F
H,n+
1
2

(3.2)
where L
u
D
Re
1
2
x
j
x
j
, and F
H,n+
1
2
u
i
is the divergence of the hyperbolic
uxes in the momentum equations, and F
H,n+
1
2

is the divergence of the


hyperbolic uxes in the continuity equation. Note that the u
i
multiplying
F
H,n+
1
2

is taken as average value of velocities at the nite volume faces obtained


from the last Riemann problem solved in the hyperbolic stage.
We update the momentum and the magnetic eld equations before solving
the energy equation, which is rewritten as

1
T
t
= L
T
D
(T
n+1
) F
H,n+
1
2
e
+
T
1
F
H,n+
1
2

1
2
_
u
k
u
k
t
+
B
k
B
k
t
_
+
e
v
x
j
n+
1
2
(3.3)
where L
T
D
(RePr)
1
1

2
x
j
x
j
, and F
H,n+
1
2
e
is the divergence of the
hyperbolic uxes in the energy equation. The term e
v
in the above equation is
given by

1
e
v
= S
1
_

B
i
x
j

B
j
x
i
_
+Re
1

ij
u
i
. (3.4)
Because the momentum and magnetic elds have been updated, all the terms in
e
v
are known and taken as the average of the values at time t
n
and t
n+1
. Finally
the time derivatives of the kinetic and magnetic energies are determined as a
simple backward dierence between times t
n+1
and t
n
. Each of the implicit
solves of the diusion terms is expressed as a variable coecient Helmholtz
equation, which is solved either with a backward Euler, or a Crank-Nicholson or
an implicit Runge-Kutta technique developed by Twizell et al. [42].
3.2 Rationale for implicit treatment
In compressible MHD we encounter the fast magnetosonic, Alfven , and the
slow magnetosonic sound waves. Typically, plasma connement devices, such
as tokamaks, stellarators, reversed eld pinches etc. are characterized by a
3.3. IMPLICIT TREATMENT OF FAST COMPRESSIONAL WAVE 33
long scale length in the direction of the magnetic eld, and shorter length
scale phenomena in the direction perpendicular to the eld. For example, in
a tokamak, the magnetic eld is dominantly along the toroidal direction and
consequently the long length scale are mostly toroidal whereas the short scales
are in the radial-poloidal plane. It is known that the Alfven wave is a transverse
wave with fastest propagation along the magnetic eld. The fast magnetosonic
aka the fast compressional wave is also anisotropic with the fastest propagation
perpendicular to the magnetic eld. In explicit methods discussed in the previous
chapter, the time step is restricted by the familiar CFL condition. Several MHD
phenomenon are studied for long-time behavior where long-time is of the order
of resistive time scales. For such investigations, the CFL condition implies an
overly restrictive time step which translates to an enormous number of time
steps. It is advantageous and desirable to design numerical schemes which
allow us to have time steps larger than that imposed by the CFL condition, and
yet the computational cost of each time step is only slightly larger than the
explicit case. This is precisely what is done in the next two sub-sections.
3.3 Implicit treatment of fast compressional wave
An implicit treatment of the fast magnetosonic wave coupled with arguments
of large length scales dominantly in a certain direction allows one to investigate
long-time scale phenomena in MHD in a computationally ecient manner. The
work we discuss here was developed by Harned & Kerner [24].
3.3.1 A model illustration
We begin our discussion with a model problem which exposes the philosophy be-
hind the implicit treatment of the fastest waves in MHD. Consider the following
hyperbolic system of equations.
u
t
= a
v
x
,
v
t
= a
u
x
. (3.5)
This can be rewritten as

2
u
t
2
= a
2

2
u
x
2
. (3.6)
We then subtract a term from either side of the above equation as

2
u
t
2
a
2
0

2
u
x
2
= a
2

2
u
x
2
a
2
0

2
u
x
2
, (3.7)
34 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
where a
0
is a constant coecient chosen mainly from stability considerations.
Furthermore, a
0
is something which mimics the behavior of a perhaps in some
limit. The underlying idea of the semi-implicit methods discussed here is this:
the term containing a
0
on the left hand side of eq. 3.6 is treated implicitly, while
the same term on the right hand side of eq. 3.6 is treated explicitly. Moreover,
the cost of solving the linear system stemming from the implicit treatment of
the term containing a
0
should be small relative to the total cost of evolving the
entire system. Consider the time evolution of eq.( 3.6) as
u
n+1

t
2
a
2
0
2

2
u
x
2
n+1
= u
n
+ t
u
t
n
+
t
2
a
2
2

2
u
x
2
n

t
2
a
2
0
2

2
u
x
2
n
(3.8)
We now solve the original hyperbolic system with the following predictor cor-
rector algorithm.
u

= u
n
+ta
v
x
n
(3.9)
v

= v
n
+ta
u
x
n
(3.10)
u
n+1

a
2
0
t
2
2

2
u
x
2
n+1
= u
n
+ ta
v
x

a
2
0
t
2
2

2
u
x
2
n
(3.11)
v
n+1
= v
n
+
1
2
at
_
u
x
n
+
u
x
n+1
_
, (3.12)
where 0.5 1.
Stability: This method is unconditionally stable if a
2
0
> (a
2
/16)(1 + 2
2
).
If this basic concept was applied to the original hyperbolic system in which a
was the coecient, we potentially have a destabilizing situation when a and
a
0
are of opposite sign. As applied above, this does not happen because a
2
is
always positive.
3.3. IMPLICIT TREATMENT OF FAST COMPRESSIONAL WAVE 35
3.3.2 Application to fast compressional wave
We begin by rewriting the equations of compressible ideal MHD.

t
= (v), (3.13)
v
t
= (v) p +B B F, (3.14)
B
t
= (v B), (3.15)
p
t
= v p p v (3.16)
In deriving this method, we will assume that the scale lengths in the z-direction
are much longer than those in the x-y plane. The fastest time scale is then due
to the fast compressional waves in the x-y plane.
First, we consider a one-dimensional problem with

z
=

y
= 0, B = B
z
z,
and v = v
x
x. Furthermore, assuming a constant density cold plasma ( =
1, p = 0), and linearizing with v
x
= v
1
(x), and B
z
= B
0
+B
1
(x) gives
v
1
t
= B
0
B
1
x
,
B
1
t
= B
0
v
1
x
. (3.17)
The above equations are the same as those in eq. 3.5. Consequently the same
ideas as in the illustrative example above can be used here to treat the fast
compressional wave implicitly. The above procedure when generalized to three
dimensions, and retaining only compressional modes gives the following

2
v
1
t
2
=
1

(B
2
0
+p
0
)( v
1
), (3.18)
where p
0
is some equilibrium constant pressure about which the equations are
linearized. A predictor -corrector algorithm to solve the above equations now
36 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
follows.
v

= v
n
+t
1

n
F
n
, (3.19)
B

= B
n
+t((v
n
B
n
)), (3.20)

=
n
t (v)
n
, (3.21)
p

= p
n
t (v
n
p
n
p
n
v
n
) ,(3.22)
v
z,n+1
= v
z,n
+ t
1

F
z,
, (3.23)
v
n+1

= v
n

+ t
1

F
,

t
2
A
2
0
2
( v

)
n+1

t
2
A
2
0
2
( v

)
n
, (3.24)
B
n+1
= B
n
+
t
2
((v
n
+v
n+1
) B

), (3.25)

n+1
=
n

t
2
(

(v
n
+v
n+1
)), (3.26)
p
n+1
= p
n

t
2
_
(v
n
+v
n+1
) p

(v
n
+v
n+1
)
_
, (3.27)
where 0.5 < 1, and v

refers to the velocity in the x-y plane, and A


0
is
similar to a
0
in the model problem described earlier. The extra computational
eort in solving these equations is inverting the block matrix in the evolution
equation for v

. Harner & Kerner further simplied the system by double


Fourier series in y- and z-directions. This makes the linear solve a one dimen-
sional tridiagonal solve in the x-direction which can be eciently implemented
with a small overhead.
Stability: We consider the stability of the above method in two-dimensions
(x and z). Fourier analyzing the above assuming periodicity in both directions,
Harned & Kerner obtained the eigenvalues of the amplication matrix as
=
1
Y
_
Y
1
4
(1 + 2)
_
Y +
1
16
(1 + 2)
2

2
_1
2
_
, (3.28)
where Y = 1 + A
2
0
K
2
, = (K
2
+ N
2
)B
2
0
, K = 2t/xsin(kx/2), N =
2n/Lt, and k, n are the mode numbers in x- and z-directions. For < 0.5
the method is unconditionally unstable. For 0.5 < 1 the method is stable
if 4Y + 1/4(1 + 2)
2
(K
2
+ N
2
)B
2
0
0. Unconditional stability for the fast
compressional modes is obtained if A
2
0
> B
2
0
(1 + 2)
2
/16. We still have to
satisfy a stability condition for the Alfven wave.
3.4. IMPLICIT TREATMENT OF THE ALFV

EN WAVE 37
3.4 Implicit treatment of the Alfven wave
The procedure is somewhat similar to the one adopted for the fast compres-
sional wave except the linear term which is subtracted on the velocity evolution
equation has a dierent form. The method for the implicit treatment of the
shear Alfven wave was proposed by Harned & Schnack [25]. The MHD equa-
tions are linearized assuming a uniform magnetic eld, density and pressure.
The resulting linear wave equation is

2
v
t
2
=
1
0
[(v B
0
)] B
0
+
p
0

0
( v). (3.29)
To arrive at the semi-implicit term B
0
is replaced by a constant vector

C
0
. The
pressure term is dropped because it enters in the magnetosonic modes with the
same form as the perpendicular magnetic eld. Hence the semi-implicit term
is
_
(v

C
0
)


C
0
. The MHD equations are then solved with the
predictor-corrector method as for the fast compressional case with the exception
that the semi-implicit operator is applied to all the velocity components in the
corrector stage as follows:
v
n+1

t
2
2

_
(v
n+1


C
0
)


C
0
= v
n
+ t
1

t
2
2

_
(v
n


C
0
)


C
0
(3.30)
Stability: In a two-dimensional stability analysis, terms in the semi-implicit
formulation having coecients C
i
C
j
(i = j) are destabilizing if

C
0
is not par-
allel to B
0
. The 2D stability analysis also shows that the eigenvalues of the
amplication matrix are: = 1Z
_
Z(Z 1) where Z = X+Y , and X =
N
2
B
2
x
/(1 +N
2
C
2
x
), Y = N
2
B
2
y
/(1 +N
2
C
2
y
), and where N
2
= (m
2
+n
2
)t
2
,
and m, n are mode numbers in the x- and y-directions. lies within the unit
circle when Z < 4/3 which makes the method unconditionally stable as long as
C
x
B
x
and C
y
B
y
, and cross terms such as C
x
C
y
are not retained in the
semi-implicit operator. This removal of the cross terms is essentially a heuristic
which works well in practice.
In this method both the fast compressional and the Alfven wave are implicitly
treated. When a Fourier decomposition is employed along two directions (y- and
z) then the resulting linear system is block tridiagonal which can be eciently
inverted. Both the methods described above are formally rst order accurate in
time for > 0.5.
38 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
3.5 Fully implicit methods for MHD
3.5.1 Implicit Upwind Method
Jones et al. [29] developed an implicit method for resistive MHD equations. It
is interesting that this work used an upwind method to evaluate the hyperbolic
terms. This brings into focus the following question: What does it mean to
have an upwind implicit method? Generally, upwind methods are based on the
solution of a Riemann problem at cell faces; such a solution is self-similar in
time, i.e. depends only on x/t for times until the waves from neighboring cell
faces Riemann problems start interacting. In traditional explicit upwind meth-
ods, this problem is avoided because we are operating within the CFL limit.
In an implicit method, the CFL limit is violated and waves from neighboring
Riemann solvers will interact. One may adopt the viewpoint that upwind meth-
ods are after all providing dissipation proportional to each wave and remove the
dispersion error which are the bane of second-order central schemes. Adopting
this viewpoint, one may ignore the interactions between neighboring Riemann
problems. While Jones et al. developed an implicit method for resistive MHD,
we will discuss their method as applied to ideal MHD in two dimensions. The
diusion terms, in their paper, were straight-forward additions using second
order central dierences. The system of ideal MHD equations is written as:
U
t
= R(U) =
_
F
x
+
G
y
_
(3.31)
where R(U) is the divergence of the hyperbolic uxes. The above equation (or
rather system of equations) is discretized in time as
1
2t
(3U
n+1
i,j
4U
n
i,j
+U
n1
i,j
) = R
n+1
i,j
(3.32)
The above equation is implicit and is solved iteratively. Let U
n+1,k
denote the
k-th iteration of the solution at the n + 1-th time level. Rewrite the above
equation as
_
U
t
_
k+1
i,j
= R
n+1,k+1
i,j
, (3.33)
where
_
U
t
_
k+1
i,j

1
2t
(3U
n+1,k+1
i,j
4U
n
i,j
+U
n1
i,j
). (3.34)
3.5. FULLY IMPLICIT METHODS FOR MHD 39
A truncated Taylor series expansion yields:
_
U
t
_
k+1
i,j
=
_
U
t
_
k
i,j
+

_
U
t
_
k
i,j
U
U
k
i,j
(3.35)
R
k+1
i,j
= R
k
i,j
+
R
k
i,j
U
U
k
i,j
, (3.36)
where U
k
i,j
= U
n+1,k+1
i,j
U
n+1,k
i,j
. The partial derivative of the divergence
of the hyperbolic uxes with respect to the solution vector is dicult to evaluate
for second order schemes. Hence, at this stage an approximation is made, i.e.,
such terms are evaluated with a rst order scheme. The rst order hyperbolic
ux divergence, denoted as

R is at point (i, j) is coupled to the neighboring
four points in 2D.

R
i,j


R(U
i,j
, U
i+
1
2
,j
, U
i
1
2
,j
, U
i,j+
1
2
, U
i,j
1
2
). Substituting
all back into 3.33 gives
_


R
k
i,j
U
+
3I
2t
_
U
k
i,j
=
_
R
k
i,j
+
_
U
t
_
k
i,j
_
(3.37)
The above equation is linear and iterated until U
k
i
j is driven to zero. The
matrix in the linear system above is a large banded matrix and will be generally
expensive to invert. Instead Jones et al. recommend the use of further ap-
proximations (discussed later) and using a lower-upper Gauss-Seidel (LU-SGS)
technique. The hyperbolic uxes R are evaluated with the Hartens approximate
Riemann solver [26], applied with the framework of the eight-wave scheme de-
veloped by Powell et al..
The LU-SGS relaxation scheme is described next. The rst order ux diver-
gence is written as:

R
i,j
=
F
i+
1
2
F
i
1
2
x
+
G
j+
1
2
F
j
1
2
y
, (3.38)
where we have suppressed the j index for F and the i index for G. The rst
order Harten ux F is expressed as
F
i+
1
2
=
1
2
_
F
i+1
+F
i

k
||
k
i+
1
2

k
i+
1
2
r
k
i+
1
2
_
, (3.39)
where
k
i+
1
2
= l
k
i+
1
2
(U
i+1
U
i
), and
k
are the eigenvalues, and l
k
(r
k
) are
the left (right) eigenvectors of the matrix A. F can also be expressed as:
F
i+
1
2
=
1
2
_
F
i+1
+F
i
|A|
i+
1
2
(U
i+1
U
i
)
_
, (3.40)
40 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
where |A| A
+
A

and A

= X
1

X, where

is a diagonal matrix
of all positive (for +) and all negative (for -) eigenvalues of A. Flux vector
splitting was originally developed for the Euler equations where the ux function
is a homogeneous function of degree one in U, i.e. F = AU. For MHD this
property no longer holds. Jones et al. make an approximation for MHD, i.e.,
F AU, so that F

U can be dened. Using this type of splitting gives:


F
i+
1
2
=
1
2
[F
i+1
+F
i
(|A|
i+1
U
i+1
|A|
i
U
i
)] (3.41)
=
1
2
(A

i+1
U
i+1
+A
+
i
U
i
) =
1
2
(F

i+1
+F
+
i
) (3.42)
Now we are in a position to evaluate the


R
k
i,j
U
term in eq: 3.37. We get
_
3I
2t
+A
+
i,j
A
+
i1,j
+A

i+1,j
A

i,j
+B
+
i,j
B
+
i,j1
+B

i,j+1
B

i,j
_
U
k
i,j
= R
k
i,j
, (3.43)
where B is the Jacobian corresponding to G. The above linear system is now a
block pentadiagonal system. A further simplication is invoked.
A

1
2
(A
A
I) (3.44)
B

1
2
(B
B
I), (3.45)
where
A
is the maximum eigenvalue of A (which corresponds to the fast
magnetosonic wave) and
B
is similarly dened. With this approximation
A
+
A

=
A
I and eq. (3.43) simplies to
_
D
i,j
A
+
i1,j
+A

i+1,j
B
+
i,j1
+B

i,j+1
_
U
k
i,j
= R
k
i,j
, (3.46)
where D
i,j
= (3/2t +
A
+
B
)
i,j
This block matrix can be solved in two
steps using a forward Gauss-Seidel sweep followed by a backward sweep. The
resulting algorithm is
_
D
i,j
A
+
i1,j
B
+
i,j1
_ _
D
i,j
+A

i+1,j
+B

i,j+1
_
U
k
i,j
= D
i,j
R
k
i,j
(3.47)
The forward sweep is inverting a lower block diagonal matrix , and the backward
sweep is inverting an upper block diagonal matrix. There are no block inversions
since D
i,j
contains only diagonal terms. One disadvantage of this method is
that the nonlinear residual is never computed to check convergence. This brings
us to the Newton-Krylov method.
3.5. FULLY IMPLICIT METHODS FOR MHD 41
3.5.2 Introduction to Newton-Krylov method
The entire ideal MHD (or resistive MHD and beyond) can be written as a
nonlinear function as follows:
F(U
n+1
) = 0, (3.48)
where U
n+1
R
N
is the vector of unknowns at time step n + 1. For example,
if we use a -scheme, one can write the nonlinear function as:
F(U
n+1
) = U
n+1
U
n
+ (1 )R(U
n+1
) +R(U
n
) = 0 (3.49)
For MHD, on a two dimensional N M mesh, the total number of unknowns
would then be 8MN. The above nonlinear systems can be solved using an
inexact NewtonKrylov solver. Apply the standard Newtons method to the
above nonlinear system gives
U
k
=
_
_
F
U
_
n+1,k
_
1
F, (3.50)
(3.51)
where J(U
n+1,k
)
_
F
U
_
n+1,k
is the Jacobian; and U
k
U
n+1,k+1
U
n+1,k
,
and k is the iteration index in the Newton method. For the two dimensional
system the Jacobian matrix is 8MN 8MN which, although sparse, is still
impractical to invert directly.
In Newton-Krylov methods, the linear system at each Newton step is solved
by a Krylov method. To briey summarize, in Newton-Krylov methods the
nonlinear system of equations are solved by Newtons method while the linear
system resulting each Newton iteration is solved by a Krylov method. In Krylov
methods, an approximation to the solution of the linear system JU = F is
obtained by iteratively building a Krylov subspace of dimension m dened by
K(r
0
, J) = span{r
0
, Jr
0
, J
2
r
0
, , J
m1
r
0
}, (3.52)
where r
0
is the initial residual of the linear system. The Krylov method can
be either: one in which the solution in the subspace minimizes the linear sys-
tem residual, or two in which the residual is orthogonal to the Krylov subspace.
Within Newton-Krylov methods the two most commonly used Krylov methods
are GMRES (Generalized Minimum Residual) and BiCGStab (Bi conjugate gra-
dient stabilized) which can both handle non-symmetric linear systems. GMRES
is very robust but generally is heavy on memory usage, while BiCGStab has
a lower memory requirement, it is less robust given that the residual is not
guaranteed to decrease monotonically.
42 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
1. Begin by guessing the solution U
n+1,0
. Typically the initial guess is
U
n+1,0
= U
n
.
2. For each Newton iteration k = 1, 2,
(a) Using a Krylov method, approximately solve for U
k
,
J(U
k
)U
k
= F(U
n+1,k
) so that ||J(U
k
)U
k
+ F(U
n+1,k
)|| <
Itol.
Each Krylov iteration requires:
a. One matrix-vector multiply with J
b. One preconditioner solve
3. Update the Newton iterate, U
n+1,k+1
= U
n+1,k
+U
k
4. Test for convergence ||F(U
n+1,k+1
)|| < ftol.
It the approximate solution U
n+1,k
is close to the true solution U

of the
nonlinear system, the convergence is quadratic.
||U
n+1,k+1
U

|| C||U
n+1,k
U

||
2
, (3.53)
where C is a constant independent of U
n+1,k
and U

. This result assumes that


the linear system is solved exactly. If the linear systems are solved inexactly
as in the Newton-Krylov method, then Itol the linear system tolerance has to
be carefully chosen. In inexact NK, Itol =
k
||F
k
||. Quadratic convergence is
retained if
k
= C||F
k
||. If we impose the condition that lim
k

k
= 0 then
convergence is super-linear, and
k
is constant in k then convergence is linear.
Since Newtons method may be viewed as a linear model of the original nonlinear
system, the model is a better approximation as the solution is approached. When
far from the solution, it is not essential to solve the linear system to machine-
zero convergence. The following choices for
k
are recommended which take
into account how well the nonlinear system is converging.

k
=

||F
k
||J
k1
U
k1
+F
k1
||

||F
k1
||
(3.54)

k
=
1
_
||F
k
||
||F
k1
||
_

2
, (3.55)
where
1
= 0.9 and
2
= 2 as recommended by Eisenstat & Walker [20].
The rst of these choices is how well the linear model agreed with the nonlin-
ear system at the prior step, while the second uses a measure of the rate of
convergence of the linear system.
3.5. FULLY IMPLICIT METHODS FOR MHD 43
In examining the Krylov methods, we notice that these require only matrix-
vector products. Thus it is never necessary to store the entire Jacobian matrix.
Furthermore, for complicated nonlinear systems such as those arising in MHD,
the Jacobian entries are not even known analytically. Instead one can conve-
niently evaluate the Jacobian vector product using rst order nite dierences
as follows:
J(U
k
)U
k

F(U
n+1,k
+U
k
) F(U
n+1,k
)

, (3.56)
where is typically used as the square root of machine zero. The above ex-
pression assumes that F is suciently dierentiable, a property which is easily
violated in upwind methods with its myriad switches, and limited-reconstruction
methods. The beauty of the Newton-Krylov method as outlined above is that it
only relies on the evaluation of the nonlinear function F. For a detailed review
of the eld of JFNK see the review paper by Knoll & Keyes [30].
3.5.2.1 Preconditioners
In many situations, Krylov methods lead to very slow convergence. To alleviate
the problem of slow convergence, preconditioners are often applied to speed up
the convergence. Preconditioning can be formulated in the following forms:
(J(U
k
)P
1
)(PU
k
) = F(U
n+1,k
) (Right), (3.57)
(P
1
J(U
k
))U
k
= P
1
F(U
n+1,k
) (Left), (3.58)
(P
1
L
J(U
k
)P
1
R
)(P
R
U
k
) = P
1
L
F(U
n+1,k
) (Both). (3.59)
In practice, preconditioning amounts to nding a cheaper related system and
inexactly solving this system within each linear iteration. The net eect of ap-
plying the preconditioner should be that the matrix (JP
1
) or (P
1
J) is close
to the identity matrix and that P
1
is easily computed. We note that the
approximations used in the preconditioner should have no eect on the overall
accuracy of the nonlinear system. It can be shown that JFNK method applied
with right preconditioning preserves the conservation properties of the equa-
tions written in conservation form [13] regardless of the nonlinear convergence
tolerances. However, one cannot prove this for left preconditioning unless the
solution is converged to machine precision [13].
Preconditioners can be divided into two broad classes:
Algebraic preconditioners: The nature of such preconditioners is of the
black-box type. These represent a close representation of the Jacobian
and are obtained using relatively inexpensive algebraic techniques such
44 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
as stationary iterative techniques, incomplete LU decomposition, multi-
grid techniques etc. These preconditioners typically require forming and
storing the Jacobian matrix.
Physics-based preconditioners: These preconditioners are derived from
other techniques such Picard iteration, or by semi-implicit techniques.
They do not require forming and storing the entire Jacobian matrix and
can be harnessed for Jacobian-free implementations. The form of the pre-
conditioners here generally tend to exploit the structure of the PDEs them-
selves and in this sense this type of preconditioning is physics-based.
3.5.3 JFNK method for resistive MHD
Chacon & co-workers have championed the use of physics-based preconditioners
for MHD. Chacon [14] has developed a JFNK approach for resistive MHD with
physics based preconditioners. The approach, given below, essentially relies on
the trick of parabolization and using a Schur complement approach. Parab-
olization refers to the technique by which a hyperbolic system is converted to a
parabolic one which is then amenable to multi-grid techniques.
3.5.3.1 A model illustration
Consider the following hyperbolic system
u
t
= a
v
x
,
v
t
= a
u
x
. (3.60)
Dierencing with backward Euler we get
u
n+1
= u
n
+a
_
v
x
_
n+1
,
v
n+1
= v
n
+a
_
u
x
_
n+1
. (3.61)
Substitute the second equation into the rst to obtain:
_
I a
2
t
2

2
x
2
_
u
n+1
= u
n
+at
_
v
x
_
n
, (3.62)
which is is much better conditioned because the parabolic operator is diagonally
dominant. Multigrid techniques usually perform well on elliptic and parabolic
operators do poorly on hyperbolic operators which are diagonal submissive.
3.5. FULLY IMPLICIT METHODS FOR MHD 45
We now turn to parabolization by the Schur complement approach.
_
D
1
U
L D
2
_
=
_
I UD
1
2
0 I
_ _
D
1
UD
1
2
L 0
0 D
2
_ _
I 0
D
1
2
L I
_
. (3.63)
Sti o-diagonal blocks L and U are now shifted to the diagonal via the Schur
complement D
1
UD
1
2
L. Applied to the model system above, D
1
UD
1
2
L =
_
I a
2
t
2
2
x
2
_
.
3.5.3.2 Application to resistive MHD
We begin by examining the linearized resistive MHD equations. These are
written as
= L

(, v) (3.64)
p = L
p
(p, v) (3.65)
B = L
B
(B, v) (3.66)
v = L
v
(v, B, , p), (3.67)
which illustrates the couplings between the various unknowns. In JFNK the
Jacobian has the following coupling
JU =
_

_
D

0 0 U
v
0 D
p
0 U
pv
0 0 D
B
U
Bv
L
v
L
pv
L
Bv
D
v
_

_
_

p
B
v
_

_
, (3.68)
which shows that the momentum equations are intimately coupled with other
equations but that the density is only coupled with the velocity nonlinearly and
so on. The diagonal blocks are of the advection-diusion type and clearly
amenable to multigrid and easily inverted. The o-diagonal terms denoted by
L and U contain the hyperbolic couplings. The above Jacobian is rewritten as
JU =
_
M U
L D
v
_ _
u
v
_
, (3.69)
where
u =
_
_

p
B
_
_
, M =
_
_
D

0 0
0 D
p
0
0 0 D
B
_
_
. (3.70)
46 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
The matrix M above is relatively easy to invert and is amenable to multigrid.
The Schur complement analysis of the above 2 2 system is given below:
_
M U
L D
v
_
1
=
_
I 0
LM
1
I
_ _
M
1
L 0
0 P
1
S
_ _
I M
1
U
0 I
_
. (3.71)
where P
S
= D
v
LM
1
U is the Schur complement. The exact Jacobian
inverse require M
1
and P
1
S
. The following predictor-corrector algorithm is
proposed.
u

= M
1
F
u
(Predictor) (3.72)
v = P
1
S
[F
v
Lv

] (V elocity update) (3.73)


u = u

M
1
Uv (Corrector). (3.74)
Multi-grid is impractical for P
S
because of the M
1
factor and hence some
simplications are desirable. For the velocity update and the corrector part in
the above equations, we can treat M
1
t. This gives
u

= M
1
F
u
(3.75)
v = P
1
SI
[F
v
Lv

] (3.76)
u = u

tUv, (3.77)
where P
SI
= D
v
tLU and is block-diagonally dominant. Mutigrid is em-
ployed for to compute the inverse of P
SI
and M.
3.5.4 JFNK method for compressible MHD
Reynolds et al. [34] have developed a fully implicit JFNK method for compress-
ible MHD. The resistive MHD equations are re-written in a form which allows
a method-of-lines approach. Reynolds et al. use a BDF method (up to fth
order accurate):
g(U
n
) U
n
t
n

n,0
f(U
n
)
qn

i=1
_

n,i
U
ni
+ t
n

n,i
f(U
ni
)

, (3.78)
where f(U) (F
v
(U)F
h
(U)), and where F
v
(U) is the vector of diusive
uxes, and F
h
(U) is the vector of hyperbolic uxes. The time-evolved state U
n
solves the nonlinear residual equation g(U) = 0. q
n
determines the methods
order of accuracy and at q
n
= {1, 2} the method is stable for any t
n
, with
stability decreases as q
n
increases.
n,i
and
n,i
are xed parameters for a given
method order q
n
. In this approach t
n
, q
n
are adaptively chosen at each time
3.5. FULLY IMPLICIT METHODS FOR MHD 47
step to balance solution accuracy, solver convergence, and temporal stability
[28]. The inexact JFNK approach is adopted to solve the nonlinear function
g(U
n
). The divergence of the uxes in (1.24) is discretized as
_
f
x
_
i,j,k
=

f
i+
1
2
,j,k


f
i
1
2
,j,k
x
, (3.79)
where f may represent either the hyperbolic or the parabolic uxes, and x is
the mesh spacing in the x-direction (assumed uniform). The quantity

f
i+
1
2
,j,k
is
referred to as the numerical ux through the face {i +
1
2
, j, k} and is computed
as a linear combination of the uxes at cell centers as

f
i+
1
2
,j,k
=
n

=m
a

f
i+,j,k
. (3.80)
Our numerical framework provides the exibility of using any of a group of dier-
ent spatial discretization schemes. For a second-order central dierence imple-
mentation, m = 0, n = 1 and a
0
= a
1
=
1
2
; for a fourth-order central dierence
approximation, m = 1, n = 2, and a
1
= a
2
=
1
12
, a
0
= a
1
=
7
12
; and for
tuned second-order central dierences, a
1
= a
2
= 0.197, a
0
= a
1
= 0.697
[27]. These central dierence approximations are free of dissipation errors, ex-
cept perhaps near domain boundaries. They do, however, suer from dispersion
errors. Consequently, physical phenomena that are not well resolved can suer
from ringing. The dispersion errors can be minimized by using schemes such as
the tuned-second order scheme, mentioned above, which has lower dispersion
error than the central dierence schemes. The numerical approximation to the
divergence B is written as
B =

B
x
i+
1
2
,j,k


B
x
i
1
2
,j,k
x
+

B
y
i,j+
1
2
,k


B
y
i,j
1
2
,k
y
+

B
z
i,j,k+
1
2


B
z
i,j,k
1
2
z
+O(x
p
) +O(y
p
) +O(z
p
) (3.81)
where B

is the -component of the magnetic eld, and the terms



B

are eval-
uated as shown in equation (3.80), and p is the order of the spatial derivatives.
If the numerical approximation of b is ensured to be zero at t = 0 then it
can be easily shown that the numerical uxes, as computed above, ensure the
solenoidal property of the magnetic eld in the discrete sense is automatically
satised.
48 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
3.5.4.1 Preconditioning Strategy
Instead of solving J U = g, we solve the related system (JP
1
)(P U) =
g, i.e., the right preconditioning approach is adopted. Since MHD stiness
results from fast hyperbolic and diusive eects, we set
P
1
= P
1
h
P
1
d
= J(U)
1
+O(t
2
).
This operator-splitting approach, widely used as a stand-alone solver, is used to
accelerate convergence of our more stable and accurate approach.
P
h
: Ideal MHD Preconditioner: P
h
treats only the fastest wave eects within
the implicit MHD system. Denoting () as the location of linear operator action,
ideal MHD has Jacobian
J
h
(U) = I + [J
x

x
() +J
y

y
() +J
z

z
()]
= I +
_
J
x
L
1
x
L
x

x
() +J
y
L
1
y
L
y

y
() +J
z
L
1
z
L
z

z
()

= I +
_
J
x
L
1
x

x
(L
x
()) J
x
L
1
x

x
(L
x
)()
+J
y
L
1
y

y
(L
y
()) J
y
L
1
y

y
(L
y
)()
+ J
z
L
1
z

z
(L
z
()) J
z
L
1
z

z
(L
z
)()

We then form an ADI-based O(


2
) preconditioner as
P
h
=
_
I +J
x
L
1
x

x
(L
x
())
_
I +J
y
L
1
y

y
(L
y
())
_
I +J
z
L
1
z

z
(L
z
())

_
I
_
J
x
L
1
x

x
(L
x
) +J
y
L
1
y

y
(L
y
) +J
z
L
1
z

z
(L
z
)
_
= P
x
P
y
P
z
P
corr
.
Let L
i
denote the spatially-local left eigenvector matrix for J
i
, i.e. at a given
x ,
L
i
(x)J
i
(x) =
i
(x)L
i
(x),
i
= Diag(
1
, . . . ,
8
)
Decoupling into 1D wave equations along characteristics:
L
i
_
I +J
i
L
1
i

i
(L
i
())

= L
i
+
i

i
= ,
where = L
i
and = L
i
. We need only solve for the fastest, stiness-
inducing, waves. This system can be solved only to low-order (O(x
2
)) since
used in preconditioning context. This leads to to a sequence of tridiagonal
system solves. These solves can even be parallelized via a divide-and-conquer
approach [1]: In this method, each processor solves local portion of tridiagonal
system with a nal small global correction system constructed and solved on all
procs.
3.5. FULLY IMPLICIT METHODS FOR MHD 49
For problems with spatially-dependent J(U), a correction solve is required:
P
corr
= I
_
J
x
L
1
x

x
(L
x
) +J
y
L
1
y

y
(L
y
) +J
z
L
1
z

z
(L
z
)

= I
_
L
1
x

x

x
(L
x
) +L
1
y

y

y
(L
y
) +L
1
z

z

z
(L
z
)

This may be constructed from existing eigen-information. Since it has no spatial


couplings on the unknown, the resulting local block systems may be solved easily
by pre-compute the 8 8 block-matrices P
corr
at each location coupled with a
LU factorization of each block P
corr
= L
c
U
c
. These decompositions are used
for fast solves at each Krylov iteration.
P
d
: Diusive MHD Preconditioner: P
d
solves the remaining diusive eects
within the implicit system,

t
U F
v
= 0.
We set P
d
to be the Jacobian of this operator,
P
d
= J
v
(U) = I

U
( F
v
)
=
_

_
I 0 0 0
0 I D
v
0 0
0 0 I D
B
0
L

L
v
L
B
I D
e
_

_
and we then exploit its structure for ecient and accurate solution. To solve
P
d
y = b for y = [y

, y
v
, y
B
, y
e
]
T
:
1. Update y

= b

2. Solve (I D
v
) y
v
= b
v
for y
v
3. Solve (I D
B
) y
B
= b
B
for y
B
4. Update

b
e
= b
e
+ (L

+L
v
y
v
+L
B
y
B
)
5. Solve (I D
e
) y
e
=

b
e
for y
e
.
Due to their diusive nature, steps 2, 3 and 5 are solved using a system-
based geometric multigrid solver Step 4 may be approximated through one
nite-dierence, instead of constructing and multiplying by the individual sub-
matrices:
L

+L
v
y
v
+L
B
y
B
=
1

[ F
v
(U +W) F
v
(U)]
e
+O(),
where W = [y

, y
v
, y
B
, 0]
T
.
50 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS
3.6 Verication Tests for Resistive MHD
3.6.1 Magnetic Reconnection in 2D
Magnetic reconnection (MR) refers to the breaking and reconnecting of oppositely-
directed magnetic eld lines in a plasma. In this process, magnetic eld energy
is converted to plasma kinetic and thermal energy. MR occurs in many contexts,
including the sawtooth-like oscillations observed in the operation of a tokamak
and in solar coronal events. In magnetic reconnection two regions are generally
distinguished: an outer inviscid region and an inner resistive region, whose
width scales as
1/2
, where the actual breaking and reconnecting of the eld
lines takes place. We have carried out simulations of magnetic reconnection in
an idealized canonical two-dimensional setting. The initial conditions consist
of a perturbed Harris sheet conguration as described in Birn et al. in [8] (the
GEM magnetic reconnection challenge). A physical quantity of considerable
interest in the reconnection problem is the reconnection rate, or the speed at
which the oppositely directed magnetic eld energy breaks and reconnects, and
its variation as a function of the magnetic resistivity or Lundquist number S.
For single-uid resistive MHD, the reconnection rate for unforced reconnection
should scale proportionally to the inverse square root of the Lundquist number,
a dependence known as the SweetParker scaling [9]. During reconnection, the
process is characterized by a thin current layer whose thickness scales as S
1/2
,
which when fully resolved results in explicit time steps proportional to the square
of the local mesh spacing for an explicit method. Therefore, the computational
time required for an explicit simulation to complete the reconnection process is
expected to scale as S
3/2
. As a result of the wide literature base on this problem,
we feel that this problem is well-suited for testing the implicit solutions against
known results. Moreover, due to the stiness of the reconnection problem, we
feel it is an ideal example for evaluating the eciency improvements through
using our implicit method.
In the GEM reconnection challenge, the domain of simulation is a 2D box
[12.8, 12.8] [6.4, 6.4] where the characteristic length and velocity scales
chosen are the ion inertial length and the Alfven speed. It is clear that for single
uid MHD, the ion inertial length is not a meaningful quantity. Nonetheless, the
simulation domain is chosen to be of the same size as in the GEM challenge. The
boundary conditions are periodic in the x-direction with perfectly conducting
wall boundary conditions in the y-direction. The non-dimensional parameters
are chosen to be S = 200, Re = 20, and Pr = 0.7.
Chapter 4
Adaptive Mesh Renement
4.1 Introduction
Adaptive mesh renement (AMR) is an eective way to provide spatial resolution
where necessary. In this chapter we will discuss the approach to multi-resolution
discretizations based on a nite-volume version of the block-structured adap-
tive mesh renement (AMR) algorithms of Berger and Oliger [5, 7]. In this
approach, the regions to be rened are organized into rectangular patches of
several hundred to several thousand grid cells per patch. Thus one is able to
use the nite-volume rectangular grid methods described above as underlying
discretization methods. Furthermore, the overhead in managing the irregular
data is amortized over a relatively large amounts or oating point work on reg-
ular arrays. For time-dependent problems, renement is performed in time as
well as in space. Each level of spatial renement uses its own stable time step,
with the time steps at a level constrained to be integer multiples of the time
steps at all ner levels. There is a considerable amount of literature on block-
structured AMR, and in this chapter we will rst review some basic ideas of
solving hyperbolic and elliptic PDEs on block-structured adaptive grids.
4.2 Berger-Colella AMR for Hyperbolic Systems
For hyperbolic systems, if one has a uniform-grid method, then such a method
can be extended to work on block-structured adaptive meshes in a relatively
straight-forward manner [7]. We assume that the underlying uniform-grid method
is an explicit conservative dierence method.
U
new
:= U
old
t(D

F) ,

F =

F(U
old
), (4.1)
51
52 CHAPTER 4. ADAPTIVE MESH REFINEMENT
, where D denote the discrete divergence operator. Let U
c
, U
f
denote the
solution on a two-level AMR grid. The update is performed in the following
steps.
Update solution on entire coarse grid:
U
c,new
= U
c,old
t
c
D
c

F
c
, (4.2)
where the superscript c denotes the quantities on the coarse grid.
Update solution on entire ne grid n
ref
times where n
ref
is the renement
ratio between the coarse and the ne grids.
U
f,new
= U
f,old
t
f
D
f

F
f
, (4.3)
U
f,old
= U
f,new
(4.4)
where the superscript f denotes the quantities on the coarse grid. For
hyperbolic systems with the usual CFL stability constraints, we have
t
c
= n
ref
t
f
.
Synchronize coarse and ne grid solutions.
Average coarse-grid solution onto ne grid.
Correct coarse cells adjacent to ne grid to maintain conservation.
U
c
:= U
c
+ t
c
(F
c,s
i
c

1
2
e

1
Z

i
f
F
f,s
i
f

1
2
e
) (4.5)
Typically, one requires a generalization of GKS theory for free boundary problem
to guarantee stability [6]. We merely note that stability not a problem for
upwind methods.
4.3 Solving Elliptic Systems
Adopting a similar approach to elliptic systems as done for hyperbolic leads to
a loss of accuracy. This is briey explained below by the example of solving a
Poisson equation on block-structured adaptive grids.
Solve
c
= g
c
on coarse grid.
Solve
f
= g
f
on ne grid, using coarse grid values to interpolate
boundary conditions.
4.3. SOLVING ELLIPTIC SYSTEMS 53
Such an algorithm yields coarse-grid solution accuracy on the ne grid [2, 39].

c

exact
+
1

c
. Using
c
to interpolate boundary conditions for ne
calculation introduces coarse-grid error on ne grid.
The correct method is to compute
comp
, the solution of the properly-posed
problem on the composite grid.

comp
=g
c
on
c
C(
f
)

comp
=g
f
on
f
_

= 0,
_

n
_
= 0 on
c/f
The Neumann matching conditions are ux matching conditions, and are dis-
cretized by computing a single-valued ux at the boundary. On the ne grid,
one is still solving the same BVP as in the naive case, but with coarse grid values
that have been modied to account for the Neumann matching conditions.
Modied equation:
comp
=
exact
+
1

comp
, where is a local function
of the solution derivatives.
4.3.1 MHD on AMR Grids
In this section, we discuss the implementation of the semi-implicit unsplit scheme
on block structured adaptive meshes. Each of the blocks is surrounded by a
layer of guard cells which are lled either by exchanging data from sibling meshes
at the same level or by interlevel interpolation from coarse to ne meshes. In
the calculation of the second order accurate hyperbolic uxes, linear interpola-
tion is sucient, while the projection operation and the diusive uxes require
a quadratic interpolation. We employ the Berger-Oliger time stepping tech-
nique in which the time steps are determined by the CFL condition imposed
by the ideal MHD wave speeds and are computed at the nest level and then
appropriately coarsened by the renement ratio to determine the larger stable
time step for coarser levels. We maintain ux registers which are used during
synchronization when disparate levels reach the same physical time. For the
hyperbolic uxes the reuxing procedure is explicit in which coarse level uxes
at coarse ne boundaries are replaced by the sum of the ne level uxes. The
reuxing procedure for the diusive uxes is done implicitly, i.e., it requires a
full elliptic solve on the entire mesh hierarchy. A detailed description of the
implicit reuxing procedure is omitted in the interest of brevity and is similar to
the method described in Martin and Colella [31].
54 CHAPTER 4. ADAPTIVE MESH REFINEMENT
Appendix A
Appendix I: Glossary of
Acronyms
AMD - Advanced Micro Devices
AMR - Adaptive mesh renement
APDEC - An Algorithmic and Software Framework for Applied Partial Dif-
ferential Equations
ASDEX - Axially Symmetric Divertor EXperiment
CEMM - Center for Extended MHD Modeling
CET - Center for Enabling Technologies
CFL - Courant-Friedrichs-Lewy
Chombo - Infrastructure for Adaptive Mesh Renement
CVS - Concurrent Versions System
DIII-D - A National fusion facility
ELM - Edge localized mode
FLR - Finite Lamor radius
FTE - Full-time employee
GVW - GyroViscous Wave
HFS - high eld side
H-Mode - High-connement mode
ITER - Old usage: International Tokamak Experimental Reactor
ITER - Current usage: ITER means the way in Latin
LBNL - Lawrence Berkeley National Laboratory
KAW - Kinetic Alfven Wave
LFS - low eld side.
L-Mode - Low-connement mode
55
56 APPENDIX A. APPENDIX I: GLOSSARY OF ACRONYMS
MHD - magnetohydrodynamics
NERSC - National Energy Research Scientic Computing Center
NTM - Neoclassical tearing mode
PPPL - Princeton Plasma Physics Laboratory
SciDAC - Scientic Discovery through Advanced Computing
WW - Whistler Wave
X-MHD - Extended MHD
Appendix B
Bibliography
[1] P. Arbenz and K. Gates. A note on divide-and-conquer algorithms for
the symmetrical tridiagonal eigenvalue problem. Eitschrift fur angewandte
mathematik und mechanik, 74(6):T529T531, 1994.
[2] D. Bai and A. Brandt. Local mesh renement multilevel techniques. SIAM
Journal on scientic and statistical computing, 8(2):109134, 1987.
[3] D. S. Balsara and D. S. Spicer. A staggered mesh algorithm using high
order Godunov uxes to ensure solenoidal magnetic elds in magnetohy-
drodynamic simulations. J. Comput. Phys., 149(2):270292, 1999.
[4] D. S. Balsara and D. S. Spicer. Maintaining pressure positivity in magne-
tohydrodynamic simulations. J. Comput. Phys., 148(1):133148, 1999.
[5] M. Berger and J. Oliger. Adaptive mesh renement for hyperbolic partial
dierential equations. J. Comput. Phys., 53:484512, March 1984.
[6] M. J. Berger. Stability of interfaces with mesh renement. Mathematics
of computation, 45(172):301318, 1985.
[7] M. J. Berger and P. Colella. Local adaptive mesh renement for shock
hydrodynamics. J. Comput. Phys., 82(1):6484, May 1989.
[8] J. Birn and et al. Geospace Environmental Modeling (GEM) magnetic
reconnection challenge. J. Geophys. Res., 106:37153719, 2001.
[9] D. Biskamp. Magnetic reconnection in plasmas. Cambridge monographs
on plasma physics, third edition, 2000.
57
58 APPENDIX B. BIBLIOGRAPHY
[10] J. U. Brackbill and D. C. Barnes. The eect of nonzero-del.b on the
numerical-solution of the magneto-hydrodynamic equations. J. Comput.
Phys., 35(3):426430, 1980.
[11] S. I. Braginskii. Transport processes in a plasma. In M. A. Leontovich,
editor, Reviews of Plasma Physics, Vol. 1. Consultants Bureau, New York,
1965.
[12] M. Brio and C. C. Wu. An upwind dierencing scheme for the equations
of ideal magnetohydrodynamics. J. Comput. Phys., 75(2):400422, 1988.
[13] L. Chacon. A non-staggered, conservative, divB=0, nite volume scheme
for 3D implicit extended magnetohydrodynamics in curvilinear geometries.
Computer Physics Comm., 163:143171, 2004.
[14] L. Chacon. A fully implicit extended MHD algorithm. In SIAM Annual
Conference, Boston, MA, July 2006.
[15] P. Colella. Multidimensional upwind methods for hyperbolic conservation
laws. J. Comp. Phys., 87:171200, 1990.
[16] R. K. Crockett, P. Colella, R. T. Fisher, R. I. Klein, and C. F. McKee. An
unsplit, cell-centered Godunov method for ideal MHD. J. Comp. Phys.,
203:422448, 2005.
[17] W. L. Dai and P. R. Woodward. Extension of the piecewise parabolic
method to multidimensional ideal magnetohydrodynamics. J. Comput.
Phys., 115(2):485514, 1994.
[18] A. Dedner, F. Kemm, D. Kroner, C.-D. Munz, T. Schnitzer, and
M. Wessenberg. Hyperbolic divergence cleaning for the mhd equations.
J. Comput. Phys., 175:645673, 2002.
[19] P. J. Dellar. A note on magnetic monopoles and the one-dimensional
MHD Riemann problem. J. Comp. Phys., 172(1):392298, 2001.
[20] S. C. Eisenstat and H. F. Walker. Choosing the forcing terms in an inexact
Newton method. SIAM J. Sci. Comput., 17(1):1632, 1996.
[21] C. R. Evans and J. F. Hawley. Simulation of magnetohydrodynamic ows
a contrained transport method. Astrophys. J., 332:659677, 1988.
[22] S. A. F. G. Falle, S. S. Komissarov, and P. Joarder. A multidimensional
upwind scheme for magnetohydrodynamics. Monthly Notices of the Royal
Astronomical Society, 297(1):265277, 1998.
59
[23] S. K. Godunov. Symmetric form of the equations of magnetohydrodynam-
ics. Num. Meth. for Mech. of Continuum Medium, 1:26, 1972.
[24] D. S. Harned and W. Kerner. Semi-implicit method for three-dimensional
compressible magnetohydrodynamic simulation. J. Comput. Phys., 60:62
75, 1985.
[25] D. S. Harned and D. D. Schnack. Semi-implicit method for long time
scale magnetohydrodynamic computations in three dimensions. J. Comput.
Phys., 65:5770, 1986.
[26] A. Harten. High-resolution schemes for hyperbolic conservation-laws. J.
Comput. Phys., 49(3):357393, 1983.
[27] D. J. Hill and D. I. Pullin. Hybrid tuned center-dierence-WENO method
for large eddy simulations in the presence of strong shocks. J. Comput.
Phys., 194:435450, 2004.
[28] A.C. Hindmarsh. The PVODE and IDA algorithms. Technical Report
UCRL-ID-141558, LLNL, Dec 2000.
[29] O. S. Jones, U. Shumlak U., and D. S. Eberhardt. An implicit scheme
for nonideal magnetohydrodynamics. J. Comput. Phys., 130(2):231242,
1997.
[30] D.A. Knoll and D.E. Keyes. Jacobian-free Newton-Krylov methods: a
survey of approaches and applications. J. Comp. Phys., 193:357397, 2004.
[31] D Martin and P Colella. A cell-centered adaptive projection method for
the incompressible Euler equations. J. Comput. Phys., 163 (2):271312,
2000.
[32] K.G. Powell, P.L. Roe, T.J. Linde, T.I. Gombosi, and D.L. DeZeeuw.
A solution-adaptive upwind scheme for ideal magnetohydrodynamics. J.
Comp. Phys., 154:284300, 1999.
[33] J. J. Ramos. General expression of the gyroviscous force. Phys. Plasmas,
12:Article No. 112301, 2005.
[34] D. R. Reynolds, R. Samtaney, and C. S. Woodward. A fully implicit nu-
merical method for single-uid resistive magnetohydrodynamics. J. Comp.
Phys., 219(1):144162, 2006.
[35] P. L. Roe. Approximate Riemann solvers, parameter vectors and dierence-
schemes. J. Comp. Phys., 43(2):357372, 1981.
60 APPENDIX B. BIBLIOGRAPHY
[36] D. Ryu and T. W. Jones. Numerical magnetohydrodynamics in astrophysics
- algorithm and tests for one-dimensional ow. Astrophys. J., 442:228258,
1995.
[37] Je Saltzman. An Unsplit 3D Upwind Method for Hyperbolic Conservation
Laws. J. Comput. Phys., 115:153168, 1994.
[38] D. D. Schnack. Computational modeling of fully-ionized, magnetized plas-
mas using the uid approximation. Bull. Amer. Phys. Soc., 50(8):137,
2005.
[39] M. C. Thompson and J. H. Ferziger. An adaptive multigrid technique for
the incompressible Navier-Stokes equations. J. Comput. Phys., 82(1):94
121, May 1989.
[40] M. Torrihlon. Non-uniform convergence of nite volume schemes for Rie-
mann problems of ideal magnetohydrodynamics. J. Comp. Phys., 192:73
94, 2003.
[41] G. Toth. The B = 0 constraint in shock-capturing magnetohydrody-
namics codes. J. Comp. Phys., 161:6052652, 2000.
[42] E.H. Twizell, A.B. Gumel, and M.A. Arigu. Second-order, l
0
-stable meth-
ods for the heat equation with time-dependent boundary conditions. Ad-
vances in Computational Mathmatics, 6:333352, 1996.
[43] V. Wheatley, D. I. Pullin, and R. Samtaney. Regular shock refraction at an
oblique planar density interface in magnetohydrodynamics. J. Fluid Mech.,
522:179214, 2005.

Você também pode gostar