Numerical Simulation of Unsteady MHD Flows and Applications: R. Abgrall, R. Huart, P. Ramet
Numerical Simulation of Unsteady MHD Flows and Applications: R. Abgrall, R. Huart, P. Ramet
B
2
2
0
and E the total energy.
We may note from now on that we wont make any use of the total pressure,
usually called P = p +
B
2
2
0
, in order to avoid confusions. In the rest of this paper,
we will drop the magnetic permeability
0
by assuming that the magnetic eld B
has been normalized in this way : B :=
B
0
.
We start with the conservative form of the Ideal MHD equations, adding
another equation which is not explicitly included in this system : the Maxwell-
ux equation div B = 0. Many ideas were found to ensure this constraint during
the simulations. Mainly two techniques among them revealed to give good results
1. Building divergence-free elements by a collocation method, consisting in stor-
ing the magnetic eld values on the faces/edges of each element (for a vertex-
centered approach),
2. Introducing some correction terms by modifying the system of equations and
adding a scalar variable representing the divergence of the magnetic eld.
The rst approach has shown to ensure a very accurate zero divergence. How-
ever, this technique is not suitable in a Residual Distribution framework. The use
of a correcting variable coupled to the equations was then the best choice. Follow-
ing the works of Dedner, Munz et al. [2], we modied the system
t
+ (u) = 0
(u)
t
+
_
uu
t
+
_
p +
B
2
2
_
Id BB
t
_
= 0
E
t
+
__
E +p +
B
2
2
_
u (u B) B
_
= 0
B
t
+
_
uB
t
Bu
t
+Id
_
= 0 (1a)
t
+c
h
2
B =
c
h
2
c
p
2
(1b)
Both classical and new systems can be reformulated in a quasi-linear form in-
volving diagonalizable Jacobean matrices. This means they are hyperbolic systems
of PDEs, as we only need to work with real quantities.
U
t
+K U = 0
where K = (A B C)
t
is a vector of Jacobian matrices, U being the vector of the
conservative variables.
Considering an arbitrary direction n, we are interested in studying K
n
, the
projection of the Jacobian matrices. The eigenvalues of K
n
for the corrected
system consist of the classical transport, slow and fast magneto-sonic and Alfvn
2
waves, and of new divergence waves. Respectively
1
= u
n
,
s
= u
n
c
s
,
f
= u
n
c
f
,
a
= u
n
c
a
,
h
= c
h
where u
n
is the dot product of the
velocity and the vector n.
Noting a =
_
p
, b =
_
B
2
and b
n
=
Bn
1
2
_
a
2
+b
2
_
(a
2
+b
2
)
2
4a
2
b
n
2
_
, c
f
=
1
2
_
a
2
+b
2
+
_
(a
2
+b
2
)
2
4a
2
b
n
2
_
and c
a
= b
n
.
Remark 2.1 Alfvn waves only appear in the three-dimensional case.
As we may need some characteristic decompositions in the numerical methods,
we are also looking for the full eigensystem of K
n
, that is to say the left and right
eigenvectors. Unfortunately, the direct formal calculation of these vectors is really
complex. It was early found [6] that the Ideal MHD system could be symmetrized
by adding some source terms proportional to B, hence not modifying the
physical solutions of the equations.
For the corrected system, adding the same source terms doesnt make it sym-
metrizable. In fact, if we look at the last two eigenvalues, we note that the system
does not even achieve Galilean invariance. Then, in [2], the authors proposed to
add some symmetrizing terms so that this last property be recovered, depending
on the gradient of .
Moreover, as we make unsteady computations, the time t truly denotes the
physical time and we aim to get a divergence-free solution at each physical time
step. Then we drop the time derivative from the last equation (1b), which actually
corresponds to the converged form of the equation : B =
c
p
2
. This will
provide a denition of our numerical divergence.
The Jacobian K
n
of the symmetrizable system is
K
n
=
_
_
_
_
_
_
_
0 n
t
0 0
t
0
( 1)
u
2
2
n u
n
u (1 )nu
t
+un
t
+u
n
Id ( 1)n (2 )nB
t
B
n
Id 0
(K
n
)
5,1
H
n
t
+ (1 )u
n
u
t
B
n
B
t
u
n
(2 )u
n
B
t
B
n
u
t
B
n
B
n
uu
n
B
Bn
t
B
n
Id
0 u
n
Id n
0 0
t
0 c
h
2
n
t
u
n
_
_
_
_
_
_
_
where H = E +p +
B
2
2
is the enthalpy, c =
_
p
n
)
5,1
= u
n
_
( 1)
u
2
2
H
_
+
B
n
u B.
As we said the system was verifying Galilean invariance (well see it after the
symmetrization), the last eigenvalue has become
h
= u
n
c
h
.
2.2. A note on the role of . Like in [2], we prefer using the generalized
Lagrange Multiplier (GLM) approach with a mixed hyperbolic-parabolic correc-
tion. It oers both transport and dissipative (smoothing) properties, which can
be seen by rewriting the last equation in terms of . First, one has to note that
the divergence of equation (1a) gives
t
( B) + = 0.
Then, taking the time derivative of equation (1b), we get the Telegraph equation
t
2
+
c
h
2
c
p
2
t
c
h
2
= 0. (2)
3
Consequently, the ratio
c
h
c
p
gives a control on the balance between parabolic and
hyperbolic behaviors.
2.3. Symmetrization Starting from the symmetrizable system, we followed
Jamesons work [7] to get a set of symmetrizing variables W satisfying
dW =
_
dp
c
2
,
c
du,
c
dv,
c
dw,
dp
c
2
d,
c
dB
x
,
c
dB
y
,
c
dB
z
,
c
d
c
h
_
t
.
Denoting h =
c
2
1
+
u
2
2
and =
1
c
2
, the transformation matrices
U
W
and
W
U
are easily found. The symmetrized Jacobian is given by K
s
=
W
U
K
n
U
W
K
s
=
_
_
_
_
_
_
_
u
n
cn
t
0 0
t
0
cn u
n
Id 0
nB
t
B
n
Id
0
0 0
t
u
n
0
t
0
0
Bn
t
B
n
Id
0 u
n
Id c
h
n
0 0
t
0 c
h
n
t
u
n
_
_
_
_
_
_
_
Here we see clearly that Galilean invariance is achieved, as K
s
= u
n
Id +
K
s
|
u
n
=0
. We are then able to calculate the full eigensystem of this matrix, and so
of K
n
.
2.4. The numerical scheme. Our framework is the RD approach, which
principles are known as
1. Integrating the unsteady equations over the contour of an element T to get
the so-called residual
T
,
2. Distributing it to each node of the element
T
i
,
3. For each node of the mesh, adding all partial residuals and solving
T,iT
T
i
= 0.
Details can be found in [4], we only recall here the more important points and how
they adapt to the MHD equations.
While the rst step basically relies on a quadrature formula conditioning the
formal accuracy of the whole scheme, all RD schemes dier from each other by
their second step. For our purpose, we only deal with the Rusanov scheme. The
pure one consists in distributing the residuals in the following way
T
i
=
1
N
s
_
_
T
+
jT
(U
i
U
j
)
_
_
where N
s
is the number of nodes in the element and is the maximum of all
the eigenvalues of K
n
(not K
n
!). Since strongly conditions the behavior of the
scheme, we have to take care about the value we impose for c
h
: it shouldnt not be
greater than the fastest physical wave. Here, it means we have to choose c
h
< c
f
.
We prefer another denition for the unsteady Rusanov scheme
T
i
=
1
N
s
_
_
_
u
h
t
_
i
+
_
T
div F(U) +
jT
(U
i
U
j
)
_
_
(3)
4
This distribution has very interesting properties [4]. Of course, it is necessarily
conservative as
iT
T
i
=
T
. But its main advantage remains in its strong
positivity, ensured by the choice of , making it capturing shocks very well and in
a monotonic manner.
For the time discretization, we choose the Gear implicit scheme so that we
get, in the case of a constant time step t
_
u
h
t
_
Gear
i
=
3
2
U
n+1
i
U
n
i
t
1
2
U
n
i
U
n1
i
t
T
i
=
1
N
s
_
_
_
u
h
t
_
Gear
i
+
_
T
div F(U)
n+1
+
jT
(U
n+1
i
U
n+1
j
)
_
_
However, it results in a rst order scheme. In order to get, formally, the
second order of accuracy, we have to turn it into a modied nonlinear scheme [4].
First, let us recall that all RD schemes can be rewritten like it :
T
i
=
T
i
T
.
The idea is to modify
T
i
so that we ensure it is bounded, and then we know that
T
i
and
T
are of the same order of accuracy, e.g. second order if the quadrature
formula is so. This nonlinear process is called the Limitation. The bounding of
these coecients also improves the monotonicity of the solution. In fact, we can
still improve this by projecting the residuals
T
i
in the basis of the eigenvectors
of K
n
, which provides better conditioned
T
i
. However, the limitation application
does not preserve the solenodal character of the magnetic eld, and that is why
the correction technique is absolutely necessary even in simple test cases : with
its use, the method eectively converges to a divergence-free behavior.
Second, we have to ensure that the convergence of the algorithm chosen for the
third step will be good enough. In other words, we want a good conditioning for
the system to solve. A way to do that, is to add a SUPG-like term S
T
i
providing an
upwind bias to our discretization [4]. Indeed, the basic distribution of the Rusanov
scheme doesnt respect upwinding and we have no control on it. Thats why it
may be even possible that a node doesnt receive information at all from the
surrounding elements. Nevertheless, as the eect of this term is also to smooth
out the regular solutions, we dont apply this near discontinuities. In fact we
use a shock sensor
T
. This addition is called the Stabilization. One possible
expression is S
T
i
=
T
d
K
i
N
T
, where d is the number of space dimensions and
N is the matrix of the Narrow scheme (see e.g. [1]), for which the knowledge of
the eigensystem is required. The limited and stabilized Rusanov scheme,
T
i
=
_
Rus
i
_
T
+S
T
i
, achieves second order of accuracy when converged.
We recall that we expect, like in [3], that the use of the symmetrizable (non-
conservative) system in the limitation and the stabilization, instead of the eigen-
system of the conservative equations (actually solved), should not aect the quality
of the solution.
The third step, gathering all the signals and nding the zero for each node-
associated problem, is performed by mean of an iterative Newton method, which
solves a linear problem in each iteration.
3. Results
3.1. The Rotor problem This test, taken from [8], involves strong oblique
Alfvn waves rising from a rotating high density region in the center of the domain.
At the beginning, the ambient uid is light and static. The whole domain is under
5
the eect of an initially uniform magnetic eld in the x-direction. The problem
takes place in a two dimensional unit square containing 200200 cells. The two
parts of the plasma have the same pressure p = 1, magnetic eld B
x
= 5 and
B
y
= 0. The central region, inside a radius r = 0.1, has a 10 units density and
spins at a constant rotating speed = 2. From r = 0.1 to 0.115, the density
decreases linearly from 10 to 1, so that we have no real discontinuity (to avoid
a strong shock). The ratio of specic heats is = 1.4, and we set c
h
= 1 and
c
p
= 10. On Figure 1, we show the solution at time 0.18, when the waves reach
the boundary (arbitrarily considered as opened).
(a) Density. (b) Magnetic pressure.
(c) Velocity. (d) Pressure.
Figure 1: A rotor involving torsional waves.
3.2. The Blast problem Also inspired from [8], this simulation introduces
a very strong shock wave coming from a central high pressure zone. We use the
same mesh as before. The plasma is entirely exposed to a strong magnetic eld
along the x-direction so that the particles, for most of them, are constrained to
move parallel to it. Hence we expect to get two fronts moving along x until they
reach the opened boundaries. Initially, the uniform magnetic eld is B
x
= 100
and B
y
= 0, the density is 1 and the velocity vector 0 everywhere. Inside the
central zone, inside a radius r = 0.1, we set the hydrodynamic pressure p = 1000,
which falls immediately to 0.1 outside this region. We keep the same and we
set c
h
= 10 and c
p
= 100. In Figure 2, we show the solution at time 0.1. This
problem has been run without stabilization, causing the solution to wiggle a little.
4. Conclusion and prospectives We have got an ecient solver for 2D
Ideal MHD problems. However, more tests will be necessary, and we will look for
6
(a) Density. (b) Magnetic pressure.
(c) Velocity. (d) Pressure.
Figure 2: A blast explosion with fast shock waves.
possible improvements of the stabilization procedure. The code is also expected
to work in three dimensional cases. We started to implement the resistive MHD
equations by using a Continuous Galerkin method, which has not been tested yet.
We aim at simulating plasma instabilities for ITER congurations.
Acknowledgements We really want to thank M. Ricchiuto and A. Larat
from INRIA for their support during all this work. This project has been nanced
by the ANR CIS ASTER (http://aster.gforge.inria.fr/index.html).
References
1. R. Abgrall. Toward the ultimate conservative scheme : following the quest. J.
Comput. Phys., vol. 167 (2001), pp. 277315.
2. A. Dedner, et al. Hyperbolic divergence cleaning for the mhd equations. J. Com-
put. Phys., vol. 175 (2002), pp. 645673.
3. A. Csik. Upwind residual distribution schemes for general hyperbolic conservation
laws and application to ideal magnetohydrodynamics. Ph.D. thesis, Katholieke Uni-
versiteit Leuven, 2002.
4. R. Abgrall. Essentially non oscillatory residual distribution schemes for hyperbolic
problems. J. Comput. Phys., vol. 214 (2006), no. 2, pp. 773808.
5. K. G. Powell, et al. An upwind scheme for magnetohydrodynamics. J. Comput.
Phys., vol. 154 (1999), pp. 284309.
6. S. K. Godunov. Nonlinear hyperbolic problems : Proceedings of an advanced re-
search workshop. In C. Carasso, P. A. Raviart, and D. Serre, editors, Lecture
Notes in Mathematics (Springer-Verlag, Berlin, 1987), vol. 1270.
7. A. Jameson. Eigenvalues, eigenvectors and symmetrization of the magneto-
hydrodynamic (mhd) equations. Tech. rep., AFSOR, 2006.
8. D. S. Balsara and D. S. Spicer. A staggered mesh algorithm using high order
godunov uxes to ensure solenoidal magnetic elds in magnetohydrodynamics simu-
lations. J. Comput. Phys., vol. 149 (1999), pp. 270292.
7