National Center for Supercomputing Applications, University of Illinois, Urbana-Champaign, 405 North Mathews Avenue, Urbana, IL 61801 ; u10956=ncsa.uiuc.
THE ASTROPHYSICAL JOURNAL SUPPLEMENT SERIES, 116 : 119È131, 1998 May ( 1998. The American Astronomical Society. All rights reserved. Printed in U.S.A.
LINEARIZED FORMULATION OF THE RIEMANN PROBLEM FOR ADIABATIC AND ISOTHERMAL MAGNETOHYDRODYNAMICS DINSHAW S. BALSARA National Center for Supercomputing Applications, University of Illinois, Urbana-Champaign, 405 North Mathews Avenue, Urbana, IL 61801 ; u10956=ncsa.uiuc.edu Received 1995 December 21 ; accepted 1997 December 3
ABSTRACT In this paper we present a linearized formulation of the Riemann problem for ideal adiabatic and isothermal magnetohydrodynamic (MHD). RoeÏs property U is obtained. This ensures good capturing of shocks of arbitrary strength. A parameter vector is found which gives an almost consistent mean state, where consistency is deÐned in the sense of Roe. The eigenvalues and eigenvectors for the linearized Riemann problem for MHD have been explicitly constructed further facilitating numerical implementation. The method has been tested in the authorÏs RIEMANN code for numerical MHD. In a companion paper on TVD methods for MHD, where this Riemann solver was used, we have shown that excellent results can be obtained. The consistency for this formulation is illustrated by the fact that the eigenvalues have the same symmetrical distribution around the Roe-averaged x-component of the velocity that the eigenvalues for ideal MHD have around the physical x-component of the velocity. The accuracy, simplicity, and noniterative nature of the linearized formulation of the MHD Riemann problem presented here make it especially suitable for use on massively parallel processor machines. Subject headings : methods : numerical È MHD 1.
INTRODUCTION
Hyperbolic systems of conservation laws describe the time evolution of various physical systems. The last decade and a half has seen signiÐcant advances in our understanding of numerical techiques for solving such systems. Much e†ort has been devoted to numerically solving the Euler and Navier-Stokes equations. For the Euler equations the results presented in Woodward & Colella (1984) have shown that the winning schemes seem to be higher order Godunov schemes. The two essential ingredients of such schemes are higher order interpolation of the Ðeld variables and use of a Riemann solver to get properly upwinded Ñuxes at zone boundaries. Efficiency considerations coerce most numerical codes to use one or the other form of approximate Riemann solver. The exact Riemann solver is almost never used. Numerous strategies have been used to design approximate Riemann solvers for the Euler equations. An approximate Riemann solver that stands out as being very cost-e†ective and yet capable of yielding highly accurate results in a wide variety of Ñow problems is the one proposed in Roe (1981). It consists of replacing the iterative solution of the exact Riemann problem by a linearized version of the problem in a sense that will be clariÐed below. This paper constructs a linearized Riemann solver for the dual cases of ideal adiabatic and isothermal MHD. The Riemann problem describes the time evolution of two arbitrary (but physical) constant states U and U that are on L R the left and right of an initial discontinuity. Solving the MHD Riemann problem in a computer code entails making several signiÐcant compromises. Iterative solution processes are computationally very costly ; see Dai & Woodward (1994a). Furthermore, much of the information generated in the iterative solution of the Riemann problem is not used in the time update. Roe (1981) realized this in the context of hydrodynamics, and the same is true for magnetohydrodynamics (MHD). In Roe (1981) it was suggested that the Riemann problem for the conservation law be replaced by the exact solution of an approximate, linearized problem L U \ A3 L U \ 0 , (1) t x where the matrix A3 depends on U and U . The matrix A3 (U , U ) was required to satisfy the following properties in Roe L : R L R (1981) which we repeat verbatim here 1. 2. 3. 4.
It represents a linear mapping from the vector space U to the vector space F. As U ] U ] U, A3 (U , U ) ] A(U), where A(U) \ LF(U)/LU. L U R, U , A3 (U L, U R) ] (U [ U ) \ F [ F . For any L R of A3 are L linearly R L R L R The eigenvectors independent.
The above properties are often collectively referred to as property U. These properties ensure that the scheme designed using these properties is conservative and consistent. Property (3) is the one that is most difficult to obtain in practice. It is also the most useful one since it ensures that all isolated shocks of arbitrary strength are exactly represented. It must also be stressed that in order to achieve property U the matrix elements of A3 (U , U ) have to depend in a highly nonlinear way on the L elements R elements of the vectors U and U . Simple arithmetic averaging of the of the vectors U and U will not suffice. L R R property (3) above. In this paper we construct such a linearized matrix A3 for MHD that satisÐes property U, Lincluding Moreover, explicit expressions have been derived for all the eigenvalues and eigenvectors. The resulting eigenvectors show a great deal of similarity to those derived from the characteristic matrix, indicating that they are almost consistent in the sense 119
120
BALSARA
Vol. 116
of Roe (1981). It must be pointed out that consistency in the sense of Roe (1981) might be thought of as being an esthetic attribute that a linearized Riemann solver may have. It is not an essential attribute that a Riemann solver must have in order to produce physically consistent numerical solutions in a numerical scheme. In particular, many linearized Riemann solvers exist that produce good results without having consistency in the sense of Roe (1981). The explicit computational construction of these eigenvectors takes little more time than the construction of eigenvectors for ideal MHD as detailed by Roe & Balsara (1996). Thus the Riemann solver step takes little more computer time than the process of performing TVD interpolation. A balanced performance is, therefore, obtained between the interpolation step and the Riemann solver step. Since the eigenvectors satisfy property U, including property (3) above, they can represent isolated shocks of arbitrary strength exactly. As pointed out by Roe (1981), this is true for all shocks but is especially true for stationary shocks. The construction is noniterative and, therefore, suitable for use on massively parallel processor (MPP) machines. Other e†orts by Ryu & Jones (1995) and Aslan & Kammash (1997) do not have property U since they do not satisfy property (3) above. They suggest building eigenvectors based on arithmetic averaging of the primitive variables on either side of the Riemann problem. They also make certain compromises in removing pathologies in their eigenvectors, compromises that have been shown to be unnecessary in Roe & Balsara (1996). Once the eigenvectors have been constructed it is easy to construct properly upwinded Ñuxes. This has been done in Harten & Hyman (1983), and we do not repeat it here. In ° 2 we present the linearization of the Riemann problem for MHD. In ° 3 we give the explicit form of the eigenvectors. In ° 4 we present the Einfeldt Ðx for MHD. In ° 5 we draw some conclusions. In the body of the paper we treat the adiabatic case. In the Appendix we treat the isothermal case. Equation numbering in the Appendix will mirror that in the text. In the Appendix we give the changed equations for the isothermal case. 2.
LINEARIZED RIEMANN PROBLEM FOR MHD
The MHD equations can be written in conservative form for variations in the x-direction as follows : L U ] L F(U) \ 0 , t x
(2.1)
where U is given by
U\
ab o ov x ov y ov z E B y B z
,
(2.2)
and F(U) is given by
q ov x t 1 1 ov 2 ] P ] (B 2 ] B2 ] B2) [ B2 t x y z 8n x 4n x t 1 t ov v [ B B x y x y 4n t F(U) \ r 1 ov v [ B B x z 4n x z t t 1 1 v [ B (B v ] B v ] B v ) t E ] P ] 8n (B2x ] B2y ] B2) z x 4n x x x y y z z t B v [B v y x x y t B v [B v s z x x z
C
D
n t t t t t o. t t t t t p
(2.3)
Here o is the density, P is the pressure, v are the x, y, and z components of the velocity, and B are the x, y, and z x,y,z we adopt cgs units. The divergence-free condition applied x,y,zto the magnetic Ðeld components of the magnetic Ðeld. In this paper in the x-direction ensures that B is a constant. The energy E is given by x 1 1 1 E \ o(v2 ] v2 ] v2) ] P] (B2 ] B2 ] B2) , (2.4) x y z y z 2 ![1 8n x where ! stands for the ratio of speciÐc heats and is taken to be a constant. The system of equations in equation (2.1) is a hyperbolic system. The characteristic matrix A 4 LF(U)/LU has seven real eigenvalues. The eigenvalues, in the order of increasing magnitude, correspond to a left-going fast magnetosonic wave, a left-going Alfven wave, a left-going slow wave, an entropy wave, a right-going slow magnetosonic wave, a right-going Alfven wave, and a right-going fast magnetosonic wave. The entropy wave and the two Alfven waves are linearly degenerate. The magnetosonic waves are genuinely nonlinear as described in Lax (1972.
No. 1, 1998
LINEARIZED FORMULATION OF RIEMANN PROBLEM
121
As in the case of the Euler equations, construction of the matrix A3 is greatly simpliÐed by choosing an alternative set of variables. This choice of variables is referred to as a parameter vector. Thus we take the parameter vector,
W\
where h4
a bab Jo Jo v x Jo v y Jo v z Jo h B /Jo y B /Jo z
4
w 1 w 2 w 3 w 4 w 5 w 6 w 7
,
C
(2.5)
D
1 1 E]P] (B2 ] B2 ] B2) . y z 8n x o
(2.6)
Notice that for any physically realizable state vector U there is a unique W and vice versa. To illustrate this, notice that the pressure can be written as P\
C
D
1 1 ![1 w w [ (w2 ] w2 ] w2) [ (B2 ] w2 w2 ] w2 w2) . 1 5 2 2 3 4 1 6 1 7 4n x !
(2.7)
The vectors U and F can be written in terms of the components of W as follows : w2 R S 1 t t w w 1 2 t t w w 1 3 t t w w 1 4 t t U\ 1 t w w ] (! [ 1) (w2 ] w2 ] w2) ] (! [ 2) 1 (B2 ] w2 w2 ] w2 w2)t , 2 3 4 1 6 1 7t 2! ! 8n x t! 1 5 w w t t 1 6 T U w w
(2.8)
1 7
w w R S 1 2 1 t(! [ 1) (! [ 1) (! [ 2) 1 t [ (B2 ] w2 w2 ] w2 w2) [ B2 t ! w1 w5 ] w22 [ 2! (w22 ] w23 ] w2) 4 1 6 1 7 ! 8n x 4n x t t t 1 w w [ B w w t t 2 3 4n x 1 6 t t 1 t t w w [ B w w 2 4 4n x 1 7 F \t t, w t 1 t w w [ B B 2]w w ]w w t t 3 6 4 7 2 5 4n x x w 1 t t w w w [B 3 t t 2 6 xw 1 t t w t t w w [B 4 2 7 xw T U 1
A
B
(2.9)
We notice that the components of U and F are merely algebraic relations involving the components of W . We denote the jump in the variables from left to right by the preÐx * so that for a general variable denoted by a dot here we have *(É) \ (É) [ (É) . Then for arbitrary jumps of any variables or combinations of variables we have the following algebraic L identitiesR: *(p ] q) \ *p ] *q ,
(2.10)
*(pq) \ q6 *p ] p6 *q ,
(2.11)
*(1/q) \ [ *q/q*2 ,
(2.12)
*(p/q) \ [ (p6 /q*2)*q ] (q6 /q*2)*p ,
(2.13)
*(p2q2) \ 2Sp2Tq6 *q ] 2Sq2Tp6 *p ,
(2.14)
122
BALSARA
Vol. 116
where q6 4 1 (q ] q ) , (2.15) 2 R L q* 4 (q q )1@2 \ (q6 2 [ 1 *q2)1@2 , (2.16) R L 4 Sq2T 4 1 (q2 ] q2) \ q6 2 ] 1 *q2 . (2.17) 2 R L 4 It is worth noting that equations (2.10)È(2.17) are valid for arbitrary values for *p and *q. When *p and *q ] 0 these equations reduce to the appropriate ones from di†erential calculus. Any jump of arbitrary magnitude in the space of the vectors U and F can, therefore, be represented as a jump in the space of the vector W . Thus we can set *U \ B3 *W ,
(2.18)
*F \ C3 *W ,
(2.19)
A3 \ C3 B3 ~1 ,
(2.20)
where the above three relations deÐne the matrices B3 , C3 , and A3 . The analytic expressions for the matrices B3 and C3 are given below. Since explicit expressions for the eigenvalues and eigenvectors will be given in the following subsections it is not necessary to evaluate the matrices A3 or C3 numerically when solving the linearized Riemann problem. B3 is given by 0 0 0 0 0 0 q 2w6 1 t w6 0 0 0 0 0 w6 1 t w6 2 0 w6 0 0 0 0 1 t w6 3 0 0 0 0 0 w6 1 4 B3 \ t 1 t 1 w6 ] d ! [ 1 w6 d d w6 d d 1 6 7 5 1 2 3 4 ! ! ! t 6 6 0 0 0 0 0 w t w6 1 s w6 0 0 0 0 0 w6 7 1
n t t t t, t t t p
(2.21)
and C3 is given by w6 0 0 0 0 0 q w6 2 n 1 t! [ 1 t !]1 ![1 w6 [d [d w6 [d [d t ! w6 5 [ d1 t 2 3 4 1 6 7 ! ! t [B t [B x w6 x t t w6 w6 0 0 0 3 2 4n t 4n 6 t [B t [Bx w6 x w6 t w6 0 w6 0 0 4 2 C3 \ t 4n 7 4n 1 t , t B2 w6 t B2 w6 [B [B [B [B 2 x w6 x w6 x w6 x w6 t w6 [ x 1 w6 t 4nx w*2 5 4n w*2 6 7 2 3 4 4n 4n 4n 4n 1 1 t t w6 w6 1 t B 3 t w6 [B 0 0 w6 0 6 x w*2 2 t x w*2 t 1 1 w6 t B w6 4 t 1 w6 0 [B 0 0 w6 7 x w*2 2 s x w*2 p 1 1
(2.22)
where ![2 1 (Sw2T ] Sw2T)w6 , 6 7 1 ! 4n
(2.23)
d 4 3
![1 w6 , 3 !
(2.24)
d 4 4
![1 w6 , 4 !
(2.25)
d 4 6
![2 1 Sw2Tw6 , 1 6 ! 4n
(2.26)
d 4 7
![2 1 Sw2Tw6 . 1 7 ! 4n
(2.27)
d 4 1
No. 1, 1998
LINEARIZED FORMULATION OF RIEMANN PROBLEM
123
To solve the linearized system in equation (1.1) we need to solve the generalized eigenvalues problem give by (C3 [ jB3 )r \ 0 ,
(2.28)
where j is the eigenvalue and r is the corresponding right eigenvector. Equation (2.28) yields a characteristic equation that is a factorizable seventh-order polynomial in j. Writing it out explicitly yields no further insight, and hence we do not do that here. In subsequent sections we give explicit expressions for the eigenvalues and the corresponding right eigenvectors r of the generalized eigenvalue problem given above. The right eigenvectors of the matrix A3 can be obtained by right-multiplying the matrix B3 by these eigenvectors. The resulting equations can be expressed in a much more compact and intuitively obvious notation if we make the following auxiliary deÐnitions : w6 w6 4 2,3,4 h8 4 5 , (2.29) w6 w6 1 1 6 B w b8 x b8 4 6,7 b8 4 (b8 2 ] b8 2)1@2b 4 y,z , b8 4 (2.30) x J4nw* y,z (4n)1@2 M y z y,z b8 M 1 1 1 1 w*2 1 w*2 w6 1 w6 2 w6 2 w6 2 1 (Sw2Tw6 2 ] w6 2Sw2T) ] 1 (Sw2Tw6 2 ] w6 2Sw2T) , 2] 3] 4 [ B2 ] c8 2 4 (! [ 1) 5 [ x 2 w6 2 1 6 1 6 1 7 1 7 4n w*2 2 w6 2 w6 2 w6 2 w2 w6 2 1 1 1 1 1 1 1 1 1 *w2 8 1 1 b2 [ (*w2 ] *w2) . (2.31) 4 (! [ 1) h8 [ (v2 ] v8 2 ] v8 2) [ b8 2 [ b8 2 [ y z x M 8 w6 2 M 32n 6 7 2 x 1 It is easy to see that v8 in equation (2.29) are the analogs of the velocities in the three directions. Similarly b8 in equation (2.30) are the analogs x,y,z of the Alfven speeds in the three directions. When the left and right states U and U arex,y,z di†erent, v8 and b8 are density-weighted averages of the velocities and the x-component of the Alfven speedLin theseR two states. Onx,y,z the other xhand, b8 are arithmetic averages of the y- and z-components of the Alfven speed in the left and right states. When the left and right y,z states are the same, v8 and b8 reduce to their ordinary meanings. As usual (see Roe & Balsara 1996), when x,y,z x,y,z equation (2.7) closely it is easy to see that equation (2.31) is the analog of a (b8 2 ] b8 2)1@2 ] 0 we set b \ 1/21@2. On examining y z y,zgoes even further. Writing the eigenvalue j in equation (2.28) as sound speed. The analogy j \ v8 ^ j8 , (2.32) B x It will be shown in the ensuing subsections that the characteristic equations for j8 for the Alfven waves, the magnetosonic waves, and the entropy wave in our linearized formulation of the MHD Riemann problem are very analogous to the characteristic equations for the ideal MHD equations (see Roe & Balsara 1996). This is neither obvious nor natural. It is very easy to choose alternative forms for the parameter vector, equation (2.5), which do not have this very desirable property. v8
G C
A
B
x,y,z
C
DH
D
3.
EXPLICIT FORM OF THE EIGENVECTORS OF THE LINEARIZED RIEMANN SOLVER
In the next three subsections we present the explicit form of the eigenvectors for Alfven waves, the fast and slow family of magnetosonic waves, and the entropy wave. 3.1. Alfve n W aves For the Alfven waves we have (3.1) j8 \ o b8 o . x Equation (3.1) reinforces our identiÐcation of b8 as an Alfven speed in equation (2.30). Alfven waves of arbitrary strength do x not change the density and x-component of velocity. They do, however, change the transverse components of the velocity. In so doing they change the total energy. Thus we expect the Ðrst two components of the right eigenvector to be zero. The Ðfth component of the right eigenvector can, however, be nonzero since it corresponds to the energy of the system. In the derivation of the Alfven wave eigenvalues, equation (3.1), and eigenvectors, equation (3.2) below, we are signiÐcantly helped by the physical fact that, for an Alfven wave, the changes in the transverse magnetic Ðeld are orthogonal to the direction of the transverse magnetic Ðeld. Indeed we Ðnd that the right eigenvectors are given by
c d
0 0 b z [b , (3.2) r \ y BA (v8 b [ v8 b ) y z z y