Brought to you by:

On the Measurements of Numerical Viscosity and Resistivity in Eulerian MHD Codes

, , , , and

Published 2017 June 13 © 2017. The American Astronomical Society. All rights reserved.
, , Citation Tomasz Rembiasz et al 2017 ApJS 230 18 DOI 10.3847/1538-4365/aa6254

Download Article PDF
DownloadArticle ePub

You need an eReader or compatible software to experience the benefits of the ePub3 file format.

0067-0049/230/2/18

Abstract

We propose a simple ansatz for estimating the value of the numerical resistivity and the numerical viscosity of any Eulerian MHD code. We test this ansatz with the help of simulations of the propagation of (magneto)sonic waves, Alfvén waves, and the tearing mode (TM) instability using the MHD code Aenus. By comparing the simulation results with analytical solutions of the resistive-viscous MHD equations and an empirical ansatz for the growth rate of TMs, we measure the numerical viscosity and resistivity of Aenus. The comparison shows that the fast magnetosonic speed and wavelength are the characteristic velocity and length, respectively, of the aforementioned (relatively simple) systems. We also determine the dependence of the numerical viscosity and resistivity on the time integration method, the spatial reconstruction scheme and (to a lesser extent) the Riemann solver employed in the simulations. From the measured results, we infer the numerical resolution (as a function of the spatial reconstruction method) required to properly resolve the growth and saturation level of the magnetic field amplified by the magnetorotational instability in the post-collapsed core of massive stars. Our results show that it is most advantageous to resort to ultra-high-order methods (e.g., the ninth-order monotonicity-preserving method) to tackle this problem properly, in particular, in three-dimensional simulations.

Export citation and abstract BibTeX RIS

1. Introduction

Every Eulerian MHD code introduces numerical errors during the integration of an MHD flow because of unavoidable errors resulting from the spatial and time discretization of the problem. These errors can manifest themselves in two ways. They can either smear out the solution (numerical dissipation) or introduce phase errors (numerical dispersion). Because the mode of action of numerical dissipation resembles that of physical viscosity and, for magnetized flows, also of resistivity, they are commonly referred to as numerical viscosity and numerical resistivity, respectively (see, e.g., Laney 1998, Chap.14, and Bodenheimer et al. 2006, Chap. 8.3).

A necessary condition for a physically reliable simulation is that the amount of numerical viscosity and resistivity be sufficiently small. If this requirement is violated, numerical errors can change the solution not only quantitatively, but even qualitatively. For example, Obergaulinger et al. (2009) found that the tearing mode (TM) instability (Furth et al. 1963; FKR63 hereafter) developed in their 2D ideal MHD simulations of the magnetorotational instability (MRI; Balbus & Hawley 1991) in core-collapse although the TM instability supernovae. However, TM instabilities should only grow in resistive MHD. Thus, it must have developed due to numerical resistivity (as pointed out by the authors).

This problem becomes even more exacerbated in relativistic (magneto)-hydrodynamics, since the jumps of physical variables across strong shocks are no longer limited in magnitude, and both linearly degenerate and nonlinear eigenfields degenerate when the flow velocities approach the speed of light (Mimica et al. 2009).

The collapsed core of a massive star is yet another physical application where viscous and resistive effects can definitively shape the outcome after core collapse, i.e., whether a failed or successful supernova explosion results. Abdikamalov et al. (2015) estimate that the Reynolds number in the gain layer (where neutrino heating is stronger than neutrino cooling) can be huge ($\sim {10}^{17}$), resulting in a fully turbulent flow in that region. This turbulence may generate anisotropic stresses on the flow that definitely help in the supernova shock revival (Murphy et al. 2013; Couch & Ott 2015). In this context, convection (Burrows et al. 1995; Herant 1995; Janka & Müller 1996; Foglizzo et al. 2006), the growth of the magnetic field induced by the MRI (Akiyama et al. 2003; Obergaulinger et al. 2006; Cerdá-Durán et al. 2007; Sawai et al. 2013; Mösta et al. 2015; Rembiasz et al. 2016b, 2016a; Sawai & Yamada 2016), and its interplay with buoyancy (Obergaulinger et al. 2009, 2014; Guilet & Müller 2015) are (magneto-)hydrodynamic instabilities whose numerical treatment crucially depends on the amount of numerical viscosity and resistivity of the algorithms employed.

As the magnitude of numerical viscosity and resistivity is a priori unknown in a given simulation, one has to perform convergence tests to determine upper limits for these quantities. However, convergence tests are not always performed in the case of 3D simulations because of a high computational cost. Therefore, it would be valuable to have some way of assessing the importance of numerical viscosity and resistivity for a given system. One would also like to know whether the dominant source of the numerical dissipation are spatial discretization errors or time integration errors.

In this paper, we propose a simple ansatz and a corresponding calibration method to estimate the numerical resistivity and viscosity of any Eulerian MHD code by investigating the dependence of the numerical resistivity and viscosity on both the numerical (i.e., grid resolution, Riemann solver, reconstruction scheme, time integrator) and physical setup of a simulation. To this end, we performed simulations of the propagation of (magneto)sonic waves and Alfvén waves, and of the TM instability. By comparing the results of our simulations with analytical solutions of these resistive-viscous MHD flow problems and an empirical ansatz for the TM growth rate, we are able to quantify the magnitude of the numerical resistivity and viscosity.

We do not consider the effects of numerical dispersion (see, however, Peterson & Hammett 2013), because this would be beyond the scope of this work. Hence, our study should be considered as a first step to better understand the mode of action of numerical viscosity and resistivity in MHD simulations, and provide a quantitative measure of the magnitude of the corresponding errors.

In Section 2, we present the key idea of our ansatz to quantify the numerical viscosity and resistivity of an MHD code, and we describe the code Aenus, used for our simulations in Section 3. Although we calibrate the numerical viscosity and resistivity for a specific code only, the method is general and independent of Aenus. As a service to the community, we provide the data from our tests online3 to facilitate comparisons with other codes. In Section 4, we present a methodology to compute numerical viscosity and resistivity based on the results of numerical simulations of several MHD flows encompassing the propagation of fast magnetosonic waves, Alfvén waves, sound waves, and of the TM instability. In Section 5, we present an example of the application of our methodology. Finally, in Section 6, we summarize and discuss our results.

2. Numerical Resistivity and Viscosity

2.1. Numerical Integration of the MHD Equations

The equations of resistive-viscous (non-ideal) magnetohydrodynamics (MHD) can be written as

Equation (1)

Equation (2)

Equation (3)

Equation (4)

Equation (5)

where ${\boldsymbol{v}}$, ρ, η, and ${\boldsymbol{b}}$ are the fluid velocity, the density, a uniform resistivity, and the magnetic field, respectively, expressed in Heaviside–Lorentz units. The total energy density, e, is composed of fluid and magnetic contributions, ${e}_{\star }=\varepsilon +\tfrac{1}{2}\rho {{\boldsymbol{v}}}^{2}+\tfrac{1}{2}{{\boldsymbol{b}}}^{2}$, where ε and $p=p(\rho ,\varepsilon ,...)$ are the internal energy density and the gas pressure, respectively. The stress tensor ${\boldsymbol{T}}$ is given by

Equation (6)

where ${\boldsymbol{I}}$ is the unit tensor, and ν and ξ are the kinematic shear and bulk viscosity, respectively.

The system of partial differential equations (PDEs) given by Equations (1)–(3) is expressed in conservation form

Equation (7)

where ${\boldsymbol{U}}$ is the vector of conservative variables and ${\boldsymbol{ \mathcal F }}$ is the matrix of the fluxes associated with those variables. For simplicity, we do not consider in this work source terms in the equations.

There exist powerful techniques to integrate numerically hyperbolic systems of conservation laws including a correct treatment of flow discontinuities (e.g., LeVeque 1992; Toro 1997; Laney 1998; LeVeque 2002). Among the most popular techniques are Eulerian methods, which rely on a numerical discretization of the solution (typically in finite volumes) on a fixed, i.e., Eulerian grid. The numerical solution of the discretized system of PDEs differs from its exact solution by an amount that we call the numerical error of the solution. This numerical error can be interpreted as the sum of numerical dissipation and numerical dispersion, which are not present in the original system of hyperbolic equations. The purpose of this work is to characterize this numerical dissipation and to assess whether it can be interpreted as numerical viscosity or as numerical resistivity for magnetized flows.

2.2. A Simple Example

To illustrate the concept of numerical viscosity and resistivity, we present an example of a one-dimensional conservation law for a scalar quantity without external sources

Equation (8)

where $u(x,t)$ is the conserved variable and $f(u)$ is the flux. Given its value at t = 0, $u(0,x)={u}_{0}(x)$, this equation can be integrated to obtain its solution at any later time.

The numerical solution of Equation (8) can be obtained discretizing the time and spatial derivatives. Hence, the numerical version of Equation (8) reads

Equation (9)

where the subscript "num" means that a given derivative is determined numerically, and ${u}^{* }(x,t)$ is a function approximating the solution.

Let us consider a spatial and time discretization of the orders r and q, respectively. Hence, the numerical approximations of the spatial and time derivatives differ from the analytical ones by terms of the order ${ \mathcal O }({\rm{\Delta }}{x}^{r})$ and ${ \mathcal O }({\rm{\Delta }}{t}^{q})$ or higher, respectively. In this case, Equation (9) reads

Equation (10)

where ar and bq are coefficients that depend on the spatial and time discretization, and $f^{\prime} ={df}(u)/{du}$, whose analytic expression is not necessarily known. This equation for u* differs from Equation (8) in terms that are proportional to powers of ${\rm{\Delta }}x$ and ${\rm{\Delta }}t$. Hence, in the limit ${\rm{\Delta }}x\to 0$ and ${\rm{\Delta }}t\to 0$, u* and u coincide. However, at finite resolution, the additional terms arising from the discretization may change the character of the equation, which, in certain regimes, may change the hyperbolic system into a parabolic one. To show the consequences more explicitly, we consider two examples.

In the first example, we examine a method with r = 1 (e.g., using piecewise constant reconstruction, as in Godunov's method) and a time integrator with $q\gt 2$. In this case,

Equation (11)

where all third- or higher-order terms are grouped into ${ \mathcal O }(3)$. The terms proportional to ${\partial }_{{xx}}{u}^{* }$ and ${\partial }_{{xxx}}{u}^{* }$ are usually referred to as numerical dissipation and numerical dispersion, respectively. For wave-like solutions of the form $\exp [i(\omega t-{kx})]$, the dispersion relation reads

Equation (12)

where ${ \mathcal R }(\omega )$ and ${ \mathcal I }(\omega )$ are the real and imaginary parts of ω, respectively. The dissipative and dispersive character can be explicitly seen by computing the dissipation rate ${\sigma }_{\mathrm{dis}}$ and the phase velocity ${v}_{\mathrm{ph}}$ of the wave. These quantities are obtained by identifying the two terms in Equation (12) with the respective spatial derivate of u* in Equation (11):

Equation (13)

Equation (14)

In the second example, we consider an explicit time integration method with q = 1 (e.g., the forward Euler method) and $r\gt 1$. In this case, keeping only first order terms for simplicity,

Equation (15)

where we used ${\partial }_{{tt}}{u}^{* }-f{^{\prime} }^{2}{\partial }_{{xx}}{u}^{* }-2f^{\prime} f^{\prime\prime} {({\partial }_{x}{u}^{* })}^{2}={ \mathcal O }(1)$ to eliminate second-order time derivatives. As in the previous example, we consider wave-like solutions, keeping only terms linear in the amplitude of the perturbations, which results in the following dispersion relation:

Equation (16)

The resulting error also acts as numerical dissipation (proportional to k2).

In this work, we focus on the measurement of numerical dissipation in single-scale problems, where the distinction between dissipation and hyperdissipation is of minor importance. However, one should bear in mind that this distinction is important if the estimates presented in this work are applied to multi-scale problems.

2.3. An Ansatz for Numerical Viscosity and Resistivity

Following the reasoning of the previous section, one can try to estimate the importance of the additional terms arising from the numerical discretization of the MHD equations. The additional terms in (2)–(4) are commonly called numerical viscosity and numerical resistivity, since these terms modify the dynamics of the system in a similar way as physical viscosity and resistivity. This is especially valid for flux-conservative methods, in which numerical discretization does not introduce non-conservative terms in the equations (i.e., sources) and similarities with physical viscosity and resistivity are accentuated.

A detailed analysis of the numerical errors is, in general, a challenging task. Here, we will perform an error analysis in a simplified manner. We will not discriminate between numerical dissipation and dispersion, but simply assume that all spatial discretization errors and time integration errors only contribute to numerical dissipation, i.e., to numerical viscosity and resistivity.

Based on the discussion above and the simple tests of the previous section, we propose an ansatz for the numerical viscosity and resistivity of an MHD code that depends on the discretization scheme and the grid resolution used in a simulation.

In the CGS units, both resistivity and kinematic viscosity have the dimension of $[{\mathrm{cm}}^{2}\,{{\rm{s}}}^{-1}]$, hence their numerical counterparts must have the same dimension. The most natural ansatz for, say, the numerical shear viscosity then has the form ${\nu }_{* }\propto { \mathcal V }{ \mathcal L }$, where ${ \mathcal V }$ and ${ \mathcal L }$ are the characteristic velocity and length of a simulated system, respectively. The determination of ${ \mathcal V }$ and ${ \mathcal L }$ is not an easy task in general, since it is problem dependent, as we will show in the subsequent sections.

Let us consider a one-dimensional (1D) MHD simulation. Because numerical errors arise from the spatial (${\rm{\Delta }}x$) and temporal discretization (${\rm{\Delta }}t$), these terms should be proportional to ${({\rm{\Delta }}x)}^{r}$ and ${({\rm{\Delta }}t)}^{q}$, where r and q depend on the order of the numerical schemes. Since ${\rm{\Delta }}x$ has the dimension $[\mathrm{cm}]$, ${({\rm{\Delta }}x)}^{r}$ should be multiplied by ${{ \mathcal L }}^{-r}$. The resulting term ${({\rm{\Delta }}x/{ \mathcal L })}^{r}$ has a simple interpretation: the more zones used to resolve the characteristic length, the lower the numerical viscosity. The same argumentation holds for time integration errors, which should enter the ansatz in the form of ${({\rm{\Delta }}t{ \mathcal V }/{ \mathcal L })}^{q}$. Therefore, the ansatz for the numerical shear viscosity ${\nu }_{* }$ should read

Equation (17)

where ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}$, ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}t}$, r, and q are constants for a given numerical scheme.

Using the CFL factor definition for an equidistant grid, Equation (17) can be rewritten as

Equation (18)

where ${v}_{\max }$ is the maximum velocity of the system limiting the time step. If ${ \mathcal V }={v}_{\max }$, Equation (18) simplifies to

Equation (19)

Note that time and spatial discretization contribute to different derivatives, provided $r\ne q$.

The same ansatz should hold for the numerical bulk viscosity ${\xi }_{* }$ and the resistivity ${\eta }_{* }$, with the coefficients ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$, ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}t}$, and ${{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$, ${{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}t}$, respectively:

Equation (20)

Equation (21)

where we assume that r and q have the same values as in Equations (17)–(19). Once the unknown coefficients ${\mathfrak{N}}$, r, and q are determined, the above ansatz can be used to estimate the numerical resistivity and viscosity in any simulation performed with the same code. Throughout this paper, we will differentiate between the measured order of a numerical scheme, r and q, and its theoretically expected value, i.e., ${r}_{\mathrm{th}}$ and ${q}_{\mathrm{th}}$. For example, for a fifth-order accurate reconstruction scheme ${r}_{\mathrm{th}}=5$, and for a third-order accurate time integrator ${q}_{\mathrm{th}}=3$. However, when fitting simulation data, r and q are always assumed to be fit parameters and not a priori known constants (see Table 1).

Table 1.  Wave Damping Simulations I

Series Wave Reco Riemann Time CFL Resolution ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}$ r ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}$ q
#S1 sound PL HLL RK4 0.01 64...1028 14.3 ± 0.7 3.049 ± 0.009
#S2 sound MP5 LF RK4 0.01 8...256 42.9 ± 2.3 4.957 ± 0.013
#S3 sound MP5 HLL RK4 0.01 8...256 43.4 ± 2.5 4.961 ± 0.014
#S4 sound MP5 HLLD RK4 0.01 8...256 42.7 ± 2.2 4.956 ± 0.013
#S5 sound MP7 HLL RK4 0.01 8...64 302 ± 20 6.897 ± 0.021
#S6 sound MP9 HLL RK4 0.01 8...32 830 ± 340 8.42 ± 0.15
#S7 sound MP9 HLL RK3 0.5 8...256 1.492 ± 0.013 2.985 ± 0.002
#S8 sound MP9 HLL RK3 0.1...0.9 64 2.45 ± 0.17 2.95 ± 0.01
#S9 sound MP9 HLL RK4 0.5 8...32 71 ± 32 5.5 ± 0.2
#A1 Alfvén MP5 LF RK4 0.01 8...256 42 ± 3 4.95 ± 0.02
#A2 Alfvén MP5 HLL RK4 0.01 8...256 42.6 ± 2.1 4.96 ± 0.01
#A3 Alfvén MP5 HLLD RK4 0.01 8...256 42 ± 3 4.95 ± 0.02
#A4 Alfvén MP7 HLL RK4 0.01 8 ...128 44 ± 53 6.19 ± 0.03
#A5 Alfvén MP9 HLL RK4 0.01 8...64 1190 ± 190 8.57 ± 0.06
#A6 Alfvén MP9 HLL RK3 0.8 16...128 0.86 ± 0.08 2.949 ± 0.022
#A7 Alfvén MP9 HLL RK4 0.8 8...64 7.6 ± 2.5 5.18 ± 0.10
#A8 Alfvén MP5 HLL RK3 0.5 5...1024
#MS1 magnetosonic MP5 HLL RK4 0.01 8...128 40 ± 3 4.95 ± 0.02
#MS2 magnetosonic MP7 HLL RK4 0.01 8...64 288 ± 20 6.903 ± 0.023
#MS3 magnetosonic MP9 HLL RK4 0.01 8...32 1970 ± 160 8.82 ± 0.03
#MS4 magnetosonic MP9 HLL RK3 0.1...0.9 64 1.77 ± 0.06 2.977 ± 0.007
#MS5 magnetosonic MP9 HLL RK4 0.2...0.9 64 4.3 ± 0.8 4.834 ± 0.013

Note. The columns give (from left to right) the series identifier, the wave type, the reconstruction scheme, the Riemann solver, the time integrator, the CFL factor, and the grid resolution. The estimators for ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}x}$, r, ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}$, and q (see Equations (17), (20), and (21)) are obtained from linear fits to the simulation results. For sound waves, Alfvén, waves, and magnetosonic waves ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$, ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}={{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$, and ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}+(3/8){{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$, respectively. The estimators ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$ are defined analogously.

Download table as:  ASCIITypeset image

In the multidimensional (multi-D) case, the ansatz given by Equations (17), (20), and (21) can be generalized. Inspecting Equation (10), one realizes that in the multi-D case, similar terms appear for the spatial derivatives in each of the directions and for all possible cross-derivatives. However, the contribution from the time derivative remains the same. A detailed analysis of the form of these numerical dissipative and dispersive terms is beyond the scope of this work. Instead, we propose a simple ansatz containing the main features of numerical dissipation in multiple directions. The first fact to realize is that different characteristic length scales apply to the different directions. For example, in 2D, using coordinates (x, y), the relevant quantities are ${\rm{\Delta }}x/{{ \mathcal L }}_{x}$ and ${\rm{\Delta }}y/{{ \mathcal L }}_{y}$, where ${{ \mathcal L }}_{x}$ and ${{ \mathcal L }}_{y}$ are characteristic lengths in the respective direction. Similarly there is a characteristic velocity, ${{ \mathcal V }}_{x}$ and ${{ \mathcal V }}_{y}$, in each direction. As a consequence, dissipation acts differently for each direction of the grid and it becomes anisotropic. The diffusion coefficients, ν, ξ, and η, appearing in Equations (2)–(4) rely on the assumption of an isotropic fluid (see, e.g., Landau & Lifshitz 1982), therefore numerical dissipation cannot be modeled using these scalar coefficients in the multi-D case. However, it is relatively easy to find a prescription for a non-isotropic dissipation generalizing the scalar character of the dissipation coefficients to two-tensors. In this way, the generalization of the scalar kinematic viscosity ${\nu }_{* }$ to a tensor ${{\boldsymbol{\nu }}}_{* }$ (whose components are ${\nu }_{* }^{{ij}}$) would imply substitutions in the MHD equations of the kind

Equation (22)

and similarly for ${{\boldsymbol{\xi }}}_{* }$ and ${{\boldsymbol{\eta }}}_{* }$, with components ${\xi }_{* }^{{ij}}$ and ${\eta }_{* }^{{ij}}$. Explicit expressions for the case of viscosity can be obtained using a rank four dynamic viscosity tensor of the form

Equation (23)

and following the procedure laid out in chapter 5 of Landau & Lifshitz (1970).

We propose an ansatz for these tensorial coefficients, in which we neglect terms coming from cross-derivatives for simplicity, keeping only the contribution to the numerical discretization error in each direction separately. For the 2D case, which can be trivially generalized to 3D, our ansatz reads

Equation (24)

where

Equation (25)

Equation (26)

Equation (27)

and similarly for ${\xi }_{* }^{{ij}}$ and ${\eta }_{* }^{{ij}}$. Note that the temporal contribution to the dissipation coefficients is isotropic and depends on the characteristic length and time of the solution (${ \mathcal L }$ and ${ \mathcal V }$) instead of on the characteristic scales along each direction. In this ansatz, we assume that the same algorithm is used to compute the derivatives in all spatial directions, and hence the coefficient ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}$ is the same in all components ${\nu }_{\mathrm{sp}}^{{ij}}$.

One also needs to correctly identify the characteristic velocity, ${ \mathcal V }$, and length, ${ \mathcal L }$, of the system (or the corresponding quantities in the multi-D case), which may require a good understanding of the problem (see 2D simulations of sound waves and TMs in Sections 4.2 and 4.3, respectively).

To test the robustness of the above ansatz and to determine the unknown coefficients, we considered four test problems in resistive-viscous MHD that have analytically known solutions: the damping of sound waves, Alfvén waves, and fast magnetosonic waves, and the TM instability. Because slow magnetosonic waves will not be discussed in the remaining part of this paper, we will simply write magnetosonic waves to denote fast magnetosonic waves.

3. The Code

We used the three-dimensional Eulerian MHD code Aenus (Obergaulinger 2008) to solve the MHD Equations (1)–(5). The code is based on a flux-conservative, finite volume formulation of the MHD equations and the constrained-transport scheme to maintain a divergence-free magnetic field (Evans & Hawley 1988). Based on high-resolution shock-capturing methods (e.g., LeVeque 1992), the code employs various optional high-order reconstruction algorithms including a total-variation-diminishing (TVD) piecewise-linear (PL) reconstruction of second-order accuracy, a third-, fifth-, seventh-, and ninth-order monotonicity-preserving (MP3, MP5, MP7, and MP9, respectively) scheme (Suresh & Huynh 1997), a fourth-order, weighted, essentially non-oscillatory (WENO4) scheme (Levy et al. 2002), and approximate Riemann solvers based on the multi-stage (MUSTA) method (Toro & Titarev 2006) and the HLLD Riemann solver (Harten 1983; Miyoshi & Kusano 2005).

We add terms including viscosity and resistivity to the flux terms in the Euler equations and to the electric field in the MHD induction equation. We treat these terms similarly to the fluxes and electric fields of ideal MHD, except for using an arithmetic average instead of an approximate Riemann solver to compute the interface fluxes. The explicit time integration can be performed with Runge–Kutta schemes of first-, second-, third-, and fourth-order accuracy (RK1, RK2, RK3, and RK4), respectively.

4. Numerical Tests

4.1. Wave Damping Tests in 1D

To determine the numerical dissipation of the Aenus code and to test the ansatz (17), (20), and (21), we perform a series of numerical tests involving the propagation of waves in a homogeneous medium. Three kinds of waves are studied, sound waves, Alfvén waves, and fast magnetosonic waves. We align the propagation direction of the wave with one of the grid coordinate directions, making the problem one-dimensional. We determine the damping rates of the wave amplitudes, which depend only on the dissipative terms in the discretized MHD equations, in our case, owing to only numerical dissipation.

To measure the damping rate, we performed numerical simulations letting the wave cross the simulation box, which has periodic boundaries, at least 10 times. The energy of the wave, computed as an integral of the kinetic energy density over the box, decreases exponentially with time. We fit a linear function to the logarithm of this quantity to obtain a measure of the energy damping rate, which is equivalent to twice the amplitude damping rate (see below). To estimate the different dissipation coefficients of our ansatz, we exploit the fact that the damping rate of the different kinds of waves depends differently on numerical viscosity and resistivity.

If not otherwise stated, the simulation box length and the wavevector are set to L = 1 and $k=2\pi $, respectively. An ideal-gas equation of state (EOS) with an adiabatic index ${\rm{\Gamma }}=5/3$ is used.

4.1.1. Sound Waves

We measured the numerical shear and bulk viscosity of the Aenus code using sound waves. We set the background density and pressure to ${\rho }_{0}={p}_{0}=1$, and imposed a perturbation of the form

Equation (28)

Equation (29)

Equation (30)

where ${c}_{{\rm{s}}}=\sqrt{{\rm{\Gamma }}{p}_{0}/{\rho }_{0}}$ is the sound speed. The amplitude of the velocity perturbation is set to $\epsilon ={10}^{-5}$, which is small enough to prevent wave steepening (see Shore 2007) within the time of our simulations.

In the presence of (numerical) viscosity, the wave is damped with time. For a plane wave ${v}_{x1}(x,t)={\hat{v}}_{x1}\exp [i({kx}-\omega t)]$, one finds from the dispersion relation

Equation (31)

In the weak damping approximation, i.e., if

Equation (32)

the phase velocity remains constant and the solution can be written as

Equation (33)

where the sound damping coefficient ${{\mathfrak{D}}}_{s}$ is defined as

Equation (34)

The sound wave propagates with a constant speed and its amplitude decreases with time. Performing simulations with different values of the physical shear and bulk viscosity, we found an excellent agreement between the analytical (Equation (33)) and the numerical solution (see Rembiasz 2013, for details).

With simulation series #S1, #S3, #S5, and #S6 (Table 1; upper left panel of Figure 1), we investigated the influence of the reconstruction scheme on the numerical dissipation. To keep the contribution of the time integration errors as small as possible, we set ${C}_{\mathrm{CFL}}=0.01$. For every simulation, we measure the damping rate ${{\mathfrak{D}}}_{{\rm{s}}* }$ from the decay of the kinetic energy, from which we compute the numerical dissipation of the code according to Equation (34) as

Equation (35)

where the right-hand side is given by the simulation results. Thus, in the case of sound waves, one cannot determine ${\nu }_{* }$ and ${\xi }_{* }$ separately from the value of ${{\mathfrak{D}}}_{{\rm{s}}* }$, but only a linear combination of both quantities. For every simulation series (i.e., reconstruction scheme), we fit the function

Equation (36)

where r is the measured order of convergence of the scheme. From the fit parameter

Equation (37)

we can compute $\tfrac{4}{3}{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ if both the characteristic speed and the length of the system are known. As we will show below, for this test ${ \mathcal L }=\lambda =1$ ($\lambda =2\pi /k$ being the wavelength) and ${ \mathcal V }={c}_{{\rm{s}}}=1.291$. The results presented in Table 1 and the upper right panel of Figure 1 show that all schemes have an exponent r close to the theoretical order ${r}_{\mathrm{th}}$ of the method.

Figure 1.

Figure 1. Numerical dissipation of sound waves. Upper left panel: dependence on the grid resolution ${\rm{\Delta }}x$ for different reconstruction schemes (PL/#S1, MP5/#S3, MP7/#S5, and MP9/#S6), the RK4 time integrator, and ${C}_{\mathrm{CFL}}=0.01$. Upper right panel: dependence on the size of the time step size ${\rm{\Delta }}t$ for the RK3 (red; series #S7 and #S8) and RK4 (blue; series #S9) time integrators in simulations done with the MP9 scheme (so that spatial reconstruction errors are negligible). Different time steps were obtained by putting ${C}_{\mathrm{CFL}}=0.5$ and varying the grid resolution (plus symbols, dotted lines), or, additionally for the RK3 integrator, by keeping the resolution fixed (i.e., 64 zones) and varying the CFL factor (diamonds, dashed line). Lower left panel: dependence on the sound speed for two simulation series in which we kept the background density ${\rho }_{0}$ constant but varied the background pressure p0 (#cS1, green crosses), and in which we kept p0 constant but varied ${\rho }_{0}$ (#cS2, red plus signs). Lower right panel: dependence on the wavenumber $k=2\pi /\lambda $, i.e., on the box size (#cS3). The results shown in the two lower panels were obtained using 32 zones, the MP5 scheme, the RK3 time integrator, and ${C}_{\mathrm{CFL}}=0.01$. Straight lines are fits to the simulation results.

Standard image High-resolution image

The results of the simulation series #S2–#S4 (Table 1) show that the LF, HLL, and HLLD Riemann solvers damp sound waves very similarly.

With the simulation series #S7–#S9, we determine the contribution of the RK3 (#S7 and #S8) and RK4 (#S9) time integrators to the numerical dissipation. To keep the contribution of the spatial discretization errors as low as possible, we use the MP9 reconstruction. We vary the time step either by varying the grid resolution (keeping ${C}_{\mathrm{CFL}}=0.5;$ series #S7 and #S9) or by varying the CFL factor (series #S8). According to Equation (19), both approaches should be equivalent. In both cases, the RK3 scheme performs very close to third-order accuracy, whereas the order of the RK4 integrator is higher than expected. We attribute the overperformance of RK4 in this test to the fact that it is not a TVD scheme since we have not computed the time-reversed operator $\tilde{L}$ as suggested in the Shu & Osher (1988) and in Suresh & Huynh (1997) for time integration schemes with orders of larger than three. However, the overperformance of RK4 in this test is very likely a fortunate coincidence (see Section 4.1.3, where it is not the case). The estimators $\tfrac{4}{3}{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}t}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}t}$ are obtained by employing a fitting procedure analogous to the one for $\tfrac{4}{3}{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ (see Table 1 and the upper right panel of Figure 1).

The natural characteristic speed of this flow problem should be the sound speed (${ \mathcal V }={c}_{{\rm{s}}}$). To test this hypothesis, we performed simulations varying the background pressure (series #cS1) or the density (#cS2) within the range given in Table 2. The results were fitted with the function

Equation (38)

From the fit, we obtain the value of α, expecting $\alpha =1$, and from the offset d, we determine ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}x}={{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}x}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ (Table 2). The table and the lower left panel of Figure 1 clearly show that the sound speed is indeed the characteristic speed of the system.

Table 2.  Wave Damping Simulations II

Series Wave p0 ${\rho }_{0}$ b0 λ ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}$ α
#cS1 sound $1...{10}^{4}$ 1 0 1 46.2 ± 2.3 0.993 ± 0.003
#cS2 sound 1 ${10}^{-4}...10$ 0 1 46.2 ± 2.3 0.993 ± 0.003
#cS3 sound 1 1 0 $0.1...20$ 46.2 ± 2.4 0.9899 ± 0.0024
#cA1 Alfvén 10−1 1 ${10}^{-3}...20$ 1 34.8 ± 2.4 0.945 ± 0.015
#cA2 Alfvén $2\times {10}^{-3}...{10}^{7}$ 1 1 1 34.8 ± 2.4 0.945 ± 0.015
#cA3 Alfvén $2\times {10}^{-3}$ ${10}^{-4}...{10}^{4}$ 1 1 34.8 ± 2.4 0.945 ± 0.015
#cA4 Alfvén $2\times {10}^{-3}$ 1 1 $0.1...10$ 44 ± 2 −1.0003 ± 0.0003
#cMS1 magnetosonic 1 1 ${10}^{-4}...{10}^{3}$ 1 40 ± 3 0.997 ± 0.006
#cMS2 magnetosonic ${10}^{-4}...{10}^{4}$ 1 1 1 40 ± 3 0.997 ± 0.006
#cMS3 magnetosonic 1 ${10}^{-3}...{10}^{4}$ 1 1 40 ± 3 0.997 ± 0.006

Note. Simulations performed with the MP5 reconstruction scheme, the HLL Riemann solver, and the RK3 time integrator to identify the characteristic velocity and length of the system. The CFL factor was set to 0.01 to guarantee negligible time integration errors. The columns give (from left to right) the series identifier, the wave type, the initial pressure, density and magnetic field, and the wavelength λ. ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}$ is defined as in Table 1 for the corresponding wave type. The exponent α is obtained for each simulation series by means of the fitting functions given by Equations (38), (39), (46), (49), and (61), respectively.

Download table as:  ASCIITypeset image

To determine the characteristic length of the system (the natural candidate being the wavelength λ), we performed the simulation series #cS3 varying the wavelength λ (and the size of the simulation domain accordingly, i.e., $L=\lambda $). The results were fitted with the function

Equation (39)

expecting again $\alpha =1$. Table 2 and the lower right panel of Figure 1 confirm our hypothesis. The figure shows that the numerical viscosity term is proportional to ${k}^{-1}$, i.e., ${D}_{s* }/{k}^{2}\propto {k}^{-1}$ (see Equation (34)).

4.1.2. Alfvén Waves

With the help of Alfvén wave simulations, we determine a linear combination of the numerical shear viscosity and resistivity of the code. We set the background magnetic field and density to ${b}_{0x}={\rho }_{0}=1$, the pressure to ${p}_{0}=2\times {10}^{-3}$, and the transversal velocity to ${v}_{0y}={v}_{0}=0$. We imposed a perturbation of the form

Equation (40)

Equation (41)

In ideal MHD, an Alfvén wave propagates with a constant amplitude at the Alfvén speed ${c}_{{\rm{A}}}={b}_{0x}/\sqrt{{\rho }_{0}}$. In the presence of viscosity and resistivity, the wave amplitude decreases with time. In the weak damping approximation, i.e., for ${k}^{4}{(\nu +\eta )}^{2}/(4{c}_{{\rm{A}}}^{2})\ll 1$, the velocity evolution reads (for the derivation, see Campos 1999)

Equation (42)

where the Alfvén damping rate is defined as

Equation (43)

We verified Equation (43) with the help of numerical simulations, and also checked that the bulk viscosity does not influence the damping coefficient (see Rembiasz 2013, for details).

In the simulation series #A2, #A4, and #A5 (see Table 1), we compared the influence of the MP5, MP7, and MP9 reconstruction schemes on the numerical shear viscosity ${\nu }_{* }$ and resistivity ${\eta }_{* }$. For every simulation, we measured the decrease of the kinetic energy, from which we determined a linear combination of the numerical shear viscosity and resistivity

Equation (44)

The simulation results are fitted with the function

Equation (45)

where r is the numerically measured order of accuracy of the reconstruction scheme. From the fit parameter d and Equations (17), (21), and (44), we determined ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$.4 Table 1 and the upper left panel of Figure 2 show that all methods have an order of convergence close to the theoretical expectation.

Figure 2.

Figure 2. Numerical dissipation of Alfvén waves. Upper left panel: dependence on the grid resolution ${\rm{\Delta }}x$ for three different reconstruction schemes (MP5/#A2, MP7/#A3, and MP9/#A4) using RK4 and ${C}_{\mathrm{CFL}}=0.01$. Upper right panel: dependence on the time step size ${\rm{\Delta }}t$ (changing the grid resolution but keeping ${C}_{\mathrm{CFL}}=0.8$) for two different time integrators (#A6 and #A7) using the HLL Riemann solver and MP9. Lower left panel: dependence on the fast magnetosonic speed for three simulation series varying the background magnetic field strength b0x (#cA1, blue diamonds), the background pressure p0 (#cA2, green crosses), and the background density ${\rho }_{0}$ (#cA3, red plus signs) keeping all other parameters constant. Lower right panel: dependence on the wavenumber $k=2\pi /\lambda $, i.e., on the box size #cA4. Straight lines are fits to the simulation results.

Standard image High-resolution image

According to the results of the simulation series #A1, #A2, and #A3 (Table 1), the numerical dissipation of the LF, HLL, and HLLD Riemann solvers are also very similar for Alfvén waves.

With the simulation series #A6 and #A7 (upper right panel of Figure 2), we assessed the contribution to the numerical dissipation of the RK3 and RK4 time integrators, respectively. We set ${C}_{\mathrm{CFL}}=0.8$ and changed the time step by varying the grid resolution. The results presented in Table 1 and the upper right panel of Figure 2 show that the RK3 time integrator performs at its theoretical order, whereas the order of the RK4 integrator is once again (like in the sound wave tests) higher than expected.

The characteristic velocity ${ \mathcal V }$ for the Alfvén wave test problem can be inferred from simulation series #cA1, #cA2, and #cA3, in which we varied the magnetic field, pressure, and density, respectively. We find that the logarithm of the numerical dissipation determined from these simulation data can be fitted (see the lower left panel of Figure 2) by the function

Equation (46)

where α and d are fitting parameters, and ${c}_{\mathrm{ms}}$ is the fast magnetosonic speed, which is defined as

Equation (47)

where θ is the angle between the perturbation wavevector and the background magnetic field. For a wavevector parallel to the background field ($\theta =0$),

Equation (48)

The values of the fitting parameter α, which are given in Table 2, confirm that the characteristic velocity ${ \mathcal V }$ is the fast magnetosonic speed (not the Alfvén speed, as one could have presumed), both in the flow regime, where ${ \mathcal V }$ is dominated by the Alfvén speed and the sound speed.

The simulation series #cA4 (Table 2) shows that the characteristic length of the Alfvén wave simulations is, as for the sound wave test, the wavelength, and that the numerical dissipation can be fitted by (see Table 2 and the lower right panel of Figure 2)

Equation (49)

Finally, to investigate whether the errors resulting from spatial discretization and time integration are additive, we performed simulations #A8, in which both types of errors should contribute non-negligibly to the numerical dissipation. Figure 3 shows the simulation results together with the expected numerical dissipation of the RK3 integrator (green), the MP5 scheme (blue), and the sum of both contributions (red). As the figure shows, the errors add linearly.

Figure 3.

Figure 3. Numerical dissipation as a function of grid resolution for the MP5 reconstruction scheme and the RK3 time integrator with ${C}_{\mathrm{CFL}}=0.5$. The simulation results are marked with black plus signs. The straight lines depict the predicted numerical dissipation of the RK3 time integrator (green), the MP5 scheme (blue), and the sum of both types of numerical dissipation (red). For a grid resolution of $\leqslant 16$ zones, Alfvén waves are mainly damped by spatial discretization errors, and for $\geqslant 128$ zones by time integration errors. In the intermediate regime ($16\ldots 128$ zones), both types of errors add linearly (like proper scalars).

Standard image High-resolution image

4.1.3. Magnetosonic Waves

From the simulations of magnetosonic waves, we determine the numerical resistivity and viscosity of the Aenus code. If not otherwise stated, the background pressure, density, and magnetic field strength are set to ${p}_{0}={\rho }_{0}={b}_{0y}=1$ and ${{\boldsymbol{b}}}_{0}={b}_{0y}\hat{{\boldsymbol{y}}}$, respectively. We perturb the background by a magnetosonic wave of the form

Equation (50)

Equation (51)

Equation (52)

Equation (53)

Equation (54)

where e1 is the total specific energy of the wave. The velocity amplitude $\epsilon ={10}^{-5}$, and the wave's angular frequency ω is given by

Equation (55)

For $\theta =\pi /2$ (a value chosen in almost all simulations), the magnetosonic speed reads (see Equation (47))

Equation (56)

In the presence of viscosity or resistivity, the wave will be damped with time, i.e., the x component of the wave velocity will decrease as

Equation (57)

where the damping coefficient for a fast magnetosonic wave propagating in the direction perpendicular to the background magnetic field is (for the derivation, see Campos 1999)

Equation (58)

We verified this equation numerically (see Rembiasz 2013 for details).

We also performed simulations #MS1, #MS2, and #MS3 (Table 1) to investigate the influence of the MP5, MP7, and MP9 reconstruction schemes. From the measured kinetic energy damping, we determined a linear combination of the numerical resistivity, shear viscosity, and bulk viscosity, i.e., 

Equation (59)

We fitted the simulation results with the function

Equation (60)

where the fit parameter r is the numerically measured order of the reconstruction scheme. From the fit parameter d, and with Equations (17), (20), (21), and (59), we determined the combination of coefficients $\tfrac{4}{3}{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}+\tfrac{8}{3}{{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ (see Table 1 and the left panel of Figure 4).

Figure 4.

Figure 4. Numerical dissipation of magnetosonic waves. Left panel: dependence on the grid resolution ${\rm{\Delta }}x$ for three different reconstruction schemes (MP5/#MS1, MP7/#MS2, and MP9/#MS3) using an HLL Riemann solver, RK4, and ${C}_{\mathrm{CFL}}=0.01$. Middle panel: dependence on the time step size ${\rm{\Delta }}t$ for two different time integrators (RK3/#MS4 and RK4/#MS5) using the HLL Riemann solver, MP9, and a grid resolution of 64 zones. Right panel: dependence on the fast magnetosonic speed for simulations varying the background magnetic field strength b0y (#cMS1, blue diamonds), the background pressure p0 (#cMS2, green crosses), and the background density ${\rho }_{0}$ (#cMS3, red plus signs) keeping all other parameters constant. Straight lines are fits to the simulation results.

Standard image High-resolution image

Using simulation series #MS4 and #MS5, we studied the contribution of the RK3 and RK4 time integrators to the numerical dissipation (see Table 1 and middle panel of Figure 4). We find that the RK4 integrator performs at a higher order than theoretically expected. Again, we point out that probably due to the non-TVD preserving property of our implementation of RK4, it overperformes in this test (see Section 4.1.2).

To determine the characteristic speed, we performed simulation series #cMS1, #cMS2, and #cMS3, varying background magnetic field strength, pressure, and density, respectively (Table 2). It is not surprising that the characteristic speed is the fast magnetosonic speed (see the bottom panel of Figure 4), which is confirmed quantitatively with the help of the fit function

Equation (61)

As expected, the fit (see Table 2) is consistent with $\alpha =1$ within the measurement errors. The value of d can be used to estimate $\tfrac{4}{3}{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}+\tfrac{3}{8}{{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$. In the asymptotic regime ${b}_{0}\ll {p}_{0}$, the numerical damping is independent of the magnetic field strength, while it is proportional to the field strength for ${b}_{0}\gg {p}_{0}$.

4.1.4. Estimation of Numerical Resistivity and Viscosity

So far, we measured the numerical damping for three wave types separately. For each type of a wave, the damping coefficient depends on a linear combination of the resistivity, shear viscosity, and bulk viscosity (see Equations (34), (43), and (58)). This gives a system of three linearly independent equations with three unknowns, which has a unique solution.

If we consider a series of simulations in which time discretization errors are negligible (such as those in the upper left panels of Figures 1, 2, and 4), at a fixed grid resolution $k{\rm{\Delta }}x=\mathrm{const}.$ and for a given numerical method, the numerical viscosity and resistivity should be the same according to our ansatz (Equations (17), (20), and (21)). Therefore, the damping rates of the three propagating waves can (in principle) be used to compute the numerical viscosity and resistivity.

In Figure 5, we present the resistivity, shear viscosity, and bulk viscosity for three different reconstruction schemes (MP5, MP7, and MP9) as a function of grid resolution. In all simulations, we used the HLL Riemann solver, an RK4 time integrator, and ${C}_{\mathrm{CFL}}=0.01$. Fitting a power law to the data allows us to compute the coefficients entering in the ansatz given by Equations (17), (20), and (21). From the fit parameters, which can be found in Table 3, we compute the exponent r appearing in the ansatz independently for resistivity and viscosity. For all three reconstruction schemes (1) the values of r are close to the expected order of convergence, ${r}_{\mathrm{th}}$, except for a small deviation in the case of MP9, and (2) the value of the numerical viscosity is significantly larger than the absolute value of the numerical resistivity.

Figure 5.

Figure 5. Fits of the numerical resistivity (left), shear viscosity (center), and bulk viscosity (right) computed from the combined damping rates of sound waves, Alfvén waves, and magnetosonic waves for three different reconstruction schemes. Note that the numerical resistivity is negative.

Standard image High-resolution image

Table 3.  Values of the Parameters in Our Ansatz for the Spatial Dependence of the Numerical Viscosity (Equations (17) and (20)) and Numerical Resistivity (Equation (21)), Based on a Fit of the Results Shown in Figure 5

Reconstruction ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ rη ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}$ rν ${{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ rξ
MP5 −7.0 ± 0.5 4.94 ± 0.02 49 ± 3 4.95 ± 0.02 51 ± 4 4.95 ± 0.02
MP7 −41 ± 3 6.81 ± 0.03 270 ± 50 6.80 ± 0.06 354 ± 18 6.881 ± 0.017
MP9 −3 ± 6 6.8 ± 0.6 300 ± 200 7.9 ± 0.3 200 ± 200 7.7 ± 0.3

Note. We obtain three different estimates of the exponent r from fits of resistivity (rη), shear viscosity (rν), and bulk viscosity (rξ).

Download table as:  ASCIITypeset image

Our most striking result is that the value of the numerical resistivity ${\eta }_{* }$ is negative, its absolute value being about one order of magnitude smaller (and even two orders for MP9) than the value of the numerical viscosity (see Table 3). The value of the resistivity coefficient ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ obtained with MP9 (providing the most accurate result) is compatible with a non-negative (very small) numerical resistivity, while the values of the numerical shear viscosity and bulk viscosity are positive and very similar. The resulting damping rate, which is a combination of resistivity and viscosity, prevented an amplification of the wave amplitude in all three systems studied. Taken together, these facts suggest that the numerical viscosity must be considerably larger than the numerical resistivity of the code. Hence, we conjecture that there are large systematic uncertainties that prevent us from properly measuring the numerical resistivity of the code in all three wave propagation tests.

Given that the dissipation is dominated by viscosity rather than resistivity, we had to turn to a completely different system in order to study whether our ansatz for numerical resistivity is a valid one, and if true, whether the results are consistent with a positive value of the resistivity (see Section 4.3).

4.1.5. Waves with a Background Velocity

So far, in the wave damping simulations, we have set the background velocity to zero. To test whether a background velocity affects the numerical damping (i.e., by modifying the characteristic speed of the flow), we repeated the damping test for the sound waves, Alfvén, waves, and magnetosonic waves with a non-zero background velocity. All simulations were performed with the MP5 reconstruction scheme and the RK3 time integrator (with ${C}_{\mathrm{CFL}}=0.1$). For all three Riemann solvers and all types of waves, we observed the same behavior, i.e., the component of the background flow velocity that is perpendicular to the propagation of the wave (${v}_{0y}$) does not affect the numerical dissipation, whereas the parallel component (${v}_{0x}$) does. Figure 6 shows the numerical dissipation for some exemplary simulations of the sound wave damping test done with the HLL Riemann solver. Based on these simulations, we conclude that the characteristic speed of the flow is given by the sum of (the parallel component of) the flow velocity and the fast magnetosonic speed or, in other words, by the fast magnetosonic eigenvalue of the ideal MHD equations.

Figure 6.

Figure 6. Numerical dissipation as a function of the flow velocity parallel (black asterisks) and perpendicular (blue diamonds) to the direction of the propagation of the sound wave. The simulations were performed with 32 zones, MP5, RK3 (with ${C}_{\mathrm{CFL}}=0.1$), and the HLL Riemann solver. Other solvers (LF and HLLD) exhibit a very similar behavior.

Standard image High-resolution image

4.2. Sound Waves in 2D

So far, we have studied wave propagation problems in 1D. However, it is well known that unless a genuinely multi-D reconstruction algorithm is used (as proposed by, e.g., Colella et al. 2011; McCorquodale & Colella 2011; Zhang et al. 2011; Buchmüller & Helzel 2014), the order of a reconstruction scheme can be reduced in simulations involving more than one spatial dimension. Our code Aenus employs several independent one-dimensional reconstruction steps (one per dimension). Thus, the convergence rate may be degraded to second order in multi-D simulations, i.e., well below that of 1D applications.

We studied this aspect with the help of 2D simulations (Table 4) of sound wave propagation in a box of size ${L}_{x}\times {L}_{y}$ with periodic boundary conditions in both directions. We set the background density and pressure to ${\rho }_{0}={p}_{0}=1$, and imposed a perturbation of the form

Equation (62)

Equation (63)

Equation (64)

Equation (65)

where ${\rm{\Gamma }}=5/3$, $\epsilon ={10}^{-5}$, θ is an angle between the x-axis and the wavevector, ${\boldsymbol{k}}=({k}_{x},{k}_{y}),$ where

Equation (66)

Equation (67)

The wavelength is given by

Equation (68)

Table 4.  Sound Wave Damping in 2D Simulations (Series #LS)

Series Ly Reco Riemann Time CFL ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}$ r ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}$ q
#LS1 1 MP5 HLL RK3 0.01 37.1 ± 2.6 4.90 ± 0.02
#LS2 1 MP7 HLL RK3 0.01 273 ± 21 6.86 ± 0.03
#LS3 1 MP9 HLL RK3 0.01 440 ± 300 8.2 ± 0.2
#LS4 1.125 MP5 HLL RK3 0.01 33.7 ± 4.4 4.86 ± 0.02
#LS5 1.25 MP5 HLL RK3 0.01 37 ± 7 4.90 ± 0.04
#LS6 2 MP5 HLL RK3 0.01 37.2 ± 2.7 4.90 ± 0.02
#LS7 2 MP7 HLL RK3 0.01 276 ± 24 6.86 ± 0.03
#LS8 2 MP9 HLL RK3 0.01 570 ± 370 8.3 ± 0.2
#LS9 3 MP5 HLL RK3 0.01 37.1 ± 2.5 4.90 ± 0.02
#LS10 3 MP7 HLL RK3 0.01 277 ± 24 6.86 ± 0.03
#LS11 3 MP9 HLL RK3 0.01 680 ± 360 8.35 ± 0.18
#S3 MP5 HLL RK4 0.01 43.4 ± 2.5 4.962 ± 0.0141
#S5 MP7 HLL RK4 0.01 302 ± 20 6.897 ± 0.021
#S6 MP9 HLL RK4 0.01 830 ± 340 8.42 ± 0.15
#LS12 1 MP9 HLL RK3 0.5 1.28 ± 0.04 2.94 ± 0.01
#LS13 1 MP9 HLL RK4 0.5 17 ± 3 5.14 ± 0.05
#LS14 2 MP9 HLL RK3 0.5 1.4 ± 0.2 2.970 ± 0.005
#LS15 2 MP9 HLL RK4 0.5 31 ± 9 5.3 ± 0.1
#LS16 3 MP9 HLL RK3 0.5 1.56 ± 0.01 2.978 ± 0.002
#LS17 3 MP9 HLL RK4 0.5 46 ± 17 5.38 ± 0.13
#S7 MP9 HLL RK3 0.5 1.492 ± 0.013 2.985 ± 0.002
#S9 MP9 HLL RK4 0.5 71 ± 32 5.5 ± 0.2

Note. Additionally, for the Reader's Convenience, we repeat some 1D simulations (Series #S) from Table 1. The columns give (from left to right) the series identifier, the Ly box length (Lx = 1), the reconstruction scheme, the Riemann Solver, the time integrator, and the CFL factor. In all 2D simulations, a uniform grid is used (i.e., ${\rm{\Delta }}y={\rm{\Delta }}x$) and the number of grid zones Nx per Lx is in the range from 8 to 32. The estimator for ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}x}$, r, ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}$, and q (see Equations (17) and (20)) is obtained from linear fits to the simulation results. For sound waves, ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ and ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}t}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}t}$.

Download table as:  ASCIITypeset image

In all 2D simulations, we set Lx = 1, like in all 1D sound wave simulations (but series #cS3) and use a uniform grid, i.e., ${\rm{\Delta }}x={\rm{\Delta }}y$. Note that the 1D expressions are recovered in the limit ${L}_{y}\to \infty $. We determine numerical damping from the kinetic energy of sound waves whose time evolution is

Equation (69)

in an analogous manner as described in Section 4.1.1. In the case of scalar constant bulk and shear viscosities, the damping rate ${{\mathfrak{D}}}_{s}$ is given by (analogically to the 1D case, Equation (34))

Equation (70)

However, as already mentioned in Section 2.3 (see Equation (24)), numerical viscosities have a tensorial character in a multi-D simulation, hence the damping rate is given by

Equation (71)

To be able to determine (linear combinations of) ${{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x},{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x},{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}$ and ${{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ (defined in Equations (17) and (20)), i.e., ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}x}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}x}$ and ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}=(4/3){{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}t}+{{\mathfrak{N}}}_{\xi }^{{\rm{\Delta }}t}$ (Table 4), we first need to identify the characteristic velocities ${{ \mathcal V }}_{x},{{ \mathcal V }}_{y}$, and ${ \mathcal V }$, and lengths ${{ \mathcal L }}_{x},{{ \mathcal L }}_{y}$, and ${ \mathcal L }$ of the system. From our studies in 1D, we infer that the former must be the sound speed, which is homogenous and isotropic in the whole system and, thereby, ${{ \mathcal V }}_{x}={{ \mathcal V }}_{y}={ \mathcal V }={c}_{{\rm{s}}}$. Moreover, we postulate that ${{ \mathcal L }}_{x}=2\pi /{k}_{x}$ and ${{ \mathcal L }}_{y}=2\pi /{k}_{y}$, since, for the reconstruction scheme in each dimensional sweep, this 2D sound wave problem reduces to a 1D wave propagation (e.g., Equation (62) reduces to Equation (50) for $y=\mathrm{const}.$). The characteristic (physical) timescale of the system is ${ \mathcal T }={c}_{{\rm{s}}}/\lambda $. Furthermore, since the time integration errors must be proportional to ${\rm{\Delta }}t/{ \mathcal T }$, we conclude that ${ \mathcal L }=\lambda $.

Therefore, for our system, ansatzes for ${\nu }_{\mathrm{sp}}^{{xx}}$ and ${\nu }_{t}$ (see Equations (25) and (27)) read

Equation (72)

Equation (73)

The ansatzes for the other components of numerical viscosities have an analogous form. Finally, the damping rate for 2D wave simulations is

Equation (74)

which for an equidistant grid, i.e., ${\rm{\Delta }}x={\rm{\Delta }}y$, and Lx = 1, further simplifies to

Equation (75)

According to the above equation, for simulations in which numerical dissipation is dominated either by spatial reconstruction errors (series #LS1–#LS11 from Table 4) or by time integration errors (series #LS12–#LS17), the dissipation rate should, respectively, be $(1+{L}_{y}^{-r-1})$ and ${(1+{L}_{y}^{-2})}^{(1+q)/2}$ times larger than in the corresponding 1D simulations (with the same ${L}_{x}=1)$. Note that this difference between 1D and 2D simulations is due to the small change in the value of λ. Deviations from this expected value would be indicative of differences in the dissipation coefficients between 1D and 2D simulations. For the MP5 reconstruction scheme, assuming r = 5, and boxes with ${L}_{y}=1,1.125$, and 1.25, the dissipation should be respectively $2,1.49$, and 1.26 times larger than in the 1D case, whereas in boxes with Ly = 2 and 3, the numerical dissipation rate should be basically equal to the 1D case (i.e., merely greater by a factor of 1.016 and 1.001, respectively). The upper panel of Figure 7 depicts (in red) the damping rates in simulation series #LS1, #LS4, #LS5, #LS6, and #LS9 (Table 4) performed with the MP5 reconstruction scheme in 2D boxes of those sizes. The ratios of these damping rates to the damping rates in 1D (simulation series #S3 from Tables 1 and 4, marked with asterisks in the figure) are in very good agreement with the above estimates. Similarly, we expect twice higher dissipation rates in simulations done with MP7 (series #LS2) and MP9 (series #LS3) reconstruction schemes in boxes with Ly = 1 than in their 1D counterparts (simulation series #S5 and #S6, respectively), and basically equal (to the 1D case) dissipation rates in simulations with Ly = 2 and Ly = 3 (simulation series #LS7, #LS8, #LS10, and #LS11). Indeed, dissipation rates presented in the upper panel of Figure 7 exhibit this behavior.

In the above analysis, we implicitly assumed that $r,{{\mathfrak{N}}}_{\nu }^{{\rm{\Delta }}x}$, etc., are equal in 1D and 2D simulations, so the previous analysis only provides a consistency check. However, these coefficients can actually be measured in 2D simulations and can be compared with the coefficients obtained for the 1D case. In Table 4, we present estimators for these quantities determined in the 2D simulations from dissipation rates with the help of Equation (75) in an analogous way as described in Section 4.1.1. The estimators are indeed equal within the measurement errors for each reconstruction scheme, i.e., MP5, MP7, and MP9, in 1D and in 2D simulations. This signifies that our ansatzes (24)–(27) are correct at least for 2D wave simulations for the spatial reconstruction errors.

The bottom panel of Figure 7 depicts dissipation rates in simulation series #LS12–#LS17 (Table 4) performed with the MP9 reconstruction scheme (so that spatial discretization errors are negligible), ${C}_{\mathrm{CFL}}=0.5$, and RK3 (red) or RK4 (blue) time integrators in 2D boxes with Ly = 1, 2, and 3 as well as in 1D (series #S7 and #S9). The estimators for q and ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$ determined from these data are presented in Table 4. The RK3 time integration scheme once again (like in 1D) has its theoretical order, i.e., $q\approx 3$, whereas the RK4 time integrator once again overperforms by one unit the expected order, i.e., $q\approx 5$. The estimators for ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$ and q for the RK3 scheme are very similar in 1D and 2D simulations, whereas, for the RK4 scheme, there is a discrepancy that cannot be explained by the measurement errors (i.e., ${{\mathfrak{N}}}_{\ \mathrm{tot}}^{{\rm{\Delta }}t}$ ranges from 17 ± 3 to 71 ± 32, and q from 5.14 ± 0.05 to 5.5 ± 0.2). Note, however, that this discrepancy is insignificant in the considered range of ${\rm{\Delta }}t$ because there is a clear correlation between q and ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$, i.e., the larger q, the larger ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$, leading to very similar predictions for the dissipation rate as we show in the next paragraph. Therefore, we conclude that our ansatzes (24)–(27) are valid for time integration errors in 2D and that both RK3 and RK4 time integration schemes perform (basically) identically in 1D and 2D simulations (with various box sizes).

Figure 7.

Figure 7. Numerical damping in sound wave simulations performed with the HLL Riemann solver in 1D (asterisks, dotted lines) and in 2D with Ly = 1 (diamonds, dashed lines), Ly = 1.125 (downward triangles, dash–dot–dot–dot line), Ly = 1.25 (circles, long-dashed line), Ly = 2 (upward triangles, dashed–dotted lines), and Ly = 3 (squares, solid lines). Top: simulations done with the RK3 time integrator with ${C}_{\mathrm{CFL}}=0.01$ (so that the time integration errors are negligible) and the MP5 (red), MP7 (green), and MP9 (blue) reconstruction schemes. Bottom: simulations done with the MP9 reconstruction scheme (so that time discretization errors are negligible) and the RK3 (red) and RK4 (blue) time integrators with ${C}_{\mathrm{CFL}}=0.5$. See also Table 4.

Standard image High-resolution image

Based on Equation (75), we can make the following estimates for simulations where time integrator errors are dominant. For simulations done with RK3, assuming q = 3 (and equal ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$), in a box with ${L}_{y}=1,2$, and 3 (series #LS12, #LS14, and #LS16, respectively) numerical dissipation should be, respectively, $4,1.56$, and 1.23 times greater than in 1D simulations (series #S7). For analogous simulations done with RK4 (series #LS13, #LS15, and #LS17, respectively), assuming q = 5 (and equal ${{\mathfrak{N}}}_{\mathrm{tot}}^{{\rm{\Delta }}t}$), the dissipation rates should respectively be $8,1.95,1.37$ greater than in the 1D case (series #S9). As can be seen in the bottom panel of Figure 7, these predictions agree very well with our simulation results.

4.3. TM Tests

The TM instability is a resistive MHD instability that can develop in current sheets, where, as a direct consequence of Ampère's law, the magnetic field changes direction. TMs dissipate magnetic energy into kinetic energy and subsequently into thermal energy, disconnect and rejoin magnetic field lines, thereby changing the topology of the magnetic field. The linear theory of TM was extensively studied, in the context of plasma fusion physics, in a seminal paper by FKR63. TMs are of great relevance in astrophysics, (e.g., in the magnetopause or magnetotail of the solar wind, in flares or coronal loops of the Sun, and in the flares of the Crab pulsar (see Priest & Forbes 2007; Pucci & Velli 2014). They have also been suggested to be a terminating agent of the MRI (Balbus & Hawley 1991; Latter et al. 2009; Pessah 2010, but see Rembiasz et al. 2016b who observed an MRI termination by the Kelvin–Helmholtz instability in their 3D MRI simulations).

In this section, we present a test involving TMs for which we know how the reconnection rate depends on the relevant parameters (resistivity, viscosity, etc.). By performing numerical simulations of viscous, but non-resistive, MHD flows at different grid resolutions with various numerical methods, we developed a method to measure the numerical resistivity of MHD codes.

4.3.1. Theory

In this section, we sketch how to analytically obtain a growth rate and an instability criterion of the TM instability, leaving out all technical details that can be found in Appendix A.1. Many of the results presented here were already obtained by FKR63, or they are different limits of expressions found in that work.

Consider a two-dimensional flow in the xy plane of constant background density ${\rho }_{0}=1$ threaded by a magnetic field

Equation (76)

where b0 is the magnetic field strength and a defines the shear length (see Figure 8). This magnetic field configuration gives rise to a current sheet at $| y/a| \lesssim 1$. To balance the resulting magnetic pressure gradient, one can introduce either a gas pressure gradient, so that ${{\rm{\nabla }}}_{y}(p+{b}_{0x}^{2}/2)=0$ (pressure equilibrium configuration), or an additional magnetic field component, so that ${{\rm{\nabla }}}_{y}({b}_{0x}^{2}/2+{b}_{0z}^{2}/2)=0$ (force-free configuration). Both equilibrium configurations are stable in ideal MHD, but are TM unstable in resistive MHD.

Figure 8.

Figure 8. Background magnetic field b0x (black; Equation (76)) and the amplitude (rescaled for a better visibility) of the velocity perturbation vy (brown; Equation (94)) of a TM. Only the central part of the computational domain is shown, i.e., $y\in [-0.15,0.15]$. In the outer region (white) and the inner region (blue) vy is given by Equations (132) and (145), respectively. In an intermediate region (shaded yellow) both solutions are valid and must be matched at a certain matching point, ${y}_{{\rm{m}}}$, within this region (yellow vertical line). Black, green, and red vertical lines respectively mark, the shear width a, the width of the resistive-viscous layer ${L}_{\mathrm{RV}}$ (Equation (92)), and the point where $y={\epsilon }_{\mathrm{RV}}$ (defined in Equation (151)). In the inner region, the Taylor expansion ${b}_{0x}(y)\approx {b}_{0}y/a$ (Equation (85)) is used to obtain the analytical solution (see Appendix A.1). The blue dashed line depicts the function ${b}_{0}y/a$ (with ${b}_{0}=1$) to illustrate the regime of the validity of the Taylor expansion.

Standard image High-resolution image

FKR63 derived the instability criterion and the growth rate using the linearized resistive-viscous MHD equations in the incompressible limit, which read

Equation (77)

Equation (78)

Equation (79)

Equation (80)

where ${\boldsymbol{v}}={{\boldsymbol{v}}}_{0}+{{\boldsymbol{v}}}_{1}$, ${\boldsymbol{b}}={{\boldsymbol{b}}}_{0}+{{\boldsymbol{b}}}_{1}$, and we denote background and perturbed quantities with subscripts "0" and "1" respectively. In the incompressible limit, $| {{\boldsymbol{v}}}_{1}| \ll {c}_{s}$ holds, which was used to obtain the linearized equations. To simplify the notation, we omit hereafter the subscript "1" for the velocity perturbations, because the background flow is assumed to be at rest.

FKR63 solved the above equations using a WKB ansatz, i.e., 

Equation (81)

Equation (82)

where k is the wavevector in the x direction, and γ is the growth rate of the TM instability. This ansatz is justified only if the time dependence of the background magnetic field can be neglected. This is the case when the diffusion timescale is much larger than the instability timescale, i.e., ${a}^{2}/\eta \gg {\gamma }^{-1}$. The Alfvén crossing time must be sufficiently short too, i.e., $a/{c}_{{\rm{A}}}\ll {\gamma }^{-1}$, which is equivalent to considering instantaneous propagation of Alfvén waves through the system. Combining both conditions, we have

Equation (83)

Among other cases, FKR63 also considered perturbations whose wavelengths in the x direction are comparable to (but smaller than) the shear width, i.e., 

Equation (84)

For such perturbations, the wavevectors may differ from that of the fastest growing mode appreciably, and it is possible to set up a numerical test in which, for a given grid resolution, both the magnetic shear layer and the TM are well resolved.

FKR63 solved the TM problem in the limit (84) with a so-called boundary layer analysis (BLA; for details, see Appendix A.1). They define an inner region (see Figure 8), where resistive effects are important. We call this region the resistive layer of width ${L}_{{\rm{R}}}$ or, if the flow is also viscous, the resistive-viscous layer of width ${L}_{\mathrm{RV}}$. Far away from this layer, $| y| \gg {L}_{{\rm{R}}}$ or $| y| \gg {L}_{\mathrm{RV}}$, there is an outer region (see Figure 8), where resistivity can be ignored and the ideal MHD equations are valid. The layer width ${L}_{{\rm{R}}}$ or ${L}_{\mathrm{RV}}$ can be expressed in terms of the physical parameters of the system (see Appendix A). The velocity perturbation ${v}_{y}(x,y,t)$ of the WKB ansatz (Equation (81)) exhibits two extrema at $y=\pm {L}_{{\rm{R}}}$ or $y=\pm {L}_{\mathrm{RV}}$ (see Figure 8). Because the location of these extrema can be determined from our simulation results, the layer width ${L}_{{\rm{R}}}$ or ${L}_{\mathrm{RV}}$ is an appropriate quantity to compare simulation and theory.

In the BLA, the inner solution of the resistive MHD equations in a linearized background, i.e., 

Equation (85)

(which holds for $| y| \ll a;$ blue dashed line in Figure 8), is matched with the ideal MHD solution in the outer region at some matching point $| {y}_{{\rm{m}}}| $. The coordinate ${y}_{{\rm{m}}}$ has to fulfill the condition ${L}_{{\rm{R}}}\ll | {y}_{{\rm{m}}}| \ll a$ (or ${L}_{\mathrm{RV}}\ll | {y}_{{\rm{m}}}| \ll a$), which implies that these transition regions can exist only if

Equation (86)

In the inviscid limit, analytic TM solutions of the resistive MHD equations can be obtained. For the background magnetic field given by Equation (76), TM will grow if

Equation (87)

In this case, the growth rate of the TM is

Equation (88)

and the width of the resistive layer is according to our definition

Equation (89)

(see Equations (147) and (148), respectively).

The growth rate given by Equation (88) is of little value for our purpose, since it is obtained in the inviscid limit. However, as we have argued in Section 2, both numerical viscosity and resistivity are an unavoidable result of the discretization of the equations. Hence, if we want to use TMs to measure numerical resistivity, we have to use an approach that takes into account numerical viscosity as well. FKR63 also considered the resistive-viscous case for Prandtl numbers

Equation (90)

in the limit $k\ll {a}^{-1}$. Based on their approach, we obtained the TM growth rate for wavenumbers $k\lesssim {a}^{-1}$ (see Equation (153))

Equation (91)

and the width of the resistive-viscous layer

Equation (92)

These expressions should be useful to set up a test to measure numerical resistivity. However, as we will show in the next sections, it is difficult to find a region in the numerical parameter space, where Equation (91) holds, i.e., where Equations (83), (84), (86), and (90) are fulfilled.

4.3.2. Numerical Simulations of Physical TM

To demonstrate the possibility of using a TM simulation to measure numerical resistivity, we first set up the test using physical resistivity. This allows us to estimate the reconnection rate as a function of physical resistivity and viscosity.

Our numerical experiment is based on Landi et al. (2008), who were mainly interested in the nonlinear phase of TM, i.e., the formation of magnetic islands and the onset of turbulence. Since we want to study the exponential growth of a single TM in detail, we modified their setup for our purposes. We used a computational box of size $[-{L}_{x},{L}_{x}]\times [-{L}_{y},{L}_{y}]$, where ${L}_{x}={L}_{y}=\pi /3$, with periodic and open boundary conditions in x and y directions, respectively. We set the density and pressure to ${\rho }_{0}={p}_{0}=1$, and used an ideal-gas EOS with ${\rm{\Gamma }}=5/3$. In the expression for the background field, Equation (76), we set ${b}_{0}=1$ and a = 0.1.

We tested both the pressure equilibrium and force-free configurations and found that only the latter is suitable for our numerical experiments (see Rembiasz 2013 for details). To obtain the force-free configuration, we set

Equation (93)

We note that our initial perturbations differ from those of Landi et al. (2008). Because those authors only perturbed the velocity, the TM instability is triggered promptly for high resistivities only ($\eta \geqslant {10}^{-5}$). Instead, we perturb both the velocity and the magnetic field based on an analytic solution of the TM:

Equation (94)

Equation (95)

The function $v(y)$ is given by Equations (132) and (145) for $| y| \geqslant {y}_{{\rm{m}}}$ and $| y| \leqslant {y}_{{\rm{m}}}$, respectively, where ${y}_{{\rm{m}}}$ is the matching point (typically ${y}_{{\rm{m}}}=2{L}_{\mathrm{RV}}$). Landi et al. (2015) used similar perturbations, i.e., eigenfunctions of the TM, in their studies of what they called "an ideal TM." This ideal case is a solution of the TM problem in a regime first studied by FKR63, but different from the one we consider here.

The function ${b}_{1}(y)$ in Equation (95) is given by Equation (131) for $| y| \geqslant {y}_{{\rm{m}}}$, and it is constant for $| y| \leqslant {y}_{{\rm{m}}}$, i.e., ${b}_{1}(y\leqslant {y}_{{\rm{m}}})={b}_{1}({y}_{{\rm{m}}})$ according to the "constant ψ approximation" (see Appendix A). The remaining perturbations ${v}_{1x}(x,y,t=0)$ and ${b}_{1x}(x,y,t=0)$ are determined from the divergence-free conditions ${\rm{\nabla }}\cdot {\boldsymbol{b}}={\rm{\nabla }}\cdot {\boldsymbol{v}}=0$. To reduce the computational cost, we chose the value of k in such a way that exactly one TM fits into the box, i.e., k = 3.

To compare the results of our TM simulations with the analytical predictions of Equations (91) and (92) for the TM growth rate and the width of the resistive-viscous layer, respectively, we must ensure that we are in the regime of applicability of these analytical predictions, i.e., Equations (83),(84), (86), and (90) should be fulfilled. The first condition (Equation (84)) is ensured by our choice of k and a. The other conditions can be written as

Equation (96)

Equation (97)

Equation (98)

Equation (99)

We plot iso-contours of these four quantities in the η-ν plane (see Figure 9) to locate the region where the analytical expressions are valid.

Figure 9.

Figure 9. Parameter space of our numerical TM simulations and validity limits of the analytical expression for the growth rate γ given by Equation (91). The color map gives the value of the quantity ${({C}_{1}^{-2}+{C}_{2}^{-2}+{C}_{3}^{-2}+0.01{P}_{{\rm{m}}}^{-2})}^{1/2}$, and the red, blue, and black solid and dashed lines show the locations, where ${{ \mathcal C }}_{1}$, ${{ \mathcal C }}_{2}$, and ${{ \mathcal C }}_{3}$ (see Equations (96)–(98)) have a constant value of 10 and 100, respectively. Solid and dashed green lines show the locations, where ${P}_{{\rm{m}}}$ has a value of 0.1 and 1, respectively. Symbols indicate the parameter values obtained for the reference simulation #Rf (asterisk), and the simulations #TMa (circles), #TMc (squares), and #TMc (triangles). In the blue shaded region, the conditions given by Equations (96)–(98) are satisfied best.

Standard image High-resolution image

We first discuss the results of a simulation with $\eta ={10}^{-5}$ and $\nu ={10}^{-4}$, which we call the reference model (#Rf) and which is marked by an asterisk in Figure 9. The first condition (Equation (96)) is only marginally satisfied for the reference model (${{ \mathcal C }}_{1}\approx 25$). To improve the situation, one should decrease the resistivity and viscosity, i.e., one should increase the grid resolution. This would place the model toward the lower left corner of Figure 9, where all the conditions are better satisfied. Therefore, we are limited here by the numerical resolution that we can afford. In the following, we present simulations with numerical resistivities and viscosities as low as 10−7, corresponding to values of ${{ \mathcal C }}_{1}$ in the range of $1\lt {{ \mathcal C }}_{1}\lt 100$, which are marginally consistent with Equation (96). As a result, the diffusion timescale is only about 10 times larger than the TM e-folding time, i.e., we observe diffusion of the background solution within the duration of the simulation. We circumvent this problem by solving, instead of the proper induction Equation (4), a modified (physically incorrect) version for a constant resistivity, η:

Equation (100)

Thereby, the background magnetic field, ${{\boldsymbol{b}}}_{0}$, does not suffer from diffusion by resistivity.

The second condition (Equation (97)) yields ${{ \mathcal C }}_{2}\approx 403\gg 1$ for the reference model, i.e., the Alfvén crossing time is sufficiently small compared to the growth timescale of the TM instability.

The third condition (Equation (98)) is ${{ \mathcal C }}_{3}\approx 10$ for the reference model, i.e., it is only roughly fulfilled. This condition is the most challenging one to be met in numerical simulations, because the size of the resistive-viscous layer ${L}_{\mathrm{RV}}$ has to be much smaller than the width a of the magnetic shear layer. This can be achieved again by decreasing viscosity and resistivity, but since ${L}_{\mathrm{RV}}\propto {(\eta \nu )}^{-1/6}$ (Equation (92)) it is necessary to decrease $\eta \nu $ by six orders of magnitude to decrease ${L}_{\mathrm{RV}}$ by a factor of 10. Thus, if we aim for ${{ \mathcal C }}_{3}\approx 100$, we need $\sim {10}^{4}$ grid points for each box dimension to resolve the resistive-viscous layer with ∼10 grid points.

The fourth condition (Equation (99)) is satisfactorily fulfilled, since ${P}_{{\rm{m}}}=10\gtrsim 1$.

The reference simulation #Rf was performed with the HLL Riemann solver, an MP9 reconstruction scheme, and with a grid of 2048 × 2048 zones (Figure 10). We find that the initially imposed magnetic field and velocity perturbations do not evolve much with time, except for a growth of their amplitudes. This indicates that our initial perturbations, which are based on the TM solution in resistive-non-viscous MHD (in the constant ψ approximation), are very similar to the eigenfunctions of resistive-viscous TM.

The upper right panel of Figure 10 shows profiles in the y direction of the initial (black) and the evolved (at t = 40; green) magnetic field perturbations at $x=-0.5$, the latter being normalized to the ratio $\max | {b}_{y}(t=0)| /\max | {b}_{y}(t=100)| $. The corresponding velocity perturbation at x = 0 (bottom panels) exhibit two pronounced extrema surrounding the magnetic shear layer (marked by the two vertical green lines in the lower right panel, which is a zoom of the lower left panel), which are characteristic of TMs.

To measure the TM growth rate, we compute the evolution with time of the quantity

Equation (101)

where the integration is performed only up to $| y| \leqslant a$ to reduce a potential influence of boundary conditions. After an initial transient lasting up to 20 time units during which the initial perturbation adjusts to the analytic solution, ${\bar{E}}_{\mathrm{mag},y}(t)$ grows exponentially at a constant rate. Since ${b}_{y}\propto \exp (\gamma t)$,

Equation (102)

where the constant depends on the initial perturbation amplitude and the box size. Using the above equation, we compute the instability growth rate by means of a simple linear regression. The black line in the upper left panel of Figure 10 shows the time evolution of ${\bar{E}}_{\mathrm{mag},y}$, while the green dashed line is the linear fit according to Equation (102). Note that both lines are almost indistinguishable after the initial transient time.

Figure 10.

Figure 10. Reference simulation (#Rf, 2048 × 2048 zones, MP9, HLL Riemann solver) of TM driven by physical resistivity ($\eta ={10}^{-5}$) and exemplary simulation (#Ex, 384 × 384 zones, MP5, LF Riemann solver) of TM driven by numerical resistivity (i.e., $\eta =0$). The numerical resistivity is negligible for #Rf (${\eta }_{* }\ll \eta ={10}^{-5}$) and has a value of ${\eta }_{* }=6.5\times {10}^{-6}$ for #Ex (marked by the third rightmost asterisk in Figure 12). Top left: evolution of the magnetic energy, ${\bar{E}}_{\mathrm{mag},y}$ (Equation (101)) for simulation #Rf (black line) and #Ex (red line) together with linear fits to the logarithm of ${\bar{E}}_{\mathrm{mag},y}$ for $t\in [20,40]$ (green and blue dashed lines) from which the instability growth rate can be measured. Top right: initial (black) and evolved profiles of the magnetic field perturbation b1y at $x=-0.5$ in simulation #Rf (at t = 40; green) and #Ex (at t = 100; red) normalized to the ratio $\max | {b}_{y}(t=0)| /\max | {b}_{y}(t=100)| $. Bottom left: same as upper right panel, but showing the velocity perturbation vy at x = 0. The two extrema at $y\approx \pm 0.02$ determine the width of the resistive-viscous layer ${L}_{\mathrm{RV}}$. Bottom right: zoom of the bottom left panel near the current sheet showing the evolved velocity perturbation for simulation #Rf. The two green and two red vertical lines, which are located at $y=\pm {L}_{\mathrm{RV}}$ and $y=\pm {\epsilon }_{\mathrm{RV}}$ (Equation (142)), respectively, bracket the resistive-viscous layer and the region where the modulus of the dimensionless parameter $\tilde{s}$ (Equation (151)) is smaller than one.

Standard image High-resolution image

To obtain the width of the resistive-viscous layer, we plot ${v}_{y}(x=0,y)$ for every simulation at t = 30 and measure the locations ${L}_{\mathrm{RV}}^{+}$ and ${L}_{\mathrm{RV}}^{-}$ of the two velocity extrema (see vertical green lines in the bottom right panel of Figure 10). To attribute a measurement error, we note that the extremum can be located anywhere inside of the corresponding computational zone of vertical size ${\rm{\Delta }}y$. Thus, the actual location of the extremum is uncertain up to an error $\pm {\rm{\Delta }}y/2$, i.e., the layer width is

Equation (103)

The methodology explained above to measure the growth rate γ and the width of the resistive-viscous layer ${L}_{\mathrm{RV}}$ was applied to all TM simulations discussed below. To understand the dependence of these quantities on the different relevant parameters and to compare with the analytic results, we performed several series of simulations exploring the parameter space in the neighborhood of the reference model, by varying η, ν, b0, and k. Details of these simulations can be found in Appendix A.

The main result extracted from this set of (numerically converged) simulations is the disagreement between the numerically obtained growth rates and the analytic ones given by Equation (91). The most likely explanation for the discrepancy is that the parameters of our TM simulations are outside of the regime of validity of the analytic results, particularly because of the difficulty to guarantee ${L}_{\mathrm{RV}}\ll a$. Unfortunately, this means that the analytic expressions (91) and (92) cannot be used to measure numerical resistivity. Thus, we decided to use an empirical approach to the problem.

Using the insight gained from the theoretical work of FKR63, we postulate an ansatz for the dependence of both the TM growth rate and the width of the resistive-viscous layer on the physical parameters, which we then calibrate using the series of numerical simulations mentioned above. The whole procedure is described in detail in Appendix A. The empirical expressions resulting for k = 3 and a = 0.1 are

Equation (104)

Equation (105)

Figure 11 shows the TM growth rates (upper panel) and the width of the resistive-viscous layer (lower panel) measured from two series of simulations done with a viscosity $\nu ={10}^{-4}$ (blue diamonds) and $\nu ={10}^{-5}$ (red asterisks) for different values of the resistivity. Solid lines represent the empirical expressions given by Equations (104) and (105), while the analytic results given by Equation (91) are plotted with dashed lines in the upper panel of Figure 11. The discrepancy in the growth rate between analytic and numerical results is obvious, whereas our empirical expression (105) for the width of the resistive-viscous layer is compatible with the analytical one (Equation (92)).

Figure 11.

Figure 11. TM growth rate (top) and resistive-viscous layer width (bottom) as a function of resistivity. Blue diamonds and red asterisks denote results of simulations performed with a constant viscosity of $\nu ={10}^{-5}$ and $\nu ={10}^{-4}$, respectively. The simulations employed the HLL Riemann solver, MP9, and a grid resolution of 2048 × 2048 zones. The solid lines are empirical expressions given by Equations (104) and (105), respectively. The dashed lines in the upper panel are the analytical predictions given by Equation (91).

Standard image High-resolution image

4.3.3. Numerical TM

With the knowledge acquired from the resistive-viscous simulations of the previous section, we can tackle the problem of estimating the numerical resistivity of the code. If we perform a simulation with $\eta =0$, the development of TM signals the presence of a non-zero numerical resistivity ${\eta }_{* }$, because TM are not present in ideal MHD.

For the numerical setup presented in the previous section and for a viscosity $\nu ={10}^{-4}$, the TM growth rate should be well described by Equation (104), if ${\eta }_{* }\lesssim {10}^{-5}$. In this case, we can determine ${\eta }_{* }$ using the expression

Equation (106)

where we need to measure only the growth rate of the instability, γ, for a simulation with k = 3 and a = 0.1.

Alternatively, one could measure the resistive-viscous layer width (Equation (105)) to obtain ${\eta }_{* }$ from the expression

Equation (107)

This method is much less accurate, however, because measuring ${L}_{\mathrm{RV}}$ from a simulation is prone to rather large relative errors (of the order of 0.1), and because ${\eta }_{* }\propto {L}_{\mathrm{RV}}^{6}$.

To compute the numerical resistivity from Equation (106), we need to know the value of the viscosity ν. However, for a coarse numerical resolution, the value of the numerical viscosity can be of the same order. Therefore, we should require $\nu \gg {\nu }_{* }$. Expecting that the numerical resistivity and viscosity are of the same order, we had to choose a value of ν that is larger than the typical values of both numerical resistivity and numerical viscosity. On the other hand, ν must not be too large because the growth rate of the instability decreases with increasing ν, i.e., more expensive simulations are required. The size of the resistive-viscous layer also grows with ν and may become comparable to a, thus violating the condition ${L}_{\mathrm{RV}}\ll a$, i.e., Equation (104) no longer holds. As a compromise, we chose a value of $\nu ={10}^{-4}$ and performed all simulations with sufficiently high resolution to ensure that ${P}_{{\rm{m}}}\gg 1$.

Equation (104) was obtained from numerical simulations in which we removed the background field from the resistive term of the MHD equations (see Equation (100)) to prevent diffusion of the background field. The simulations to be discussed in the remainder of this section did not require this measure, because they were performed without physical resistivity. In spite of this difference, we can still apply the calibration obtained in the former series of simulations, because we find that the results of both series of simulations are consistent (TM develop in both cases, but the background magnetic field does not diffuse). Hence, numerical resistivity seems to act independently on large scales (diffusion of the background field across the box) and small scales (development of TM). This finding confirms our ansatz, which postulates that the value of numerical resistivity differs for phenomena occurring at different length scales, because ${\eta }_{* }$ depends on the typical length (${ \mathcal L }$) and velocity (${ \mathcal V }$) of the flow.

To determine the dependence of the numerical resistivity on the three Riemann solvers (LF, HLL, HLLD), we performed simulations with the MP5 reconstruction scheme, the RK3 time integrator, a CFL factor of 0.7, and grids of 128 × 128 to 1024 × 1024 zones. The default physical parameters were a = 0.1, k = 3, ${b}_{0}={\rho }_{0}=1$, $\nu ={10}^{-4}$, and $\eta =0$.

We find that TM are instigated by numerical resistivity for the LF solver. In the simulations performed with the HLL and HLLD Riemann solvers, no TM are observed, i.e., the numerical resistivity resulting from these solvers, though undetermined, must be much less than that of the LF solver. For the latter solver, as expected, the higher the grid resolution the smaller the instability growth rate, i.e., the lower the numerical resistivity (see Figure 12), since $\gamma \propto {\eta }^{4/5}$ (Equation (104)). Coarsening the grid resolution, the numerical resistivity eventually becomes so high that the width of the resistive-viscous layer is so large that Equation (104) is invalid, and we can no longer precisely measure the magnitude of the numerical resistivity. The resolution limit depends on the order of the reconstruction scheme, being 320, 256, and 224 zones per dimension for the MP5, MP7, and MP9 scheme, respectively.

Figure 12.

Figure 12. Numerical resistivity of TM simulations performed with 224–1024 zones (per dimension), the LF Riemann solver, a viscosity $\nu ={10}^{-4}$, no (physical) resistivity, and the MP5 (green asterisks), MP7 (blue plus signs), and MP9 reconstruction scheme (black diamonds). The straight lines are linear fits to the data.

Standard image High-resolution image

The results of an exemplary simulation (#Ex) without resistivity obtained with MP5 reconstruction scheme on a grid of 384 × 384 zones are shown in Figure 10. Like in the reference model #Rf (with $\eta ={10}^{-5};$ black dashed–dotted line in upper left panel), a TM grows exponentially with time in model #Ex (red dashed–dotted line in the panel), this time being driven by numerical resistivity (in this simulation ${\eta }_{* }=6.5\times {10}^{-6}$ marked with the third rightmost asterisk in Figure 12). The TM induced growth of the magnetic field (upper right panel of Figure 10) and velocity (bottom left panel) perturbations in model #Ex (without resistivity; red lines) are similar to those in model #Rf (with resistivity; green lines). This comparison clearly demonstrates that the behavior of the numerical resistivity closely resembles that of (real) physical resistivity.

We anticipate that the main contribution to the numerical resistivity comes from the y-direction. All variables exhibit a much stronger variation in the y-direction than in the x-direction. Hence, the characteristic length scales in our multi-D ansatz for the numerical resistivity (analogous one to ansatz (24) for numerical shear viscosity), are much larger in the x-direction than in the y-direction, ${{ \mathcal L }}_{x}\gg {{ \mathcal L }}_{y}$. More specifically, we can preliminarily estimate that ${{ \mathcal L }}_{x}\propto {k}^{-1}\propto {L}_{x}$ and ${{ \mathcal L }}_{y}\lesssim a$. Consequently, the total numerical errors coming from the x-direction will be negligible compared to the ones due to the discretization in y, allowing us to use the simpler one-dimensional ansatz in the following. Therefore, in the further discussion of TMs, we will refer to the 1D ansatz for numerical resistivity (Equation (21)) for the sake of simplicity. Furthermore, we will use ${\rm{\Delta }}x$ instead of ${\rm{\Delta }}y$, since they are equal in our simulations, having in mind, however, that the main contribution comes form errors proportional to ${({\rm{\Delta }}y/{{ \mathcal L }}_{y})}^{r}$. A similar situation occurred in the 2D simulation of sound waves (series #LS6–#LS11 from Table 4) in which ${({\rm{\Delta }}x/{{ \mathcal L }}_{x})}^{r}\gg {({\rm{\Delta }}y/{{ \mathcal L }}_{y})}^{r}$ and therefore the contribution of the y sweep to the numerical dissipation was negligible and one could equally well use 1D ansatzes for numerical dissipation.

The dependence of the numerical resistivity (which is determined from the measured growth rate of the instability using Equation (106)) on the grid resolution is shown in Figure 12. The results are fitted with the functions

Equation (108)

where ${\alpha }_{i}$ and ci are the coefficients of the MP reconstruction scheme of the ith order. Their values are (for a CFL factor in the range of 0.1–0.7)

Equation (109)

If the numerical resistivity scales as ${\eta }_{* }\propto { \mathcal V }{ \mathcal L }\,{({\rm{\Delta }}x/{ \mathcal L })}^{r}$ as in Equation (21), one would naively expect that the growth rate scales as $\gamma \propto {({\rm{\Delta }}x)}^{4r/5}$, i.e., the expected theoretical values should be ${\alpha }_{5}=4$, ${\alpha }_{7}=5.6$, and ${\alpha }_{9}=7.2$, which do not agree with our results. As we explain below, this argumentation is wrong, however, because it fails to account for an (implicit) dependence of the quantities ${ \mathcal V }$ and ${ \mathcal L }$ on ${\eta }_{* }$.

To explain the apparent considerable reduction of the convergence order r of the MP reconstruction schemes in (109), we need to have a careful look at the ansatz (21) for the numerical resistivity (neglecting the contribution of time integration errors)

Equation (110)

where ${ \mathcal V }$ and ${ \mathcal L }$ are the system's characteristic speed and length, respectively.

If we were to assume ${ \mathcal L }\propto a$ (which is constant), we would obtain ${r}_{i}=(5/4){\alpha }_{i}$. The conceptual mistake we have made here is that a is the correct choice for the characteristic length of the background magnetic field diffusion problem, but not for a TM whose length scale is much smaller than the shear width. It turns out (as we demonstrate below) that the characteristic length of the system is proportional to the width of the resistive-viscous layer, i.e., ${ \mathcal L }\propto {L}_{\mathrm{RV}}$. This seems logical because the current sheet can be described very well neglecting Ohmic dissipation everywhere outside the narrow resistive-viscous layer whose width is ${L}_{\mathrm{RV}}$ rather than a.

The value of ${ \mathcal L }$ is somewhat arbitrary, because the boundary of the resistive-viscous layer is (physically) not sharp. We defined its width to be set by the characteristic velocity peaks (see Figure 8), which is a useful convention for our purpose. In fact, there exists a transition region (marked in shaded yellow in the figure), where the ideal MHD equations can still approximately be applied, though one is already in the non-ideal regime.

For our applications, we found a useful definition based on the fact that resistive and viscous effects are largest in the vicinity of steep gradients of the MHD variables. The (in relative terms) most important gradient is that of the y-component of the velocity, which is very large between the two extrema close to the current sheet (see bottom left panel of Figure 10). Taking into account that ${L}_{\mathrm{RV}}$ is the half distance between the two extrema, which approximately corresponds to one-fourth of a wavelength of a sine function, we propose to use as the proper length scale

Equation (111)

This choice is consistent with identifying ${ \mathcal L }$ with the wavelength in the wave damping tests. It further suggests that a similar reasoning based on local extrema may lead to the appropriate value in other systems as well. Combining Equations (111) and (110), we obtain

Equation (112)

On the other hand, from Equation (105), we have

Equation (113)

Note the explicit dependence of Equation (112) on ${L}_{\mathrm{RV}}$ and of Equation (113) on ${\eta }_{* }$. This dependence can be easily removed obtaining the expressions

Equation (114)

Equation (115)

which are valid only for a = 0.1 and k = 3, and give the true dependence of ${\eta }_{* }$ and ${L}_{\mathrm{RV}}$ on the grid resolution. Consequently, the TM growth rate is expected to depend on ${\rm{\Delta }}x$ with an exponent ${\alpha }_{i}=24r/[5(5+r)]$, which allows us to compute the order of convergence from the numerical values ${\alpha }_{i}$ as

Equation (116)

Similarly, Equation (114) can be used to compute ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$, resorting to the coefficient ci from the fit to the growth rate and identifying ${ \mathcal V }$ as the magnetosonic speed, i.e., ${ \mathcal V }={c}_{\mathrm{ms}}\approx 1.63$ in this case ($\theta =\pi /2$ in Equation (47)).

In Table 5, we list the values of ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ and r computed with the procedure outlined above. The MP5 and MP7 schemes are almost fifth and seventh order accurate, whereas the MP9 scheme performs below the theoretical expectation. In other words, the higher the order of the reconstruction scheme, the higher the reduction of the convergence order. A possible explanation of this fact is the following. The function ${v}_{y}$ is proportional to ${y}^{-1}$ for $| y| \ll a$, i.e., outside of the resistive-viscous layer (see the discussion in Appendix A, in particular, Equation (129) and Figure 17). For this reason, all the derivatives of ${v}_{y}$ in the y-direction diverge. Thus, the neglected higher-order terms of the Taylor expansion in the reconstruction of ${v}_{y}$ for $y\approx 0$ can actually be dominant. Taking this into consideration, it is rather more surprising that the MP5 and MP7 schemes almost achieve their theoretical order of accuracy than the fact that the MP9 scheme performed below the theoretical expectation.

Table 5.  Resistivity Coefficient ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ (for the Definition, See Equation (21)) and Reconstruction Scheme Order r (Equation (116)) Determined from TM Simulations Performed with the LF Riemann Solver (see also Figure 15)

Reconstruction ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ r
MP5 16 ± 5 4.81 ± 0.09
MP7 142 ± 33 6.65 ± 0.08
MP9 170 ± 220 7.6 ± 0.6

Download table as:  ASCIITypeset image

According to Figure 13, the values of ${L}_{\mathrm{RV}}$ measured directly from the numerical simulations (see the previous section) agree well with those computed with Equation (115), where the values of r and ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$ needed in this equation are extracted from the growth rate using Equations (109) and (116). This result shows that our assumptions are correct, which is far from being obvious, because we assumed that (1) numerical errors can be called "numerical resistivity," (2) this numerical resistivity can be treated as normal physical resistivity, and (iii) the same equations can be used to determine its magnitude or predict its influence on the system. Moreover, we also had to make use of ansatz (21) for the numerical resistivity.

Figure 13.

Figure 13. Width of the resistive-viscous layer as a function of ${\rm{\Delta }}x$ (which is proportional to the value of the numerical resistivity) in simulations of TM driven by numerical resistivity. Black crosses depict measured values obtained in simulations with MP7. The red curve shows the expected layer width (Equation (115)), given the parameters for the numerical resistivity determined from the measured growth rate.

Standard image High-resolution image

To test whether the magnetosonic speed is indeed the characteristic velocity of our TM setup, as expected from the arguments given in the discussion of the wave damping simulations, we ran several simulations with the same setup, but varying the fast magnetosonic speed from ${c}_{\mathrm{ms}}\approx 1$ to $\approx 39$. This was achieved by changing the background pressure from 0.01 to 900, keeping ${b}_{0}={\rho }_{0}=1$. The upper panel of Figure 14 shows that the numerical resistivity increases with ${c}_{\mathrm{ms}}$.

Figure 14.

Figure 14. Upper panel: numerical resistivity in TM simulations performed with MP5 on a grid of 512 × 512 zones as a function of the fast magnetosonic speed ${c}_{\mathrm{ms}}$ (Equation (118)), which was changed varying p0 but keeping b0 and ${\rho }_{0}$ constant. The black curve is a fit to the simulation data. Bottom panel: width of the resistive-viscous shear layer (black crosses) as a function of ${c}_{\mathrm{ms}}$ for the simulations shown in the upper panel. The red curve gives the predicted width of the resistive-viscous layer based on the fit in the upper panel.

Standard image High-resolution image

Different from the wave damping tests, it is not straightforward, however, to compute the fast magnetosonic speed, because in TM simulations the perturbed fluid makes a "U-turn" in the vicinity of the magnetic shear layer (i.e., for $| y/a| \ll 1$). Therefore, determining the "correct" values of θ (which changes from 0 to $\pi /2$) and the background magnetic field strength (which changes from 1 for $| y/a| \gg 1$ to 0 for $| y/a| \approx 0$) is very error-prone. That is why we introduced ansatzes (17), (20), and (21) to have a simple way of estimating the code's numerical dissipation. Consequently, we took the maximum possible magnetosonic speed (obtained for $\cos \theta =0;$ Equation (47)) in our previous analysis, i.e., 

Equation (117)

and put ${c}_{{\rm{A}}}=1$, which is well motivated by practical purposes (i.e., to keep the ansatzes as simple as possible). However, in the current analysis (simulations presented in Figure 14), we obtained a better fit with respect to ${c}_{\mathrm{ms}}$ with ${c}_{{\rm{A}}}=0.76$, which corresponds to the Alfvén speed at a distance of y = a, i.e., 

Equation (118)

We note that the precise choice of ${c}_{{\rm{A}}}$ is irrelevant in the high plasma β regime, while it only slightly affects the quality of the fits in the low plasma β regime (where the parameter $\beta \equiv {b}_{0}^{2}/(2{p}_{0})$).

From the measured growth rates γ, we determined the numerical resistivity in each simulation (${\eta }_{* }\propto {\gamma }^{5/4}$), and fitted the results with

Equation (119)

obtaining

Equation (120)

From Equation (114) and Equation (104), we find that

Equation (121)

and putting ${ \mathcal V }={c}_{\mathrm{ms}}$ in Equation (121), we finally obtain

Equation (122)

For MP5 reconstruction (${r}_{\mathrm{th}}=5$), the expected value is s = 0.6, which is close to the measured one. Using s from Equation (120), we determine the reconstruction scheme order to be $r=6.45\pm 0.05$, which is neither equal to 5 within the errors nor consistent with the value of $r=4.81\pm 0.09$ from Table 5. This discrepancy should not concern us, however, because we included only statistical errors in the measurement errors from the linear fit neglecting other errors, e.g., those originating from estimating the fast magnetosonic speed (which changes from zone to zone in the simulation). This implies that this way of determining the order of the reconstruction scheme is much less reliable than from the resolution studies.

In the bottom panel of Figure 14, we show the measured width of the resistive-viscous layer and its value (red curve) predicted from the fit Equation (119). Using the values of s and d in Equation (120), we determined r and ${{\mathfrak{N}}}_{\eta }^{{\rm{\Delta }}x}$, which we then inserted into Equation (115). This methodology demonstrates that our model is self-consistent, since the width of the resistive-viscous layer does depend on ${c}_{\mathrm{ms}}$ as expected.

At the beginning of this section, we made the assumption that the numerical resistivity is not changing the background magnetic profile, but affects only the flow in the resistive-viscous layer, where the TM grows. All consistency checks performed in this section seem to indicate that our assumption is correct. As a confirmation, we checked that there has not been a significant modification of the background profile in any of the simulations. This finding differs from the one obtained in the simulations with physical resistivity but without removing the background field from the induction equation (100). In those simulations, the background field started to diffuse during the simulations (which was the reason why we modified the induction equation (Equation (100)) in the first place).

Finally, in Figure 15, we present a comparison of the expected numerical dissipation in simulations of TM and magnetosonic wave damping based on our ansatz (see Equations (17), (20), and (21)) and the estimators from Tables 1 and 5. For the simulations, we set the characteristic velocities and lengths equal to one, i.e., ${ \mathcal V }={ \mathcal L }=1$. The box length is set to 1 too, hence "resolution" in the abscissa of Figure 15 refers to the number of zones per characteristic length. As we can see, the expected numerical dissipation based on calibration with the help of both types of simulations (MS waves and TM) is similar. This is an indication that our approach is presumably universal, and it makes us confident that it can be used to estimate dissipation coefficients for other flows.

Figure 15.

Figure 15. Comparison of the numerical dissipation of Aenus when simulating magnetosonic waves (MS) and tearing modes (TM) with different reconstruction schemes (MP5, MP7, and MP9) and RK3. The numerical dissipation is given by $(4/3){\nu }_{* }+{\xi }_{* }+{\eta }_{* }/(1+{c}_{{\rm{s}}}^{2}/{c}_{{\rm{A}}}^{2})$ in the former case and by ${\eta }_{* }$ in the latter case. For the wave simulations, we found that ${\eta }_{* }/(1+{c}_{{\rm{s}}}^{2}/{c}_{{\rm{A}}}^{2})\ll (4/3){\nu }_{* }+{\xi }_{* }$ (see Section 4.1.3). For the wave problem, both the HLL and the LF Riemann solver result in a very similar amount of dissipation, whereas for the TM simulations ${\eta }_{* }(\mathrm{HLL})\ll {\eta }_{* }(\mathrm{LF})$. The CFL factor was chosen such that time integration errors were negligible. The results are renormalized by setting the characteristic velocity and length equal to one, i.e., ${ \mathcal V }={ \mathcal L }=1$.

Standard image High-resolution image

5. Case Study: MRI

In the previous section, we present a methodology that allows us to estimate the numerical viscosity (bulk and shear) and resistivity of a code. It also serves to determine the characteristic velocity, ${ \mathcal V }$, relevant for the numerical dissipation coefficients. We applied this methodology to the AENUS code for different numerical schemes. Using the ansatzes Equations (17), (20), and (21) and the numerical dissipation coefficients given by Tables 3 (for shear and bulk viscosity coefficients) and 5 (for resistivity coefficients), it is possible to determine the numerical resolution, ${\rm{\Delta }}x$, needed to perform a numerical simulation with a numerical viscosity and resistivity lower than a given threshold. This allows us to estimate the computational resources needed for a particular application and helps us to choose the numerical scheme that minimizes the computational cost. To show the feasibility and the usefulness of this analysis, we present here the estimates for a particular application of AENUS to simulations of the MRI.

The MRI (Velikhov 1959; Chandrasekhar 1960) is an instability that can develop in a differentially rotating fluid in the presence of a magnetic field. In the case of an homogeneous vertical magnetic field, the MRI develops nonlinear channel flows, which are then disrupted by parasitic instabilities (Goodman & Xu 1994; Pessah & Goodman 2009) into a turbulent flow. The instability has been proposed as the main driver of accretion in accretion disks (Balbus & Hawley 1991) and may play an important role in the amplification of magnetic field during the collapse of stellar cores (Akiyama et al. 2003). There are a number of MHD simulations devoted to the study of the MRI in local box simulations (see, e.g., Obergaulinger et al. 2009; Rembiasz et al. 2016b, 2016a) in which we can aim to resolve numerically the magnetized flow with minimal numerical viscosity and resistivity. The main difficulty of those simulations is that the characteristic length scale relevant for the growth of the MRI channel modes and its termination due to parasitic instabilities (Kelvin–Helmholtz vortices) is very small (${ \mathcal L }\sim 100$ m) compared to the size of the system (∼10 km) when realistic conditions are considered (see Obergaulinger et al. 2009, for a discusion). Here we show, as an example, how one can estimate the resolution requirement and computational cost for the numerical simulations presented in Rembiasz et al. (2016b).

In the typical setup of Rembiasz et al. (2016b), the box size is $2\,\mathrm{km}\times 2\,\mathrm{km}\times 0.666\,\mathrm{km}$ or $2\,\mathrm{km}\times 8\,\mathrm{km}\times 2\,\mathrm{km}$ (radial, azimuthal, and vertical extension) and channel modes develop with a size of ${\lambda }_{\mathrm{MRI}}=0.666$ km in the vertical direction (one or three channel modes fit in the vertical direction, depending on the box size). The characteristic length is set by the width of the channel mode, i.e., ${ \mathcal L }={\lambda }_{\mathrm{MRI}}$. The characteristic speed may be chosen among the fast magnetosonic speed (${c}_{\mathrm{ms}}=3\,\times {10}^{9}$ cm s−1), the Alfvén speed, (${c}_{{\rm{A}}}=7.8\times {10}^{7}$ cm s−1), or the flow velocity (${v}_{\mathrm{flow}}=2.4\times {10}^{9}$ cm s−1). To make a conservative estimate, we take the largest of the three, i.e., ${ \mathcal V }=3\times {10}^{9}$ cm s−1. The goal of Rembiasz et al. (2016b) was to run the simulations with numerical viscosities and resistivities below a value of $7.48\times {10}^{8}$ cm2 s−1 (according to estimates of Guilet et al. 2015, (physical) viscosity due to neutrinos can vary from ${10}^{9}\mbox{--}{10}^{12}$ cm2 s−1 inside of a proto-neutron star). They estimated that in that regime the Reynolds numbers are above ∼100, which would be sufficient to have convergent results for the growth of the channel flows up to the termination due to parasitic instabilities. The post-termination evolution of the generated turbulent flow would have probably required more stringent resolutions, but this was not the aim of Rembiasz et al. (2016b).

Figure 16 shows the estimated numerical viscosities and resistivities of the AENUS code according to the measurements of the present work rescaled to the simulations of Rembiasz et al. (2016b) for an HLLD solver and three different reconstruction schemes (MP5, MP7, and MP9). According to the figure, it is sufficient to perform simulations with 10, 14, and 28 zones per ${ \mathcal L }$ to reach the accuracy goal for MP9, MP7, and MP5, respectively. This result demonstrates the advantage of using ultra-high-order schemes (MP9) in simulations of smooth flows.

Figure 16.

Figure 16. Estimation of the numerical shear viscosity (solid lines), bulk viscosity (dashed lines), and resistivity (dotted lines) for the MRI simulations of Rembiasz et al. (2016b) for different numbers of grid points per length scale (${\rm{\Delta }}x/{ \mathcal L };$ lower abscissa). Results are shown for three different reconstruction schemes: MP5 (red), MP7 (blue), and MP9 (green). Vertical black lines show the resolution used in that work. The horizontal black line shows the viscosity and resistivity goal, below which the Reynolds numbers exceed a value of ∼100. The upper abscissa gives an estimate of the corresponding computational cost of a 12 ms simulation with AENUS for the smallest box size ($2\,\mathrm{km}\times 2\,\mathrm{km}\times 0.666\,\mathrm{km}$).

Standard image High-resolution image

Once the numerical resolution is known, it is possible to estimate the computational cost of a given simulation. As an example, we consider our smallest simulation box ($2\,\mathrm{km}\times 2\,\mathrm{km}\times 0.666\,\mathrm{km}$), a typical simulation period of 12 ms duration, and a CFL factor of 0.7. AENUS performs on the SuperMUC supercomputer (www.lrz.de) typically at 0.15 ms/iteration/zone. The upper abscissa of Figure 16 shows the resulting total CPU time for this setup. To reach the accuracy goal, we estimate that we need at least 15, 60, and 842 CPU hrs for MP9, MP7, and MP5, respectively. Even if MP9 suffers a slight computational overhead in comparison to MP7 and MP5, due to the larger size of the numerical stencil, our analysis shows that it pays off to perform simulations with MP9. Indeed, Rembiasz et al. (2016b) performed their simulations with resolutions ranging from 20 to 134 zones per ${\lambda }_{\mathrm{MRI}}$ and showed convergence of the results.

6. Summary and Conclusions

We have presented a reliable methodology to measure the numerical shear and bulk viscosity, and the resistivity of Eulerian finite volume MHD codes by means of a simple ansatz for each of these numerical effects, which are inevitably present in any such code. We have postulated that the amount of numerical dissipation depends on the characteristic length and velocity of the system under consideration, the numerical resolution, and some free parameters that have to be calibrated depending on the numerical scheme in use. Hence, our ansatz for each of the three numerical effects consists of two additive terms describing the contribution of spatial and temporal discretization errors, which both depend on the characteristic length and velocity of the system, and on the grid resolution and the size of the time step, respectively.

We performed the parameter calibration by means of a set of test simulations using the Aenus code. However, because the procedure is not restricted to this code, we provide potential users of our methodology with the detailed results of our test suite at http://www.uv.es/camap/tmweb/Web_tm.html. These data should help to measure the dissipation coefficients of other Eulerian finite volume MHD codes.

First, we have considered three wave damping tests from which one can directly extract a linear combination of the numerical resistivity, and the numerical shear and bulk viscosities. These simulations allowed us to estimate the latter two quantities accurately. However, we failed to obtain a physically sound value of the numerical resistivity, because it is much smaller than that of the numerical viscosity of Aenus, i.e., our estimate of the numerical resistivity is dominated by systematic errors.

Nevertheless, the wave damping simulations confirm the appropriateness of our ansatz for the numerical shear and bulk viscosity, and the resistivity. In almost all simulations performed by us, the spatial reconstruction schemes and the RK time integrators have the theoretically expected order of accuracy. We also find that in simulations of sound waves, Alfvén waves, and fast magnetosonic waves, the characteristic length and velocity of the system are always the wavelength of the wave and the fast magnetosonic speed (which reduces to the sound speed in the case of sound waves), respectively. Because the value of the numerical resistivity is substantially lower than that of the numerical viscosity in the wave damping tests (see above), the numerical magnetic Prandtl number ${P}_{{\rm{m}}* }\equiv {\nu }_{* }/{\eta }_{* }$ is not close to 1, as is commonly suspected among practitioners in the field.

Second, we have performed TM simulations since the wave damping ones were hardly useful to asses the value of the numerical resistivity. By measuring the growth rate of the TM instability and fixing the value of the physical viscosity, we have been able to estimate the numerical resistivity of Aenus. Moreover, from the estimated value of the numerical resistivity, we could correctly predict the expected width of the resistive-viscous layer. This indicates that our method is (self-)consistent. A cautionary note must be added here. In order to obtain reliable estimates of the numerical resistivity in TM simulations, it is necessary to employ spatial reconstruction schemes of the order of $r\geqslant 5$. Extensive numerical experience (Rembiasz 2013) shows that the TM setup employed here becomes numerically unstable for lower-order reconstruction schemes in the resolution range considered by us, i.e., it was difficult to maintain a magnetohydrodynamical equilibrium of the background flow for tests in which less than a fifth-order spatial reconstruction scheme was employed.

Comparing the expected numerical dissipation in simulations of magnetosonic wave damping and TM, we find that the expected numerical dissipation based on a calibration with the help of both types of simulations is similar. This indicates that our approach is supposedly universal, which gives us confidence that it is also applicable to estimate the dissipation coefficients for different flow regimes and numerical setups. To illustrate our approach in an astrophysical context, we have estimated in Section 5 the numerical viscosities and resistivity for the MRI models of Rembiasz et al. (2016b), which in turn have allowed us to obtain a reliable estimate of the computational needs in terms of numerical resolution and computational time for these particular simulations.

We have found that the high orders of convergence of the MP reconstruction schemes obtained in the wave damping tests are retained in the 2D simulations of sound waves and TMs. This is a remarkable result, because our approach is based on several (one per dimension) independent one-dimensional reconstruction steps instead of a genuinely multi-D reconstruction algorithm as proposed by, e.g., Colella et al. (2011), McCorquodale & Colella (2011), Zhang et al. (2011), and Buchmüller & Helzel (2014). In general, such a simplification may introduce additional numerical errors, thus degrading the order of accuracy of multi-D simulations to second order, i.e., well below that of 1D ones.

However, our 2D simulations do not suffer from this degradation. This may be the result of our somewhat simple tests, i.e., in the TM case, the derivatives in the y-direction dominate over the ones in the x-direction, and in 2D simulations of sound waves, we consider small sinusoidal perturbations of the background. One should not expect this behavior to hold in a general case of a nonlinear multi-D problem. However, exploring this topic is beyond the scope of this work.

It is important to note that, in our ansatz, there is a single length scale ${ \mathcal L }$ for which the dissipation coefficients are estimated. If applied to systems in which dissipation occurs at multiple length scales (e.g., turbulence), then the interpretation of our ansatz is a measurement of the dissipation coefficients at each length scale, which may give rise to different values of these coefficients. Indeed, we observe this effect in our TM simulations, if the background magnetic field is not eliminated from the induction equation. If not eliminated, we have dissipation occurring both in the resistive-viscous layer (of size ${L}_{\mathrm{RV}}$) and within the background shear profile (of size $a\gg {L}_{\mathrm{RV}}$) at the same time. This scale-dependent definition of the dissipation coefficients is similar to that used in large eddy simulations of anisotropic weakly compressible turbulence (see, e.g., Fureby & Grinstein 1999; Zhou et al. 2014; Radice et al. 2015). Alternatively, we could have formulated our ansatz equivalently in terms of scale-independent hyperviscosity and hyperresistivity coefficients. This formulation has the disadvantage of not having physical counterparts for the purely numerical hyperdissipation coefficients but, on the other hand, it allows us to interpret the high-order derivative terms appearing in the Taylor expansion of the space and time derivatives (see Equation (10)).

Using our ansatz may not always be straightforward, since it requires identifying the relevant characteristic velocity ${ \mathcal V }$ and length ${ \mathcal L }$, of the system. As for the former, we have shown that in all our tests (wave damping and TM) without background flow, the characteristic velocity is equal to the fast magnetosonic speed. In the wave damping tests with a non-zero background velocity (see Section 4.1.5), we have found that the characteristic velocity depends on the direction of the wave propagation relative to the direction of the background flow. However, one can easily obtain an estimate for the upper limit of the characteristic velocity, i.e., for the sum of the moduli of the background velocity and the fast magnetosonic speed. The determination of the characteristic length, ${ \mathcal L }$, of the system can be tricky and requires a good understanding of the simulated system. For example, in the case of the TM simulations, the first "natural candidate" for ${ \mathcal L }$ seems to be the width of the magnetic shear layer, a, (Equation (76)), but it turns out to be the width of the resistive-viscous layer, ${L}_{\mathrm{RV}}$ (Equation (105)).

Even though all of our tests were performed in boxes with uniform grid resolutions, our results can be translated to adaptive mesh refinements (AMR) codes that refine the grid where the flow develops small-scale structures. A natural way of using our ansatzes in AMR simulations would be to apply it at each refinement level separately, i.e., to compute the numerical dissipation coefficients (21) based on the refined grid width. Numerical viscosity and resistivity then quite obviously are position-dependent. This is, however, not a unique feature of AMR simulations because, in general, numerical viscosity and resistivity are local quantities because they depend on the characteristic velocity and length scale that may vary strongly throughout the simulation domain.

Finally, we note that in the (astro-)physics literature hydrodynamic and magnetohydrodynamic simulations are often categorized by the numerical Reynolds numbers

Equation (123)

where L and V are the typical length and typical velocity of the system, respectively. However, often both quantities are subjectively chosen. In other words, the assumed typical length and velocity of the system are not the values obtained after a thorough calibration analysis, as we have conducted here. Indeed, in general, $L\ne { \mathcal L }$ and $V\ne { \mathcal V }$, i.e., the typical values (chosen by the respective author), are not equal to the characteristic values, which are uniquely set by the physics and numerics of a given simulation. Hence, the Reynolds numbers commonly estimated can vary by a few orders of magnitude for the same physical system and numerical setup across the literature. For this reason, the typical values of the numerical Reynolds number seldomly are a useful quantity to cross-compare different numerical models. However, once the numerical viscosity and resistivity are measured (as we propose in this paper), one can easily express simulation results in terms of numerical hydrodynamic and magnetohydrodynamic Reynolds numbers, in as much as the proper characteristic length and velocity of the system have been identified. Because this is not a common practice in the community, we conclude that the use of numerical Reynolds numbers more often obscures than reveals the true nature of numerical viscosity and resistivity.

T.R. acknowledges support from The International Max Planck Research School on Astrophysics at the Ludwig Maximilians University Munich. E.M. and T.R. acknowledge support from the Max-Planck-Princeton Center for Plasma Physics as well as from the Deutsche Forschungsgemeinschaft through the grant EXC 153 "Origin and Structure of the Universe." M.A., M.O., P.C.D., and T.R. acknowledge support from the European Research Council (grant CAMAP-259276). We also acknowledge support from grants AYA2015-66899-C2-1-P, AYA2013-40979-P, and PROMETEOII/2014-069. The computations were performed at the Max Planck Computing and Data Facility (MPCDF) and at the Servei d'Informàtica of the University of Valencia. We thank J. Guilet for his useful comments on the manuscript. We also thank the anonymous referee whose valuable comments and suggestions allowed us to improve the quality of this manuscript.

Software: Aenus (Obergaulinger 2008).

Appendix A: TM Growth Rate

In Appedix A.1, we present an analytical derivation of the TM growth rate in resistive MHD, and we briefly discuss a generalization of these results to resistive-viscous MHD, which was already done by FKR63.

In Appendix A.2, we postulate empirical equations for the TM growth rate in resistive-viscous MHD and calibrate these rates with the help of numerical simulations.

A.1. Analytical Approach

In their analytical study of the TM instability, FKR63 considered the effects of various physical factors, like a position-dependent background density, temperature, and resistivity. We will restrict ourselves to a much simpler system, yet demonstrating the key features of the TM instability. Our presentation is greatly inspired by the excellent discussion of this topic in Goedbloed et al. (2010). We also recommend Schnack (2009) for a concise introduction to the TM instability.

A.1.1. General Case

We consider perturbations of the system described in Section 4.3.1 whose wavelength in x direction is comparable to the shear width, i.e., $k\lesssim {a}^{-1}$ (Equation (84)). Note that one only needs to solve Equations (77) and (78) for ${v}_{y}$ and b1y, respectively, while the other perturbation components can be easily determined from conditions (79) and (80). For the WKB ansatz (Equations (81) and (82)) to be justified, condition (83) must be satisfied.

Inserting the WKB ansatz into Equations (77) and (78) and taking the curl of the latter equation to eliminate the pressure, the y component of the induction equation and the derivative ${\partial }_{x}$ of the z component of the equation of motion read

Equation (124)

Equation (125)

After some algebra, we arrive at

Equation (126)

Equation (127)

Because this system cannot be integrated analytically, FKR63 used the BLA method (see Section 4.3.1). They divided the domain into two regions, an outer one ($-{L}_{y}\leqslant y\lt -{y}_{\epsilon }$ and ${y}_{\epsilon }\lt y\leqslant {L}_{y}$, where ${y}_{\epsilon }$ is a small positive constant such that ${y}_{\epsilon }\ll a$) in which dissipative effects can be neglected, and an inner layer ($-{y}_{\epsilon }\lt y\lt {y}_{\epsilon }$) in which resistivity (and viscosity) are important (see Figure 8). The complete solution is determined by an interplay between both regions: resistivity acts in the inner region, but the rate at which magnetic field lines are reconnected also depends on the rate at which the field can be advected into and out of the inner region. Hence, the growth rate can be quite different for field profiles that are the same close to y = 0, but differ elsewhere.

Outer Layer—Condition (83) implies that there are negligible field gradients in the outer regions ($| y| \gt {y}_{\epsilon }$), i.e., resistive processes are slow there compared to the growth of TMs. On the other hand, $\gamma \gg {a}^{-2}\eta \sim {k}^{2}\eta $ (the second relation follows from assumption 84). Hence, to solve Equations (126) and (127) in the outer region the resistivity term in the induction Equation (126) can be neglected, i.e., 

Equation (128)

Furthermore, from the second part of condition (83), we have $\gamma \ll {c}_{{\rm{A}}}/{L}_{y}\sim {c}_{{\rm{A}}}k$. This inequality together with Equation (128) implies that terms proportional to velocity (gradients) in Equation (127) are negligible, i.e., $| \gamma {\rho }_{0}{k}^{2}{v}_{y}| \ll | {{ik}}^{3}{b}_{0x}{b}_{1y}| $. Hence, TMs evolve so slowly that the plasma inertia (terms containing ${\rho }_{0}{v}_{y}$ in Equation (127)) can be neglected on the ideal MHD timescale, and Equations (126) and (127) simplify to

Equation (129)

Equation (130)

in the outer layers. So far, we have not yet made any assumption concerning the background magnetic field. For ${b}_{0x}(y)={b}_{0}\tanh (y/a)$, the solution of Equation (130) reads

Equation (131)

where b1 is a constant (initial perturbation amplitude) and Γ denotes the Euler gamma function. The velocity perturbations can be easily determined combining Equations (129) and (131):

Equation (132)

Note that Equation (129) has a singularity for $| y/a| \to 0$, i.e., for $| {b}_{0x}| \to 0$, which is removed (i.e., smearded out) by resistivity in the inner region.

Inner Layer—Resistive (and viscous) terms can no longer be neglected in the inner layer ($| y| \lt {y}_{\epsilon }$), and we have to solve Equations (126) and (127) simultaneously. Because in the inner region $| y/a| \ll 1$, we can approximate the background magnetic field (Equation (76)) as ${b}_{0x}(y)\approx {b}_{0}y/a$ (Equation (85)). In the inner region, perturbations in both velocity and magnetic field vary more strongly in the y direction than in the x direction, i.e., $| {k}^{2}{v}_{y}| \ll | {\partial }_{y}^{2}{v}_{y}| $ and $| {k}^{2}{b}_{1y}| \ll | {\partial }_{y}^{2}{b}_{1y}| $.5 Therefore, we can neglect the terms proportional to k2 in Equations (126) and (127), and we obtain

Equation (133)

Equation (134)

where we used also Equation (85). Combining both equations into a single one by eliminating terms that contain b1y, we arrive at a sixth-order ordinary differential equation (ODE) for ${v}_{y}$ that reads

Equation (135)

where ${c}_{{\rm{A}}}^{2}\equiv {b}_{0}^{2}/{\rho }_{0}$ and ${v}_{y}^{(n)}\equiv {\partial }_{y}^{n}{v}_{y}$. This equation cannot be integrated analytically, i.e., some further approximations are necessary.

In the inner layer, but sufficiently far away from y = 0, velocity perturbations will have a solution of type ${v}_{y}\propto {y}^{-1}$, i.e., the terms with the highest order derivatives of ${v}_{y}$ dominate the solution of (135). Thus, we proceed neglecting lower-order derivatives in (135). Because the two terms with the highest order derivatives (${\partial }_{y}^{6}{v}_{y}$ and ${\partial }_{y}^{5}{v}_{y}$) depend on viscosity, we consider Equation (135) for two limiting cases, namely in the viscous and the inviscid regime.

A.1.2. Inviscid Case

In the inviscid case ($\nu =0$), Equation (135) reduces to a fourth-order differential equation that is still too complicated to be solved analytically. Therefore, we follow FKR63 and use their "constant ψ approximation".6

FKR63 noted that the function ${v}_{y}$ becomes singular in ideal MHD because ${v}_{y}\propto {y}^{-1}$ for $y\to 0$ (see Equation (129)), i.e., ${v}_{y}$ varies strongly in the limit of small resistivity. Resistivity regularizes this ill-behaved solution. The function b1y varies less for $| y/a| \approx 0$ and can be approximated by a constant ${b}_{1y}(y)\approx {b}_{1y}(0)$. With this approximation, Equations (133) and (134) reduce to

Equation (136)

Equation (137)

We solve this system of equations by first integrating Equation (136) to obtain ${v}_{y}$, which we insert into Equation (137) to get b1y.

To express Equations (136) and (137) in dimensionless form, we introduce the dimensionless variables

Equation (138)

Equation (139)

Equation (140)

Equation (141)

with the length scale

Equation (142)

The physical interpretation of ${\epsilon }_{{\rm{R}}}$ is that resistive effects are important in the center (y = 0) up to $| y| \sim {\epsilon }_{{\rm{R}}}$. In these new variables, Equations (136) and (137) read

Equation (143)

Equation (144)

The solution of Equation (143) can be written as an integral over an auxiliary variable u (Goedbloed et al. 2010):

Equation (145)

The function Φ (black line in Figure 17) is positive for $s\gt 0$, and has a global maximum at ${s}_{\max }\approx 1.48$. Moreover, ${\rm{\Phi }}(s)\approx 1.06/\sqrt{\pi }\,s$ for $s\ll 1$, and ${\rm{\Phi }}(s)\approx 1/s$ for $s\gg 1$.

Figure 17.

Figure 17. Graphical illustration of the functions ${\rm{\Phi }}(s)$ (black; defined in Equation (145) and $1/s$ (green)). The velocity perturbations ${v}_{y}$ are exactly proportional to the former function in the inner region and approximately proportional to the latter one in the outer region for $| y/a| \ll 1$. For $s\gtrsim 2.5$, both functions are very similar.

Standard image High-resolution image

To obtain the final form of the velocity perturbations, ${v}_{y}$, in the inner layer (given by Equations (139) and 145), we need to determine the TM growth rate γ. It can be calculated by matching the inner and outer solutions of ${v}_{y}$ (the former given by Equation (132)) at a certain point ${y}_{{\rm{m}}}$ in the region (marked in yellow in Figure 8), where both solutions are valid and overlap, i.e., where they give the same predictions for both the velocity and the magnetic field perturbations. The value of ym must be large enough, so that ${\rm{\Phi }}(s)$ can be approximated as ${\rm{\Phi }}(s)\approx {s}^{-1}$, i.e., $s\gg 1$, yet small enough that the outer ideal MHD solution behaves like ${v}_{y}\propto {y}^{-1}$ (for $y\to 0$). Moreover, the inner resistive solution was found for such small values of y that ${b}_{0x}(y)$ can be approximated by Equation (85). Hence, ${y}_{{\rm{m}}}\ll a$ must hold. Recalling that s = 1 for $y={\epsilon }_{{\rm{R}}}$, we can combine the above conditions into

Equation (146)

The remaining part of the matching procedure is conceptually rather straightforward. Comparing Equations (145) and (132) at ${y}_{{\rm{m}}}$, we can determine the TM growth rate γ. We omit the details of these calculations7 and only give here the final expression for the TM growth rate in resistive (-inviscid) MHD:

Equation (147)

For $a\,k\gt 1$, the growth rate is complex (because of the last factor), i.e., the system is TM unstable only for perturbations with wavevectors $a\,k\lt 1$. On the other hand, for $a\,k\to 0$, the growth rate given by Equation (147) diverges, but in this regime the "constant ψ approximation" becomes invalid and Equation (147) no longer holds.

We note that the width of the resistive layer is somewhat arbitrary. Some authors (see Schnack 2009; Goedbloed et al. 2010) define that the layer extends to $| y| ={\epsilon }_{{\rm{R}}}$, whereas we define its boundary to be located at

Equation (148)

which corresponds to the maximum of ${\rm{\Phi }}(s)$ (Figure 17). This is a convenient definition because ${\rm{\Phi }}({s}_{\max })$ corresponds to the peaks of ${v}_{y}$, which can be determined from simulations rather easily (compare Figure 17 with the bottom panels of Figure 10).

Equations (132) and (145) for the velocity perturbation ${v}_{y}$, and Equation (131) for the magnetic field perturbation b1y (supplemented by Equation (147) and the transformations (138) and (139) constitute a complete solution of the TM problem in resistive MHD. In the inner layer, the magnetic field perturbation b1y is approximately constant, i.e., ${b}_{1y}(y\leqslant {y}_{{\rm{m}}})\approx {b}_{1y}({y}_{{\rm{m}}})$, and the perturbations ${v}_{x}$ and b1x can be determined from conditions (79) and (80), respectively.

As a next step, we will generalize the above results to resistive-viscous MHD, because Equation (147) does not take into account (numerical) viscosity, which might be comparable to (or even larger than) numerical resistivity.

A.1.3. Viscous Case

The derivation of the TM solution in resistive-viscous MHD by FKR63 is very similar to that of the non-viscous case. Therefore, we will only sketch their procedure (for more details, see FKR63). One integrates Equations (126) and (127) again separately in the outer and inner region. In the outer region, one can neglect dissipative terms and plasma inertia as in the inviscid case, i.e., the magnetic field perturbation b1y and the velocity perturbation ${v}_{y}$ are still given by Equations (131) and (132), respectively. In the inner region, FKR63 simplified the sixth-order ODE (135) for ${v}_{y}$ using again the "constant ψ approximation" to a fourth-order ODE, but now including viscous terms. They further simplified the ODE by neglecting terms with lower-order derivatives, which is an acceptable approximation for magnetic Prandtl numbers ${P}_{{\rm{m}}}\equiv \nu /\eta \gtrsim 1$. Next, FKR63 introduced the dimensionless variables

Equation (149)

Equation (150)

(where we used the tilde symbol to explicitly stress that functions 145 and 150 differ) with the length scale

Equation (151)

The latter expression shows that both resistivity and viscosity affect the size of the region, where dissipative effects are important. We call this region the resistive-viscous layer. The width of this layer ${L}_{\mathrm{RV}}$ is proportional to ${\epsilon }_{\mathrm{RV}}$, and hence differs from the width ${L}_{{\rm{R}}}$ of the resistive (inviscid) layer, which is proportional to ${\epsilon }_{{\rm{R}}}$ (Equation (142)).

In the resistive-viscous case, matching condition (146) has to be replaced by

Equation (152)

and from matching of $\tilde{{\rm{\Phi }}}(\tilde{s})$ with Equation (132), we obtain the TM growth rate in resistive-viscous MHD:

Equation (153)

The above expression differs from the result of FKR63 (see their Equation (H.8)) because these authors derived their equation in the $a\,k\ll 1$ limit (in our units), whereas we did not neglect terms proportional to $a\,k$. For the background magnetic field ${b}_{0x}={b}_{0}\tanh (y/a)$, we calculated the growth rate more accurately. Note that Equation (153) is only an approximation, because FKR63 only approximately solved ODE (135). Therefore, the above equation could be off by a small constant numerical factor.

Our numerical results differ from the analytic growth rates derived above. Restrictions of grid resolution and computing time prevented us from reaching the parameter regime where the derivation of the analytic growth rates holds. Therefore, in the following subsection, we present an "empirical" ansatz for the TM growth rate, which gives much better predictions for our simulation results presented in Section 4.3.

A.2. Empirical Approach

In the analytically derived Equations (147) and (153), the TM growth rate is proportional to a product of different powers of resistivity, viscosity, Alfvén speed, $a,k$, and $(1/(a\,k)-a\,k)$. Based on this observation, we postulate an ansatz:

Equation (154)

where N0 is a (real) constant and ${n}_{1},\ldots ,{n}_{6}$ are fractional constants, which shall be determined by numerical simulations. The dimension of the growth rate is $[{s}^{-1}]$, which we abbreviate as $\dim (\gamma )=[{{\rm{s}}}^{-1}]$. It has to be "constructed" from the other physical quantities. Since $\dim (\eta )=\dim (\nu )=[{\mathrm{cm}}^{2}\ {{\rm{s}}}^{-1}]$, $\dim ({c}_{{\rm{A}}})=[\mathrm{cm}\ {{\rm{s}}}^{-1}]$, $\dim (k)=[{\mathrm{cm}}^{-1}]$, and $\dim (a)=[\mathrm{cm}]$, dimensional analysis provides the following conditions:

Equation (155)

Equation (156)

Similarly, the width ${L}_{\mathrm{RV}}$ of the resistive-viscous layer should be equal to

Equation (157)

where M0 is a (real positive) constant and ${m}_{1},\ldots ,{m}_{6}$ are fractional numbers to be determined by simulations. From the dimensional analysis follows

Equation (158)

Equation (159)

To determine n1 and m1, we performed the simulations series #TMa (the setup is described in Table 6 and the results are given in Figure 11, where the solid lines are the theoretical predictions according to Equations (171) and (172)) keeping all parameters constant but the resistivity. To the measured TM growth rates and widths of the resistive-viscous layer (as described in Section 4.3.2), we fit functions

Equation (160)

Equation (161)

where according to ansatzes (154) and (157) N1 and M1 should be constant for the models of series #TMa, i.e., 

Equation (162)

Equation (163)

From the obtained estimators (and their small errors; see Table 6) ${N}_{1}^{{\rm{a}}}$ and ${M}_{1}^{{\rm{a}}}$ (the upper index "a" denotes the simulation series, i.e., #TMa), we conclude that our ansatzes hold (at least for resistivity) and that ${n}_{1}=4/5$ and ${m}_{1}=1/6$.

Table 6.  2D Simulations Performed to Test and Calibrate Ansatz (154) and (157)

Series a b0 ν η ni Ni mi Mi
#TMa 0.1 1 10−4 ${10}^{-7}...{10}^{-5}$ 0.7994 ± 0.0012 5.377 ± 0.015 0.160 ± 0.003 −2.08 ± 0.04
#TMar 0.1 1 10−4 ${10}^{-7}...{10}^{-5}$ 4/5 5.385 ± 0.001 1/6 −1.992 ± 0.004
#TMb 0.1 1 10−5 ${10}^{-6}...{10}^{-5}$ 0.801 ± 0.004 5.84 ± 0.05 0.159 ± 0.007 −2.393 ± 0.006
#TMbr 0.1 1 10−5 ${10}^{-6}...{10}^{-5}$ 4/5 5.826 ± 0.003 1/6 −2.393 ± 0.006
#TMc 0.1 $0.5...10$ 10−4 $5\times {10}^{-5}$ 0.391 ± 0.004 −4.377 ± 0.006 −0.364 ± 0.017 −4.021 ± 0.015
#TMcr 0.1 $0.5...10$ 10−4 $5\times {10}^{-5}$ 2/5 −4.385 ± 0.006 −1/3 −4.03 ± 0.02
#TMd 0.05 $0.5...4$ 10−5 10−6 0.411 ± 0.008 −4.058 ± 0.005 −0.329 ± 0.017 −5.17 ± 0.01
#TMdr 0.05 $0.5...4$ 10−5 10−6 2/5 −4.055 ± 0.005 −1/3 −5.17 ± 0.01

Note. The columns give the series identifier, shear parameter a, initial magnetic field strength b0, viscosity ν, and resistivity η. In all simulations the background density is set to ${\rho }_{0}=1$, and an equidistant grid spacing of ${\rm{\Delta }}x={\rm{\Delta }}y=(\pi /3)/1024$ is used. The box length is $2L=20\,\pi a/3$ and the TM wavevector $k=3/(10a)$. The estimators ni, Ni, mi, and Mi are given by fits according to Equations (160), (161), (165), and (166), respectively. In #TMa, the estimators n1, ${N}_{1}^{{\rm{a}}}$, m1, and ${M}_{1}^{{\rm{a}}}$ are determined, whereas in #TMar the estimators n1 and m1 are set to fractional values and ${N}_{1}^{\mathrm{ar}}$ and ${N}_{1}^{\mathrm{ar}}$ are determined. For series #TMb, #TMc, and #TMd, we proceeded analogously.

Download table as:  ASCIITypeset image

In the simulation series #TMb (Figure 11), we set the value of the viscosity to $\nu ={10}^{-5}$, keeping the other parameters as in #TMa, and also vary the value of the resistivity. The fits done according to Equations (160) and (161) (see Table 6) confirm that ${n}_{1}=4/5$ and ${m}_{1}=1/6$.

We determine the dependence of the TM growth rate and of the width of the resistive-viscous layer on viscosity in the following somewhat indirect way. To the results of simulations #TMa, we refit functions (160) and (161), but this time with ${n}_{1}\equiv 4/5$ and ${m}_{1}\equiv 1/6$, to obtain ${N}_{1}^{\mathrm{ar}}$ and ${M}_{1}^{\mathrm{ar}}$, respectively (Table 6; note that we denote this series as #TMar, where "r" stands for "refitted"). In an analogous way, we obtain ${N}_{1}^{\mathrm{br}}$ and ${M}_{1}^{\mathrm{br}}$. According to ansatz (154), the difference between ${N}_{1}^{\mathrm{ar}}$ and ${N}_{1}^{\mathrm{br}}$ should be

Equation (164)

From the obtained estimators (Table 6), we have ${N}_{1}^{\mathrm{ar}}-{N}_{1}^{\mathrm{br}}\,=-0.441\pm 0.004$, from which we can infer ${n}_{2}=-1/5$. Analogously, from ${M}_{1}^{\mathrm{ar}}-{M}_{1}^{\mathrm{br}}=0.40\pm 0.01$, we infer that ${m}_{2}=1/6$ (theoretically this value should be ${M}_{1}^{\mathrm{ar}}-{M}_{1}^{\mathrm{br}}\,=(1/6)\mathrm{ln}(10)\approx 0.384$).

In two further sets of simulations (#TMc and #TMd), we determined the dependence of the TM growth rate and of the width of the resistive-viscous layer on the strength of the background magnetic field. To the simulation results (Figure 18), we fit functions

Equation (165)

Equation (166)

where N3 and M3 should be constant for a given simulation series.

Figure 18.

Figure 18. TM growth rate (left) and resistive-viscous layer width (right) as a function of background magnetic field strength. Simulations #TMd and #TMc are depicted with blue diamonds and red asterisks, respectively. Straight lines of the corresponding colors are linear fits to the logarithms of the simulation data.

Standard image High-resolution image

From the obtained estimators (Table 6), we infer that ${n}_{3}=2/5$ and ${m}_{3}=-1/3$. Note that these results are consistent with our ansatzes, as from condition (155), by putting ${n}_{1}=4/5$ and ${n}_{2}=-1/5$, we find ${n}_{3}=1-({n}_{1}+{n}_{2})=2/5$, and analogously from condition (158), we have ${m}_{3}=-{m}_{1}-{m}_{2}=-1/3$, as ${m}_{1}={m}_{2}=1/6$.

With the results of simulation series #TMc and #TMd, one more aspect of Equations (154) and (157) can be tested. Even though we have not determined ${n}_{4},{n}_{5},{n}_{6}$ and ${m}_{4},{m}_{5},{n}_{6}$, we expect from dimensional analysis that ${n}_{4}-{n}_{5}=8/5$ and ${m}_{4}-{m}_{5}=-2/3$ (Equations (156) and (159), respectively). Therefore, doubling ${a}^{-1}$ and k (from a = 0.1, k = 3 to a = 0.05, k = 6) should increase the instability growth rate by a factor of ${2}^{8/5}$ and decrease the width of the resistive-viscous layer by a factor of ${2}^{-2/3}$ (because for a constant a to k ratio, the term ${(1/(ak)-ak)}^{{n}_{6}}$ in Equation (154) does not change). To the results of simulations #TMc and #TMd, we refitted functions (165) and (166), but this time with ${n}_{3}\equiv 2/5$ and ${m}_{3}\equiv -1/3$, obtaining (Table 6) ${{\rm{\Delta }}}_{{\rm{N}}3}^{\mathrm{sim}}\equiv {N}_{3}^{\mathrm{cr}}-{N}_{3}^{\mathrm{dr}}=0.330\pm 0.011$ and ${{\rm{\Delta }}}_{{\rm{M}}3}^{\mathrm{sim}}\equiv {M}_{3}^{\mathrm{cr}}-{M}_{3}^{\mathrm{dr}}=1.14\pm 0.03$. Taking into account the different values of resistivity and viscosity in these two series of simulations, we theoretically expect ${{\rm{\Delta }}}_{{\rm{N}}3}^{\mathrm{th}}\equiv {N}_{3}^{\mathrm{cr}}-{N}_{3}^{\mathrm{dr}}=0.282$ and ${{\rm{\Delta }}}_{{\rm{M}}3}^{\mathrm{th}}\equiv {M}_{3}^{\mathrm{cr}}-{M}_{3}^{\mathrm{dr}}=1.11$. Hence, the difference between theory and simulation is

Equation (167)

Equation (168)

Hence, the predictions for the resistive-viscous layer agree within the measurement error. Moreover, we tested that, as theoretically expected, in the parameter range explored by us (incompressible limit), the growth rate of the TM neither depends on the background pressure p0 nor on the bulk viscosity (see Rembiasz 2013, for details).

So far, we have confirmed that our ansatzes for the TM growth rate (Equation (154)) and the width of the resistive-viscous layer (Equation (157)) hold and are given by

Equation (169)

Equation (170)

where N0 and M0 are (real) constants, and ${n}_{4},{n}_{5},{n}_{6}$ and ${m}_{4},{m}_{5}$ are fractions. Moreover, from conditions (156) and (159) we have ${n}_{4}-{n}_{5}=8/5$ and ${m}_{4}-{m}_{5}=-2/3$, respectively. This allows us to calibrate these equations with the help of estimators ${N}_{1}^{\mathrm{ar}}$ and ${M}_{1}^{\mathrm{ar}}$ (Table 6) for k = 3 and a = 0.1 obtaining8

Equation (171)

Equation (172)

Footnotes

  • The characteristic velocity and length of the system was set to ${ \mathcal V }=1$ and ${ \mathcal L }=\lambda $, respectively. See the extended discussion that appears later in this subsection.

  • As an example, we consider velocity perturbations. Assuming that b1y is constant and using approximation (85), Equation (129) implies $| {\partial }_{y}^{2}{v}_{y}| \sim | {v}_{y}/{y}^{2}| $. Because $| y| \ll a$ in the inner layer, we have from Equation (84) ${a}^{-1}\sim k$, and hence $| {v}_{y}/{y}^{2}| \gg | {v}_{y}{k}^{2}| $. Although Equation (129) holds only in the outer layer, it should still be roughly applicable near the edge of the inner region. Note that ${b}_{1y}=\mathrm{const}.$ was only assumed to simplify the calculations, i.e., relaxing this assumption does not change the estimate.

  • FKR63 used dimensionless quantities, and in particular a dimensionless variable $\psi \sim {b}_{1y}$. This explains the name constant ψ approximation, which is commonly used in the literature (see, e.g., Schnack 2009 and Goedbloed et al. 2010).

  • We require that the velocity perturbations ${v}_{y}(y)$ (132) in the outer layer and ${v}_{y}(y)={v}_{y}({\rm{\Phi }}(s))$ (145) in the inner layer are equal in the vicinity of ${y}_{{\rm{m}}}$, and that the same holds for their first derivatives. FKR63 and Goedbloed et al. (2010) matched instead the magnetic field perturbations.

  • In these two equations we decided not to include the measurement errors, because for the applications discussed in Section 4.3.3 they would be negligible anyway.

Please wait… references are loading.
10.3847/1538-4365/aa6254