computational mhd

Upload: verthex20992828

Post on 03-Apr-2018

239 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Computational Mhd

    1/66

    Computational

    Magnetohydrodynamics

    Ravi SamtaneyPrinceton Plasma Physics Laboratory

    Princeton [email protected]

  • 7/28/2019 Computational Mhd

    2/66

    ii

    c 2007Ravi SamtaneyALL RIGHTS RESERVED

  • 7/28/2019 Computational Mhd

    3/66

    Contents

    Preface v

    1 Introduction to Magnetohydrodynamics 11.1 Magnetohydrodynamics- Where does it come from? . . . . . . . 1

    1.1.1 MHD Equations . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.2 Single-fluid 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 finite volume methods . . . . . . . . . . . . . . 11

    2.2 Conservative vs. Non-conservative Formulation . . . . . . . . . 122.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 fields . . . . . . . . . . 18

    2.6 Constrained Transport Method . . . . . . . . . . . . . . . . . . 21

    2.7 Unsplit Method for Ideal MHD . . . . . . . . . . . . . . . . . . 24

    2.7.1 Algorithm Steps . . . . . . . . . . . . . . . . . . . . . . 25

    2.8 Verification tests . . . . . . . . . . . . . . . . . . . . . . . . . . 272.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

  • 7/28/2019 Computational Mhd

    4/66

    iv CONTENTS

    2.8.5 MHD shock refraction . . . . . . . . . . . . . . . . . . . 29

    3 Semi-implicit and Implicit Methods 313.1 Semi-implicit unsplit upwind method for compressible MHD . . 31

    3.1.1 Implicit treatment of diffusive fluxes . . . . . . . . . . . 313.2 Rationale for implicit treatment . . . . . . . . . . . . . . . . . . 323.3 Implicit treatment of fast compressional wave . . . . . . . . . . 33

    3.3.1 A model illustration . . . . . . . . . . . . . . . . . . . . 333.3.2 Application to fast compressional wave . . . . . . . . . . 35

    3.4 Implicit treatment of the Alfven wave . . . . . . . . . . . . . . 373.5 Fully implicit methods for MHD . . . . . . . . . . . . . . . . . 38

    3.5.1 Implicit Upwind Method . . . . . . . . . . . . . . . . . 383.5.2 Introduction to Newton-Krylov method . . . . . . . . . 41

    3.5.2.1 Preconditioners . . . . . . . . . . . . . . . . . 433.5.3 JFNK method for resistive MHD . . . . . . . . . . . . . 44

    3.5.3.1 A model illustration . . . . . . . . . . . . . . 443.5.3.2 Application to resistive MHD . . . . . . . . . . 45

    3.5.4 JFNK method for compressible MHD . . . . . . . . . . 463.5.4.1 Preconditioning Strategy . . . . . . . . . . . . 48

    3.6 Verification Tests for Resistive MHD . . . . . . . . . . . . . . . 503.6.1 Magnetic Reconnection in 2D . . . . . . . . . . . . . . . 50

    4 Adaptive Mesh Refinement 514.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    4.2 Berger-Colella AMR for Hyperbolic Systems . . . . . . . . . . . 514.3 Solving Elliptic Systems . . . . . . . . . . . . . . . . . . . . . . 524.3.1 MHD on AMR Grids . . . . . . . . . . . . . . . . . . . 53

    A Appendix I: Glossary of Acronyms 55

    B Bibliography 57

  • 7/28/2019 Computational Mhd

    5/66

    Preface

    Computational fluid dynamics (CFD) is a very interesting subject which com-bines numerical analysis, algorithms, applied mathematics with the practicalaim of solving fluid flow problems by computational means. The motivations

    are many-fold: a desire to understand the physics of fluid flow and turbu-lence, scientific and technological applications, as well as a desire to peek in tothe beautiful structure of solutions nonlinear partial differential equations. Alarge number of books have been written on CFD. On the other hand, thereis precious little for computational plasma dynamics and magnetohydrodynam-ics. Magnetohydrodynamics is the simplest model for plasma dynamics butit is, nonetheless, rich in mathematical structure and no less important in themodeling of several physical phenomenon ranging from MHD turbulent, stellardynamics, and modeling at the device-scale of fusion devices such as tokamaksand 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 electromagneticequations. There is a rather broad spectrum for MHD, too. On one end ofthe spectrum is ideal MHD which is a system of hyperbolic conservation laws,followed by resistive MHD, two-fluid and Hall MHD, and extended MHD. Thelatter 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 knowledgeof finite difference methods. The book is focused on finite volume and finitedifference methods. This first draft is organized as follows: Chapter 1 presentsan introduction to MHD; Chapter 2 discusses explicit finite volume methods;Chapter 3 is concerned with semi-implicit and implicit formulations; and Chapter

    4 deals with adaptive mesh refinement. These chapters are all geared towardsideal and resistive MHD. This book grew out of the set of ERCOFTAC lecturespresented 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

  • 7/28/2019 Computational Mhd

    6/66

    vi PREFACE

    tory, Princeton University, under USDOE Contract no. DE-AC020-76-CH03073.

    Ravi SamtaneyPrinceton, NJ

    January 2007

  • 7/28/2019 Computational Mhd

    7/66

    Chapter 1

    Introduction to

    Magnetohydrodynamics

    A true description of plasma motion must rely on kinetic equations for eachplasma 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.

    ft

    + u f + qm

    (E+ uB) fu

    = C,(f), (1.1)

    where f f(x,u, t) is the distribution function which represents the num-ber density of particles of species found in an infinitesimal 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 toelectric and magnetic forces. Generally for simulation purposes the kinetic ap-proach is computationally prohibitively expensive. This is one of the reasons, aswell as a desire to have a simpler set of equations in three dimensional physicalspace that a fluid description of a plasma is undertaken.

    1.1 Magnetohydrodynamics- Where does it come from?

    A fluid description of the plasma is obtained by taking velocity moments of thekinetic equations (1.1) for electrons and ions (assuming only one ion species)

    and employing certain closure assumptions. The oft-used term resistive MHDis a single-fluid model of a plasma in which a single velocity and pressure de-scribe both the electrons and ions. The resistive MHD model of a magnetizedplasma does not include finite Larmor radius (FLR) effects, and is based on thesimplifying limit in which the particle collision length is small compared with

    1

  • 7/28/2019 Computational Mhd

    8/66

    2 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS

    Time scales Model

    ei One fluid modelii ei Two-fluid modelee ii Electron fluid; ion particles

    ee Electron and ion particlesTable 1.1: Domain of validity of MHD in term of relaxation times

    the macroscopic length scales. A more sophisticated set of models, hereafterreferred to as extended MHD (X-MHD), can be derived from more realisticclosure approximations. Such models allow independent motion of ions and

    electrons. The lowest order FLR corrections to resistive MHD result in modifi-cations to the electron momentum equation (generalized Ohms law) and theion stress tensor.

    Validity regime for MHD: We start by considering component particlesin non-equilibrium moving through a background of component particles.The time it takes for each species to reach equilibrium, is generally lesser thanthe time (defined as ) for thermal equilibrium between the and species.For electrons and ions:

    ee : ii : ei = 1 : (mi/me)1

    2 : (mi/me),

    where mi and me 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 fluid description ofa plasma is valid when the length scales under investigation are larger thanthe Debye length; and the frequencies are smaller than the cyclotron frequency.The Debye length argument can also be cast in terms of a frequency: namelythe plasma frequency. In addition it is a standard assumption that the speedsinvolved 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 theconservation of mass, momentum and energy coupled with Maxwells equations.These are written below. In the MHD equations below, we will use the moments

  • 7/28/2019 Computational Mhd

    9/66

    1.1. MAGNETOHYDRODYNAMICS- WHERE DOES IT COME FROM? 3

    of the kinetic distribution functions defined 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) = nm < w2 >, (1.6)

    h =1

    2nm < w

    2w >, (1.7)

    R,(x, t) =

    dwmwC, (1.8)Q,(x, t) =

    1

    2

    dwmw

    2C. (1.9)

    Furthermore, we use qi = qe = e.Conservation of mass: For each plasma species, the conservation of mass

    or the continuity equation is:

    nt

    + (nv) = Sn, (1.10)

    where n is the number density of the species, and Sn is a source/sink termdue to interaction with neutrals such as ionization.

    Conservation of momentum: For each species, momentum conservationis expressed as

    nmvt

    + (nmvv) = P+nq(E+ v B) + R(1.11)

    where P is the pressure tensor, and R is the momentum density transferredfrom species to .

    Conservation of energy: The energy equation for each species is,

    12nmv2 + 32Tt

    +

    1

    2n

    m

    v2

    +3

    2Tv

    + (v P + h) qnv E= Q + v R,, (1.12)where T is the temperature, h is the heat flux due to random motion, andQ is the heat transfer due to collisions between the different species.

  • 7/28/2019 Computational Mhd

    10/66

    4 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS

    Quasi-neutrality: Under the assumption of quasi-neutrality, i.e. ni ne n so that = (nimi + neme) n(mi + me) nmi. The charge density = (ni ne)e and mass velocity v = (nimivi + nemeve)/ (nimivi +nemeve)/(mi + me) vi + me/mive. The current density is given by J =e(nivi neve) ne(vi ve).

    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

    Rei = men < ei > (vi ve) = 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 writtenbelow.

    E+ v B = 1ne

    [JB pe e + Rei] ,

    E+ v B = J+ 1ne

    [JB pe e] , (1.16)

    where pe

    is the isotropic part of the electron pressure tensor, and e

    is theanisotropic part. The momentum equation includes a term E which is thecontribution to the Lorentz force due to the electric field. It is estimated thatthe magnitude of the electric force compared with the inertial term is negligibleE : v v0E2/L : u2/L0B2/

  • 7/28/2019 Computational Mhd

    11/66

    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 magneticmonopoles is written as:

    B = 0 (1.21)

    Amperes law is

    B = 0J+ 1c2

    Et

    , (1.22)

    where for the time scales of interest to MHD, the term containing the c2 termis neglected, so that B = 0J.

    The equation governing charge density is written as:

    0E= , (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 notgenerally solve or evolve .

    1.1.2 Single-fluid Resistive MHD

    The above equations can be reduced by assuming high collisionality which letsus drop the anistropic portions of the pressure tensors. Furthermore, assuminga small Larmour radius, the single-fluid resistive MHD equations couple theequations of hydrodynamics and resistive Maxwells equations. The Ohms lawin single fluid resistive MHD simplifies to E+ v B = J. The entire set ofsingle fluid resistive MHD may be written in conservation form as,

    U

    t + F(U) = Fv(U) (1.24)where the solution vector U U(x, t) is,

    U = {, v,B, e}T,

  • 7/28/2019 Computational Mhd

    12/66

    6 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS

    and the flux vectors F(U) and Fv(U) are given by

    F(U) =

    v , vv +

    p +

    1

    2B B

    IBB ,

    vB Bv ,

    e +p +1

    2B B

    v B(B v)

    T,

    Fv(U) =

    0 , Re1 , S1

    B (B)T ,Re1 v +

    1

    Re PrT +

    S

    1

    2(B B) B(B)T

    T.

    In the above equations, is the density, v is the velocity, B is the magneticfield, 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 areference viscosity R. The ratio of specific heats is denoted by (= 5/3. Thenondimensional parameters in the above equations are the Reynolds number,defined as Re 0U0L/R, the Lundquist number, defined as S 0U0L/R,and the Prandtl number, denoted by P r, which is the ratio of momentum tothermal diffusivity. The non-dimensionalization is carried out using a character-istic length scale, L and the Alfven speed U0 = B0/

    00, where B0, 0, and

    0 are the characteristic strength of the magnetic field, a reference density andthe permeability of free space, respectively. The equations are closed by the

    following equation of state

    e =p

    1 +

    2v v + 1

    2B B.

    The stress tensor is related to the strain as

    = v + (v)T 2

    3 vI.

    Finally, a consequence of Faradays law is that an initially divergence-free mag-netic field must lead to a divergence-free magnetic field for all times, whichcorresponds to the lack of observations of magnetic monopoles in nature. Thissolenoidal property is expressed as

    B = 0.

    1.1.3 Ideal MHD

    In the limit of zero resistivity, conductivity and viscosity, the equations of resistiveMHD reduced to those of ideal MHD. These equations are similar to those

  • 7/28/2019 Computational Mhd

    13/66

    1.1. MAGNETOHYDRODYNAMICS- WHERE DOES IT COME FROM? 7

    written above with = = = 0.

    Ut

    + F(U) = 0, (1.25)

    where U and F(U) are the same as defined 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, forinstance, there is a dominant magnetic field, and length scales parallel to thefield are significantly larger than those perpendicular to it (in the discussionwhich follows, we use the || symbol to define quantities parallel to the magneticfield, and for quantities perpendicular to it). In such cases, one can derive theextended MHD models by considering different orderings of the characteristicfrequency 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 di/L, where s is the ion sound gyrora-dius, and di is the ion inertial skin depth. In addition to , we have to concernourselves with /ci and vi/vthi orderings for consistency, where ci and vthiare the ion cyclotron frequency, and the ion thermal velocity, respectively. InMHD ordering fast dynamics results if /ci and vi/vthi 1, whereas inthe so-called drift ordering (slow dynamics near equilibrium), /ci 2 andvi/vthi . Hall and drift MHD represent the lowest order (in ) FLR and two-fluid corrections to the resistive MHD model. In these cases, the gyro-viscousforces enters at the same order as the pressure gradient.

    Some of the extended MHD models [38] are shown in Table 1.2 in whichthe generalized drift model for slow dynamics has been omitted. Note thatthese generalized MHD models assume quasi-neutrality and ignore electron in-ertia. The stress tensors are now no longer isotropic. The ion stress tensor isdecomposed as i = ||i +

    gvi where the parallel component ||i includes the

    neoclassical part describing collisional transport in a toroidal plasma. The crosscomponent is gvi , the gyro-viscous stress as given by Braginskii [11]; this partof the stress tensor does not lead to dissipative terms. Recently, a more gen-eral expression for the gyroviscous force has been derived assuming only smallgyromotion periods and Larmor radius [33]. The dispersive waves (

    k2) in

    the extended MHD models are:

    1. Whistler waves (WW): These are dispersive waves arising from theJ B term in Ohms law, and are associated with finite k|| and theelectron response.

  • 7/28/2019 Computational Mhd

    14/66

    8 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS

    Model Momentum Ohms Law WW KAW GVW

    General mndv

    dt = (pe +pi) E= v B + J Yes Yes Yes JB (||e + ||i) 1ne (JB pe ||e)

    gviGeneralized mndvdt = (pe +pi) E= v B + J Yes Yes No

    Hall JB (||e + ||i) 1ne (JB pe ||e)MHD

    Neoclassical mndvdt = (pe +pi) E= v B + J No No YesMHD JB (||e + ||i) 1ne ||e

    gviGeneralized mndvdt = p E= v B + J No No No

    Resistive JB ||MHD

    Table 1.2: Extended MHD Models

    2. Kinetic Alfven Waves (KAW): These are dispersive waves due to theparallel electron pressure gradient ||pe in Ohms law. These waves areassociated with finite k|| and k, as well as both the ion and electronresponses.

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

    gvi tensor.

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

    gvi =32

    b (I+ 3bb) + (b (I+ 3bb))T (1.26)

    where = v+(v)T2/3b is the strain tensor, and 3 nTi/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. Forperpendicular propagation they appear as corrections to the fast magnetosonicmode. The perpendicular dispersive waves have generally not been accountedfor in numerical MHD investigations and deserve special attention for implicittreatment.

  • 7/28/2019 Computational Mhd

    15/66

    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 tot < x2 for explicit methods. Hence, these dispersive modes will require animplicit treatment. Furthermore, the neat classification of resistive MHD as ahyperbolic-parabolic system (ideal MHD leads to a hyperbolic system of PDEs)is no longer valid. It is not obvious that upwind methods, which have beensuccessfully applied to ideal and resistive MHD, can be used for these dispersivesystems. Some form of a splitting algorithm which will treat the hyperbolic partswith upwinding methods and the dispersive modes with an implicit method maybecome necessary.

    1.2 Boundary Conditions

    For ideal MHD, at the perfectly conducting boundary, the following boundaryconditions must be satisfied.

    nE= 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 finite volumemethods with a discussion of Riemann problems, as well as solenoidal preservingmethods. These are done in the context of explicit time integration methods.In Chapter 3, we discuss semi-implicit and implicit methods. This chapterincludes a general discussion of Jacobian-Free Newton-Krylov method and theimportance of preconditioners. Chapter 4 has a discussion of block structuredadaptive mesh methods. These early chapters focus on ideal and resistive MHD.Numerical methods for two-fluid and extended MHD are presented in subsequentchapter (to be written).

  • 7/28/2019 Computational Mhd

    16/66

    10 CHAPTER 1. INTRODUCTION TO MAGNETOHYDRODYNAMICS

  • 7/28/2019 Computational Mhd

    17/66

    Chapter 2

    Finite Volume Methods

    In this chapter we will discuss finite volume methods for MHD. The main empha-sis will be on ideal MHD and methods which preserve the solenoidal property ofthe magnetic field. We begin with a general introduction to high-resolution finitevolume methods, followed by a discussion of conservative vs. non-conservativeformulations. The role of Riemann solvers with an emphasis on linearized Rie-mann solvers is presented. Finally, we present an extension of Colellas [15] toideal MHD.

    2.1 Introduction to finite 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 fluxes. In finite volume methods,the physical domain is decomposed into cells. We adopt the following notationin this book. The domain is decomposed in to cells in such a fashion as topermit indexing of each cell by an n-tuple index (n=3 for three dimensions andn=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 + 12

    , j), (i + 12

    , j) in 2D. Faces in the other directions are similarly

    labeled. The solution Ui,j,k in each cell represents the average of the conservedquantities in each of these cells. Thus,

    Ui,j,k =1

    x y z

    i+ 12,j,k

    i 12,j,k

    i,j+ 12,k

    i,j+ 12,k

    i,j,k+ 12

    i,j,k 12

    U(x,y ,z ,t)dxdydz. (2.2)

    11

  • 7/28/2019 Computational Mhd

    18/66

    12 CHAPTER 2. FINITE VOLUME METHODS

    Ui,j,k varies in each cell due to the flux of the various conserved quantities

    through the cell faces. It is common place to adopt the method of lines tosolve equation 2.1). The quantity R(U) is computed in each cell and an ODEintegrator is then used. One has to, of course, take care that the final methodis stable, and consistent. There is a vast amount of literature on so-calledhigh-resolution upwind methods in the CFD literature. In several of thesemethods, the flux through each cell face is determined by solving a Riemannproblem which is discussed in detail later. Furthermore, in several of thesemethods, the cell averaged values are interpolated to obtain values on eitherside of the cell faces. For example, if linear reconstruction is used, the slopes ineach cell are limited in order to preserve monotonicity and avoid introductionof new extrema into the solution. A widely used limited linear reconstructionmethod is the one by Van Leer. Another reconstruction method is the piecewiseparabolic method (PPM) which is a quadratic reconstruction method. Thesereconstruction methods are quite popular in the CFD literature, and are notdiscussed in this book. So, to summarize, an explicit method of solving theideal 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 ofthe limited reconstruction methods.

    2. Using the left and right state, determine the fluxes 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 themotion of a conducting fluid in the presence of a magnetic field. The equationsare then the equations of hydrodynamics coupled with Maxwells equations andthese are written below in non-conservation form:

    U

    t + F(U) = S (2.3)where the flux vectors F(U) are given by

    F(U) =

    v , vv +pI ,vB Bv , (e +p)vT

    , (2.4)

  • 7/28/2019 Computational Mhd

    19/66

    2.2. CONSERVATIVE VS. NON-CONSERVATIVE FORMULATION 13

    and the source terms S(U) is given by

    S(U) = {0 , JB , 0 , (J E)}T , (2.5)

    As written above, the total energy is now defined as p/( 1) + 1/2v v.The source terms occur in the momentum equations in the form of the Lorentzforce and as the Ohmic heating term in the energy equation. These form ofthe equations are completely equivalent to the fully conservative form (writtenbelow). The non-conservative form has been used in several instances in theliterature (e.g. in the work of Evans & Hawley [21]). An advantage of thisformulation is seen in for low plasmas ( is the ratio of thermal to magneticpressures), in which the pressure computation does not involve the differencebetween two large quantities (total energy and magnetic energy) which is prone

    to large error. We denote these form of the equations as a loose-couplingbetween the equations of hydrodynamics and the electro-magnetic equationswith the coupling occurring through the aforementioned source terms. In thepresence of shocks it is clearly advantageous to write the ideal MHD equationsin fully conservative form.

    U

    t+ F(U) = 0, (2.6)

    where flux vector F(U) is given by

    F(U) =

    v

    , vv

    +

    p +

    1

    2B

    B IBB ,

    vB Bv ,

    e +p +1

    2B B

    v B(B v)

    T,

    2.2.1 Godunov Symmetrization

    It was observed by Godunov [23] that the conservative form of the ideal MHDequations leads to a eigenvalue degeneracy. This implies that while the idealMHD equations are hyperbolic they are not strictly hyperbolic. Adding a sourceterms proportional to B i.e.

    SB(U) = B({0, Bx, By, Bz, ux, uy, uz(B u)}T), (2.7)to the conservative equations removes the eigenvalue degeneracy. Adding thissource term also makes the equations Galilean invariant. This is also the therationale adopted by Powell et al. for including the non-conservative source

  • 7/28/2019 Computational Mhd

    20/66

    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.

    Bt

    + (v B) = 0. (2.8)

    This implies that B/, if non-zero (presumably due to numerical error), willget 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 = {, ux, uy, uz, Bx, By, Bz, p}T are known as the primitive vari-ables. The matrix

    A is given by

    A UW UF WU (2.11)

    =

    ux 0 0 0 0 0 00 ux 0 0 Bx/ By/ Bz/ 1/0 0 ux 0 By/ Bx/ 0 00 0 0 ux Bz/ 0 Bx/ 00 0 0 0 0 0 0 00 By Bx 0 uz ux 0 00 Bx 0 Bx u 0 ux 00 p 0 0 ( 1)B u 0 0 ux

    .

    When using the non-conservative source term, the quasilinear form is

    W

    t+ A

    W

    x= 0, (2.12)

  • 7/28/2019 Computational Mhd

    21/66

    2.3. SEVEN VS. EIGHT WAVES 15

    where

    A =

    ux 0 0 0 0 0 00 ux 0 0 0 By/ Bz/ 1/0 0 ux 0 0 Bx/ 0 00 0 0 ux 0 0 Bx/ 00 0 0 0 ux 0 0 00 By Bx 0 0 ux 0 00 Bz 0 Bx 0 0 ux 00 p 0 0 0 0 0 ux

    . (2.13)

    While A has an eigenvalue degeneracy, A does not. Riemann solvers can bedeveloped based on either A or A. In the former case, the fifth row and columnof A is dropped to give the following 7

    7 matrix:

    A =

    ux 0 0 0 0 00 ux 0 0 By/ Bz/ 1/0 0 ux 0 Bx/ 0 00 0 0 ux 0 Bx/ 00 By Bx 0 ux 0 00 Bx 0 Bx 0 ux 00 p 0 0 0 0 ux

    . (2.14)

    The eigenvalues of A are: {ux, ux cf, ux ca, ux cs} where cs, ca, cfare, respectively, the slow magnetosonic, Alfven , and fast magnetosonic soundspeeds. These speeds are defined below:

    ca =Bx

    1

    2

    (2.15)

    c2f,s =1

    2

    a2t

    a4t 4a2c2a

    12

    , (2.16)

    where a is the usual sound speed defined as a2 = p/, and a2t = (p + (B2x +

    B2y + B2z ))/. In the definitions above the plus (minus) sign is for the fast

    (slow) magnetosonic sound speeds. Thus, in MHD, disturbances travel at threedifferent characteristic speeds as opposed to gas dynamics in which there is onlyone sound speed. Furthermore, in MHD, disturbances propagate anisotropicallydepending on the orientation with respect to the magnetic field.

    Here, in passing, we mention the work of Dellar [19]. He derived the MHDequation which would result if magnetic monopoles actually did exist. He foundthat for nonzero B the only source term required is the v B term inthe induction equation. The energy and momentum conservation equations areunchanged.

  • 7/28/2019 Computational Mhd

    22/66

    16 CHAPTER 2. FINITE VOLUME METHODS

    2.4 Riemann Solvers

    Several finite volume methods rely on the solution of Riemann problems at cellfaces to determine the fluxes of conserved quantities. It should be emphasizedthat 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 satisfieseq. 1.25 with the following initial data:

    U(x, 0) = constant = UL f or x 0U(x, 0) = constant = UR f or 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 orrarefactions.

    2.4.1 Linearized Riemann Solvers

    We begin by considering approximate solution to the Riemann problem. This isone in which the following linear system is solved:

    W

    t+ AR

    W

    x= 0, (2.18)

    where AR

    AR(WL, WR) is a matrix which is held constant for the solutionand is constructed using some averaging procedure for WL and WR (WL andWR are primitive variables corresponding to UL and UR, respectively). For gasdynamics AR should satisfy the following property due to Roe [35]:

    F(UR) F(UL) = AR(UR UL), (2.19)

    which ensures that the solution to the Riemann problem is exact for a singleshock. For MHD the above property is satisfied only if = 2 [12]. In practiceAR = AR(

    1

    2(WL + WR)) works out quite satisfactorily. The solution to the

    Riemann problem is then given by:

    W = WL +k0

    (lk (WR WL)) rk, (2.20)

  • 7/28/2019 Computational Mhd

    23/66

    2.4. RIEMANN SOLVERS 17

    where k, lk and rk are the eigenvalues, left and right eigenvectors, respectively,

    of matrix AR.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 thework of Falle et al. [22] and for the eight-wave method in the work of Powell etal. [32].

    The flux can then be computed as follows: F F(W). This, of course, isnot strictly valid for linearized Riemann solvers, but it is, nonetheless, still used.Alternatively, following Roes method [35], the flux can be written as:

    F =1

    2

    FL + FR

    k||kkrk

    , (2.21)

    where k = lk (UR UL).

    2.4.2 Exact solution to the Riemann problem

    For a vast majority of cases, the linearized Riemann solver described above isfairly adequate. However, for certain cases where strong rarefactions are en-countered lead to negative pressures and/or densities. There have been certainad-hoc cures for this behavior. For example, Balsara and Spicer [4] recom-mends computing an additional Riemann problem for a system in which theenergy equation is replaced by the entropy equation in which the pressure re-

    mains positive. The solution of the second Riemann problems is used where thepressure 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 theRiemann problem. Another exact Riemann solver was developed by Dai andWoodward [17] in which rarefactions were approximated by rarefaction shocks.Ryu and Jones [36] devised an improved version in which the rarefactions aretreated correctly but their solver fails to converge for switch-on or switch-offwaves.

    We point out that one has to be at least aware of the fact that solutionsof Riemann problems in finite volume schemes can be contaminated by wave

    patterns of irregular Riemann solutions. This was pointed out very convincinglyby Torrihlon [40]. In particular problems associated with convergence arise whenthe initial conditions are such that 180 are replaced by an intermediate wavesolution. These problems were observed when regions where the magnetic fieldis undergoing large changes in its directions are inadequately resolved.

  • 7/28/2019 Computational Mhd

    24/66

    18 CHAPTER 2. FINITE VOLUME METHODS

    2.4.3 Degeneracies

    Without delving into details, we point out that care must be exercised when thetransverse magnetic field component (Bt = (B

    2y + B

    2z)

    1

    2 ) is zero. For Bt = 0,either cs = ca if ca < a, or cf = ca if ca > a where a is the gas sound speeddefined in the usual manner as a2 = p/. Thus, if ca < a (resp. ca > a)we have slow wave (resp. fast wave) degeneracy. The slow-wave and fast-waveeigenvectors contain terms proportional to By/Bt and Bz/Bt as Bt 0. Itcan be shown that the eigenvectors are still linearly independent irrespective ofthe direction of the transverse magnetic field component as it tends to zero.For the case of ca = a, both the fast and slow waves are degenerate. WhenBx = 0 the fast waves cannot change the transverse velocity components, andboth the Alfven and the slow wave merge with the contact discontinuity. The

    equations then reduce to those of gas dynamics with pressure replaced by thesum of the gas and the magnetic pressures.

    2.5 Methods to ensure solenoidal magnetic fields

    A consequence of Faradays induction law is that an initially divergence free mag-netic field remains divergence free for all time. However, applying the divergenceoperator () to the right hand side of the induction equation ( E) doesnot ensure that the solenoidal property of the magnetic field is satisfied. A non-zero divergence leads to an anomalous Lorentz force parallel to the magneticfield ([10]). The following methods to be, described in detail later, are some

    techniques to ensure that some discrete form of the B = 0 is satisfied.1. Constrained transport: In this method, the B = 0 is built into the

    finite difference or finite volume method such that a discrete form of thesolenoidal condition is satisfied. This method will be described in detaillater.

    2. Non-conservative source: In this method, the non-conservative sourceterm (eq. 2.7) is added to the equations. The underlying argument inusing this term is that there is nothing special about a particular dis-cretized form of B and that other evolution equations suffer fromtruncation error in any case, so there is truncation error in discrete form

    ofB. Falle et al. have argued that if indeed B = 0 then adding thesource term to the conservative formulation is necessary to make it exactlyequivalent to the quasilinear form. Furthermore, adding this source termmitigates some of the bad behavior of conservative schemes which donot preserve the solenoidal property of the magnetic field. If in addition,

  • 7/28/2019 Computational Mhd

    25/66

    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, thereempirical evidence that the max norm of the error grows with time. Afiltering of the magnetic field at the end of every time step can lessen thedetrimental effects of this growing error. The filtering is applied as:

    B = B + ( B), (2.22)where is appropriately chosen coefficient proportional to the square ofthe mesh spacing. This filter is tantamount to diffusing the divergenceerrors.

    3. Vector potential formulation: In this method, the magnetic field is ex-pressed as B =

    A so that the condition

    B = 0 is automatically

    satisfied. However, A A which is a gauge transformation. Inother words, the vector potential is undetermined to within the gradientof a scalar function. The choice of the particular scalar function isreferred to the as the choice of the gauge. For the vector potential, themost commonly chosen gauge condition is A = 0 which is called theCoulomb gauge. Making use of the Coulomb gauge, we get

    J = B = ( A) = 2A. (2.23)Usually, satisfying the gauge conditions requires the solution of an ellipticequation.

    4. Projection: In this method, the magnetic field at the end of each timestep is projected onto a space of zero divergence. This is accomplishedby solving the following Poisson equation

    2 = B, (2.24)and correcting the magnetic field as B := B . Toth [41] hasshown that for a uniform Cartesian grid, projection provides the smallestcorrection to B. There are interesting questions which arise. The abovePoisson equation is an elliptic equation which implies global coupling.However, in hyperbolic systems, we expect a finite signal speed. So,does projection violate hyperbolicity? In other words, will the effects of

    projection be felt ahead of a shock, for instance. We leave such questionsunanswered at present. Suffice to say that there is empirical evidence that B errors occurs in pairs with opposite signs. Such dipolar structureslead to corrections of order 1/r2 in 2D, and 1/r3 in 3D where r is thedistance from the dipole.

  • 7/28/2019 Computational Mhd

    26/66

    20 CHAPTER 2. FINITE VOLUME METHODS

    5. Hyperbolic divergence cleaning: Dedner et al. [18] developed a mod-

    ified system in which the divergence constraint is coupled with the con-servation laws by introducing a generalized Lagrange multiplier. Considerthe modified 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. Thefollowing choices are considered

    (a) Elliptic: D = 0 which leads to an elliptic system. The modifiedinduction equation is solved with an operator split approach. Firstthe usual induction equation is solved to give a predicted value ofBwhich we denote as Bn+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 = Bn+1,

    t, (2.31)

    where we assume that B at time (n+1) is zero. This is a Poissonequation which is similar to the one used in the projection scheme.Finally the magnetic field is obtained as:

    Bn+1

    =B

    n+1,

    t (2.32)(b) Parabolic: In this method, we use

    D() =1

    c2p, (2.33)

  • 7/28/2019 Computational Mhd

    27/66

    2.6. CONSTRAINED TRANSPORT METHOD 21

    with cp (0, ). This leads to the heat equationt

    = c2p, (2.34)

    which implies that the divergence errors are dissipated and smoothedout. Dedner et al. note that the parabolic correction method doesnot lead to satisfactory results.

    (c) Hyperbolic: In this method, we use

    D() =1

    c2h

    t(2.35)

    with ch (0, ). This leads to the wave equation2

    t2 = c2h, (2.36)

    which implies that divergence errors are propagated to the boundarywith finite speed ch > 0. Dedner et al. recommend combiningthe parabolic and hyperbolic methods for best results. The finalextended system obtained can be shown to be hyperbolic and yeildsa more robust scheme.

    2.6 Constrained Transport Method

    Brackbill and Barnes used the non-conservative form for the Lorentz force which

    significantly reduces errors in the kinetic energy. The constrained transportmethod was introduced by Evans and Hawley [21] in which they used thenon-conservative formulation.

    In the CT formulation, a staggered mesh approach is used in which quantitiessuch as density and pressure are located at cell centers while the velocity andmagnetic field components are located at the cell faces. Let us consider a two-dimensional case in which B (Bx, By) and v (vx, vy). In the original CTformulation 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 notationhere and rewrite the CT formulation such that the cell centers are indexed(i, j), and cell corners by (i + 1

    2, j + 1

    2). By, vx are located at (i + 1

    2, j) while

    Bx, vy are located at (i, j + 12

    ). A forward Euler discretization of the inductionequation gives

    Bx,n+1i,j+ 1

    2

    = Bx,ni,j+ 1

    2

    t (vyBx vxBy)i,j+1 (vyBx vxBy)i,j ,By,n+1

    i+ 12,j

    = By,ni+ 1

    2,j

    t (vxBy vyBx)i+1,j (vxBy vyBx)i,j ,(2.37)

  • 7/28/2019 Computational Mhd

    28/66

    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 vy

    Bx

    in the evolution equation forBx. This has the form of a transport term which requires some form of anupwinding approach. The other term in the equation for Bx is like a shearterm which typically does not need any special treatment. However, the rolesof these two terms are reversed in the equation for By. Hence, both terms arecomputing using some form of upwinding procedure. The terms (vyBx)i,j actslike a flux term. Evans & Hawley recommend that these terms be computedby upwind interpolation using the method of Van Leer or PPM. Consider theVan Leer method applied to (vyBx)i,j .

    vxi,j =1

    2 vxi+ 1

    2,j + v

    xi 1

    2,j

    (2.38)

    The raw slopes for interpolation of By are computed as

    Byi,j =By

    i+ 12,j

    Byi 1

    2,j

    x, (2.39)

    and used to compute the following monotonic slopes:

    Byi+ 12,j =

    2 Byi+1,j Byi,j

    Byi+1,j + Byi,jif Byi+1,j B

    yi,j > 0,

    Byi+ 12,j = 0 if B

    yi+1,j B

    yi,j 0. (2.40)

    The monotonic interpolations of the magnetic field are then

    Byi,j = Byi 1

    2,j +

    1

    2Byi 1

    2,j [x tvxi,j ] if vxi,j > 0

    Byi,j = Byi+ 1

    2,j

    1

    2Byi+ 1

    2,j [x + tv

    xi,j ] if vxi,j < 0 (2.41)

    It is clear that taking the divergence at the cell corners in the following formis identically zero provided it is zero at t = 0.

    ( B)i+ 12,j+ 1

    2

    =Bx

    i+1,j+ 12

    Bxi,j+ 1

    2

    x+

    Byi+ 1

    2,j+1

    Byi+ 1

    2,j

    y= 0. (2.42)

    Note that the Evans & Hawley CT method can also be cast in terms of anunderlying vector potential which is cell centered.

    The above idea of using constrained transport was incorporated into finitevolume schemes Godonov-type schemes by several researchers. Noteworthy arethe works by Dai & Woodward [17], Balsara & Spicer [3], and by Toth [41]. In

  • 7/28/2019 Computational Mhd

    29/66

    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 magneticfields are also defined. The x-component is defined on the cell faces (i + 1

    2, j),

    and y-components on the cell faces (i, j + 12

    ). Toth has shown that it is notessential to use these face centered fields but they do make matters convenientand are therefore used here, and we will use lower case b to denote the facecentered magnetic fields. 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 thecorner magnetic field components as follows:

    B

    n+ 12

    i+ 12,j+ 1

    2 =

    1

    8B

    ni,j + B

    ni+1,j + B

    ni,j+1 + B

    ni+1,j+1

    + Bi,j + Bi+1,j + B

    i,j+1 + B

    i+1,j+1

    , (2.43)

    where indicates the updated cell centered magnetic field using theupwind Godunov-type scheme. The velocity field at the cell corners issimilarly determined. The z-component of electric field is computed usingthe above averaged magnetic and velocity components as

    Ezi+ 1

    2,j+ 1

    2

    = (vxi+ 1

    2,j+ 1

    2

    Byi+ 1

    2,j+ 1

    2

    vyi+ 1

    2,j+ 1

    2

    Bxi+ 1

    2,j+ 1

    2

    ) (2.44)

    2. Flux-interpolated CT scheme: This method was originally proposed by

    Balsara & Spicer. In this method, the fluxes computed in the upwindGodunov type method at the cell faces are used to compute the EMFquantities at the cell corners.

    Ezi+ 1

    2,j+ 1

    2

    =1

    4

    fx

    i+ 12,j

    fxi+ 1

    2,j+1

    + fyi,j+ 1

    2

    + fyi+1,j+ 1

    2

    , (2.45)

    where fx and fy are the fluxes through the cell face in the x- and y-direction, respectively. The fx flux is occurs in the evolution equation forBy and equal to (vxBy vyBx), while the fy flux occurs in the evolutionequation for Bx and equals (vxBy vyBx).

    The face centered magnetic field components are then updated as

    bx,n+1i+ 1

    2,j

    = bx,ni+ 1

    2,j

    tEzi+ 1

    2,j+ 1

    2

    Ezi+ 1

    2,j 1

    2

    y

    by,n+1i+ 1

    2,j

    = by,ni+ 1

    2,j

    + tEzi+ 1

    2,j+ 1

    2

    Ezi 1

    2,j+ 1

    2

    x(2.46)

  • 7/28/2019 Computational Mhd

    30/66

    24 CHAPTER 2. FINITE VOLUME METHODS

    The cell centered magnetic field is then obtained by averaging the face

    centered field as

    Bx,n+1i,j =bx,ni+ 1

    2,j

    + bx,ni 1

    2,j

    2

    By,n+1i,j =by,ni,j+ 1

    2

    + by,ni,j 1

    2

    2(2.47)

    In these methods the cell centered divergence defined as

    ( B)i,j =bxi+ 1

    2,j

    bxi 1

    2,j

    x+

    byi,j+ 1

    2

    byi,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 difference approxima-

    tion in which there are no staggered quantities and in which the EMF quantitiesare themselves computed at cell centers and not the cell corners. A discussionof the cell-centered constrained transport schemes is omitted for the sake ofbrevity.

    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 etal. [16]. We begin by rewriting the equation (2.3) as follows.

    U

    t+D1d=0

    Fd

    xd= SD (2.49)

    where, where D is the dimensionality of physical space, and SD is the di-vergence of the diffusive fluxes. We define a vector of variables called theprimitive variables W W(U). In our implementation we chose W ={ , ui, Bi , ui, p( or pt )}T, where pt = p + 12BkBk is the total pressure, analternative to pressure which proves convenient for certain problems. Rewritingthe equations using W in quasilinear form, we get

    W

    t+D1d=0

    Ad(W)Wd

    xd= SD, A

    d = UWUFd WU, SD = UWSD.

    (2.50)

  • 7/28/2019 Computational Mhd

    31/66

    2.7. UNSPLIT METHOD FOR IDEAL MHD 25

    Ad 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 isessentially the approach by Powell et al. [32] in which the desingularized matrixAd has an additional eigenvalue equal to the advection speed and correspondsto an extra wave responsible for advecting away the divergence errors.

    The unsplit algorithm [15] is essentially a predictor-corrector method inwhich face-centered and time-centered primitive variables are predicted, fol-lowed by a corrector step in which a Riemann problem is solved using thepredicted values to compute a second order accurate estimate of the fluxes:

    Fn+ 1

    2

    i+1

    2ed

    Fd(x0 + (i+ 12ed)h, tn + 12t). The predictor step is further dividedinto 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 dWi in each com-putational cell, which are subsequently limited using Van Leer slope lim-iting.

    2. Normal Predictor: Compute the effect of the normal derivative termsand the source term on the extrapolation in space and time from cellcenters to faces. In this step we split the primitive variables as follows

    Wni

    = Wn

    i

    Bni,d , (2.51)

    For 0 d < D,

    Wi,,d = Wni

    +1

    2(I t

    hAdi)P(

    dWi), (2.52)

    Adi

    = Ad(Wi), P(W) =

    k>0

    (lk W)rk,

    Bi,,d = Bi,d, Wni,,d =

    Wn

    i,,d

    Bni,,d

    ,

    Wi,,d = Wi,,d +t

    2UW SnD,i, (2.53)

    where Adi

    is the matrix obtained from Adi

    after deleting the row andcolumn corresponding to the normal component of the magnetic field, kare eigenvalues of Ad

    i, and lk and rk are the corresponding left and right

    eigenvectors.

  • 7/28/2019 Computational Mhd

    32/66

    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. Thisstems from the fact that in multi-dimensions the derivative of the normalcomponent of the magnetic field in the d-direction is not zero. The StoneCorrection is given as

    Wi,,d = Wi,,d t2

    Bdxd

    i

    aB , (2.54)

    where aB = {0, Bk/,ud1 , ud2 , ( 1)ukBk}T, and dl = mod(d+l, 3);and the term (Bdxd )i is the derivative of the normal component of themagnetic field in the d-direction, computed using a standard second-ordercentral difference formula.

    3. Transverse Predictor: Compute estimates of Fd suitable for computing1D flux derivatives F

    d

    xdusing a Riemann solver. The above normal pre-

    dictor step gives us left and right states at each cell interface. We employa seven-wave linearized Riemann solver to obtain the primitive variables atthe cell faces, except the normal component of the magnetic field,whichis taken as the arithmetic mean of the left and right states. The entire so-lution vector at i+ 1

    2ed is termed as the solution of the Riemann problem

    R(., .). The fluxes are then computed from the primitive variables as,

    F1Di+

    1

    2ed

    F1D(Wi+

    1

    2ed

    ), W1Di+

    1

    2ed

    R(Wi,+,d, Wi+ed,,d). (2.55)

    In 3D, we compute corrections to Wi,,d corresponding to one set oftransverse derivatives appropriate to obtain (1, 1, 1) diagonal coupling.

    Wi,,d1,d2 = Wi,,d1 t

    3hUW (F1D

    i+1

    2ed2

    F1Di 1

    2ed2

    ) (2.56)

    Furthermore, in 3D, we compute fluxes corresponding to corrections made

    in the previous step,

    Fi+

    1

    2ed1 ,d2

    = R(Wi,+,d1,d2 , Wi+ed1 ,,d1,d2 , d1)

    d1 = d2, 0 d1, d2 < D. (2.57)

  • 7/28/2019 Computational Mhd

    33/66

    2.8. VERIFICATION TESTS 27

    Compute final corrections to Wi,,d due to the final transverse derivatives.

    2D : Wn+ 1

    2

    i,,d = Wi,,d t

    2hUW (F1D

    i+1

    2ed1

    F1Di 1

    2ed1

    ) (2.58)

    d = d1, 0 d, d1 < D,3D : W

    n+ 12

    i,,d = Wi,,d t

    2hUW (Fi+ 1

    2ed1 ,d2

    Fi 1

    2ed1 ,d2

    )

    t2h

    UW (Fi+ 12ed2 ,d1

    Fi 1

    2ed2 ,d1

    )

    d = d1 = d2, 0 d, d1, d2 < D.

    4. Compute final estimate of fluxes as follows. First compute the solutionto the Riemann problem using the time-centered predicted states,

    Wn+ 1

    2

    i+1

    2ed

    = R(Wn+ 1

    2

    i,+,d, Wn+ 1

    2

    i+ed,,d, d). (2.59)

    Projection: Using the normal component of the magnetic field at i + 12ed

    compute a cell centered divergence. The following Poisson equation issolved using a multigrid technique with a Gauss-Seidel Red-Black orderingsmoother, and a BiCGStab bottom solver.

    2 =D1d=0

    Bdxd i

    (2.60)

    Project the magnetic field as Bi+ 12ed = Bi+ 1

    2ed , and replace

    the corrected magnetic field in to Wn+ 1

    2

    i+1

    2ed

    , and recompute the fluxes as

    Fn+ 1

    2

    i+1

    2ed

    = F(Wn+ 1

    2

    i+1

    2ed

    ).

    5. Final update: Compute the final update to the conserved variables.

    Un+1i

    = Uni

    th

    D1d=0

    (Fn+ 1

    2

    i+1

    2ed

    Fn+1

    2

    i 12ed

    ) (2.61)

    2.8 Verification tests

    In this section, we will describe a few verification tests for ideal MHD. Clearly,this list is not exhaustive, but illustrative of the variety of test problems widelyused in the literature.

  • 7/28/2019 Computational Mhd

    34/66

    28 CHAPTER 2. FINITE VOLUME METHODS

    2.8.1 Linear wave propagation

    The first verification test for ideal MHD is that of 2D linear wave propagationproblem. In this problem, the domain is defined as the square [0, 2] [0, 2],having periodic boundary conditions on all sides. The initial conditions aresetup as follows. We write the ideal MHD equations in quasilinear form suitablefor wave propagation along a direction = kxx + kyy

    W

    t+ A

    W

    = 0,

    where W = {,u,v,w,Bx, By, Bz, p}T. We begin with a constant equilib-rium state, denoted as W0, and project this state on to the characteristic

    space by taking the inner product of W0 with the left eigenvectors of the ma-trix A(W0). Thus the k-th equilibrium characteristic variable is written asV0,k(W0) (lk(W0), W0), where lk is the k-th left eigenvector ofA(W0). Thel-th wave is then initialized by perturbing only the l-th characteristic variable,i.e., Vk(x,y, 0) = V0,k(W0) + kl cos(kxx + kyy), where kl is the Kroneckerdelta function. The perturbed characteristic variables are then projected backto physical space by multiplying Vk with the right eigenvectors ofA(W0). Theamplitude of perturbation is chosen to be small (105), and the l-th wave canbe chosen to be one of the ideal MHD wave (i.e., either an Alfven wave, or a fastor slow magneto-acoustic wave moving obliquely to the mesh at 45 (kx = ky)or along the x-axis kx = 1, ky = 0 , with the magnetic field at a certain angle tothe 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 hastento add that the small perturbation amplitude ensures that the waves propagatealmost linearly, with nonlinear effects of O(2).) Hence, we use it to analyzethe 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.1sin[2(x cos + y sin ] = B, vz = 0.1cos[2(x cos + y sin ] =Bz . The domain is [0, 1/ cos ] [0, 1sin ] with periodic boundary conditionsin both directions. In this case, the Alfven speed is ca = B||/

    = 1 so that

  • 7/28/2019 Computational Mhd

    35/66

    2.8. VERIFICATION TESTS 29

    at t = 1 the wave returns to its original location. The /2 phase shift between

    B and Bz ensures a constant magnetic pressure.

    2.8.3 Shock-tube problem

    In hydrodynamics, the Sod shock-tube problem is quite well known. For idealMHD, 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 ismisaligned 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 field are zero.

    2.8.4 The Rotor problem

    In this test problem, the initial conditions consist of a dense rapidly spinningcylinder embedded in a light ambient fluid. This problem, which mimics theproblem of angular momentum loss through torsional Alfven waves in star forma-tion, was originally proposed by Brackbill at a Los Alamos National Laboratoryworkshop [3]. The computational domain in this 2D test is [0, 1] [0, 1]. Theinitial pressure and magnetic field are uniform (p = 1, Bx = 1, By = 0). Thedensity is = 10, and velocity is vx =

    v0(y

    1

    2

    )/r0 and vy = v0(x

    1

    2

    )/r0for r < r0, where r is the radial distance from the center of the domain, andr0 = 0.1. The ambient density is = 1. For, r0 < r < r1, the density andangular velocity profiles are linear in r to avoid large transients. Because thecentrifugal forces are not in balance, there magnetic field winds up and entrainsthe dense fluid into an oblate shape.

    2.8.5 MHD shock refraction

    Two dimensional MHD shock refraction during early stages of the RichtmyerMeshkov instability was examined in detail by Wheatley et al. [43]. An analyticalsolution valid in the vicinity of the quintuple point, where all the nonlinear

    waves intersect was obtained. This analytical solution can be compared withthe numerical solution. In this test case, the analytical solution consists of fastshocks, a slow shock and a 2-4 intermediate shock (permissible in this stronglyplanar case), and a contact discontinuity. In this test case, a hydrodynamicshock of Mach number M = 1.5 propagates and strikes an initially quiescent

  • 7/28/2019 Computational Mhd

    36/66

    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 fluid is at uniformpressure. The magnetic field is in the x-direction and uniform Bx = 1.

  • 7/28/2019 Computational Mhd

    37/66

    Chapter 3

    Semi-implicit and Implicit

    Methods

    In this chapter we will discuss semi-implicit and implicit methods for resistiveMHD. We first dispense with the implicit treatment of the diffusion terms inthe single fluid resistive MHD equations. This is followed by a discussion of thevarious waves in ideal MHD followed by techniques which which treat some ofthe wave modes implicitly.

    3.1 Semi-implicit unsplit upwind method for compress-

    ible MHDIn this method, we extend the unsplit upwind method for ideal MHD discussedin the previous chapter to include diffusion terms. The equations are the single-fluid resistive MHD equations written in conservation form (eq. 1.24). Usingoperator splitting arguments, we first compute the hyperbolic fluxes at time stepn + 1

    2as discussed in the previous chapter. Then, we stop short of performing

    the final update, and treat the diffusive fluxes implicitly as described below.

    3.1.1 Implicit treatment of diffusive fluxes

    At the end of the above step, the face-centered time-averaged hyperbolic fluxeshave been obtained. We can update the density because the continuity equationcontains no diffusion terms. The induction equation for the magnetic field isrewritten as

    Bit

    = LBD(Bn+1i ) FH,n+ 1

    2

    Bi(3.1)

    31

  • 7/28/2019 Computational Mhd

    38/66

    32 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS

    where LBD S1 2

    xjxj, and FH,n+

    1

    2

    Biis the divergence of the hyperbolic

    fluxes for the magnetic field components, and act as a source term in the abovediffusive update step. Similarly, the momentum equation is rewritten as

    uit

    = LuD(un+1i ) FH,n+ 1

    2

    ui + ui FH,n+ 1

    2

    (3.2)

    where LuD Re1 2

    xjxj, and FH,n+

    1

    2

    ui is the divergence of the hyperbolic

    fluxes in the momentum equations, and FH,n+1

    2

    is the divergence of thehyperbolic fluxes in the continuity equation. Note that the ui multiplying F

    H,n+ 12

    is taken as average value of velocities at the finite volume faces obtainedfrom the last Riemann problem solved in the hyperbolic stage.

    We update the momentum and the magnetic field equations before solvingthe energy equation, which is rewritten as

    1T

    t= LTD(Tn+1) F

    H,n+ 12

    e +T

    1 FH,n+ 1

    2

    12

    ukuk

    t+

    BkBkt

    +

    evxj

    n+ 12

    (3.3)

    where LTD (RePr)1 1 2

    xjxj, and FH,n+

    1

    2

    e is the divergence of the

    hyperbolic fluxes in the energy equation. The term ev in the above equation isgiven by

    1 ev = S

    1

    Bi

    xj Bj

    xi

    + Re1ijui. (3.4)

    Because the momentum and magnetic fields have been updated, all the terms inev are known and taken as the average of the values at time t

    n and tn+1. Finallythe time derivatives of the kinetic and magnetic energies are determined as asimple backward difference between times tn+1 and tn. Each of the implicitsolves of the diffusion terms is expressed as a variable coefficient Helmholtzequation, which is solved either with a backward Euler, or a Crank-Nicholson oran 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 theslow magnetosonic sound waves. Typically, plasma confinement devices, suchas tokamaks, stellarators, reversed field pinches etc. are characterized by a

  • 7/28/2019 Computational Mhd

    39/66

    3.3. IMPLICIT TREATMENT OF FAST COMPRESSIONAL WAVE 33

    long scale length in the direction of the magnetic field, and shorter length

    scale phenomena in the direction perpendicular to the field. For example, ina tokamak, the magnetic field is dominantly along the toroidal direction andconsequently the long length scale are mostly toroidal whereas the short scalesare in the radial-poloidal plane. It is known that the Alfven wave is a transversewave with fastest propagation along the magnetic field. The fast magnetosonicaka the fast compressional wave is also anisotropic with the fastest propagationperpendicular to the magnetic field. In explicit methods discussed in the previouschapter, the time step is restricted by the familiar CFL condition. Several MHDphenomenon are studied for long-time behavior where long-time is of the orderof resistive time scales. For such investigations, the CFL condition implies anoverly restrictive time step which translates to an enormous number of timesteps. It is advantageous and desirable to design numerical schemes whichallow us to have time steps larger than that imposed by the CFL condition, andyet the computational cost of each time step is only slightly larger than theexplicit 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 argumentsof large length scales dominantly in a certain direction allows one to investigatelong-time scale phenomena in MHD in a computationally efficient manner. Thework 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 followinghyperbolic system of equations.

    u

    t= a

    v

    x,

    v

    t= a

    u

    x. (3.5)

    This can be rewritten as2u

    t2 = a2

    2u

    x2 . (3.6)

    We then subtract a term from either side of the above equation as

    2u

    t2 a20

    2u

    x2= a2

    2u

    x2 a20

    2u

    x2, (3.7)

  • 7/28/2019 Computational Mhd

    40/66

    34 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS

    where a0 is a constant coefficient chosen mainly from stability considerations.

    Furthermore, a0 is something which mimics the behavior of a perhaps in somelimit. The underlying idea of the semi-implicit methods discussed here is this:the term containing a0 on the left hand side of eq. 3.6 is treated implicitly, whilethe 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 ofthe term containing a0 should be small relative to the total cost of evolving theentire system. Consider the time evolution of eq.( 3.6) as

    un+1 t2 a202

    2u

    x2

    n+1

    = un + tu

    t

    n

    +t2 a2

    2

    2u

    x2

    n

    t2 a202

    2u

    x2

    n

    (3.8)

    We now solve the original hyperbolic system with the following predictor cor-rector algorithm.

    u = un + tav

    x

    n

    (3.9)

    v = vn + tau

    x

    n

    (3.10)

    un+1 a20 t

    2

    2

    2u

    x2

    n+1

    = un + tav

    x

    a20 t

    2

    2

    2u

    x2

    n

    (3.11)

    vn+1 = vn +1

    2at

    u

    x

    n

    +u

    x

    n+1, (3.12)

    where 0.5 1.

    Stability: This method is unconditionally stable if a20 > (a

    2

    /16)(1 + 22

    ).If this basic concept was applied to the original hyperbolic system in which awas the coefficient, we potentially have a destabilizing situation when a anda0 are of opposite sign. As applied above, this does not happen because a

    2 isalways positive.

  • 7/28/2019 Computational Mhd

    41/66

    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-directionare much longer than those in the x-y plane. The fastest time scale is then dueto 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 = vxx. Furthermore, assuming a constant density cold plasma ( =1, p = 0), and linearizing with vx = v1(x), and B

    z = B0 + B1(x) gives

    v1

    t=

    B0

    B1

    x,

    B1t

    = B0v1x

    . (3.17)

    The above equations are the same as those in eq. 3.5. Consequently the sameideas as in the illustrative example above can be used here to treat the fastcompressional wave implicitly. The above procedure when generalized to threedimensions, and retaining only compressional modes gives the following

    2v1

    t2 =

    1

    (B

    2

    0 + p0)( v1), (3.18)

    where p0 is some equilibrium constant pressure about which the equations arelinearized. A predictor -corrector algorithm to solve the above equations now

  • 7/28/2019 Computational Mhd

    42/66

    36 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS

    follows.

    v = vn + t 1n

    Fn, (3.19)B = Bn + t( (vn Bn)), (3.20)

    = n t (v)n, (3.21)p = pn t (vn pn pn vn) ,(3.22)

    vz,n+1 = vz,n + t1

    Fz,, (3.23)

    vn+1 = v

    n + t

    1

    F,

    t2 A202

    (

    v)

    n+1

    t2 A202

    (

    v)

    n, (3.24)

    Bn+1 = Bn +

    t

    2 ((vn + vn+1) B), (3.25)

    n+1 = n t2

    ((vn + vn+1)), (3.26)

    pn+1 = pn t2

    (vn + vn+1) pp (vn + vn+1) , (3.27)

    where 0.5 < 1, and v refers to the velocity in the x-y plane, and A0 issimilar to a0 in the model problem described earlier. The extra computationaleffort in solving these equations is inverting the block matrix in the evolution

    equation forv. Harner & Kerner further simplified the system by doubleFourier series in y- and z-directions. This makes the linear solve a one dimen-

    sional tridiagonal solve in the x-direction which can be efficiently implementedwith 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 amplification matrix as

    =1

    Y

    Y 1

    4(1 + 2)

    Y + 1

    16(1 + 2)22

    12

    , (3.28)

    where Y = 1 + A20K2, = (K2 + N2)B20 , K = 2t/x sin(kx/2), N =

    2n/Lt, and k, n are the mode numbers in x- and z-directions. For < 0.5the method is unconditionally unstable. For 0.5 < 1 the method is stableif 4Y + 1/4(1 + 2)2(K2 + N2)B20 0. Unconditional stability for the fastcompressional modes is obtained if A20 > B

    20(1 + 2)

    2/16. We still have tosatisfy a stability condition for the Alfven wave.

  • 7/28/2019 Computational Mhd

    43/66

    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 evolutionequation has a different form. The method for the implicit treatment of theshear Alfven wave was proposed by Harned & Schnack [25]. The MHD equa-tions are linearized assuming a uniform magnetic field, density and pressure.The resulting linear wave equation is

    2v

    t2=

    1

    0[ (v B0)] B0 + p0

    0( v). (3.29)

    To arrive at the semi-implicit term B0 is replaced by a constant vector C0. The

    pressure term is dropped because it enters in the magnetosonic modes with thesame form as the perpendicular magnetic field. Hence the semi-implicit termis (v C0) C0. The MHD equations are then solved with the

    predictor-corrector method as for the fast compressional case with the exceptionthat the semi-implicit operator is applied to all the velocity components in thecorrector stage as follows:

    vn+1 t

    2

    2 (vn+1 C0) C0 = vn + t 1

    F

    t2

    2 (vn C0) C0 (3.30)

    Stability: In a two-dimensional stability analysis, terms in the semi-implicitformulation having coefficients CiCj(i = j) are destabilizing if C0 is not par-allel to B0. The 2D stability analysis also shows that the eigenvalues of theamplification matrix are: = 1ZZ(Z 1) where Z = X+ Y, and X =N2B2x/(1 + N

    2C2x), Y = N2B2y/(1 + N

    2C2y ), and where N2 = (m2 + n2)t2,

    and m, n are mode numbers in the x- and y-directions. lies within the unitcircle when Z < 4/3 which makes the method unconditionally stable as long asCx Bx and Cy By, and cross terms such as CxCy are not retained in thesemi-implicit operator. This removal of the cross terms is essentially a heuristicwhich works well in practice.

    In this method both the fast compressional and the Alfven wave are implicitlytreated. When a Fourier decomposition is employed along two directions (y- andz) then the resulting linear system is block tridiagonal which can be efficientlyinverted. Both the methods described above are formally first order accurate intime for > 0.5.

  • 7/28/2019 Computational Mhd

    44/66

    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. Itis interesting that this work used an upwind method to evaluate the hyperbolicterms. This brings into focus the following question: What does it mean tohave an upwind implicit method? Generally, upwind methods are based on thesolution of a Riemann problem at cell faces; such a solution is self-similar intime, i.e. depends only on x/t for times until the waves from neighboring cellfaces 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 thedispersion error which are the bane of second-order central schemes. Adoptingthis viewpoint, one may ignore the interactions between neighboring Riemannproblems. While Jones et al. developed an implicit method for resistive MHD,we will discuss their method as applied to ideal MHD in two dimensions. Thediffusion terms, in their paper, were straight-forward additions using secondorder central differences. 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 fluxes. The above equation (orrather system of equations) is discretized in time as

    1

    2t(3Un+1i,j 4Uni,j + Un1i,j ) = Rn+1i,j (3.32)

    The above equation is implicit and is solved iteratively. Let Un+1,k denote thek-th iteration of the solution at the n + 1-th time level. Rewrite the aboveequation as

    Ut

    k+1

    i,j

    =

    Rn+1,k+1i,j , (3.33)

    where U

    t

    k+1i,j

    12t

    (3Un+1,k+1i,j 4Uni,j + Un1i,j ). (3.34)

  • 7/28/2019 Computational Mhd

    45/66

    3.5. FULLY IMPLICIT METHODS FOR MHD 39

    A truncated Taylor series expansion yields:

    U

    t

    k+1i,j

    =

    U

    t

    ki,j

    +Ut

    ki,j

    UUki,j (3.35)

    Rk+1i,j = Rki,j +

    Rki,jU

    Uki,j , (3.36)

    where Uki,j = Un+1,k+1i,j Un+1,ki,j . The partial derivative of the divergence

    of the hyperbolic fluxes with respect to the solution vector is difficult to evaluatefor second order schemes. Hence, at this stage an approximation is made, i.e.,such terms are evaluated with a first order scheme. The first order hyperbolicflux divergence, denoted as R is at point (i, j) is coupled to the neighboringfour points in 2D. R

    i,j R(U

    i,j, U

    i+1

    2 ,j, U

    i1

    2 ,j, U

    i,j+1

    2

    , Ui,j

    1

    2

    ). Substituting

    all back into 3.33 givesRki,j

    U+

    3I

    2t

    Uki,j =

    Rki,j +

    U

    t

    ki,j

    (3.37)

    The above equation is linear and iterated until Uki j is driven to zero. Thematrix in the linear system above is a large banded matrix and will be generallyexpensive 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 fluxes R are evaluated with the Hartens approximateRiemann 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 first order flux diver-

    gence is written as:

    Ri,j =Fi+ 1

    2

    Fi 12

    x+

    Gj+ 12

    Fj 12

    y, (3.38)

    where we have suppressed the j index for F and the i index for G. The firstorder Harten flux F is expressed as

    Fi+ 12

    =1

    2

    Fi+1 + Fi

    k

    ||ki+ 1

    2

    ki+ 1

    2

    rki+ 1

    2

    , (3.39)

    where ki+ 1

    2

    = lki+ 1

    2

    (Ui+1 Ui), and k are the eigenvalues, and lk (rk) arethe left (right) eigenvectors of the matrix A. F can also be expressed as:

    Fi+ 12

    =1

    2

    Fi+1 + Fi |A|i+ 1

    2

    (Ui+1 Ui)

    , (3.40)

  • 7/28/2019 Computational Mhd

    46/66

    40 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS

    where |A| A+ A and A = X1X, where is a diagonal matrixof all positive (for +) and all negative (for -) eigenvalues of A. Flux vectorsplitting was originally developed for the Euler equations where the flux functionis a homogeneous function of degree one in U, i.e. F = AU. For MHD thisproperty no longer holds. Jones et al. make an approximation for MHD, i.e.,F AU, so that F AU can be defined. Using this type of splitting gives:

    Fi+ 12

    =1

    2[Fi+1 + Fi (|A|i+1Ui+1 |A|iUi)] (3.41)

    =1

    2(Ai+1Ui+1 + A

    +i Ui) =

    1

    2(Fi+1 + F

    +i ) (3.42)

    Now we are in a position to evaluate theRki,jU term in eq: 3.37. We get

    3I2t

    + A+i,j A+i1,j + Ai+1,j Ai,j

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

    Uki,j = Rki,j , (3.43)

    where B is the Jacobian corresponding to G. The above linear system is now ablock pentadiagonal system. A further simplification is invoked.

    A 12

    (A AI) (3.44)

    B 12

    (B BI), (3.45)

    where A is the maximum eigenvalue of A (which corresponds to the fastmagnetosonic wave) and B is similarly defined. With this approximationA+ A = AI and eq. (3.43) simplifies to

    Di,j A+i1,j + Ai+1,j B+i,j1 + Bi,j+1

    Uki,j = Rki,j , (3.46)

    where Di,j = (3/2t + A + B)i,j This block matrix can be solved in twosteps using a forward Gauss-Seidel sweep followed by a backward sweep. Theresulting algorithm is

    Di,j A+i1,j B+i,j1

    Di,j + Ai+1,j + B

    i,j+1

    Uki,j = Di,jRki,j (3.47)

    The forward sweep is inverting a lower block diagonal matrix , and the backwardsweep is inverting an upper block diagonal matrix. There are no block inversionssince Di,j contains only diagonal terms. One disadvantage of this method isthat the nonlinear residual is never computed to check convergence. This bringsus to the Newton-Krylov method.

  • 7/28/2019 Computational Mhd

    47/66

    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 anonlinear function as follows:

    F(Un+1) = 0, (3.48)where Un+1 RN 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(Un+1) = Un+1 Un + (1 )R(Un+1) + R(Un) = 0 (3.49)For MHD, on a two dimensional N M mesh, the total number of unknownswould then be 8MN. The above nonlinear systems can be solved using aninexact NewtonKrylov solver. Apply the standard Newtons method to the

    above nonlinear system gives

    Uk =

    FU

    n+1,k1F, (3.50)

    (3.51)

    where J(Un+1,k) FUn+1,k is the Jacobian; and Uk Un+1,k+1Un+1,k,and k is the iteration index in the Newton method. For the two dimensionalsystem the Jacobian matrix is 8M N 8M N which, although sparse, is stillimpractical to invert directly.

    In Newton-Krylov methods, the linear system at each Newton step is solved

    by a Krylov method. To briefly summarize, in Newton-Krylov methods thenonlinear system of equations are solved by Newtons method while the linearsystem resulting each Newton iteration is solved by a Krylov method. In Krylovmethods, an approximation to the solution of the linear system JU = F isobtained by iteratively building a Krylov subspace of dimension m defined by

    K(r0, J) = span{r0, Jr0, J2r0, , Jm1r0}, (3.52)where r0 is the initial residual of the linear system. The Krylov method canbe 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. GMRESis very robust but generally is heavy on memory usage, while BiCGStab hasa lower memory requirement, it is less robust given that the residual is notguaranteed to decrease monotonically.

  • 7/28/2019 Computational Mhd

    48/66

    42 CHAPTER 3. SEMI-IMPLICIT AND IMPLICIT METHODS

    1. Begin by guessing the solution Un+1,0. Typically the initial guess is

    Un+1,0

    = Un

    .2. For each Newton iteration k = 1, 2,

    (a) Using a Krylov method, approximately solve for Uk,J(Uk)Uk = F(Un+1,k) so that ||J(Uk)Uk + F(Un+1,k)||