Abstract
An overview of gridbased numerical methods used in relativistic hydrodynamics (RHD) and magnetohydrodynamics (RMHD) is presented. Special emphasis is put on a comprehensive review of the application of highresolution shockcapturing methods. Results of a set of demanding test bench simulations obtained with different numerical methods are compared in an attempt to assess the present capabilities and limits of the various numerical strategies. Applications to three astrophysical phenomena are briefly discussed to motivate the need for and to demonstrate the success of RHD and RMHD simulations in their understanding. The review further provides FORTRAN programs to compute the exact solution of the Riemann problem in RMHD, and to simulate 1D RMHD flows in Cartesian coordinates.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
Relativity is a necessary ingredient for describing astrophysical phenomena involving compact objects and flows near the speed of light. Among these phenomena are core collapse supernovae, Xray binaries, pulsars, coalescing neutron stars, formation of black holes, active galactic nuclei (AGN) and gammaray bursts (GRB). The relativistic jets and outflows found in, e.g., microquasars, radioloud AGN and GRB involve flows at relativistic speeds, too. Moreover, in most of these scenarios dynamically important magnetic fields are encountered.
This review summarizes the progress in gridbased methods for numerical (special) relativistic hydrodynamics (RHD) and magnetohydrodynamics (RMHD) and discusses their application to astrophysical flow. Developments in numerical RHD prior to the year 2003 are reviewed in Martí and Müller (2003) and are summarized here for completeness.
1.1 Overview of the numerical methods
Wilson (1972, 1979) and collaborators (Centrella and Wilson, 1984; Hawley et al., 1984) made the first attempt to solve the RHD equations in more than one spatial dimension using an Eulerian explicit finitedifference code with monotonic transport. The code relied on artificial viscosity techniques to handle shock waves and was widely used in numerical cosmology, studies of axisymmetric relativistic stellar collapse, and accretion onto compact objects. Almost all numerical codes developed for both special and general RHD in the 1980s (Piran, 1980; Stark and Piran, 1987; Nakamura et al., 1980; Nakamura, 1981; Nakamura and Sato, 1982; Evans, 1986) were based on Wilson’s approach. However, despite its popularity, it turned out that Wilson’s approach is unable to accurately describe highly relativistic flows, i.e., with Lorentz factors larger than 2 (see, e.g., Centrella and Wilson, 1984).
In the mid1980s, Norman and Winkler (1986) proposed a new formulation of the difference equations of RHD with an artificial viscosity consistent with the relativistic dynamics of nonperfect fluids. They obtained accurate results in the description of strong relativistic shocks with large Lorentz factors in combination with adaptive mesh techniques. However, the strong coupling introduced in the equations by the presence of the viscous terms in the definition of relativistic momentum and total energy density required them to treat the difference equations implicitly, which has prevented the development of any multidimensional version of their formulation.
Relying on the same type of techniques (finite differencing and artificial viscosity), Wilson (1975, 1977) also pioneered the development of the first numerical code for RMHD that was used to simulate stellar collapse and the accretion of magnetized matter onto black holes.
Attempts to integrate the RHD equations without the use of artificial viscosity started in the early 1980s. Yokosawa et al. (1982) developed a 2D code based on the fluxcorrected transport method (FCT) of Boris and Book (1973) to study the early phases of the interaction of a hypersonic relativistic beam with an ambient medium, in the context of extragalactic jets. The same kind of techniques were applied in the 1990s to solve the RMHD equations (Dubal, 1991; Yokosawa, 1993). Following a completely different approach, Mann (1991) presented a multidimensional code for general relativistic hydrodynamics (GRHD) based on the smoothed particle hydrodynamics (SPH) technique (Monaghan, 1992), which he applied to relativistic spherical collapse (Mann, 1993). When tested against 1D relativistic shock tubes all these codes performed similarly well as Wilson’s code.
A major breakthrough in the simulation of (ultra) relativistic flows was accomplished when highresolution shockcapturing (HRSC) methods, specifically designed to solve hyperbolic systems of conservation laws were applied to integrate the RHD equations (Martí et al., 1991; Marquina et al., 1992; Eulderink, 1993; Eulderink and Mellema, 1995), and more recently the RMHD equations (Koide et al., 1996, 1999; Koide, 2003; Komissarov, 1999a; Balsara, 2001a).
1.2 Plan of the review
This review provides a comprehensive discussion of different gridbased methods used in RHD and RMHD, with special attention to HRSC methods.^{Footnote 1} Recent developments in finitedifference methods based on artificialviscosity techniques are also considered. We refer to the book of Wilson and Mathews (2003) for a comprehensive review of these techniques. Despite the fact that spectral methods are able to attain very high accuracy, they have recognized limitations in the treatment of discontinuous solutions. Hence, we shall not consider them in this review and refer the reader to a recent review of spectral methods for numerical relativity by Grandclément and Novak (2009). We also do not discuss numerical methods here that are specific to general relativistic flow, but we present the underlying methods in the special relativistic limit and assess their performance. Numerical techniques for both GRHD and GRMHD are masterly reviewed by Font (2008).
In Section 2, we discuss three astrophysical phenomena (astrophysical jets, GRB, and pulsar wind nebulae) whose study has largely benefited from the development of numerical RHD and RMHD. In Section 3, we present the equations of ideal RMHD, which reduce to those of RHD in the zero field limit, and discuss their mathematical properties.
In Section 4 and 5, we review the development of gridbased methods for RHD and RMHD. We pay particular attention to HRSC methods and focus on those aspects more specific to RHD, i.e., discussing relativistic Riemann solvers and the computation of numerical fluxes. In Section 6, we present the results of several onedimensional and multidimensional test problems simulated with different methods. In Section 7, we provide an assessment of various numerical methods together with an outlook on future developments.
Finally, in Section 8, we provide some additional information about the exact solution of the Riemann problem in both RHD and RMHD, and the corresponding spectral decompositions of the flux Jacobians. We also summarize the basics of finite difference/finite volume methods for hyperbolic systems of conservation laws in Section 8.3. In Section 8.4, we briefly discuss other approaches recently extended to numerical RHD and RMHD although not widely used yet. In this section we also summarize the method of van Putten, who first exploited the conservative nature of the RMHD equations for their numerical integration. Lastly, in Section 9, we provide source codes to compute the exact solution of the Riemann problem in RMHD and to solve numerically the equations of RMHD in one spatial dimension and Cartesian coordinates.
We presume that the reader has a basic knowledge of classical and relativistic fluid dynamics (Landau and Lifshitz, 1987; Courant and Friedrichs, 1976; Taub, 1978) and magnetohydrodynamics (Jeffrey and Taniuti, 1964; Anile, 1989), as well as of finite difference/finite volume methods for partial differential equations (Potter, 1977; Oran and Boris, 1987). A discussion of modern finite volume methods for hyperbolic systems of conservation laws can be found, e.g., in LeVeque (1992); Toro (1997); LeVeque (1998); Laney (1998). A unique monograph covering both theoretical and numerical aspects of RHD is the book by Rezzolla and Zanotti (2013). Chapters on computational MHD and RMHD can be found in the book by Goedbloed et al. (2010).
2 Astrophysical Scenarios
We note here that the following discussion of astrophysical phenomena is not thought to be a review of the respective phenomena, which would be well beyond the scope of this article on numerical methods. Instead, we present a biased view of the phenomena and of the status of the research to motivate the need for and to demonstrate the success of RHD and RMHD simulations in understanding these astrophysical phenomena.
The simulations discussed in this section were performed with RHD and RMHD codes based on the methods (mainly HRSC methods) that are reviewed in this work. The most important properties of these codes are summarized in Tables 1 and 2, respectively.
2.1 Jets from AGN
2.1.1 Observations and theoretical models
The most compelling case for a special relativistic phenomenon are the ubiquitous jets in extragalactic radio sources associated with AGN and quasars. In the commonly accepted standard model (Begelman et al., 1984), flow velocities as large as 99% (in some cases even beyond) of the speed of light are required to explain the apparent superluminal motion observed at parsec scales in many of these sources. Readers interested more deeply in the field of AGN jets may consult the recent book edited by Böttcher et al. (2012).
Models proposed to explain the origin of relativistic jets involve accretion onto a compact central object, such as a neutron star or a stellar mass black hole in the galactic microquasars (radio emitting Xray binaries, scaleddown versions of quasars), or a rotating supermassive black hole in an AGN fed by interstellar gas and gas from tidally disrupted stars. There is a general agreement that MHD processes are responsible for the formation, collimation and acceleration up to relativistic speeds of the outflows. In the models of magnetically driven outflows (Blandford and Payne, 1982; Li et al., 1992), poloidal magnetic fields anchored at the basis of the accretion disk generate a toroidal field component and consequently a poloidal electromagnetic flux of energy (Poynting flux) that accelerates the magnetospheric plasma along the poloidal magnetic field lines, converting the Poynting flux into kinetic energy of bulk motion. Energy can also be extracted from rotating black holes with similar efficiencies (Blandford and Znajek, 1977; Hirotani et al., 1992). Several parameters are potentially important for powering the jets: the black hole mass and spin, the accretion rate, the type of ccretion disk, the properties of the magnetic field, and the nvironment of the source (Komissarov, 2012).
At parsec scales, extragalactic jets, observed via their synchrotron and inverse Compton emission at radio frequencies with VLBI imaging, appear to be highly collimated with a bright spot (the core) at one end of the jet and a series of components which separate from the core, sometimes at superluminal speeds (see, e.g., Lister et al., 2009). In the standard model of Blandford and Königl (1979), these speeds are a consequence of relativistic bulk motion in jets propagating at small angles to the line of sight with Lorentz factors up to 20 or more. Moving components in these jets, usually appearing after outbursts in emission at radio wavelengths, are interpreted in terms of traveling shock waves (Marscher and Gear, 1985). An ongoing, important debate is concerned with the nature of the radio core. Whereas in the standard Blandford and Königl’s conical jet model the core corresponds to the location near the black hole where the jet becomes optically thin, recent multiwavelength observations of several sources [e.g., 3C 120 (Marscher et al., 2002), BL Lac (Marscher et al., 2008), and 3C 111 (Chatterjee et al., 2011)] suggest that the radio core can be a physical feature in the jet (as, e.g., a recollimation shock; Marscher, 2012) placed probably parsecs (i.e., tens of thousands of gravitational radii of the central black hole) away from the central engine.
At kiloparsec scales, the morphology and dynamics of the jets are dominated by their interaction with the surrounding extragalactic medium, the jet power being responsible for dichotomic morphologies (FanaroffRiley I and II classes, FR I and FR II, respectively; Fanaroff and Riley, 1974; see Bridle’s homepage). Whereas current models (Laing and Bridle, 2002a, b) interpret FR I morphologies as the result of a smooth deceleration from relativistic to nonrelativistic, transonic speeds on kpc scales, flux asymmetries between jets and counterjets in the most powerful radio galaxies (FR II) and quasars indicate that relativistic motion extends up to kpc scales in these sources (Bridle et al., 1994).
Extragalactic jets also play a very important role in the evolution of galaxies and clusters of galaxies as the most likely reheating agent to explain the low rates of cooling in the intracluster medium (McNamara and Nulsen, 2007).
Theoretical models of AGN jets have been the subject of intensive and extensive testing by relativistic numerical simulations during the past two decades. However, since jets are produced on scales of a few gravitational radii of the central black hole (≲ 10^{−3} pc, for a 10^{9} M_{⊙} black hole) but extend to hundreds of kpcs, simulations have traditionally divided the study of the jet phenomenon into separate problems.
2.1.2 Simulations of kpcscale jets
Although general relativistic (and MHD) effects seem to be crucial for a successful launch of the jet, purely hydrodynamic special relativistic simulations are adequate to study the morphology and dynamics of relativistic jets at distances sufficiently far from the central compact object (i.e., at parsec scales and beyond). Leaving aside the pioneering work of Yokosawa et al. (1982), the numerical simulation of relativistic jets at parsec and kiloparsec scales was triggered by the development of RHD codes based on conservative techniques as those described in Section 4.
At kiloparsec scales, the implications of relativistic flow speeds and/or relativistic internal energies for the morphology and dynamics of jets have been the subject of a number of 2D (van Putten, 1993b; Martí et al., 1994; Duncan and Hughes, 1994; Martí et al., 1995, 1997; Komissarov and Falle, 1998; Rosen et al., 1999; Mizuta et al., 2001; Scheck et al., 2002; MonceauBaroux et al., 2012; Walg et al., 2013, 2014) and 3D (Aloy et al., 1999a; Hughes et al., 2002; Choi et al., 2007; Rossi et al., 2008) simulations. The aim of these simulations was to connect the prominence of the main structural features of the jets (internal shocks, hot spots, lobes) and their dynamical properties (hot spot advance speed and pressure, deceleration of the flow along the jet) with the basic parameters characterizing jets. They supersede former nonrelativistic simulations of supersonic jets.
Recent developments concern themselves with the origin of the FR I/II dichotomy. One tries to gauge the importance of different factors contributing to the dichotomy, like the jet composition (Scheck et al., 2002), the jet propagation into an ambient medium of decreasing density (Perucho and Martí, 2007), the entrainment of ambient medium into the jet by KelvinHelmholtz (KH) instabilities (Rossi et al., 2008; Perucho et al., 2010), the mass load from stellar winds (Perucho et al., 2014), and the presence of density discontinuities in the jet environment (Meliani et al., 2008). Porth and Komissarov (2015) pointed to the loss of causal connectivity across jets, because of their rapid expansion in response to the fast decline of the ambient pressure with distance, as the source of the remarkable stability of FR II jets. Finally, simulations have also focused on the effects of feedback by relativistic jets on star formation in the host galaxy (Wagner and Bicknell, 2011; Wagner et al., 2012) and the heating of the intracluster medium in clusters of galaxies (Perucho et al., 2011).
As in the pure hydrodynamic case, the simulation of relativistic magnetized jets was one of the first applications of the conservative RMHD methods described in Section 5. The first simulations focused on the propagation of relativistic jets with aligned magnetic fields injected into an ambient medium with an aligned (Koide et al., 1996; Nishikawa et al., 1997) and oblique (Koide, 1997; Nishikawa et al., 1998) magnetic field to study how the fields affect the bending properties of relativistic jets. However, these early simulations covered the evolution only for a brief period of time during which the jet propagated only ∼ 20 jet radii. In addition, the Lorentz factors of the jets were small (≃ 4.56). Although these results had some impact on specific problems, like e.g., understanding the misalignment of jets between pc and kpc scales, these simulations did not address the effects of magnetic fields on the jet structure and the jet dynamics. One of these first, exploratory simulations (van Putten, 1996) dealt with the formation of ‘knots’ (i.e., bright localized features) in extragalactic jets possessing a toroidal magnetic field.
Later studies explored the dependence of morphological and dynamic properties of jets on the magnetic field configuration, and on the ratio of magnetic energy density and thermal pressure, and magnetic energy density and restmass energy density, respectively: Komissarov (1999b); Mignone et al. (2005a); Leismann et al. (2005) simulated jets with toroidal magnetic fields, Leismann et al. (2005) jets with poloidal magnetic fields, and Keppens et al. (2008) jets with helical magnetic fields. Mignone et al. (2010) presented the first highresolution 3D simulations of relativistic magnetized jets (see Figure 1).
2.1.3 Simulations of pcscale jets
The development of multidimensional RHD codes facilitated the simulation of parsec scale jets and of superluminal radio components (Gómez et al., 1997; Komissarov and Falle, 1997; Mioduszewski et al., 1997; Aloy et al., 2000a; Agudo et al., 2001; Aloy et al., 2003; Perucho et al., 2008). The presence of emitting flows at almost the speed of light enhances the importance of relativistic effects (relativistic Doppler boosting, light aberration, time delays) for the appearance of these sources (Gómez, 2002). This implies that one should use models which combine hydrodynamics and synchrotron radiation transfer when comparing to observations.
In these models, moving radio components are modeled as perturbations in steady relativistic jets. Reconfinement shocks are produced where pressure mismatches exist between the jet and the surrounding medium. The energy density enhancement that arises downstream from these shocks can give rise to stationary radio knots as observed in many VLBI sources (e.g., 3C 279; Wehrle et al., 2001). Superluminal components are produced by triggering small perturbations in these steady jets. The interaction between the induced traveling shocks and the underlying steady jet can account for the complex behavior observed in many sources as, e.g., the dragging of steady components in 3C 279 (Wehrle et al., 2001), the presence of trailing components in 3C 120 (Gómez et al., 1998; Gómez et al., 2001) and 3C 111 (Kadler et al., 2008), and the tangled evolution of components in 3C 111 (Perucho et al., 2008). Mimica et al. (2009a) presented numerical simulations of the spectral evolution and the emission of radio components in relativistic jets. They incorporated the time evolution of a population of nonthermal electrons which is responsible for the synchrotron emission, and included the respective radiative losses from the flow (see Figure 2).
The combination of hydrodynamic simulations and linear stability analysis provides a very useful tool to comprehend relativistic jets in extragalactic sources. It is commonly accepted that most of the features observed in jets (radio components, transversal structure, bends, etc.) admit an interpretation in terms of the growth of KH normal modes, hence allowing to constrain the jet properties. The main theoretical developments concerning the linear analysis of the relativistic KH instability are summarized in Section 6.7. This analysis has been successfully applied to probe the physical conditions in the jets of several sources [e.g., S5 0836+710 (Lobanov et al., 1998; Perucho and Lobanov, 2007; Perucho et al., 2012a, b), 3C273 (Lobanov and Zensus, 2001), 3C120 (Walker et al., 2001; Hardee, 2003; Hardee et al., 2005); see also the review by Hardee (2006)]. Beyond the linear regime, the analysis requires numerical (hydrodynamic or magnetohydrodynamic) simulations. Here, the main purpose is to assess the stability, collimation, and mass entrainment properties of jets at large (temporal and spatial) scales. In a series of papers, Perucho et al. studied the nonlinear phase of the KH instability in relativistic jets in two (Perucho et al., 2004b, 2005, 2007) and three spatial dimensions (Perucho et al., 2010). Motivated by the hydromagnetic nature of most jet formation mechanisms, Mizuno et al. analyzed the stability of magnetized jets under different conditions. In Mizuno et al. (2007), they focused on the stability of magnetized relativistic precessing spinesheath jets, while they studied the growth of the currentdriven kink instability in relativistic forcefree jets in Mizuno et al. (2009, 2011a, 2012) (see Figure 3).
2.1.4 Simulations of jet formation
The advances in the numerical methods in RMHD were soon incorporated into GRMHD codes (see, e.g., Font, 2008) allowing for the first time to explore the formation mechanism of relativistic jets. Koide et al. considered the problem of jet formation from Schwarzschild (Koide et al., 1998, 1999; Nishikawa et al., 2005) and Kerr (Koide et al., 2000) black holes surrounded by accretion disks. In the case of Schwarzschild black holes, jets are formed via BlandfordPayne’s mechanism (Blandford and Payne, 1982) with a twolayered shell structure consisting of a fast gas pressure driven jet in the inner part and a slow magnetically driven outflow in the outer part both being collimated by the global poloidal magnetic field that penetrates the disk.
In the case of counterrotating disks around Kerr black holes (Koide et al., 2000), a powerful (although still subrelativistic, v_{jet} < 0.5c) magnetically driven jet forms inside the gas pressure driven jet. This jet is accelerated by the magnetic field anchored in the ergospheric disk. The framedragging effect rapidly rotates the disk in the same direction as the black hole’s rotation, increasing the azimuthal component of the magnetic field and the magnetic tension, which in turn accelerates the plasma by the magnetic pressure and centrifugal force. This mechanism of jet production is a kind of Penrose process (Hirotani et al., 1992) that uses the magnetic field to extract rotational energy of the black hole and eject a collimated outflow from very near the horizon.
The same authors (Koide et al., 2002) also explored this jet formation mechanism in the case of a maximally rotating Kerr black hole surrounded by a uniform, magnetically dominated corona with no disk. With a similar setup, Komissarov (2005) reported significant differences in the longterm evolution of the system with respect to the short phase studied in Koide et al. (2002). The topology of magnetic field lines within the ergosphere was similar to that of the splitmonopole model. It gave rise to a strong current sheet in the equatorial plane and no regions of negative hydrodynamic energy at infinity (suggestive of the MHD Penrose process) inside the ergosphere. In contrast, the rotational energy of the black hole was continuously extracted via the purely electromagnetic BlandfordZnajek mechanism (Blandford and Znajek, 1977).
None of the previously discussed simulations was able to generate strong relativistic outflows from the black hole within a few tens of gravitational radii from the central source. A couple of studies (Koide, 2004; Komissarov, 2004a) focused on the influence of the initial magnetic field configuration around the rotating black hole on the outflow characteristics considering monopole magnetospheres as in the original BlandfordZnajek mechanism. Koide (2004) obtained outflows with Lorentz factors of ∼ 2.0. In the longer simulation performed by Komissarov (2004a), the numerical solution evolved towards a stable steadystate solution very close to the corresponding forcefree solution found by Blandford and Znajek. For the first time, numerical solutions showed the development of an ultrarelativistic particle wind (Lorentz factor ∼ 15) which remained Poyntingdominated all the way up to the fast critical point. The wind was poorly collimated along the equatorial plane as in the original BlandfordZnajek solution. We note here that direct numerical simulations of the BlandfordZnajek mechanism were performed by Komissarov (2001, 2004b), who solved the timedependent equations of (forcefree, degenerate) electrodynamics in a Kerr black hole magnetosphere. The equations are hyperbolic (Komissarov, 2002a) and were solved by means of a Godunovtype method. Palenzuela et al. (2010a) studied numerically the interaction of black holes with ambient magnetic fields proving the robustness of the BlandfordZnajek mechanism, by which the black hole’s rotational energy is converted into Poynting flux. In particular, they analyzed the dependence of the Poynting flux luminosity on the misalignement angle between the black hole spin and the asymptotic magnetic field. Palenzuela et al. (2010a, b) also considered the case of binary black holes and showed that the electromagnetic field extracts energy from the orbit through a kind of BlandfordZnajek’s process before merging and settling into the standard BlandfordZnajek scenario.
The first simulations of selfconsistent jet production from accretion disks, i.e., without assuming a largescale magnetic field right from the beginning, were performed by McKinney and Gammie (2004), and by De Villiers et al. (2003); Hirose et al. (2004); De Villiers et al. (2005), who performed, respectively, a series of 2D (axisymmetric) and 3D GRMHD simulations of Keplerian accretion disks orbiting Kerr black holes. In all the models considered, the outflows (formed at the edge of a funnel about 0.5 rad wide around the black hole’s rotation axis; see Figure 4) were subrelativistic. However, tuning the floor model used to refill the evacuated funnel, McKinney (2006a) succeeded in generating longlived, superfast magnetosonic, relativistic Poyntingflux dominated jets.
Basing on 3D simulations, McKinney and Blandford (2009) explored both the stability of the jet against the development of the nonaxisymmetric helical kink (m = 1) mode that leads to rapid disruption, and the stability of the jet formation process during accretion of dipolar and quadrupolar fields. In their dipolar model, despite strong nonaxisymmetric disk turbulence, the jet reaches Lorentz factors of ∼ 10 with an opening halfangle ∼ 5° at 10^{3} gravitational radii without significant disruption (see Figure 5). Porth (2013) studied the stability of jets from rotating magnetospheres performing highresolution adaptive mesh refinement simulations in 3D. His analysis showed that the m =1−5 modes saturate at a height of ∼ 20 inner disc radii.
The strength of the magnetic field on the event horizon of the central black hole can be estimated to be of the order of thousands of gauss. How this magnetic field is built up from the disk magnetic field is another subject of current research (Tchekhovskoy et al., 2011; McKinney et al., 2012).
Following a diferent approach, Vlahakis and Königl (2003) examined the production of relativistic, largescale jets by means of selfsimilar solutions of magnetically driven outflows. This semianalytic approach was tested by Komissarov et al. (2007) using axisymmetric simulations.
2.2 Gammaray bursts
2.2.1 Observations and theoretical models
A phenomenon that also involves flows with velocities very close to the speed of light are gammaray bursts (GRB). Although known observationally since several decades their nature still is a matter of debate. They are detected with a rate of about one event per day, and come in two flavors: shortduration and longduration bursts the emission of gammarays varying from milliseconds to hours. The duration of the shorter bursts and the temporal substructure of the longer bursts implies a geometrically small source (less than ∼ c · 1 ms ∼ 100 km), which in turn points towards compact objects, like neutron stars or black holes. The emitted gammarays have energies in the range 30 keV to 2 MeV, the spectra being nonthermal, i.e., they do not allow a direct measurement of the distance of the GRB ((for recent reviews, see the book edited by Kouveliotou et al., 2012).
Observations by the BATSE detector on board the Compton GammaRay Observatory (GRO) proved that GRB are distributed isotropically over the sky (Meegan et al., 1992) indicating that they are located at cosmological distances. The detection and the rapid availability of accurate coordinates of the fading Xray counterparts of GRB 970228 by the ItalianDutch BeppoSAX spacecraft (Costa et al., 1997; Piro et al., 1998) allowed for subsequent successful ground based observations of faint GRB afterglows at optical, millimeter, and radio wavelength. Thereby the distances of GRB could be directly determined, which confirmed their cosmological origin (for a review see, e.g., Greiner, 2012). Updated information on GRB that have been localized to less than 1 degree can be obtained from a website maintained by Greiner.
The pure cosmological origin of GRB was challenged by the detection of the broadlined Type Ic supernova SN 1998bw (Galama et al., 1998) at a redshift of z = 0.0085 (Tinney et al., 1998) within the error box of GRB 980425 (Soffitta et al., 1998; Pian et al., 1999). The explosion time of SN 1998bw is consistent with that of the GRB, and relativistic expansion velocities are derived from radio observations (Kulkarni et al., 1998). Modeling of the optical spectra and light curve of SN 1998bw implies an unusually energetic ((2−5) × 10^{52} erg) supernova explosion (Galama et al., 1998; Iwamoto et al., 1998; Woosley et al., 1999). Thus, Iwamoto et al. (1998) called SN 1998bw a hypernova, a name which was originally proposed by Paczyński (1998) for very luminous GRB/afterglow events. However, the term “hypernova” draws on a theoretical classification pertaining to energetics, and it is entirely possible to have a core collapse supernova with large expansion velocity yet typical kinetic energy (10^{51} erg) (Hjorth and Bloom, 2012). In addition, others (Paczyński, 1998; MacFadyen and Woosley, 1999) use hypernova as a synonym for a jetinduced supernova connected to a GRB as predicted by the collapsar model (see below).
Nowadays there exists growing observational evidence for an association between longduration GRB and radiobright, broadlined Type Ic core collapse supernovae resulting from the death of a massive star with a circumburst medium which may be fed by the massloss wind of the progenitor (Hjorth, 2013). There still remain some open issues, however: less than ∼ 10% of Type Ic supernovae are associated with a typical GRB, while current optical data suggest that all GRB supernovae are broadline (Soderberg et al., 2006). Hence, broad optical absorption lines do not serve as a reliable proxy for relativistic ejecta, unless quite small beaming factors are assumed. Moreover, for some longduration bursts there is no observational evidence for an associated bright supernova (for a review, see e.g., Hjorth and Bloom, 2012). The same holds for shortduration bursts, which are thought to result from merger events (see, e.g., Paczyński, 1986; Eichler et al., 1989; Narayan et al., 1992).
Longduration GRB associated with a supernova seem to come in two types. In lowluminosity (or subenergetic) GRB observational evidence suggests that the radio and highenergy emission results from the breakout of a relativistic shock from the circumstellar wind of the massive progenitor, while in jet GRB (also known as normal, energetic, or cosmological GRB) the emission is thought to be produced by a relativistic jet at large distance from the progenitor star (Hjorth, 2013). The rapid temporal decay of several (longduration) GRB afterglows provides further evidence for collimated relativistic outflows, because it is consistent with the evolution of a relativistic conical flow or jet after it slows down and spreads laterally (for a review, see e.g., Piran et al., 2012; Méeszáaros and Wijers, 2012). In addition, to find an astrophysical site isotropically releasing up to ∼ 10^{54} erg of gammaray energy within less than a second, as implied by redshift measurements, poses a severe problem unless the radiation is strongly beamed as suggested by observations (Soderberg et al., 2006).
Another problem concerns the compact nature of the GRB source. The observed fluxes and the cosmological distance taken together imply a very large photon density in the gammaray emitting fireball, and hence a large optical depth for pair production. This is inconsistent with the optically thin source indicated by the nonthermal gammaray spectrum, which extends well beyond the pair production threshold at 500 keV. Assuming an ultrarelativistic expansion of the emitting region eliminates the compactness constraint. The bulk Lorentz factors required are W > 100 (for reviews, see, e.g., Méeszáaros and Wijers, 2012; Granot and RamirezRuiz, 2012). The presence of such large Lorentz factors is supported by observations of the prompt optical and gammaray emission from the extraordinarily bright longduration GRB 080319B, where W ∼ 1000 can be inferred from a suitable modeling of the spectral energy distribution of the event (Racusin et al., 2008).
To explain the existence of highly relativistic outflow and the energies released in a GRB various catastrophic collapse events have been proposed (Woosley, 1993; MacFadyen and Woosley, 1999). These models all rely on a common engine, namely a stellar mass black hole which accretes several solar masses of matter from a disk (formed during a merger or by a nonspherical core collapse) at a rate of ∼ 0.01 M_{⊙} s^{−1} to ∼ 10 M⊙ s^{−1} (Woosley, 1993; Popham et al., 1999). A fraction of the gravitational binding energy released by accretion is converted into neutrino and antineutrino pairs, which in turn annihilate into electronpositron pairs. This creates a pair fireball, which will also include baryons present in the environment surrounding the black hole. Provided the baryon load of the fireball is not too large, the baryons are accelerated together with the e^{−}/e^{+} pairs to ultrarelativistic speeds with Lorentz factors > 10^{2} (Cavallo and Rees, 1978; Piran et al., 1993).
Taken as a whole current observational facts and theoretical considerations suggest that GRB involve three evolutionary stages (for reviews, see e.g., Kouveliotou et al., 2012): (i) a compact source, which is opaque to gammarays and cannot be observed directly, produces a relativistic energy flow; (ii) the energy is transferred by means of a highly irregular flow of relativistic particles (or by Poynting flux) from the compact source to distances larger than ∼ 10^{13} cm where the flow becomes optically thin; (iii) the relativistic flow is slowed down and its bulk kinetic energy is converted into internal energy of accelerated nonthermal particles, which in turn emit the observed gammarays via cyclotron radiation and/or inverse Compton processes. The dissipation of kinetic energy either occurs through external shocks arising due to the interaction of the flow with circumburst matter, or through internal shocks arising when faster shells overtake slower ones inside the irregular outflow (internalexternal shock scenario).
2.2.2 Hydrodynamic simulations
Numerical studies of relativistic flows in GRB sources have been performed since the mid 1990s. The first simulations were onedimensional (Piran et al., 1993; Panaitescu et al., 1997; Wen et al., 1997; Kobayashi et al., 1999; Daigne and Mochkovitch, 2000; Tan et al., 2001), i.e., restricted to simulations of spherically symmetric relativistic fireballs, which are optically thick concentrations of radiation energy with a high ratio of energy density to rest mass (for more details about these studies, see Martí and Müller, 2003). Although meanwhile superseded by 2D and 3D ones, 1D simulations are still performed to investigate certain aspects of GRB (see e.g., Kobayashi and Zhang, 2007; Mimica et al., 2009b; Mimica and Aloy, 2010; Mimica et al., 2010; Mimica and Aloy, 2012; Mimica and Giannios, 2011; Harrison and Kobayashi, 2013).
Guided by the Blandford and McKee (1976) selfsimilar relativistic spherical shock solution, the propagation of ultrarelativistic blast waves was simulated using AMR techniques combined with shockcapturing RHD methods. Models at high Lorentz factors (up to 75) followed the propagation of the spherically symmetric blastwave through windshaped circumburst media (Meliani and Keppens, 2007), and excluded the interpretation of optical afterglow rebrightening due to the encounter with the stellar wind termination shock (van Eerten et al., 2009). Collisions between consecutive ultrarelativistic shells were shown to produce both optical and radio variability in Vlasis et al. (2011). Extensions to 2D (ultra)relativistic blast wave evolutions were presented in Meliani et al. (2007), while an extreme resolution AMR RHD simulation from Meliani and Keppens (2010) predicts their liability to hydrodynamic instabilities that induce fragmentation during the ultrarelativistic phase of blast wave propagation.
Multidimensional modeling of ultrarelativistic jets in the context of GRB was attempted for the first time by Aloy et al. (2000b). Using a collapsar progenitor model (MacFadyen and Woosley, 1999) they simulated the propagation of an axisymmetric jet through the envelope of a collapsing massive star that after loosing its hydrogen envelope had a mass of about 10 M_{⊙}. The jet was instigated depositing thermal energy at rates of 10^{49} erg/s to 10^{51} erg/s within a 30 degree cone around the rotation axis of the star. At breakout, when the jet reaches the surface of the star, the maximum Lorentz factor of the jet flow is about 50, i.e., Newtonian simulations of this phenomenon (MacFadyen and Woosley, 1999) are inadequate.
Zhang et al. (2003) performed a parameter study of the propagation of axisymmetric (2D) relativistic jets through the stellar progenitor of a collapsar and beyond varying the initial Lorentz factor, opening angle, power and internal energy of the jet as well as the radius where it is injected. They find, in agreement with Aloy et al. (2000b), that relativistic jets are collimated by their passage through the stellar mantle. When they emerge from the star the jets have a moderate Lorentz factor and a very large internal energy. After the escape from the star conversion of its internal energy into kinetic energy leads to a further acceleration of the jet boosting the Lorentz factor to a terminal value of ∼ 150 for the initial conditions chosen. Zhang et al. (2004) extended this study performing 2D and 3D simulations of relativistic jet propagation and break out in massive WolfRayet stars (see Figure 6 and attached movie — online version only —). Their 3D simulations showed that if the jet changes angle by more than three degrees in several seconds, it will dissipate, producing a broad beam with inadequate Lorentz factor to make a common GRB.
Similar 2D studies were performed by Mizuta et al. (2006), Mizuta and Aloy (2009), Mizuta et al. (2011), and Mizuta and Ioka (2013) who investigated, in particular, the dependence of the angular energy distribution of collapsar jets on the presupernova stellar model (Mizuta and Aloy, 2009), and the dependence of the opening angle of the jet on the initial Lorentz factor, W_{0} (Mizuta and Ioka, 2013). The latter is given by Θ_{j} ∼ 1/5W_{0}, which allows one to infer the initial Lorentz factor of the jet at the central engine from observations. They also calculated light curves and spectra of the photospheric thermal radiation of their simulated collapsar jets (Mizuta et al., 2011).
Tominaga et al. (2007); Tominaga (2009) simulated jetinduced axisymmetric explosions of 40 M_{⊙} Population III stars with a 2D RHD code and computed the resulting nucleosynthesis. The simulations can explain both longduration GRB with and without a bright broadlined Type Ic corecollapse supernovae in a unified manner. Nagakura et al. (2011) performed axisymmetric RHD simulations of a jet propagating through the envelope of a rapidly rotating collapsing massive star, and of its breakout and subsequent expansion into a stellar wind environment. They also computed the photospheric emission accompanying the event.
The first collapsar jet simulations using adaptive mesh refinement (AMR) were presented by Morsony et al. (2007), who performed their axisymmetric (2D) simulations in cylindrical coordinates with the RHD module of FLASH. In this and several related subsequent AMR studies (Lazzati et al., 2009; Morsony et al., 2010; Lazzati et al., 2012; LópezCámara et al., 2013) the authors were able to simulate the evolution of relativistic jets in collapsars after break out from the star.
They singled out three evolutionary phases: a precursor phase during which relativistic matter turbulently shed from the head of the jet first emerges from the star, a shockedjet phase when a fully shocked jet is emerging, and an unshockedjet phase where the jet consists of a freestreaming unshocked core surrounded by a thin boundary layer of shockedjet material. Whether these phases can be observed depends on the angle under which one observes the GRB jet (Morsony et al., 2007).
The interaction of the relativistic matter with the progenitor star influences the outflow properties well beyond the stellar surface (Lazzati et al., 2009), and the variability imprinted by the GRB engine is preserved even if the jet is heavily shocked inside the star (Morsony et al., 2010). The latter result suggests that the broad pulses (∼ seconds) in a typical longduration GRB are due to interaction of the jet with the progenitor, while the shorttimescale (∼ msec) variability must be caused at the base of the jet (Morsony et al., 2010).
The outcome of the explosion sensitively depends on the duration of the engine activity: Only the longestlasting engines result in successful GRB, while engines with intermediate duration produce weak GRB and those with the shortest duration give rise to explosions that lack sizable amounts of relativistic ejecta, and hence, if they exist in nature, are dynamically indistinguishable from ordinary corecollapse supernovae (Lazzati et al., 2012).
LópezCámara et al. (2013) extended these 2D studies performing 3D AMR simulations of collapsar jets, which expand inside a realistic stellar progenitor. They confirmed the result of previous 2D simulations that initially relativistic jets can propagate and break out of the progenitor while remaining relativistic. They also find that the jet’s propagation is slightly faster in 3D than in 2D models (at the same grid resolution), because the jet head can wobble around the jet axis and hence drill better when no axisymmetry is imposed. This property of 3D jets was already noticed by Aloy et al. (1999a) in the case of extragalactic jets.
Wygoda et al. (2011) studied the deceleration and expansion of highly relativistic conical jets propagating into a medium of uniform density. De Colle et al. (2012a, c, b) performed 2D AMR simulations of GRB jets, studying the influence of both uniform and, for the first time, stratified circumburst environments. Further AMR simulations in the context of GRB jets were performed by Meliani et al. (2007) and Wang et al. (2008). The former investigated various evolutionary phases in the interaction of jetlike relativistic fireballs with a surrounding interstellar medium (ISM), while the latter performed a 3D simulation of a GRB jet.
2.2.3 Magnetodynamic and magnetohydrodynamic simulations
Electromagnetic extraction of black hole spin energy by the BlandfordZnajek mechanism (Blandford and Znajek, 1977) is the most astrophysically plausible mechanism to generate a relativistic jet. Alternatively, jets in GRB may originate from rapidly rotating magnetars, the outflow being powered by the rotational energy of the strongly magnetized neutron star (for a review, see e.g., Woosley, 2012). Because the collapsar model of longduration GRB (Woosley, 1993) relies on rapid accretion onto a black hole that forms in the center of a collapsing massive star, several groups have performed general relativistic simulations of the formation and propagation of GRB jets including the effects of magnetic fields (McKinney and Gammie, 2004; McKinney, 2006a; Mizuno et al., 2008; Tchekhovskoy et al., 2008; McKinney and Blandford, 2009; Tchekhovskoy et al., 2009; Komissarov et al., 2009, 2010; Tchekhovskoy et al., 2010; Harrison and Kobayashi, 2013).
Extending previous work to larger radii and later times, McKinney and Gammie (2004) (see also Section 2.1.4) and McKinney (2006a) studied selfconsistently generated Poyntingdominated axisymmetric jets. He considered a generic black hole accretion system because the GRMHD equations scale arbitrarily with the mass of the black hole and the massaccretion rate. He found that, unlike in some hydrodynamic simulations, the environment plays a negligible role in jet structure, acceleration, and collimation as long as the ambient pressure of the surrounding medium is small compared to the magnetic pressure in the jet. In his simulations the jet becomes marginally unstable to currentdriven instabilities, beyond the Alfvién surface (located between 10 and 100 gravitational radii). These instabilities induce jet substructure with 3 ≲ W ≲ 15, whereas the jet moves at a labframe bulk Lorentz factor of W ∼ 10 with a maximum terminal value of W_{∞} ≲ 10^{3}.
Using global axisymmetric stationary solutions of magnetically dominated ultrarelativistic jets Tchekhovskoy et al. (2008) investigated whether the magneticdriving paradigm can generate Lorentz factors and opening angles as required by the collapsar scenario. The global solutions were obtained via ideal magnetodynamic (i.e., forcefree) simulations in spherical polar coordinates based on a Godunovtype scheme (McKinney, 2006b) covering the jet propagation from the central engine to beyond six orders of magnitude in radius. To ensure accuracy and to properly resolve the jet, they used a numerical grid that approximately follows the magnetic field lines in the jet solution (Narayan et al., 2007). Thereby they achieved an effective radial resolution of about 100 000 with only 256 radial grid points.
The simulations showed that the size of the progenitor star and its pressure profile determine the terminal Lorentz factor (100 ≲ W ≲ 5000) and the opening angle of the jet (0.1° ≲ Θ_{j} ≲ 10°), consistent with observations of longduration GRB jets. In some of their solutions the Poynting flux is concentrated in a hollow cone with Θ ∼ Θ_{j}, while the maximum Lorentz factor occurs at Θ ≪ Θ_{j}, also in a hollow cone.
A similar study, but employing a MHD code, was performed by Komissarov et al. (2009) who considered, however, only special relativistic jets arguing that general relativistic effects can be neglected sufficiently far from the central engine, where most of the action takes place. They investigated the magnetic acceleration of ultrarelativistic flows within channels of prescribed geometry corresponding to powerlaw distributions of the confining pressure that is expected in the envelopes of GRB collapsar and magnetar progenitors.
Extending the simulations of Tchekhovskoy et al. (2008) to 3D and MHD, McKinney and Blandford (2009) explored both the stability of the jet against the development of the nonaxisymmetric helical kink mode that leads to rapid disruption (see also Section 2.1.4). Tchekhovskoy et al. (2009) performed timedependent axisymmetric RMHD simulations to find steadystate solutions for a wind from a compact object endowed with a splitmonopole field geometry. For axisymmetric rapidly rotating systems, a dipolar magnetosphere is the commonly expected field configuration, which can be well modeled by a splitmonopole at large radii beyond the Alfvéen surface (i.e., light cylinder). Obtaining approximate analytical solutions Tchekhovskoy et al. could extend their results to wind models with arbitrary magnetization. The simulations covered ten orders of magnitude in distance from the compact object and demonstrated that the production of ultrarelativistic jets is a quite robust process.
Tchekhovskoy et al. (2010) confirmed the work of Komissarov et al. (2009) by also exploring the effect of a finite stellar envelope on the structure of axisymmetric collapsar jets. They treated the jetenvelope interface as a collimating rigid wall, which opens up at the stellar surface to mimic loss of collimation. The onset of deconfinement causes a burst of acceleration accompanied by a slight increase in the opening angle. The results \(({W_\infty } \simeq 500,\;\Theta _j^\infty \simeq {2^ \circ })\) are consistent with observations of typical longduration GRB and also explain the occurrence of jet breaks.
Axisymmetric RMHD simulations by Komissarov et al. (2010) support the finding of Tchekhovskoy et al. (2010) that after break out but before entering the regime of ballistic expansion (during which additional magnetic acceleration becomes ineffective), the jets experience a spurt of acceleration. Komissarov et al. attributed this acceleration to a sideways expansion of the jet, associated with a strong magnetosonic rarefaction wave that is driven into the jet when it loses pressure support. Using the equations of RMHD they demonstrated that this mechanism, which they dubbed rarefaction acceleration, can only operate in a relativistic outflow, where the total energy can still be dominated by the magnetic component even in the superfastmagnetosonic regime (Komissarov et al., 2010). This jet boosting mechanism was previously found by Aloy and Mimica (2008).
The asymptotic evolution of strongly magnetized relativistic ejecta, i.e., after they have experienced a significant deceleration and a reverse shock has formed, resembles that of hydrodynamic ejecta in the BlandfordMcKee selfsimilar regime (Mimica et al., 2009b). Thus, the magnetization of GRB fireballs can only be determined from the early phases of the afterglow (Giannios et al., 2008; Mimica et al., 2009b, 2010; Harrison and Kobayashi, 2013) or from the prompt GRB broad spectral energy distribution (Mimica and Aloy, 2010). Giannios et al. (2008) derived the conditions for the existence of a reverse shock in arbitrarily magnetized ejecta that decelerate and interact with a circumburst medium. They concluded that the paucity of optical flashes, believed to be a distinctive signature of a reverse shock, may be explained by the existence of dynamically important magnetic fields in the ejecta.
Harrison and Kobayashi (2013) showed that with the current standard treatment, the fireball magnetization is underestimated by up to two orders of magnitude, particularly in the subrelativistic reverse shock regime, where most optical GRB flashes are detected. For their numerical study they employed a spherical relativistic Lagrangian hydrodynamic code based on Godunov’s method with an exact Riemann solver assuming that the magnetization of the fireball is not too large (ratio of magnetic to kinetic energy flux ≲ 10%), i.e., the dynamics of the shocks is not affected by magnetic fields.
2.3 Pulsar wind nebulae
2.3.1 Fiducial KennelCoroniti’s model
Pulsars lose their rotational energy predominantly by generating a highly magnetized ultrarelativistic wind. The wind interacts with the ambient medium, either the supernova remnant (SNR) or the ISM, and terminates at a strong reverse shock. The shocked plasma inflates a bubble of nonthermal relativistic particles and magnetic field, known as Pulsar Wind Nebula (PWN). The Crab Nebula is the best example of a PWN (for a recent review of the Crab pulsar and its nebula, see Bühler and Blandford, 2014).
The first theoretical model of the structure and the dynamic properties of PWN was presented by Rees and Gunn (1974), further developed by Kennel and Coroniti (1984a, b), and is based on a RMHD description. In it simplest form the MHD model of PWN can be summarized as follows (see Figure 7): the ultrarelativistic pulsar wind is confined inside the slowly expanding SNR, and slowed down to non relativistic speeds in a strong termination shock. At the shock the plasma is heated, the toroidal magnetic field of the wind is compressed, and particles are accelerated to high energies. These high energy particles and magnetic field produce a postshock flow which expands at a nonrelativistic speed toward the edge of the nebula.
Close to the pulsar, the energy is carried mostly by electromagnetic fields as Poynting flux, however the simple 1D models of PWN (Rees and Gunn, 1974; Kennel and Coroniti, 1984a, b; Begelman and Li, 1992) suggest that the magnetization parameter, here defined as the ratio of the Poynting and the kinetic energy fluxes, needs to be as small as 0.001 to 0.01 just upstream of the termination shock. If the ratio of magnetic pressure and gas pressure were larger, the amplification of the magnetic field due to compression at the shock front would cause the outer nebula to be strongly pinched and therefore highly elongated, in contradiction to observations (Rees and Gunn, 1974; Begelman and Li, 1992). This problem, known in the literature as the sigmaproblem, is a longstanding puzzle in pulsar wind theory.
Despite its simplicity and limitations the model of KennelCoroniti has been for a long time the reference for the understanding of young PWN, with only minor theoretical developments. The presence of an underluminous region centered at the location of the pulsar is interpreted as being caused by the ultrarelativistic unshocked wind. Polarization measures — of the, e.g., Vela (Dodson et al., 2003), Boomerang (Kothes et al., 2006), and Crab (Hester, 2008) nebulae — show that the emission is highly polarized and the nebular magnetic field is mostly toroidal. Both properties are expected from the compression of the pulsar wind, and they are consistent with the inferred symmetry axis of the system. The MHD flow from the terminal shock to the edge of the nebula also explains why PWN appear bigger at smaller frequencies: high energy Xrays emitting particles are present only in the vicinity of the terminal shock. They have a shorter lifetime against synchrotron losses than radioemitting particles which fill the entire volume.
2.3.2 The new paradigm from high resolution imaging and the role of axisymmetric numerical simulations
The high resolution optical and Xrays images from HST, Chandra, and XMMNewton have revolutionized the field of PWN showing that the properties of their emission at high energies cannot be explained within a simplified 1D model. This refers not just to the geometrical features that are observed, but in practice to all aspects of Xray emission.
The new data show that the inner region of young PWN is characterized by a complex axisymmetric structure, generally referred to as the jettorus structure, first observed in the Crab Nebula (Hester et al., 1995; Weisskopf et al., 2000) (see Figure 8). This structure is characterized by an emission torus, in what is thought to be the equatorial plane of the pulsar rotation, and a series of multiple arcs or rings, together with a central knot, almost coincident with the pulsar position, and one or two opposite jets along the polar axis, which seem to originate close to the pulsar itself.
The keys in understanding the jettorus structure are the magnetization and energy distribution in the pulsar wind, both displaying a strong latitudinal dependence. As suggested by Bogovalov and Khangoulian (2002) and Lyubarsky (2002), the consequence of such anisotropic energy injection into the surrounding nebula would be a greatly enhanced emission in a belt around the rotational equator — the “torus” appearing in Xray and optical images.
In addition, Lyubarsky suggested that the outflow from the torus, since it is injected into the nonrelativistically expanding cavity formed by the supernova, would be deflected into a subsonic backflow at higher latitudes, where magnetic hoop stress could act to focus plasma into a magnetically compressed, outflowing, subsonic plume along the pulsar rotation axis, thus creating the appearance of a jet.
An understanding of the complexity of this scenario requires the use of efficient and robust numerical schemes for RMHD (Komissarov, 1999a; Del Zanna et al., 2003; Mizuno et al., 2006). Thanks to numerical simulations (Komissarov and Lyubarsky, 2003, 2004; Del Zanna and Bucciantini, 2004; Bogovalov et al., 2005) the qualitative picture could be extended into a quantitative model that has been successfully validated against observations (see Figure 9). The wind’s magnetization regulates the formation and the properties of the jet: for low values of the magnetization (< 0.001), equipartition is not reached inside the nebula, and no jet is formed. At higher magnetizations equipartition is reached in the close vicinity of the terminal shock, and most of the plasma ends in a jet. The simulations (Del Zanna and Bucciantini, 2004) also explain the kinematics of the postshock flow inside the torus that requires velocities of ∼ 0.5c (Hughes et al., 2002). They contradict KennelCoroniti’s model which predicts significantly smaller speeds (Shibata et al., 2003) and the production of Xray nebulae with comparable size in radio.
One of the most recent achievements of the MHD nebular models has been the ability to reproduce the observed time variability in young PWN. Close to the supposed location of the termination shock, PWN show a short time variability mainly detected in optical and Xray bands. Variability of the wisps in the Crab Nebula has been known for a long time (Hester et al., 2002). Recent observations have shown that the jet in Vela appears to be strongly variable (Pavlov et al., 2003; Durant et al., 2013), together with the main rings (Kargaltsev and Pavlov, 2008). Variability is also observed in MSH 1552 (DeLaney et al., 2006), and has recently been detected in the jet of Crab (Weisskopf, 2011). In the strongly toroidal field of these nebulae, the jet variability, which usually has a timescale of years, is likely due to a variety of MHD instabilities or pulsar spin axis precession (DeLaney et al., 2006; Durant et al., 2013). On the other hand, the wisps show variability on shorter timescales of months having the form of an outgoing wave pattern with a possible yearlong duty cycle (see movie — online version only — Figure 8). The most recent MHD simulations (Volpi et al., 2008; Camus et al., 2009; Porth et al., 2014b) are able to recover the variability, the outgoing wave pattern, its typical speed, and the luminosity variations (see the synthetic Hubble movies of the inner PWN in the online material of Porth et al., 2014b, which show several wisps emanating from the termination shock).
Finally, employing axisymmetric, highly gridadapted, longterm RMHD simulations, Porth et al. (2014a) studied the development of RayleighTaylor filaments at the decelerated contact discontinuity that separates the PWN from the SNR ejecta. These filaments resemble the filamentary structures observed in the outer regions of the Crab Nebula.
2.3.3 Towards a solution of the sigmaproblem: 3D simulations
Simple 1D models of PWN fit the observations only if pulsar winds are particledominated, i.e., the ratio of Poynting flux to kinetic energy flux σ must be very small (10^{−3} − 10^{−2}). However, theoretical models of pulsar magnetospheres and winds predict σ ≫ 1. The striped wind oblique rotator model of Coroniti (1990) offers a possible solution to this discrepancy: reconnection of stripes of toroidal magnetic field of opposite polarity close of the equatorial plane of the wind converts the initially dominant Poynting flux into thermal and kinetic energy of particles as the wind flows radially outward. However, the dissipation lengthscale still significantly exceeds the radius of the wind termination shock for the Crab pulsar (Lyubarsky and Kirk, 2001).
Begelman (1998) proposed an alternative solution. Based on the axisymmetric model of Begelman and Li (1992), Begelman (1998) suggested that the sigmaproblem can be alleviated if a currentdriven kink instability destroys the concentric field structure in the nebula. The currentdriven kink instability allows the loops to come apart and one expects that in three dimensions, the mean field strength is not amplified much by the expansion of the flow, and the hoop stress would not necessarily pinch the flow as much as would otherwise be supposed. In this case, the ratio of Poynting flux and kinetic energy flux just upstream of the termination shock might not need to be so unreasonably small as was found in axisymmetric models.
Begelman (1998) derived a dispersion relation valid for relativistic fluids in the ideal MHD limit. The dominant instabilities are kink (m = 1) and pinch (m = 0) modes. The former generally dominate, destroying the concentric field structure and driving the system toward a more chaotic state in which the mean field strength is independent of radius.
Mizuno et al. (2011b) and more recently Porth et al. (2013) have tested Begelman’s suggestion by means of 3D RMHD simulations. Mizuno et al. (2011b) investigated the relaxation of a hydrostatic hot plasma column containing toroidal magnetic field (the original cylindrical magnetostatic configuration used in Begelman and Li, 1992) by the currentdriven kink instability. In their simulations, the instability is excited by a small initial velocity perturbation, which develops into a turbulent tructure inside the hot plasma column. The authors demonstrate that, as envisioned by Begelman, the hoop stress declines, the initial gas pressure excess near the axis decreases, and the ratio of the Poynting and kinetic energy flux, declines from an initial value of 0.3 to about 0.01 when the currentdriven kink instability saturates.
The most important ingredient missing in the simulations by Mizuno et al. is the continuous injection of magnetic flux and energy in PWN by pulsar winds. As a result, there is no termination shock whose size is an important parameter used to test theories of PWN against observational data. Hence, the next natural step is to carry out 3D numerical simulations of PWN with setups similar to those of the previous axisymmetric simulations.
Such a study was performed by Porth et al. (2013) who showed that the kink instability (and the magnetic dissipation) inside these nebulae may be the key process allowing one to reconcile the observations with the theory of pulsar winds. In agreement with the simulations of Mizuno et al. (2011b) the highly organized coaxial configuration of the magnetic field, characteristic of previous 2D simulations of PWN, is largely destroyed in the 3D models. However, the azimuthal component still dominates in the vicinity of the termination shock, i.e., in the region roughly corresponding to Crab torus (see Figure 10), which is filled mainly with plasma that flows from the termination shock towards the center of the nebula. The hoop stress of the azimuthal field is still capable of producing a notable axial compression close to the termination shock and driving polar outflows, which are required to explain the Crab jet, and the jets of other PWN. However, these outflows are much more moderate than in the 2D models.
Simulations of PWN beyond the free expansion phase (as in, e.g., Blondin et al., 2001; Bucciantini et al., 2005; Vigelius et al., 2007) when the interaction with the SNR and the proper motion of the pulsar become important, and the interpretation of the gammaray emission remain two of the main challenges in the field (see, e.g., Bucciantini, 2011, 2012). Both problems are of particular importance for the study of gammaray binaries for which there is compelling evidence that they are driven by rotationpowered pulsars (Dubus, 2006, 2013).
3 Special Relativistic Hydrodynamics and Magnetohydrodynamics
3.1 Equations
The simplest model to describe a relativistic medium is that of a relativistic nondissipative (perfect) fluid. When the medium is magnetized and electrically highly conducting, the simplest description is in terms of ideal MHD (the equations describing the evolution of a perfect magnetofluid in the limit of infinite conductivity). In this review we shall refer to the equations describing such systems as the equations of relativistic hydrodynamics (RHD) and magnetohydrodynamics (RMHD). A derivation of the equations of relativistic fluid dynamics based on the analogy with Newtonian fluid dynamics with an appropriate identification of the relativistic counterparts corresponding to energy and momentum densities and fluxes can be found in Synge (1956); Landau and Lifshitz (1987); Misner et al. (1973); Taub (1978). Anile (1989) provides a justification of the RHD and RMHD equations based on the phenomenological theory of electromagnetically polarizable media. The reader is also addressed to the book of Dixon (1978). In this Section we present without derivation the equations of both RHD and RMHD. Another presentation of these equations, including a brief discussion, can also be found in Chapter 21 of Goedbloed et al. (2010).
Using the Einstein summation convention the equations describing the motion of a relativistic fluid are given by the five conservation laws
where μ,ν = 0,…, 3, and; μ denotes the covariant derivative with respect to the coordinate x^{μ}. Furthermore, ρ is the proper restmass density of the fluid, u^{μ} its 4velocity, and T^{μν} is the stressenergy tensor, which for a perfect fluid can be written as
Here, g^{μν} is the metric tensor, p the fluid pressure, and h the specific enthalpy of the fluid defined by
where ε is the specific internal energy. Finally, one requires an equation of state (EOS) that relates the thermodynamic variables, e.g., p = p(ρ, ε).
For an ideal magnetofluid, the stress energy tensor must include the contribution of the magnetic field,
where h* = 1 + ε + p/ρ + b^{2}/ρ is the specific enthalpy including the contribution of the magnetic field (b^{2} stands for b^{μ}b_{μ}), p* = p + b^{2}/2 is the total pressure, and b^{μ} is the magnetic field in the fluid rest frame which satisfies the condition u^{μ}b_{μ} = 0. In this case, the equations expressing the conservation of restmass, energy and momentum (1), (2) must be complemented with Maxwell’s equations that govern the evolution of the magnetic field
where * F^{μν} is the Maxwell dual tensor,
In the preceding equations and throughout the review, besides using units in which the speed of light is set to unity, we absorb a factor √4π in the definition of the magnetic field (see also Section 6)
The equations of RMHD can be written as a system of conservation laws. In Minkowski spacetime (g_{μν} = η_{μν} = diag(−1, 1, 1, 1)) and Cartesian coordinates ({i, j, k} = {x, y, z}) this system reads
where the state vector, U, and the fluxes, F^{i}, are the following column vectors,
and
In these equations, D, S^{j}, and τ are the restmass density, the momentum density of the magnetized fluid in jdirection, and the total energy density measured in the laboratory (i.e., Eulerian) frame, i.e.,
where v^{i} are the components of the fluid 3velocity measured in the laboratory frame. They are related to the components of the fluid 4velocity by the expression u^{μ} = W(1,v^{x}, v^{y}, v^{z}) with the flow Lorentz factor
The following fundamental relations hold between the components of the magnetic field 4vector in the comoving frame and the three vector components B^{i} measured in the laboratory frame:
where v and B denote the 3vectors (v^{x},v^{y},v^{z}) and (B^{x}, B^{y}, B^{z}), respectively. The square of the modulus of the magnetic field can be written as
with B^{2} = B^{i}B_{i}.
Subtracting the restmass energy D from the total energy τ, the energy equation can be written in terms of the conserved variable τ′ = τ − D. In the nonrelativistic limit (i.e., v ≪ 1, ε, p ≪ 1, and B^{2} ≪ 1), the conserved variables D, S^{i} and τ′ tend to their Newtonian counterparts ρ, ρv^{i}, and ρε + ρv^{2}/2 + B^{2}/2, and the classical MHD equations are recovered. Setting B = 0 in the MHD or RMHD equations leads to the corresponding hydrodynamic limits.
The dynamic importance of a magnetic field can be quantified with the following two parameters: (i) β = b^{2}/(2p), the ratio of magnetic pressure to gas pressure, and (ii) κ = b^{2}/(ρh), which is related to the ratio of magnetic energy density to enthalpy density and coincides with the ratio of Poynting flux to kinetic energy density for flows perpendicular to the magnetic field. In a medium at rest β = B^{2}/(2p) and κ = B^{2}/(ρh). The parameter κ varies monotonically with the Alfvén speed given by \({c_a} = B/\sqrt {\rho h + {B^2}} \), i.e., \(\kappa = c_a^2/(1  c_a^2)\) and κ → 0 (∞) for c_{a} → 0 (1). Important dynamic effects due to the presence of a magnetic field are expected when β and/or κ are large. We note that our definitions of these parameters can differ from those of other authors (in particular, our β parameter is defined as the inverse of the plasma β parameter).
3.2 Mathematical aspects
3.2.1 Hyperbolicity of the RHD equations
Lichnerowicz (1967) and Anile (1989) discussed the mathematical structure of the equations of RHD and RMHD. An important property of the former set of nonlinear partial differential equations is that it is hyperbolic for causal EOS (Anile, 1989). For hyperbolic systems of conservation laws, the Jacobians of the fluxes ∇F^{i}(U)/∇U have real eigenvalues and a complete set of eigenvectors (see Section 8.1 for the spectral decomposition of the flux Jacobians of the RHD equations). Information about the solution propagates at finite velocities given by the eigenvalues of the Jacobians, which are related to the propagation speeds of flow disturbances. In the case of a fluid, these are entropy waves and sound waves.
If the solution is known in some spatial domain at some given time, the hyperbolicity of the RHD equations can be used to advance the solution to some later time (initial value problem). In general, it is not possible, however, to derive an exact solution. Instead one has to rely on numerical methods which provide an approximate solution. Moreover, the numerical methods must be able to handle solutions with discontinuities (i.e., shocks), which are inherent to nonlinear hyperbolic systems. Readers interested in the theory and numerical solution of hyperbolic systems are addressed to the monographs by LeVeque (1992) and Toro (1997).
Associated with the hyperbolicity of the system are the concepts of characteristics (integral curves of the eigenvalues of the flux Jacobians) and simple waves (solutions that are constant along characteristics). Simple waves and shocks (limiting solutions of converging simple waves) are the building blocks of the solution of Riemann problems (initial value problems with discontinuous data). They are of paramount importance from a theoretical point of view and also for the numerical solution of the hyperbolic system of equations. We present the solution of the Riemann problem in RHD in Section 8.5, as derived in Martí and Müller (1994); Pons et al. (2000). Several theoretical developments related to the theory of simple waves and shocks in RHD are discussed in Martí and Müller (1994) (and references therein), including an analysis of the jump conditions across shocks, of the shock adiabats, of selfsimilar solutions of relativistic blast waves, and of the process of shock formation by the steepening of simple waves.
3.2.2 Hyperbolicity of the RMHD equations and degeneracies
The hyperbolicity of the RMHD equations including the derivation of eigenvalues and the corresponding eigenvectors was studied by Anile and Pennisi (1987) and reviewed by Anile (1989). In both classical and relativistic MHD, the eigenvalues are associated with the propagation of entropy waves, Alfvén waves, and slow and fast magnetosonic waves (Jeffrey and Taniuti, 1964). Moreover, the MHD equations exhibit degeneracies in the sense that two or more eigenvalues may coincide, i.e., the set of equations is not strictly hyperbolic.
The degeneracy conditions in RMHD have been analyzed by Komissarov (1999a), and more recently by Antón et al. (2010). They coincide with those for Newtonian flows in the fluid rest frame. Degeneracies are encountered in this frame for waves propagating perpendicular (Type I) and along (Type II) the magnetic field direction. In case of the Type I degeneracy, the two Alfvén waves, the entropic wave, and the two slow magnetosonic waves propagate at the same speed, while for the Type II degeneracy, the speeds of an Alfvén wave and a magnetosonic wave (slow or fast) are the same.
Some differences between classical and relativistic MHD exist in the laboratory frame. If one encounters the Type II degeneracy in classical MHD, both Alfvén waves exhibit the degeneracy. In RMHD, due to aberration, the condition for degeneracy can be fulfilled only for one of the Alfvén waves. Only if the tangential component of the fluid velocity vanishes, one recovers the classical behavior. The degeneracies can be visualized with the help of the characteristic wave speed diagrams (Antón et al., 2010), equivalent to the phase speed diagrams for linear perturbations (Keppens and Meliani, 2008). These diagrams show the normal speed of planar wave fronts propagating in different directions, the speed given by the distance between the origin and the normal speed surface along the corresponding direction. Figure 11 displays the degeneracies for a selection of states.
The eigenvectors derived in Anile and Pennisi (1987) and Anile (1989) do not form a complete basis for degenerate states since they become zero or linearly dependent in that case. Antón et al. (2010) obtained a new set of eigenvectors that do form such a basis both for nondegenerate and degenerate states. The new set of renormalized right eigenvectors in covariant variables as well as a short discussion of the derivation of the left and right eigenvectors in conserved variables can be found in Section 8.2.
We present the solution of the Riemann problem in RMHD in Section 8.6 as derived in Giacomazzo and Rezzolla (2006). Some interesting analytical results involving simple waves in magnetized fluids can be found in Mathews (1971); Lyutikov (2010); Lyutikov and Hadden (2012).
3.2.3 Convexity
A hyperbolic system is said to be convex when all the characteristic fields are either genuinely nonlinear or linearly degenerate (Lax, 1957; LeVeque, 1992). The solutions of a hyperbolic system are qualitatively different depending on whether the system is convex or not. In a convex system, genuinely nonlinear fields can give rise to a single shock or a single centered rarefaction wave, whereas linearly degenerate fields are associated to contact discontinuities. If the system is nonconvex, the fields which have no definite character can give rise to an alternate series of shocks and rarefactions (Godlewski and Raviart, 1996) (compound waves; see below).
In a purely fluid dynamical system, the convex or nonconvex character is determined by the EOS, and one speaks of convex or otherwise nonconvex equations of state. An EOS is said to be convex if the isentropes are convex in the p − V plane (where V ≡ 1/ρ is the specific volume). Convexity of the isentropes is guaranteed by a positive value of the fundamental derivative (Menikoff and Plohr, 1989); see Ibáñez et al. (2013) and Ibáñez et al. (2015) for a generalization of this result to RHD and RMHD, respectively. However, whereas in unmagnetized fluids nonconvexity is associated to complex equations of state, the equations of MHD are of nonconvex nature because at degenerate states magnetosonic waves change from genuinely nonlinear to linearly degenerate waves (see Brio and Wu, 1988, Antón et al., 2010, for classical and relativistic MHD, respectively).
The fact that the MHD equations form a nonstrictly hyperbolic, nonconvex system makes them considerably more complex than the hydrodynamic ones. Shock waves in hydrodynamic flows are regular, while MHD flows admit nonregular or intermediate shocks (see Torrilhon, 2003, for the corresponding definitions). Among these intermediate shocks are the socalled overcompressive shocks^{Footnote 2} and switchon/off shocks, where the magnetic field vanishes on one side of the wave.^{Footnote 3} Intermediate shocks are also associated with rarefactions in the socalled compound waves (Torrilhon, 2003). They are related to the question of the existence and the uniqueness of solutions of some Riemann problems. However, there is a ongoing controversy about the significance of nonregular shocks (and compound waves) in MHD (see Takahashi and Yamada, 2014, for an uptodate overview of the problem).
3.2.4 Divergencefree constraint
The solutions of the system of classical and relativistic MHD must satisfy the divergencefree constraint for the magnetic field derived from the temporal component of Eq. (6). The evolution system guarantees the fulfillment of this constraint for an initially divergencefree magnetic field at all later times, but to satisfy the constraint in numerical simulations of MHD flows poses a challenge. We shall come back to this point later, when discussing specific numerical methods.
4 Gridbased Methods in RHD
The application of highresolution shockcapturing (HRSC) methods caused a revolution in numerical RHD. These methods satisfy in a quite natural way the basic properties required for any acceptable numerical method: (i) high order of accuracy, (ii) stable and sharp description of discontinuities, and (iii) convergence to the physically correct solution. Moreover, HRSC methods are conservative, and because of their shock capturing property discontinuous solutions are treated both consistently and automatically whenever and wherever they appear in the flow.
HRSC methods are built following two possible strategies, namely finite volume (FV) and finite difference (FD) methods. Both strategies rely on a conservative form of the discretized equations. However, whereas FD methods are based on the differential form of the conservation equations and evolve point values of the state vectors in time, FV methods utilize the integral form of the conservation laws and cell averaged values. This difference has implications for the algorithms that have been developed following both strategies.
In FV methods, the numerical fluxes (i.e., the functions that govern the time evolution of the corresponding state vectors) are considered as an approximation to the timeaveraged true fluxes. They are obtained solving in a variety of ways (e.g., Riemann solvers, flux formulas) the Riemann problems defined at each numerical interface. This restriction in the interpretation of the numerical fluxes is eased in FD methods leading to a wider set of methods.
The difference between FV and FD methods manifests itself also in the use of different spatial interpolation strategies. Although the division between both classes of methods is not strict in this respect, most RHD codes based on FV methods achieve second order spatial accuracy by employing linear interpolation and slope limiters, which leads to TVD (total variation diminishing) algorithms. The piecewise parabolic method (PPM) of Colella and Woodward (1984), using parabolas for cell reconstruction, has an accuracy higher than second order but it is not TVD. Most FD methods rely on more modern (and higher order) ENO (essentially nonoscillatory) schemes, which use adaptive stencils to reconstruct the variables at the desired grid locations from the corresponding point values. ENO schemes can be employed also in FV methods, but because they require multidimensional reconstruction they have not been employed in RHD codes.
While we present the fundamentals of HRSC methods in Section 8.3, we review specific ingredients used in modern numerical RHD codes based on HRSC methods in this section.
4.1 Relativistic Riemann solvers
4.1.1 Solvers based on the exact solution of the relativistic Riemann problem
Martí and Müller (1996) used the procedure discussed in Section 8.5 to construct an exact Riemann solver, which they then incorporated in an extension of the PPM method (Colella and Woodward, 1984) for purely 1D RHD (i.e., in the absence of transverse velocities). In their relativistic PPM method numerical fluxes are calculated according to
where U_{L} and U_{R} are approximations of the state vector at the left and right side of a cell interface obtained by a secondorder accurate interpolation in space and time, and U_{RP}(0; U_{L}, U_{R}) is the solution of the Riemann problem defined by the two interpolated states at the position of the initial discontinuity.
The twoshock approximate Riemann solver is obtained from a relativistic extension of Colella’s method (Colella, 1982) for classical fluid dynamics, where it has been shown to properly handle shocks of arbitrary strength (Colella, 1982; Woodward and Colella, 1984). In order to construct Riemann solutions in the twoshock approximation one analytically continues shock waves towards the rarefaction side (if present) of the cell interface instead of using an actual rarefaction wave solution. Balsara (1994) developed an approximate relativistic Riemann solver of this kind by solving the jump conditions in the oblique shocks’ rest frames in the absence of transverse velocities, after appropriate Lorentz transformations, although it was only tested for purely 1D flows. Dai and Woodward (1997) developed a similar Riemann solver based on the jump conditions across oblique shocks that is more efficient.
Wen et al. (1997) developed a firstorder code for 1D RHD combining Glimm’s random choice method (Glimm, 1965; Chorin, 1976) — using an exact Riemann solver (Martí and Müller, 1994) — with standard FD schemes. Cannizzo et al. (2008) extended the method of Wen et al. to 1D problems involving transversal flows using the exact Riemann solver in Pons et al. (2000) and Rezzolla et al. (2003). Finally, Mignone et al. (2005b) implemented and tested the twoshock relativistic Riemann solver for arbitrary initial transverse velocities and incorporated it into the RHD module of the FLASH code.
4.1.2 Roetype relativistic solvers
Linearized Riemann solvers are based on the exact solution of Riemann problems of a modified system of conservation equations obtained by a suitable linearization of the original system. This idea was put forward by Roe (1981), who developed a linearized Riemann solver for the equations of ideal (classical) gas dynamics. Eulderink (1993) and Eulderink and Mellema (1995) extended Roe’s Riemann solver to the general relativistic system of equations in arbitrary spacetimes. Eulderink used a local linearization of the Jacobian matrices of the system fulfilling the properties demanded by Roe in his original paper. Let \(\mathcal{B} = \partial {\bf{F}}/\partial {\bf{U}}\) be the Jacobian matrix associated with one of the fluxes F of the original system, and U the vector of unknowns. Then, the locally constant matrix \(\tilde{\mathcal{B}}\), depending on U_{L} and U_{R} (the left and right state defining the local Riemann problem) must have the following four properties:

1.
It constitutes a linear mapping from the vector space U to the vector space F.

2.
As U_{L} → U_{R} → U, \(\tilde{\mathcal{B}}\left( {{{U}_{L}},{{U}_{R}}} \right)\to \mathcal{B}\left( U \right)\).

3.
For any U_{L}, U_{R}, \(\tilde{\mathcal{B}}\left( {{{U}_{L}},{{U}_{R}}} \right)\left( {{{U}_{R}},{{U}_{L}}} \right)=F\left( {{{U}_{R}}} \right)F\left( {{{U}_{L}}} \right)\).

4.
The eigenvectors of \(\tilde{\mathcal{B}}\) are linearly independent.
Conditions 1 and 2 are necessary to recover smoothly the linearized algorithm from the nonlinear one. Condition 3 (supposing 4 is fulfilled) ensures that if a single discontinuity is located at the interface, then the solution of the linearized problem is the exact solution of the nonlinear Riemann problem.
Once a matrix, \(\tilde{\mathcal{B}}\), satisfying Roe’s conditions has been obtained for every cell interface, the numerical fluxes are computed by solving the locally linear system. Roe’s numerical flux is then given by
with
where \({\tilde \lambda ^{(p)}},\;{{\bf{\tilde r}}^{(p)}}\), and \({{\bf{\tilde l}}^{(p)}}\) are the eigenvalues and the right and left eigenvectors of \(\tilde{\mathcal{B}}\), respectively (m is the number of equations of the system).
Roe’s linearization for the relativistic system of equations in a general spacetime can be expressed in terms of the average state (Eulderink, 1993; Eulderink and Mellema, 1995)
with
and
where g is the determinant of the metric tensor g_{βν}. The role played by the density ρ in case of the Cartesian nonrelativistic Roe solver as a weight for averaging, is taken over in the relativistic variant by k, which apart from geometrical factors tends to ρ in the nonrelativistic limit. A Riemann solver for special relativistic flows and the generalization of Roe’s solver to the Euler equations in arbitrary coordinate systems are easily deduced from Eulderink’s work. The results obtained in 1D test problems for ultrarelativistic flows in the presence of strong discontinuities and large gravitational background fields demonstrate the excellent performance of the EulderinkRoe solver (Eulderink and Mellema, 1995).
Relaxing condition 3 above, Roe’s solver is no longer exact for shocks but still produces accurate solutions. Moreover, the remaining conditions are fulfilled by a large number of averages of the left an right states. The 1D codes described in Martí et al. (1991) (RHD, testfluid approximation of GRHD) and Romero et al. (1996) (dynamical GRHD) use Eq. (19) with an arithmetic average of the primitive variables at both sides of the interface to compute the numerical fluxes.
Roe’s original idea has been exploited in the local characteristic approach (see, e.g., Yee, 1989a), which relies on a local linearization of the system of equations by defining at each cell a set of characteristic variables that obey a system of uncoupled scalar equations. This approach has proven to be very successful, because it allows for the extension of scalar nonlinear methods to systems in both FV and FD methods. The codes cited in the previous paragraph are examples of FV methods based on the local characteristic approach, while examples of FD methods based on this approach are those developed by Marquina et al. (1992) and Dolezal and Wong (1995), both using highorder reconstructions (PHM Marquina et al., 1992; ENO Dolezal and Wong, 1995) of the numerical characteristic fluxes.
The 2D RHD code developed by Martí (1994; 1997) and its 3D extensions GENESIS and Ratpenat can be cast as FV schemes based on the local characteristic approach. More details about the computation of the numerical fluxes in these codes will be given in Section 4.2.
Also based on a local linearization of the RHD equations are the relativistic Riemann solvers developed by Falle and Komissarov (1996) relying on previous work by Falle (1991). Instead of starting from the conservative form of the hydrodynamic equations, one can use a primitivevariable formulation in quasilinear form
where V is any set of primitive variables. Using a local linearization of the above system one obtains a solution of the Riemann problem and from that the numerical fluxes needed to advance a conservation form of the equations in time.
Falle and Komissarov (1996) have considered two different algorithms to solve the local Riemann problems in RHD by extending the methods devised in Falle (1991). In the first algorithm, the intermediate states of the Riemann problem at both sides of the contact discontinuity, V_{L*} and V_{R*}, are obtained by solving the system
where \({\bf{r}}_{\rm{L}}^  \) is the right eigenvector of \(\mathcal{A}({{\bf{V}}_{\rm{L}}})\) associated with sound waves moving upstream and \({\bf{r}}_{\rm{R}}^ + \) is the right eigenvector of \(\mathcal{A}({{\bf{V}}_{\rm{R}}})\) of sound waves moving downstream. The continuity of pressure and of the normal component of the velocity across the contact discontinuity allows one to obtain the wave strengths b_{L} and b_{R} from the above expressions, and hence the linear approximation to the solution of the Riemann problem, V^{FK}(V_{L}, V_{R}).
In the second algorithm proposed by Falle and Komissarov (1996), a linearization of system (24) is obtained by constructing a constant matrix \(\mathcal{A}({{\bf{V}}_{\rm{L}}},{{\bf{V}}_{\rm{R}}}) = \mathcal{A}({\textstyle{1 \over 2}}({{\bf{V}}_{\rm{L}}} + {{\bf{V}}_{\rm{R}}}))\). The solution of the corresponding Riemann problem is that of a linear system with matrix \(\tilde{\mathcal{A}}\), i.e.,
or, equivalently,
with
where \({\tilde \lambda ^{(p)}},\;{{\bf{\tilde r}}^{(p)}}\), and \({{\bf{\tilde l}}^{(p)}}\) are the eigenvalues, and the right and left eigenvectors of \(\tilde{\mathcal{A}}\), respectively (p runs from 1 to the number of equations of the system).
In both algorithms, the final step involves the computation of the numerical fluxes for the conservation equations
4.1.3 Relativistic HLL and HLLC methods
Schneider et al. (1993) proposed to use the method of Harten, Lax and van Leer (HLL hereafter Harten et al., 1983) to integrate the equations of RHD. This method avoids the explicit calculation of the eigenvalues and eigenvectors of the Jacobian matrices and is based on an approximate solution of the original Riemann problems with a single intermediate state
where a_{L} and a_{R} are lower and upper bounds for the smallest and largest signal velocities, respectively. The intermediate state U_{*} is determined by requiring consistency of the approximate Riemann solution with the integral form of the conservation laws in a grid cell. The resulting average of the Riemann solution between the slowest and fastest signals at some time is given by
and the numerical flux vector by
where
An essential ingredient of the HLL method are good estimates for the smallest and largest signal velocities. In the nonrelativistic case, Einfeldt (1988) proposed calculating them based on the smallest and largest eigenvalues of the Jacobian matrix of the system. The HLL scheme with Einfeldt’s recipe is a very robust scheme for the Euler equations and possesses the property of being positively conservative, i.e., the scheme is conservative, and the internal energy and density remain positive during the flow’s evolution. In the relativistic case, several estimates of the limiting characteristic wavespeeds have been proposed which rely on the 1D relativistic addition of velocities. For example, Schneider et al. (1993) used in their 1D simulations the estimates
where \(\bar v\) and \({\bar c_s}\) are the fluid velocity and the sound speed, respectively. The bar denotes some average (arithmetic or Roelike) between the corresponding left and right states. Duncan and Hughes (1994) and Hughes et al. (2002) performed multidimensional simulations with a wave speed estimate based on the 1D relativistic addition of velocities formula applied to the individual components of the velocities. Del Zanna and Bucciantini (2002) generalized the method of Schneider et al. to multidimensional RHD, the estimates of the limiting characteristic wavespeeds being based on the multidimensional relativistic addition of velocities.
Underestimating the signal velocities may introduce instabilities or entropy violating shocks, because the numerical domain of dependence does not completely cover that of the true solution. One way to prevent these undesired effects, is e.g., to define the wave speeds as
This overestimate of the signal speeds, however, gives rise to a larger numerical dissipation, and the resulting HLL scheme leads to the LaxFriedrichs scheme (see Section 4.2.1), which is very dissipative. Finally, in the relativistic case, the speed of light is an absolute limit, i.e., one can also define the wave speeds according to
Nowadays the relativistic HLL method is one of the most popular Riemann solvers in RHD codes; see Del Zanna and Bucciantini (2002), RAM, WHAM, RENZO, and RAMSES.
The HLL method is exact for single shocks and it is very robust. However, it is also very dissipative, especially at contact discontinuities. In the HLLC method (Toro et al., 1994) the contact discontinuity in the middle of the Riemann fan is also captured in an attempt to reduce the dissipation of the HLL method across contacts. Mignone and Bodo (2005) extended the HLLC method to 1D, 2D and 3D RHD and incorporated it in the RHD module of the PLUTO code. In the HLLC approximate Riemann solver, the solution of the Riemann problem reads
where a_{*} is the (constant) speed of the contact discontinuity separating the L_{*} and R_{*} intermediate states. Consistency of the approximate Riemann solution with the underlying conservation laws in a grid cell results in the relations:
and
where F_{L*,R*} is the flux associated with the intermediate state U_{L*R*} (note that, in general, F_{L*,R*} = F(U_{L*,R*})), and
and
are the intermediate state in the original HLL method and its associated flux, respectively.
In two dimensions, the consistency relations (38) and (39) together with the continuity of pressure and normal velocity across the contact wave provide ten conditions to resolve the two intermediate states. In order to reduce the number of unknowns and to have a wellposed problem, τ_{L*,R*} and F_{L*,R*} are defined in terms of the ten unknowns D_{L*,R*}, \(v_{{{\rm{L}}_{\ast}},{{\rm{R}}_{\ast}}}^x,S_{{{\rm{L}}_{\ast}},{{\rm{R}}_{\ast}}}^x,S_{{{\rm{L}}_{\ast}},{{\rm{R}}_{\ast}}}^y\), p_{L*,R*}, and the speed of the contact discontinuity a_{*}. The latter follows from the condition \({a_\ast} = v_{{{\rm{L}}_\ast},{{\rm{R}}_\ast}}^x\), and the intercell numerical flux is given by
The HLLC solver has been implemented in the relativistic code of Matsumoto et al. (2012), and also in RENZO, AMRVAC and RAMSES.
4.2 Flux formulas
In this category we include numerical flux functions that are not obtained from the solution of specific (exact or approximate) Riemann problems, although they can be interpreted and used in that way. Given their popularity in numerical RHD, we will restrict our discussion to the LaxFriedrichs and the Marquina flux formulas here.
4.2.1 LaxFriedrichs flux formula
The LaxFriedrichs scheme (Lax, 1954) is among the most known FD schemes. When applied to the linear advection equation, ∂u/∂t + a∂u/∂x = 0, the scheme reads
where a is the constant signal propagation speed. It can be cast in conservation form by defining the numerical flux
In the nonlinear case, a suitable definition of the LaxFriedrichs (LF) numerical flux is
with
where f′(u) is the derivative of f with respect to u. A less dissipative formulation is the local LaxFriedrichs (LLF) scheme, the numerical flux being given by
with
For systems of conservation laws, conservative schemes can be built based on the numerical fluxes defined by Eqs. (45) or (47) applied either directly to the equations in conservation form or to the characteristic equations (within the local characteristic approach, Section 4.1.2).
LaxFriedrichs flux formulas are nowadays widely used in RHD codes. Dolezal and Wong (1995) used the LLF flux in combination with ENOFD schemes both for the characteristic fields (following the local characteristic approach) or directly for the conserved variables. Del Zanna and Bucciantini (2002) implemented a version of the LLF flux for the conserved equations in combination with CENO (convex ENO) interpolation routines. LucasSerrano et al. (2004) tested the performance of the LLF flux with piecewise parabolic and piecewise hyperbolic reconstructions. RAM allows for the use of the LLF flux for both FV and FD methods (in this last case together with WENO reconstruction of the characteristic fluxes). RENZO exploits the LLF flux as an alternative for FV methods. The RHD module of AMRVAC was tested and applied to a GRB model in Meliani et al. (2007), the discretization relying on a TVDLF type method (Yee, 1989b; Tóth and Odstrčil, 1996) based on the LLF fux formula.
The LaxFriedrichs flux is also at the heart of the NOCD (nonoscillatory central differencing) schemes (see Section 8.3) implemented in COSMOS and tested in RHD calculations (Anninos and Fragile, 2003).
4.2.2 Marquina flux formula
Godunovtype schemes are indeed very robust in most situations although they fail on occasions (Quirk, 1994). Motivated by the search for a robust and accurate approximate Riemann solver that avoids these common failures, Donat and Marquina (1996) extended to systems a numerical flux formula first proposed by Shu and Osher (1989) for scalar equations. In the scalar case and for characteristic wave speeds which do not change sign at the given numerical interface, Marquina’s flux formula is identical to Roe’s flux. Otherwise, the scheme switches to the more viscous, entropy satisfying LLF scheme (Shu and Osher, 1989).
In the case of systems, the combination of Roe and LLF solvers is carried out in each characteristic field after the local linearization and decoupling of the system of equations Donat and Marquina (1996). However, contrary to Roe’s and other linearized methods, the extension of Marquina’s method to systems is not based on any averaged intermediate state. In Marquina’s flux formula the lateral local characteristic variables and fluxes are calculated, for given left and right states, according to:
for p = 1, 2 …, m, where m is the number of equations of the system. Here l^{(p)}(U_{L}) and l^{(p)}(U_{R}), are the (normalized) left eigenvectors of the Jacobian matrix \(\mathcal{B}\) of the system of equations in conservation form, calculated for the left and right states U_{L} and U_{R}, respectively.
Let λ^{(1)}(U_{L}), …, λ^{(m)}(U_{L}) and λ^{(1)}(U_{R}), …, λ^{(m)}(U_{R}) be the corresponding eigenvalues. For every k = 1,…, m, one then proceeds as follows:

If λ^{(k)}(U) does not change sign in [U_{L}, U_{R}], the scalar scheme is upwind and the numerical flux is calculated according to the relevant characteristic information:

Otherwise, the scalar scheme is switched to the more viscous LLF scheme:
$$\matrix{ {{\alpha ^{(k)}} = \max \{ \vert{\lambda ^{(k)}}({{\bf{U}}_{\rm{L}}})\vert,\vert{\lambda ^{(k)}}({{\bf{U}}_{\rm{R}}})\vert\} } \cr {\phi _ + ^{(k)} = (\phi _{\rm{L}}^{(k)} + {\alpha ^{(k)}}\omega _{\rm{L}}^{(k)})/2} \cr {\phi _  ^{(k)} = (\phi _{\rm{R}}^{(k)}  {\alpha ^{(k)}}\omega _{\rm{R}}^{(k)})/2} \cr } $$Marquina’s flux formula is then given by
$${{\bf{\hat F}}^{\rm{M}}} = \sum\limits_{p = 1}^m {\left({\phi _ + ^{(p)}{{\bf{r}}^{(p)}}({{\bf{U}}_{\rm{L}}}) + \phi _  ^{(p)}{{\bf{r}}^{(p)}}({{\bf{U}}_{\rm{R}}})} \right)},$$(49)where r^{(p)}(U_{L}) and r^{(p)}(U_{R}) are the right (normalized) eigenvectors of the Jacobian matrices \(\mathcal{B}({{\bf{U}}_{\rm{L}}})\) and \(\mathcal{B}({{\bf{U}}_{\rm{R}}})\), respectively.
Marquina flux formula is nowadays widely used in RHD codes. Martí et al. (1995, 1997) implemented a version that applies the LLF flux to all characteristic fields in their 2D FV RHD code. This modified Marquina’s flux formula (MMFF) is also implemented in the 3D RHD codes GENESIS and Ratpenat, and in the code of Mizuta et al. (2001, 2004), the RAM code, and the RENZO code. In all these cases FV methods are used.
4.3 Spatial reconstruction
No special contributions from numerical RHD concern the strategies of spatial reconstruction, i.e., techniques developed for general hyperbolic systems of conservation laws are carried over to RHD.
In HRSC methods, the spatial order of accuracy is increased by interpolating the approximate solution between grid points to produce more accurate numerical fluxes. In FV schemes, this is achieved by substituting the mean values by better representations of the true flow at the left and right of cell interfaces as initial data for Riemann problems. The interpolation algorithms have to preserve the TVstability of the algorithm. This is usually achieved by using linear interpolation and slope limiters, leading to TVD schemes. PPM (Colella and Woodward, 1984) uses parabolas for cell reconstruction and specific monotonicity constraints that keep the solution free of numerical oscillations. Experience has shown that the approach where one first recovers the primitive variables (see Section 4.6) from averaged conserved ones and then reconstructs the primitive variables is numerically more robust than the reverse approach. Hence, most of the relativistic conservative codes reconstruct primitive variables, like e.g., density, pressure, and the spatial components of the four velocity.
In FD schemes, the standard approach relies on the use of ENO schemes based on adaptive stencils to reconstruct variables (typically fluxes) at cell interfaces from point values. Contrary to TVD schemes, ENO schemes do not degenerate to firstorder accuracy at extreme points but achieve the same highresolution (third to fifth order) everywhere. We also note that there are ENO schemes adapted to FV methods.
4.3.1 Piecewise linear reconstruction and slope limiters
Within a numerical cell i a piecewise linear function of the form
with x_{i−1/2} < x < x_{i+1/2} is constructed for the quantity a from the corresponding cell averages. The quantity \(s_i^n\) is the linear slope for cell i. Note that according to the definitions of x_{i} and x_{i±1/2}, the linear reconstruction of a preserves its average value \(a_i^n\) within the cell. The idea to use piecewise linear slopes for cell reconstruction in combination with slope limiters is due to van Leer (1973, 1974, 1977b, a, 1979). Among the most popular slope limiters are the following:

$$s_i^n = {1 \over {\Delta x}}\min \bmod (a_i^n  a_{i  1}^n,a_{i + 1}^n  a_i^n),$$(51)
where the minmod function of a set of arguments selects the one that is smaller in modulus if all of them have the same sign, or is otherwise zero.

MC (monotonized centraldifference limiter; van Leer, 1977a)
$$s_i^n = {1 \over {\Delta x}}\text{minmod} \left({{{a_{i + 1}^n  a_{i  1}^n} \over 2},2(a_i^n  a_{i  1}^n),2(a_{i + 1}^n  a_i^n)} \right).$$(52) 
VAN LEER (van Leer, 1974):
$$s_i^n = {2 \over {\Delta x}}{{\max (0,(a_i^n  a_{i  1}^n)(a_{i + 1}^n  a_i^n))} \over {a_{i + 1}^n  a_{i  1}^n}}$$(53)
The effect of the minmod function is, on one hand, to guarantee linear slopes within cells that avoid the generation of spurious extrema at cell interfaces, and on the other, a vanishing slope at extrema (reducing the accuracy of the method to first order at these points). The MC limiter results in somehow steeper slopes than the pure MINMOD limiter, while the slopes of the VAN LEER limiter are intermediate to those obtained with the MINMOD and MC limiters.
Piecewise linear reconstructions have been widely used in RHD codes. Schneider et al. (1993) used piecewise linear reconstruction of the primitive variables (baryonic number, pressure and velocity components) together with the MINMOD slope limiter in their FV algorithm based on the relativistic HLL scheme. Duncan and Hughes (1994) and Hughes et al. (2002) employed piecewise linear reconstruction of the conserved variables within each cell. Falle and Komissarov (1996) used piecewise linear reconstruction within cells based on the gradients in the adjacent cells and applied a slope limiter different from MINMOD. The variables chosen for reconstruction were the proper restmass density, the pressure and the spatial components of the fourvelocity. Also based on a linear interpolation within cells (and the MINMOD slope limiter) is the reconstruction procedure (applied in this case to the density, pressure and velocity components) in the code of Mizuta et al. (2004). The MUSCLHancock scheme (implemented in PLUTO and in the relativistic extension of RAMSES) and the PLM method implemented in the relativistic extension of RAMSES rely on piecewise linear reconstruction, too.
The RAM code utilizes a linear interpolation procedure in two of its implemented schemes, called UPLM and FPLM. In the first (FV) scheme, the reconstruction is performed on the primitive variables. Pressure and proper restmass density are reconstructed directly, whereas velocities are reconstructed using a combination of the reconstruction of the threevelocity and the Lorentz factor. For all variables, the slope limiter is a generalized MINMOD slope limiter according to which
The more diffusive usual MINMOD limiter results when θ = 1, whereas the MC limiter is recovered for θ = 2. Zhang and MacFadyen (2006) usually use θ = 1.5. In the (FD) FPLM scheme the same reconstruction and limiter (the averaged values substituted by the corresponding point values) are used, but applied to the characteristic fluxes. The same reconstruction procedures are implemented in the HLLPLM and FPLM schemes in the RENZO code.
The AMRVAC code incorporates more modern limiters, like Koren and its generalizations (see Keppens et al., 2012, and references therein), which achieve third order accuracy on smooth profiles.
4.3.2 Piecewise parabolic reconstruction
The piecewise parabolic interpolation algorithm described in Colella and Woodward (1984) gives monotonic conservative parabolic profiles of variables within a cell. In the (1D) relativistic version of PPM (Martí and Müller, 1996), the original interpolation algorithm is applied to cell averaged values of the primitive variables (pressure, proper restmass density, 1D fluid velocity), which are obtained from cell averaged values of the conserved quantities. For each cell i, the quartic polynomial with cell averaged values a_{i−2}, a_{i−1}, a_{i}, a_{i+1}, and a_{i+2} (where a = ρ, p, v) is used to interpolate the structure inside the cell. In particular, the values of a at the left and right interface of the cell, a_{L,i} and a_{R,i}, are obtained in this way (interpolation step). Up to this point, the reconstructed values are continuous at cell interfaces, however these reconstructed values can be modified near contact discontinuities to produce narrower jumps (contact steepening), and at strong shocks to avoid spurious oscillations (flattening). Finally, the interpolated values are modified to force the parabolic profile inside each cell (uniquely determined by a_{L,i}, a_{R,i} and a_{i}) to be monotonic (monotonization).
This piecewise parabolic reconstruction is used in the 2D RHD code developed by Martí et al. (1994; 1997), GENESIS and in the Ratpenat code. It is implemented also in the multidimensional version of the relativistic PPM method developed by Mignone et al. (2005b) and in the RHD module of the FLASH code. Finally, it is also used in RAM (UPPM scheme), RENZO, and AMRVAC.
4.3.3 ENO schemes
The interpolation algorithms discussed so far use fixed stencils to reconstruct the solutions inside numerical cells. However, fixed stencil interpolation of second or higher order accuracy is necessarily oscillatory near a discontinuity. Hence the need to use slope limiters (reducing the order of the method to first order at jumps). The ENO idea proposed by Harten et al. (1987) is the first successful attempt to obtain a uniformly high order accurate, yet essentially nonoscillatory interpolation (i.e., the magnitude of the oscillations decays as O(Δx^{k}), where k is the order of accuracy) for piecewise smooth functions. The idea behind the ENO schemes is the use of adaptive stencils for cell reconstruction, which can vary from cell to cell in order to avoid including the discontinuous cell in the stencil, if possible. To this end a kthorder accurate ENO scheme involves a stencil of k + 1 consecutive points including the cell (or interface) to be reconstructed, such that the primitive of the interpolating function is the smoothest in this stencil compared to other possible stencils.
Since the publication of the original work of Harten et al. (1987), they and many other researchers have improved the methodology and expanded the area of its application (see Shu, 1997, for a review). The original ENO schemes constructed in Harten et al. (1987) were applied to cell averages (FV schemes) obtaining left and right states of variables at cell interfaces as initial states for Riemann solvers. Hence, a reconstruction procedure is needed to recover point values from cell averages to the correct order, which can be rather complicated, especially in multidimensional problems. Shu and Osher (1988, 1989) developed ENO schemes to be carried out on numerical fluxes (FD scheme) in combination with TVDRK methods for time advance. For stability reasons, it is important that upwinding is used in constructing the fluxes. One possibility is to use the flux splitting approach where one reconstructs separately the parts of the flux with positive and negative derivatives.
Liu et al. (1994) proposed an improved fourthorder accurate weighted ENO (WENO) scheme utilizing a weighted combination of several possible stencils instead of just one stencil. This improves the accuracy of the scheme without loosing the essentially nonoscillatory property close to discontinuities. An even more accurate scheme is the modified fifthorder WENO scheme of Jiang and Shu (1996). A more recent variant is the CENO reconstruction (Liu and Osher, 1998), which has thirdorder accuracy in smooth regions but reduces to linear reconstruction or even to firstorder (by using minmodtype limiters) near discontinuities. Finally, ENO schemes for hyperbolic conservation laws can be applied componentwise or characteristicwise. In general, component by component versions of ENO schemes are simple and cost effective. They work reasonably well for many problems, especially when the order of accuracy is not high (second or sometimes third order). However, for more demanding problems, or when the order of accuracy is high, the more costly but more robust characteristicwise schemes are preferred (Shu, 1997).
Dolezal and Wong (1995) followed the ENO strategy in their RHD code and applied the ENO reconstruction on numerical fluxes (previously splitted according to the LaxFriedrichs splitting) both componentwise CWENOLF and CWENOLLF schemes) and characteristicwise (CHENOLF, CHENOLLF). Del Zanna and Bucciantini (2002) developed an RHD code based on the CENO reconstruction of the point values of primitive variables in combination with approximate Riemann solvers. The RAM and RENZO codes use fifthorder WENO reconstruction of the fluxes according to a characteristicwise fluxsplitting FD scheme. The RENZO code provides CENO reconstruction of primitive variables (in a FV scheme), too. In their FV RHD code WHAM, Tchekhovskoy et al. (2007) implemented a modified WENO scheme that avoids fieldbyfield decomposition by adaptively reducing to 2point stencils near discontinuities for a more accurate treatment of shocks, and the excessive reduction to loworder stencils as in standard WENO schemes.
4.4 Nonconservative finitedifference schemes
4.4.1 Fluxcorrected transport method
The fluxcorrected transport (FCT) algorithm of Boris and Book (1973), Boris et al. (1975), and Boris and Book (1976) was constructed to solve scalar advection equations numerically. As early as in 1982, Yokosawa et al. (1982) applied FCT techniques to describe the dynamical interaction of a hypersonic (relativistic) beam with a homogeneous ambient medium, in the context of extragalactic jets. However, it is in the context of heavy ion collisions (Martí and Müller, 2003) where relativistic extensions of FCT algorithms have been widely used. Schneider et al. (1993) compared a code based on the relativistic HLL method (see Section 4.1.3) with two FCT algorithms (SHASTA and LCPFCT). Further comparisons between these two strategies were performed by Rischke et al. (1995a, b). In the FCT algorithms, each hydrodynamic equation is treated separately as an advection equation for the corresponding conserved quantity with proper source terms. Relativistic FCT algorithms built in this way have been able to handle flows with discontinuities and large Lorentz factors although the results are in general poorer than those obtained with HLL or other Godunovtype methods.
4.4.2 Artificial viscosity methods
May and White (1966, 1967) were the first to develop a numerical code to solve the RHD equations. With their timedependent FD Lagrangian code they simulated the adiabatic spherical collapse in general relativity. Artificial viscosity (AV) terms were included in the equations to damp the spurious numerical oscillations at shock waves. The idea of modifying the hydrodynamic equations by introducing an artificial dissipative mechanism near discontinuities mimicking a physical viscosity (AV schemes) was originally proposed by von Neumann and Richtmyer (1950) and Richtmyer and Morton (1967) in the context of the classical Euler equations. The form and strength of the AV terms are such that the shock transition becomes smooth, extending over a small number of numerical cells.
This generic recipe has been used with minor modifications in conjunction with standard FD schemes in all numerical simulations employing May and White’s approach, and particularly in Wilson’s formulation of numerical RHD. Relying on an Eulerian explicit nonconservative FD code with monotonic transport and AV terms, Wilson (1972, 1979) and collaborators (Centrella and Wilson, 1984; Hawley et al., 1984) simulated for the first time relativistic flows in more than one spatial dimension.
Wilson’s formulation was widely used in the 1980s in numerous general relativistic scenarios including cosmology, multidimensional stellar collapse, and accretion onto compact objects (see, e.g., Font, 2008, for a review). However, despite its popularity it turned out to be unable to accurately describe extremely relativistic flows (Lorentz factors larger than 2; see, e.g., Centrella and Wilson, 1984). Norman and Winkler (1986) concluded that those large errors were mainly due to the way in which the AV terms were included in the numerical scheme in Wilson’s formulation. They proposed a reformulation of the difference equations with an artificial viscosity consistent with the relativistic dynamics of nonperfect fluids (consistent AV schemes). The strong coupling introduced in the equations by the presence of the viscous terms in the definition of relativistic momentum and total energy densities required an implicit treatment of the difference equations. Accurate results across strong relativistic shocks with large Lorentz factors in 1D were obtained in combination with adaptive mesh techniques. Artificial viscosity techniques in numerical RHD are reviewed in the book of Wilson and Mathews (2003).
Anninos and Fragile (2003) and Anninos et al. (2003) compared stateoftheart AV schemes and highorder central schemes using Wilson’s formulation for the former class of schemes and a conservative formulation for the latter (NOCD scheme). Employing the 3D Cartesian code COSMOS, they found that earlier results for AV schemes in shock tube tests are improved thanks to the consistent implementation of the AV terms (see Sections 6.3.1 and 6.3.2). This does not hold, however, for the shock reflection test that cannot be simulated accurately beyond infall velocities 0. 95 (or 0. 99 by adjusting the AV parameters). Similar results are obtained with the traditional AV schemes implemented in COSMOS++, which is a FV code designed to solve the equations of GRMHD. The results improve when applying the eAV scheme. In this scheme one solves an extra equation for the total energy, which is used to substitute the solution obtained from the internal energy equation, depending on the accuracy of the results. We note here for completeness that COSMOS and COSMOS++ incorporate five different AV recipes — three scalar (von Neumann and Richtmyer, 1950; White, 1973) and two tensor ones (Tscharnuter and Winkler, 1979; Anninos et al., 2005).
4.5 Multidimensional schemes and time advance
Many modern HRSC methods for RHD use multistep algorithms for time advance. Codes in Martí et al. (1991); Martí et al. (1994); Falle and Komissarov (1996); Choi and Wiita (2010) and the NOCD scheme in COSMOS use standard predictorcorrector algorithms to achieve secondorder accuracy in time. Other codes (Marquina et al., 1992; Dolezal and Wong, 1995; Martí et al., 1997; Del Zanna and Bucciantini, 2002; LucasSerrano et al., 2004) and GENESIS, RAM, PLUTO, RENZO, and Ratpenat rely on second and thirdorder TVDRK time discretization algorithms developed in Shu and Osher (1988, 1989). These algorithms preserve the TVD property at every substep, although standard fourth and fifthorder RungeKutta methods (Lambert, 1991) have been used, too (RAM, WHAM). Radice and Rezzolla (2012) employed a thirdorder strongstabilitypreserving RungeKutta scheme (Gotlieb et al., 2009).
Other RHD codes exploit singlestep, secondorder algorithms. Codes based on relativistic extensions of the PLM Lamberts et al. (2013) and PPM methods (Martí and Müller, 1996; Mignone et al., 2005b; FLASH; Mignone et al., 2007; Morsony et al., 2007; Lamberts et al., 2013) achieve secondorder accuracy in time by incorporating information of the domain of dependence of each interface during the time step to the states used in the solution of the Riemann problems (characteristic tracing). Of special interest by its simplicity, accuracy, and robustness is the MUSCLHancock scheme implemented in the HRSC method of Schneider et al. (1993), the code of Mignone and Bodo (2005), and in PLUTO, and in the TVDLF scheme (Yee, 1989b; Tóth and Odstrčil, 1996) of AMRVAC.
The codes developed on the basis of Wilson’s formulation (see Section 4.4.2) all rely on explicit fullydiscrete schemes. Their accuracy is sensitive to the order and frequency of the updates composing a complete time cycle, specially in the highly relativistic regime. Hence, the sequence of steps is determined by a reasonable balance between accuracy and computational cost.
Codes using operator splitting apply the differential operators separately along coordinate directions and the integration of sources in successive steps according to Strang’s (Strang, 1968) prescription to preserve secondorder accuracy (Martí et al., 1994; Eulderink, 1993; Eulderink and Mellema, 1995; Mignone and Bodo, 2005; Choi and Ryu, 2005), while codes based on RungeKutta methods (Dolezal and Wong, 1995; Martí et al., 1997; Aloy et al., 1999b; LucasSerrano et al., 2004; Zhang and MacFadyen, 2006; Tchekhovskoy et al., 2007; Mignone et al., 2007; Wang et al., 2008; Perucho et al., 2010) advance the spatial operators simultaneously (unsplit schemes). The code in Mignone et al. (2005b) uses Strang splitting for the source terms and the spatially unsplit fully cornercoupled method CTU (Colella, 1990) for the evaluation of the fluxes.
4.6 Equation of state and primitive variable recovery
The equations of RHD and RMHD are closed by means of an EOS relating the thermodynamic variables. For single component fluids (like those presented in Section 3.1) only three thermodynamic quantities are involved and an EOS of the form p = p(ρ, ε) is usually needed. For multiple component fluids the EOS depends on the densities (or mass fractions) of the species, i.e., additional continuity equations (including reactive terms if necessary) for all species must be added to the evolution system.
Early on most astrophysical simulations dealt with matter whose thermodynamic properties can be described by an ideal gas equation of state with constant adiabatic index. However, present day applications concerned with astrophysical jets, GRB, accretion flows onto compact objects and the evolution of relativistic stars require a more sophisticated, microphysical EOS for a proper description of the phenomena.
In the context of relativistic jets, Falle and Komissarov (1996), Komissarov and Falle (1998), Scheck et al. (2002), and Perucho and Martí (2007) considered a mixture of ideal relativistic Boltzmann gases (Synge EOS; Synge, 1957; Chandrasekhar, 1967), hence allowing for jets with general (i.e., e, e^{+}, p) composition. Assuming plasma neutrality, only one parameter is needed to fix the composition, e.g., the mass fraction of the leptons, X_{l}. Using the Synge EOS instead of a constant adiabatic index EOS requires more computation time, because an iteration of the temperature, involving modified Bessel functions, has to be performed for each cell in every timestep to recover the primitive variables from the conserved ones (see below). To avoid this extra complexity, approximate expressions for the relativistic ideal gas EOS for single (Duncan et al., 1996; Sokolov et al., 2001; Mignone et al., 2005b; Ryu et al., 2006) and multiple component (Chattopadhyay and Ryu, 2009; Choi and Wiita, 2010) flows were proposed. Of particular interest are the approximate EOS proposed by Mignone et al. (2005b) (first used by Mathews, 1971; see also Meliani et al., 2004) and Ryu et al. (2006) which are consistent with Taub’s inequality^{Footnote 4} at all temperatures. They have the correct classical and ultrarelativistic limiting values and differ from the exact ideal gas EOS by only up to a few percent in the relevant thermodynamic quantities.
A comprehensive discussion of the EOS used in the astrophysical scenarios mentioned above is beyond the scope of this review. However, it is worth mentioning that a general EOS causes no special problems for HRSC methods based on Riemann solvers. If the latter are based on the exact solution, one needs to implement the proper adiabats across rarefactions and shocks (Taub’s adiabat, see Section 8.5), while if they are based on the spectral decomposition of the Jacobian matrices one has to write the eigenvalues and eigenvectors in terms of the thermodynamic quantities (i.e., enthalpy, density, sound speed, and other thermodynamic derivatives) of the EOS. Donat et al. (1998) (see also Section 8.1) provided the eigenvalues, and the left and right eigenvectors of 3D RHD for a general EOS of the form p = p(ρ, ε), and Ryu et al. (2006) for an EOS of the form h = h(ρ, p). Finally, simpler Riemann solvers like HLL or those based on the LF flux formula can be used directly.
The situation described in the previous paragraph extends to the use of any convex EOS (see Section 3.2), for which a discontinuity in the initial state gives rise to at most one (compressional) shock, one contact, and one simple centered expansion fan, i.e., one wave per conservation equation. For a real gas, however, the EOS can be nonconvex. If that is the case, the character of the solution of the Riemann problem changes resulting in anomalous wave structures. In particular, the solution may be no longer unique, i.e., an initial discontinuity may give rise to multiple shocks, multiple contacts, and multiple simple centered expansion fans (see, e.g., Laney, 1998). In these situations, Riemann solvers based on the common Riemann problem breakout or on a local linearization of the system will obviously fail.
Conservative numerical schemes in both RHD and RMHD require a method to switch between conserved variables (D, S^{i}, τ) and primitive variables (ρ, v^{i}, p). The transformation from primitive to conserved variables has a closedform solution (see Eqs. (11)–(13)), but the inverse transformation (conserved to primitive) requires the solution of a set of nonlinear equations that depends explicitly on the equation of state p(ρ, ε). In the RHD case, a function of pressure, whose zero represents the pressure of the physical state, can be obtained easily from Eqs. (11)–(13), (14) and the EOS:
with \({\rho _\ast}(\bar p)\) and \({\varepsilon _\ast}(\bar p)\) given by
and
where
and
The root of Eq. (55) can be obtained by means of a nonlinear rootfinder (e.g., a 1D NewtonRaphson iteration). For an ideal gas with constant adiabatic index this procedure has proven to be very successful in a large number of tests and applications (Martí et al., 1991; Martí and Müller, 1996; Martí et al., 1997; Aloy et al., 1999b; Mizuta et al., 2004). One can approximate the derivative of f with respect to \(\bar p\) by (Aloy et al., 1999b)
where c_{s}(ρ, ε) is the sound speed which can be computed efficiently for any EOS. This approximation tends to the exact derivative as one approaches the solution, and it is used together with the algorithm described above to recover the primitive variables in the codes GENESIS and Ratpenat.
Mignone et al. (2005b) proposed a similar procedure but for an EOS of the form h = h(p, ρ). The resulting nonlinear equation is again a function of the pressure, and reads in our notation:
This procedure is implemented in the relativistic module of FLASH. It is also used in the code of Choi and Wiita (2010), and specialized for an ideal gas equation in Mignone and Bodo (2005). Radice and Rezzolla (2012) proposed a function of the enthalpy which in our notation can be written as
whose zero is the physical enthalpy.
Although the above procedures are valid for a general equation of state, in the case of the Synge EOS, it is better to define another function of the pressure:
with \({w_\ast}(\bar p) = {\rho _\ast}(\bar p)(1 + {\varepsilon _\ast}(\bar p)) + \bar p\), and \({\rho _\ast}(\bar p)\) and \({\varepsilon _\ast}(\bar p)\) being given by Eqs. (56) and (57), respectively. \({T_\ast}(\bar p) \propto \bar p/{\rho _\ast}(\bar p)\), where the constant of proportionality is a function of the effective mass of the gas particles in the mixture. Finally, w(ρ, T) is the enthalpy density according to the Synge EOS. Alternative strategies were derived for approximations of the Synge EOS (Mignone et al., 2005b; Ryu et al., 2006; Mignone et al., 2007).
Dolezal and Wong (1995) solved an implicit equation for the rest mass density and a general EOS of the form p = p(ρ, ε), and Eulderink (1993), and Eulderink and Mellema (1995) developed several procedures to calculate the primitive variables for an ideal gas EOS with constant adiabatic index. One of their procedures is based on finding the physically admissible root of a fourthorder polynomial of a function of the specific enthalpy. The quartic can be solved analytically by the exact algebraic quartic root formula, but this computation is rather expensive. The root of the quartic can be found much more efficiently using a 1D NewtonRaphson iteration. Another procedure is based on the use of a sixdimensional NewtonKantorovich method to solve the whole set of nonlinear equations.
Also for ideal gases with constant adiabatic index, Schneider et al. (1993) and Duncan and Hughes (1994), and Hughes et al. (2002) transform the system (11)–(13) (for zero magnetic field) and (14) algebraically into a fourthorder polynomial in the modulus of the flow speed that can be solved analytically (Choi and Ryu, 2005; Ryu et al., 2006) or by means of iterative procedures (Zhang and MacFadyen, 2006). The analytic solver seems to be more robust for large (i.e.,, ≳ 100) Lorentz factor flows (Bernstein and Hughes, 2009). Del Zanna and Bucciantini (2002) solve, instead, a sixorder polynomial in the Lorentz factor.
4.7 Adaptive mesh refinement (AMR)
The underlying concepts and general strategies of adaptive mesh refinement (AMR) are summarized in Section 8.3.5. Here we discuss specific implementations of AMR for RHD. For general relativistic flows, see e.g., the Whisky code which has AMR capabilities based on Carpet.
The first application of AMR in the field of RHD was presented by Duncan and Hughes (1994). Their AMR algorithm was written by Quirk (1991, 1996), which is an outgrowth of the original work of Berger and Oliger (1984), Berger and Colella (1989), and Bell et al. (1994). In order for the AMR method to sense where further refinement is needed, Duncan and Hughes used the gradient of the laboratory frame mass density. The simulations were performed using only one level of refinement by a factor of 4 in both directions. The method was extended later to 3D by Hughes et al. (2002). Wang et al. (2008) have also implemented a variant of Berger’s AMR technique in their RHD code RENZO (see Table 1) that is adaptive in time and space, can handle curvilinear coordinates (cylindrical and spherical), has loadbalancing functionality, and uses the standard message passing interface (MPI).
Further AMR simulations of relativistic flows were utilizing the FLASH code, which is a general purpose simulation tool for astrophysical flow including modules for RHD and AMR. The AMR module was adapted from PARAMESH, which is a blockstructured AMRpackage written in Fortran 90. Contrary to the AMR implementation of Berger and Oliger (1984); Berger and Colella (1989); Bell et al. (1994) PARAMESH does not allow patches (i) rotated relative to the coordinate axes, (ii) of arbitrary shape, (iii) to overlap, and (iv) being merged with other patches at the same refinement level whenever appropriate. These four properties provide a very flexible and memoryefficient strategy, but result in a very complex code, which is difficult to parallelize. Instead, PARAMESH uses a hierarchy of nested, logically Cartesian blocks that are aligned with the coordinate axes and typically have eight cells per dimension for a total of 8 cells per block, where d = 1, 2, or 3 is the dimensionality of the flow. The refinement is by a factor of two in each direction so that each block is either at the highest level or contains 2^{d} children blocks. Leaf blocks are defined to be those blocks with no children, i.e., they are at the bottom of the tree. The basic data structure is then an octtree, quadtree and binarytree for 3D, 2D, and 1D problems, respectively. Flux conservation at patch boundaries is imposed by replacing fluxes computed at the coarser level with appropriate sums of fluxes at the finer level. Whether to refine or coarsen the grid is determined by calculating an approximate numerical second derivative of flow variables that can be specified at run time. FLASH handles parallelization with the MPI library and uses an estimate of the work per processor for load balancing.
Using the FLASH code, LópezCámara et al. (2013) performed 3D AMR simulations of longduration gammaray burst jets inside massive progenitor stars (see also Section 2.2) The AMR components of FLASH are utilized also by the RHD code RAM which is designed to handle special relativistic flows in the context of GRB, too.
A novel, hybrid blockadaptive AMR strategy for solving sets of nearconservation laws in general curvilinear (orthogonal) coordinate systems was presented by van der Holst and Keppens (2007). This was a further step in the development of the AMRVAC code (Keppens et al., 2003) which is designed to integrate the equations of hydrodynamics and magnetohydrodynamics both in their classical and special relativistic form. The hybrid blockAMR scheme is based on individual grids with a prefixed number of cells instead of differentsized patches, but it relaxes the full octtree structure where a block that needs refinement triggers 2^{d} subblocks when the grids are refined by a factor of two. Hence, it allows for incomplete block families (also called ‘leaves’), by incorporating the idea of the patchbased strategy of an optimal adjustment of the grid structure to dynamical features of interest. However, in the patchbased strategy this was accomplished at the expense of introducing unequally sized grids per level. On the other hand, the good cache performance of the tree blockbased scheme is fully utilized. In their code, van der Holst and Keppens (2007) have also eliminated the possibility that patches residing on the same level can overlap, which is a natural choice for both the hybrid and full octtree. The up to now latest version in this development is the code MPIAMRVAC (Keppens et al., 2012). Currently, it works with a pure blockquadtree or blockoctree (also for curvilinear grids). The block size is (N + 2G)^{d}, where N is the number of cells in each mesh block (which can be different along each coordinate direction), and G is the number of ghost cells on each lateral side. These parameters can be adjusted by the user at compile time, i.e., MPIAMRVAC can handle larger stencil expressions easily, and has in a sense more flexibility than the 2^{d} block size hardcoded in RAMSES (see below).
Another AMR code for simulating classical and relativistic hydrodynamics and MHD flows is PLUTO, which was originally designed for static grids (Mignone et al., 2007, 2009, 2010), but extended to more general grids by Mignone et al. (2012) to exploit blockstructured AMR based on the Chombo library. The latter is a software package providing a distributed infrastructure for serial and parallel calculations over blockstructured adaptively refined grids in multiple dimensions. Chombo follows the Berger and Rigoutsos (1991) strategy to determine the most efficient patch layout to cover the cells that have been tagged for refinement. In the MPI parallelized PLUTO — Chombo code, cells are tagged for refinement whenever a prescribed function of the conserved variables and of its derivatives exceeds a prescribed threshold.
De Colle et al. (2012a) developed MezcalSRHD an MPI parallelized AMR code for RHD. It uses octtree blockstructured grid refinement. Different from other AMR codes, at any given time each position on the grid is covered by only one cell, i.e., there are no pointers between ‘parent’ and ‘sibling’. Furthermore, there are no ghost cells, usually present in other treeAMR codes (e.g., Berger and Oliger, 1984; Khokhlov, 1998), attached to any of the blocks. The code employs a global time step common to all grid levels, which may cause some important computational overhead with respect to using a local time step, but avoids an important bottleneck for parallelization. MezcalSRHD has been used to simulate GRB dynamics and afterglow radiation.
A relativistic extension of the AMR hydrodynamics code RAMSES was presented by Lamberts et al. (2013). RAMSES uses a Cartesian grid, where cells are related in a recursive tree structure and grouped into blocks of 2^{d} cells (d is the number of spatial dimensions), which share the same parent cell. Grid refinement is based on the gradient of the Lorentz factor. Prolongation is performed by secondorder interpolation using a minmod limiter, while restriction involves computing block averages. To avoid failures in the restriction step in the case of nearly ballistic flows, the relativistic extension of RAMSES employs reconstruction of the specific internal energy rather than of the specific total energy. This method makes the numerical scheme nonconservative, but guarantees positivity of the pressure and subluminal speeds. The code was used to perform 2D simulations of gammaray binaries, which are systems composed of a massive star and a rotationpowered pulsar with a highly relativistic wind. The simulated models involve winds with a Lorentz factor up to 16 (Lamberts et al., 2013).
4.8 Summary of existing codes
Table 1 lists the multidimensional codes for RHD based on HRSC methods in chronological order, which rely both on FD and FV schemes, and summarizes the basic algorithms implemented in the codes (type of spatial reconstruction, Riemann solvers and flux formulas used, time advance and multidimensional schemes). The table only includes those codes specifically developed for RHD, and those GRHD codes for fixed spacetimes that were used or tested also in RHD. We also include the GRHD code for dynamical spacetimes Whisky, because it has been widely tested in RHD. COSMOS, AMRVAC, PLUTO, and FLASH are multipurpose codes for computational astrophysics. Special attention is paid to the algorithms implemented in their corresponding relativistic modules. COSMOS++, RAISHIN, and TESS are RMHD codes, but they have been tested in RHD, too.
The codes Whisky, AMRVAC, PLUTO, and FLASH are publicly available and provide comprehensive online documentation. They can be downloaded from the corresponding webpages: Whisky, AMRVAC, PLUTO, and FLASH. AMRVAC is an AMRoffspring of the Versatile Advection Code (VAC, Tóth, 1996; VAC). The website AMRVAC hosts the development version of the code and points to the former code website MPIAMRVAC, where some further information can be found that is unfortunatley not properly updated.
5 Gridbased Methods in RMHD
The success of HRSC methods in (classical and relativistic) hydrodynamics fostered their application to MHD, and more recently, to RMHD. In MHD two additional equations must be solved, which are the induction equation
and the divergencefree condition for the magnetic field
The enlarged set of MHD equations is harder to solve than that of HD, because the MHD equations possess additional families of waves and admit additional wave structures such as switchon/off shocks and rarefactions, and compound waves (see Section 3.2). The MHD equations involve also degeneracies, i.e., they are no longer strictly hyperbolic. Finally, satisfying the divergencefree constraint for the magnetic field poses a numerical challenge. Hence, the development of HRSC methods for numerical MHD was slower than in classical computational fluid dynamics. In Brio and Wu (1988) extended the HRSC techniques based on approximate Riemann solvers to 1D MHD. They renormalized the eigenvectors of the MHD equations in order to use them in the degenerate cases and built a Roetype Riemann solver for the 1D MHD equations. Later this line of research was extended to Godunovtype methods for multidimensional MHD (e.g., Zachary et al., 1994; Dai and Woodward, 1994a,b; Ryu et al., 1995).
Because the induction equation and the divergencefree condition are the same in both classical and relativistic MHD, the techniques to integrate the former one and to force the magnetic field to remain divergence free carry over from classical to relativistic MHD, i.e., respective numerical schemes were developed for classical MHD in parallel with those for RMHD. The most popular approaches are reviewed in Tóth (2000), and Mignone and Bodo (2008) and summarized in this section.
In the following we discuss the development of multidimensional RMHD codes based on HRSC techniques, an activity which took place mainly during the past decade. The structure of the discussion closely follows that of the previous Section concerned with HRSC methods in RHD.
5.1 Relativistic Riemann solvers
5.1.1 Relativistic solvers based on the exact solution of the Riemann problem
The procedure described in Section 8.6 and derived by Giacomazzo and Rezzolla (2006) to obtain the exact solution of the Riemann problem in RMHD can be used to construct an exact Riemann solver. However, no numerical code based on this approach has been developed yet. As Giacomazzo and Rezzolla discussed in a more recent paper (Giacomazzo and Rezzolla, 2007), the exact solver described in Giacomazzo and Rezzolla (2006) is computationally too expensive to be used in multidimensional codes.
5.1.2 Roetype relativistic solvers
Roetype Riemann solvers use as a key ingredient the spectral decomposition of the flux vector Jacobians of the system of equations in conservation form. In the case of RMHD, the spectral decomposition is done in covariant variables. After removing the unphysical waves (see Section 8.2), the eigenvectors are obtained in conserved variables using the corresponding variable transformations. The treatment of degenerate states requires some extra effort.
Komissarov (1999a) developed a linearized Riemann solver based on a primitivevariable formulation of the 1D RMHD system in quasilinear form, which is similar to the RHD Riemann solverB of Falle and Komissarov (1996) (see also Section 4.1.2). The 7component right eigenvectors in primitive variables are obtained from the 10component right eigenvectors in the augmented system of covariant variables. Unlike the Riemann solver B of Falle and Komissarov (1996), the RMHD Riemann solver does not make use of the left eigenvectors and the wave strengths which are needed to compute the fluid state at the numerical interface are obtained from the jump conditions at the (central) contact discontinuity. Komissarov’s Riemann solver, which has been implemented successfully in a multidimensional FV scheme, treats nondegenerate and degenerate states separately.
Independently, Balsara (2001a) presented a detailed discussion of the characteristic structure of the RMHD system in covariant variables and the algebraic transformations that are needed to obtain the physical eigenvectors in primitive as well as conserved variables. The resulting eigenvectors are input for both a TVD interpolation procedure that operates on the characteristic variables, and a linearized Riemann solver. Although Balsara discussed a multidimensional extension of his code in Balsara (2001a), he described and tested only a 1D version.
Koldoba et al. (2002) also described a 1D code for the RMHD system based on a linearized Roetype Riemann solver. They presented the left and right eigenvectors of the system in covariant variables and the transformations that are required to obtain the numerical fluxes in conservation form together with a small set of 1D tests. As far as we know, no further (multidimensional) testing of the algorithm has been done.
Antón et al. (2010) (see also Section 8.2) presented a thorough analysis of the characteristic structure of the RMHD equations and a Riemann solver based on renormalized (i.e., valid for both nondegenerate and degenerate states) sets of left and right eigenvectors of the system in conserved variables (Full Wave Decomposition Riemann solver, FWD). They provided the matrix transformations (changes of variables) from the set of eigenvectors in covariant variables to the corresponding sets in (i) the reduced system of covariant variables and (ii) the conserved variables. Running a set of 1D and 2D test calculations, they also compared the performance of their FWD Riemann solver with that of several Riemann solvers of the HLL family (HLL, HLLC, HLLD; see next Section 5.1.3).
5.1.3 Relativistic HLL, HLLC and HLLD methods
The HartenLaxvan Leer Riemann solver (Harten et al., 1983) described in Section 4.1.3 for RHD can be used also in RMHD, if one applies proper lower and upper bounds for the smallest and largest signal velocities (fast magnetosonic wavespeeds). In the RMHD code developed by Del Zanna et al. (2003) and in the MHD version of the relativistic code GENESIS (Leismann et al., 2005), the numerical fluxes are computed according to Eq. (30), with a_{L} (a_{R}) equal to the speed of the slowest (fastest) leftpropagating (rightpropagating) wave, computed at both sides of the cell interface. The same procedure is used in the GRMHD codes HARM, RAISHIN, ECHO, WhiskyMHD, and in those of Duez et al. (2005) and Antón et al. (2006).
Relying on previous experience in RHD (Mignone and Bodo, 2005; see also Section 4.1.3), Mignone and Bodo (2006) extended the HLLC Riemann solver of Gurski (2004) and Li (2005) for classical MHD to RMHD. In the HLLC approximate Riemann solver (see Toro et al., 1994, and Section 4.1.3), the presence of a contact discontinuity in the middle of the Riemann fan is recovered. Requiring consistency of the approximate Riemann solution with the conservation laws in a cell, gives rise to fourteen conditions determining the two intermediate states in 3D RMHD.
In their discussion, Mignone and Bodo (2006) differentiated between the cases where the component of the magnetic field normal to the contact discontinuity, B^{x}, vanishes and where it does not. In either case, the speed of the contact discontinuity is assumed to be equal to the (constant) normal velocity in the intermediate states, i.e., \({a_\ast} = v_\ast^x\), and the normal component of the magnetic field is assumed to be continuous at the interface. Hence, \(B_\ast^x = B_{\rm{L}}^x = B_{\rm{R}}^x\) can be considered as a parameter of the solution. If B^{x} ≠ 0, the fourteen consistency relations together with the six continuity conditions across the contact discontinuity (for total pressure, flow velocity, and tangential magnetic field components) allow one to determine the values of 20 variables, i.e., 10 per state. Mignone and Bodo (2006) chose the relativistic density, the components of the fluid velocity, the components of the tangential magnetic field, the components of the tangential relativistic momentum, the total energy, and the total pressure as independent unknowns.
For B^{x} = 0, the continuity of the normal component of the fluid velocity and of the total pressure across the contact discontinuity together with the consistency relations, allows one to determine 8 unknowns per state (relativistic density, normal fluid velocity, components of the tangential magnetic field, components of the tangential relativistic momentum, total energy, and total pressure). Once the corresponding algebraic problem is solved, the remaining state variables and then the numerical fluxes can be calculated. Honkkila and Janhunen (2007) developed another HLLC scheme for RMHD using different assumptions to solve the intermediate states.
The direct application of the HLLC solver of Mignone and Bodo (2006) to genuinely 3D problems suffers from a potential pathological singularity. It arises when the component of the magnetic field normal to a cell interface is zero. Sticking to the HLL approach, Mignone et al. (2009) extended the fivewave Riemann solver HLLD originally developed by Miyoshi and Kusano (2005) for MHD to the relativistic case. In this solver, besides the central contact discontinuity, the Alfvén discontinuities are reintroduced in the Riemann fan, which then involves four intermediate states. The resulting relativistic HLLD solver is considerably more elaborate than its classical counterpart, because the velocity normal to the interface is (different from classical MHD) no longer constant across Alfvén discontinuities, and because of the higher complexity of the RMHD equations. PLUTO and ATHENA incorporate HLL, HLLC, and HLLD Riemann solvers. TESS uses HLLC, whereas Mara relies on HLLD. MPIAMRVAC allows to switch between HLL and HLLC. The computational efficiency and the accuracy of HLL, HLLC and HLLD were tested and compared in Mignone et al. (2009), and HLL, HLLC and FWD in Antón et al. (2010).
5.2 Flux formulas
The LaxFriedrichs flux formula (see Section 4.2.1) can be used straightforwardly to compute the numerical fluxes in conservative RMHD schemes. Most of the RMHD simulations performed by van der Holst et al. (2008) with the AMRVAC code utilized the TVDLF scheme (Yee, 1989b; Tóth and Odstrčil, 1996), which is a secondorder accurate variant of the LLF flux formula. The COSMOS++ code exploits the NOCD scheme of Kurganov and Tadmor (2000), in which the numerical fluxes are calculated according to the LLF formula. None of the presentday RMHD codes uses the Marquina flux formula.
5.3 Spatial reconstruction
As in RHD, the strategies for spatial reconstruction in numerical RMHD do not differ from those developed for general hyperbolic systems of conservation laws. Again one of the preferred choices are TVD schemes (mainly used in FV methods), which rely on linear interpolation and slope limiters for cell reconstruction. The corresponding codes are limited to secondorder of accuracy. Preferably, one reconstructs primitive variables, like density, pressure, the components of the tangential magnetic field, and the spatial components of the four velocity. The codes of Komissarov (1999a), Gammie and Tóth (2003), Leismann et al. (2005), Duez et al. (2005), Antón et al. (2006), Mizuno et al. (2006), Mignone and Bodo (2006), Giacomazzo and Rezzolla (2007) and Del Zanna et al. (2007) use piecewise linear reconstruction with standard slope limiters (e.g., VAN LEER, MINMOD, MC), while MPIAMRVAC incoporates also more modern limiters, like Koren (Keppens et al., 2012). TESS employs piecewise linear reconstruction on a moving Voronoi mesh with a TVD preserving slope limiter to extrapolate the primitive variables from cell centers to face centers. Codes that also allow for piecewise parabolic reconstructions are those of Duez et al. (2005), Leismann et al. (2005) and Mizuno et al. (2006), MPIAMRVAC and an upgraded version of HARM.
Another choice are ENO schemes (mainly used in FD methods), which are based on adaptive stencils to reconstruct variables (typically fluxes) at cell interfaces from the point values. They achieve thirdorder to fifthorder accuracy. The codes of Del Zanna et al. (2003) and Anderson et al. (2006) are thirdorder accurate using CENO reconstruction. The ECHO code includes different ENO reconstruction routines (ENO, CENO, and WENO), and also ENOlike routines, like e.g., the Monotonicity Preserving scheme (MP; Suresh and Huynh, 1997), which are up to fifthorder accurate. The MP scheme is based on interpolation using a fixed 5point stencil and a filter that preserves monotonicity near discontinuities.
A comment is necessary here, because the above discussion concerned the spatial reconstruction of cell interface values from cell average (FV methods) or cell center (FD methods) values. However, most of the contemporary RMHD codes (i.e., those based on the constrained transport algorithm to keep the magnetic field divergence free; see Section 5.5.1) need to reconstruct the magnetic field components, defined on a staggered grid, from cell interfaces to cell centers. Special care must be taken to avoid a reduction of the spatial accuracy of the method in this additional interpolation step.
5.4 Fluxlimiter methods: Davis scheme
The LaxWendroff scheme (Lax and Wendroff, 1960) is among the most well known finite difference schemes. When applied to the linear advection equation, the scheme reads
where a is the constant signal propagation speed. When applied to a nonlinear conservation law with flux f, the previous scheme becomes the twostep LaxWendroff scheme
\((f_i^{(1)} = f(u_i^{(1)}))\). In the original twostep LaxWendroff scheme \(u_i^{n + 1} = u_i^{(2)}\) is the solution at the new time step. However, in Davis’ approach (Davis, 1984)
where the extra terms are local, parameterfree dissipation terms that do not require any characteristic information and make the whole algorithm TVD. Koide et al. (1999) implemented the scheme of Davis in their GRMHD code.
5.5 Nonconservative finitedifference schemes
5.5.1 Flux corrected transport method
Special relativistic 2D MHD test problems with Lorentz factors up to 3 were investigated by Dubal (1991) with a code based on FCT techniques. They utilized a secondorder LaxWendroff FD method including a fourthorder dispersion error algorithm (Weber et al., 1979). In the context of GRMHD, Yokosawa (1993) studied with a FCT technique developed for a RMHD code (Yokosawa et al., 1982) the influence of frame dragging on MHD accretion flows onto a Kerr black hole. Both Dubal (1991) and Yokosawa (1993) treated the RMHD equations as advection equations, and hence violated the conservation laws.
5.5.2 Artificial viscosity methods
Relying on a similar formulation of the equations and AV techniques as those used in the early days of numerical RHD (see Section 4.4.2), Wilson (1975, 1977) led the efforts to develop numerical codes for GRMHD. More recently, De Villiers and Hawley (2003) presented a 3D GRMHD code based on techniques (including AV) first developed for axisymmetric hydrodynamics around black holes Hawley et al. (1984). The code suffers from the known limitations of the artificial viscosity algorithm.
COSMOS++ also relies on Wilson’s formulation of the GRMHD equations, but uses consistent AV techniques (involving different AV recipes) and solves an extra equation for the total energy (see Section 4.4.2). The code seems not to suffer from the aforementioned limitations of traditional AV methods in RHD.
5.6 Multidimensional schemes and time advance
The original version of HARM uses the midpoint method for time advance. However, most RMHD codes (including the upgraded HARM) rely on RungeKutta methods of second and third order accuracy (whether TVDpreserving or not; Del Zanna et al., 2003; Leismann et al., 2005; Antón et al., 2006; Mizuno et al., 2006; Neilsen et al., 2006; Anderson et al., 2006; Del Zanna et al., 2007; Nagataki, 2009; Antón et al., 2010; Beckwith and Stone, 2011), and even higher order accuracy (Etienne et al., 2010), or on the MUSCLHancock scheme (Mignone and Bodo, 2006; van der Holst and Keppens, 2007; van der Holst et al., 2008; Beckwith and Stone, 2011; Zrake and MacFadyen, 2012). Codes like PLUTO and MPIAMRVAC incorporate both types of schemes. TESS employs a third order TVDRK to update the values of the conserved variables and the positions of the points generating the moving Voronoi mesh. In all these cases, the solution is advanced in time in an unsplit manner.
5.7 Divergencefree condition
In general, the divergencefree condition of the magnetic field is fulfilled during a simulation only at the truncation level, i.e., nonsolenoidal components of the magnetic field may be generated. This numerical failure produces artificial forces parallel to the magnetic field and falsifies the solution (Brackbill and Barnes, 1980). Hence, different numerical strategies have been developed to keep the violation of the constraint below a reasonable value.
Mignone and Bodo (2008) gave a concise description of the respective approaches used in HRSC schemes, while Tóth (2000) provided a thorough discussion of constrained transport (CT) methods, also comparing the performance of the most popular ones. In this section, we shall closely follow the description given in these two studies. Another useful overview of numerical strategies to keep the solenoidal condition can be found in Chapter 19 of Goedbloed et al. (2010).
The approaches, which can be considered as modifications of the HRSC base scheme, comprise two categories (Balsara, 2004; Mignone and Bodo, 2008). In the first one (divergencecleaning schemes), the magnetic field is advanced as any other variable and the fulfillment (up to truncation error) of the divergencefree condition of the magnetic field is imposed in a separate divergencecleaning step. Such schemes use a cell centered representation of the magnetic field, which allows for an easy extension of the base scheme. Moreover, with a cell centered representation of all conserved quantities the extension to adaptive and unstructured grids is straightforward. In the second category (CT), the magnetic field is usually represented on a staggered grid, while the other variables are still allocated to cell centers. In CT schemes, the induction equation is naturally updated using Stokes theorem, i.e., the divergencefree condition is fulfilled to machine accuracy (divergencefree schemes).
5.7.1 Eightwave method
The eightwave formulation of the MHD equations (Powell, 1994) is based on a derivation of the equations that does not involve Maxwell’s ∇ · B = 0 equation. In this formulation, the three components of the magnetic field are evolved in an unconstrained way and source terms proportional to the divergence of the magnetic field appear in the momentum, energy, and induction equations. Powell (1994) showed that these sources terms change the character of the equations introducing an additional eighth wave which corresponds to the advection of the divergence of the magnetic field. The other seven waves are the same as in the traditional formulation.
The eightwave formulation is more stable and robust than the original conservative formulation for any shockcapturing MHD code. However, Tóth (2000) pointed out that by virtue of the LaxWendroff theorem (Lax and Wendroff, 1960), the nonconservative source terms can produce incorrect jump conditions, leading to incorrect results particularly in problems involving strong shocks. Janhunen (2000) and Dellar (2001) argued to add the source terms only to the induction equation, hence restoring the momentum and energy conservation.
The eightwave method is incorporated in PLUTO and MPIAMRVAC as one of the algorithms for divergence cleaning in both the MHD and RMHD modules.
5.7.2 Hyperbolic/parabolic divergence cleaning
In Dedner et al. (2002) the divergence constraint for the magnetic field is coupled to the hyperbolic MHD evolution equations by introducing a new unknown scalar function. Accordingly, the induction equation is replaced by
and the solenoidal condition by
where \(\mathcal{D}\) is some differential operator. For any choice of \(\mathcal{D}\), it can be shown that the divergence of B and the function ψ satisfy the same type of equation:
One chooses \(\mathcal{D}\), and the initial and boundary conditions of ψ in such a way that a numerical approximation of Eqs. (70) and (71) also provides a good approximation of the original equations (without the ψterms). One possibility is to define
With this parabolic correction Eq. (73) becomes
and any nonzero values of the divergence of B are dissipated if suitable boundary conditions are imposed. In this case, ψ can be trivially eliminated from the equations and the modified induction equation reads
Defining
a hyperbolic correction is made, whereby Eq. (73) becomes
This equation implies that local divergence errors propagate off the computational grid with the speed c_{h}.
Finally, choosing \(\mathcal{D}(\psi) = 0\) leads to an elliptic correction, since a Poisson equation has to be solved for the function ψ (Dedner et al., 2002). This approach is equivalent to the projection method of Brackbill and Barnes (1980) explained later in this section.
The hyperbolic and parabolic corrections can be combined to a mixed one offering both dissipation and propagation of the divergence errors. The MHD system augmented with either the hyperbolic or mixed corrections is hyperbolic and still possesses its original conservation properties. Moreover, divergence errors are transported by two kind of waves with speeds independent of the fluid velocity, i.e., such an approach may be considered as an extension of Powell’s eightwave method.
COSMOS++, AMRVAC, PLUTO and TESS, as well as the codes of Neilsen et al. (2006) and Anderson et al. (2006), incorporate different implementations of this divergence cleaning algorithm.
5.7.3 Constrained transport
The CT scheme, originally developed by Evans and Hawley (1988) for artificial viscosity methods, relies on a particular discretization on a staggered grid, which maintains ∇ · B exactly in a specific discretization. If the initial magnetic field has zero divergence in this discretization, it will remain so (to the accuracy of machine round off errors) for all times.
DeVore (1991) combined the CT scheme with the FCT method, and Dai and Woodward (1998), Ryu et al. (1998), and Balsara and Spicer (1999) combined the CT discretization with schemes based on Godunovtype Riemann solvers. In their original form, the algorithms of Dai and Woodward, Ryu et al., and Balsara and Spicer require the introduction of a staggered magnetic field variable. To advance this new variable in time one has to interpolate the magnetic and velocity fields (Dai and Woodward, 1998), or the fluxes (Balsara and Spicer, 1999), or the transport fluxes (Ryu et al., 1998) of the base scheme to the cell corners. Tóth (2000) called these methods, respectively, fieldCT, fluxCT, and transportfluxCT.
The interpolations performed to obtain the required fluxes at cell edges, and the cell centered magnetic field from the staggered one reduces the accuracy of the algorithm to second order. Tóth (2000) reformulated these schemes as standard cellcentered schemes (although this requires the interpolation of the fluxes in the induction equation over a much wider stencil than in the base scheme). Following Tóth’s notation we shall call these schemes fieldCD and fluxCD (from central difference as opposed to staggered one).
Before discussing more modern developments of the CT scheme, in particular, its application in RMHD, let us describe the basics of this method (staggered version). The starting point is a surface integral of the induction equation (64) across an open surface S
where Ω = v × B. Applying Stokes theorem to the integral on the right side of the equation leads to
where ∂S denotes the boundary of S.
To simplify the following discussion we restrict ourselves to a timeindependent, homogeneous Cartesian grid. The cell centers of the grid have the coordinates (x_{i},y_{j}, z_{k}), and the cell interfaces are located at x_{i±1/2}, y_{j±1/2}, and z_{k±1/2}, respectively (see Figure 12). Because of the homogeneity of the computational grid, the grid spacings x_{i+1/2} − x_{i−1/2}, y_{j+1/2} − ^{yj−1/2}, and z_{k+1/2} − z_{k−1/2} in x, y and zdirection are constant, and hence simply are Δx, Δy and Δz, respectively.
Considering now S as the face of the cubic cell (i,j,k) intersecting the xaxis at X_{i+1/2}, and assuming translational symmetry along the zaxis,^{Footnote 5} Eq. (80) can be written as
or in semidiscrete form as
where
with ΔS_{i+1/2, j} = [y_{j−1/2}, y_{j+1/2}] × [z_{k−1/2}, z_{k+1/2}] = Δy Δz. We note that the quantities B^{x}, Ω^{z}, and ΔS carry no κindex, because of the assumed translational symmetry along the zaxis.
Repeating the above procedure for the magnetic field averaged over the cell interface at y_{j+1/2}, we obtain
with
and ΔS_{i, j+1/2}, = [x_{i−1/2}, x_{i+1/2}] × [z_{k−1/2}, z_{k+1/2}] = Δx Δz. Obviously, this algorithm for the time advance of the cellinterface averaged magnetic field verifies
where the integral extends over the volume of the corresponding numerical cell.
To determine the quantities Ω^{z}, which are defined at the vertices of numerical cells, different procedures were proposed. Dai and Woodward (1998) used spatial and temporal interpolations to obtain the cellvertex centered magnetic field \({\bf{B}}_{i + 1/2,j + 2/2}^{n + 1/2}\) and the velocity \({\bf{v}}_{i + 1/2,j + 1/2}^{n + 1/2}\), and from these
Balsara and Spicer (1999) compute \(\Omega _{i + 1/2,j + 1/2}^z\) by interpolating the cellinterface centered fluxes of the induction equation in the base Godunovtype scheme, \({\hat F^x}\) and \({\hat F^y}\), such that
where F^{x} = B^{y}υ^{x} − B^{x}υ^{y} is the flux in xdirection in the equation for B^{y}, and F^{y} = B^{x}υ^{y} − B^{y}υ^{x} is the flux in ydirection in the equation for B^{x}.
For planeparallel gridaligned flows the algorithm provides only half the dissipation of its 1D version, questioning the stability of the algorithm (see the discussion in Gardiner and Stone, 2005). This problem, which can be traced back to the lack of a directional bias in the averaging formula for \(\Omega _{i + 1/2,j + 1/2}^z\), was studied in a broader context by a number of researchers. To eliminate the problem, Ryu et al. (1998) considered only the transport term in the corresponding numerical flux and defined
where \(F_t^x = {B^y}{v^x}\) is the transport flux in x direction in the equation for B^{y}, and \(F_t^y = {B^x}{v^y}\) is the transport flux in y direction in the equation for B^{x}.
Gardiner and Stone (2005) proposed a family of staggered fluxCT algorithms that enforce consistency between volumeaveraged and areaaveraged magnetic fields, and between the associated numerical fluxes. These FVconsistent fluxCT schemes reduce to the 1D solver when applied to planeparallel flows aligned with one of the coordinate axes. They combined their CT schemes with a singlestep, secondorder accurate Godunov scheme based on piecewise parabolic reconstruction, and the CTU method (Colella, 1990) for multidimensional integration.
In all the previous CT schemes, one first computes the magnetic field at cell interfaces, \(B_{i + 1/2,j}^x,{B_{y\;\;i,j + 1/2,j}}\), B_{yi,j+1/2}, and then the corresponding cellcentered fields by linear interpolation, i.e.,
Focusing on the same problems as Gardiner and Stone (2005), i.e., on the construction of the upwind fluxes in the induction equation and the consistency between volumeaveraged and areaaveraged magnetic fields, Londrillo and Del Zanna (2000, 2004) developed the upwind constrained transport (UCT) strategy, which extends the CT method to highorder upwind schemes. UCT imposes the following conditions: (i) use the staggered magnetic field components in the computation of the numerical fluxes in the energymomentum equations of the MHD system, (ii) avoid timesplitting techniques (the magnetic field derivatives along the two coordinate directions have to be computed at the same time), and (iii) use proper upwind expressions for the numerical fluxes in the induction equation. Finally, to go beyond secondorder accuracy, the reconstruction procedure of the cellcentered magnetic fields, Eqs. (90), (91), should be changed Londrillo and Del Zanna (2000). A respective thirdorder ENO centraltype scheme was proposed and tested against several 1D and 2D problems by Londrillo and Del Zanna (2000, 2004).
Parallel to these developments, the CT algorithm was being implemented in RMHD codes. Komissarov (1999a) used a kind of upwind fieldCT scheme, the normal components of the magnetic field being defined on the staggered grid that is used to solve the Riemann problems at cell interfaces (see condition (i) above). Gammie and Tóth (2003) implemented the fluxCD scheme in their RMHD and GRMHD codes, as did Duez et al. (2005) in their GRMHD code for dynamical spacetimes, and Mizuno et al. in their GRMHD code RAISHIN (and Nagataki, 2009). The fluxCD scheme is also the option chosen in Mara. The transportfluxCT scheme was implemented in the RMHD code of Leismann et al. (2005) and the fluxCT scheme in the codes of Antón et al. (2010) (RMHD), Antón et al. (2006) (fixed spacetime GRMHD), and WhiskyMHD (dynamical spacetime GRMHD). Mignone and Bodo (2006) and Mignone et al. (2007) combined the fluxCT scheme with the CTU method for multidimensional flows, and Del Zanna et al. (2003) and Mignone et al. (2007), and Shibata and Sekiguchi (2005), Del Zanna et al. (2007) and Etienne et al. (2010) implemented the UCT scheme in RMHD and GRMHD, respectively.
Using staggered grid involves two sets of cellcentered magnetic fields: one set consists of field values obtained from the averages of facecentered magnetic fields, while the other set derives from advancing the field directly with a Godunov method. The corresponding values from both sets usually are not much different (of the order of the discretization error of the scheme). However, in magnetically dominated flows the difference can lead to negative pressures. Hence, Komissarov (1999a) proposed to recompute the conserved variables after every time step from primitive variables that are recovered from the conserved ones advanced in time with the Godunov scheme, and cellcentered magnetic fields computed from the averages of facecentered fields. Following Balsara and Spicer (1999), Mignone and Bodo (2006) recomputed the total energy only, making a classical correction of the magnetic energy. Martí (2015) compares several correction algorithms proving the supremacy of the relativistic corrections as the one proposed by Komissarov (1999a). Redefining the conserved variables has the drawback that the whole scheme is no longer conservative. Nevertheless, the procedure was found to be useful for problems where the magnetic pressure exceeds the thermal pressure by more than two orders of magnitude.
5.7.4 Projection scheme
Brackbill and Barnes (1980) proposed the projection scheme as a correction to the magnetic field that is applied at the end of every time step. The name derives from the idea that the magnetic field B* computed with a numerical scheme in time step n + 1 is possibly not divergencefree, and hence is projected to a divergencefree field B^{n+1} according to
where ϕ satisfies the Poisson equation ∇ϕ = ∇ · B*.
As noted by Tóth (2000), the correction resulting from the projection scheme is the smallest possible one to make the field divergencefree. The projection scheme does not reduce the order of accuracy of the numerical scheme, but adds the computational costs for the solution of the Poisson equation.
5.8 Equation of state and primitive variable recovery
As in RHD, the evolution of the conserved variables in HRSC RMHD codes requires one to solve a nonlinear algebraic system of equations to obtain the primitive variables. This involves the inversion of the 5 × 5 system given by Eqs. (11)–(13) in each time (sub)step. Balsara (2001a) and Gammie et al. (HARM) used a NewtonRaphson iteration for this purpose and calculated the corresponding Jacobian analytically.
The system can be manipulated, however, to reduce the number of equations that have to be solved iteratively. In Koide’s code (Koide et al., 1996, 1999; Koide, 2003), and for an ideal gas EOS, the original 5 × 5 system is reduced to two equations (with the flow Lorentz factor W and the scalar product v · B as unknowns), which are solved by means of a 2D NewtonRaphson. In the absence of a magnetic field, one of these equations becomes the one in the RHD case as derived in Schneider et al. (1993) and Duncan and Hughes (1994), whereas the other becomes a trivial equation.
Komissarov (1999a) considered a reduced system of three equations for the unknowns W, v · B, and p (thermal pressure) for a general EOS of the form ω = ω(ρ,p) (where ω and ρ are the enthalpy and the proper restmass densities, respectively) which is solved iteratively. Del Zanna et al. (2003) particularized Komissarov’s system to an ideal gas. Concerned with the speed and precision of the recovery procedure, Del Zanna et al. derived a single nonlinear equation to be solved iteratively (and a cubic equation which is solved analytically to get the coefficients of the other equation). The equation, a function of the square of the flow velocity, is solved by means of a NewtonRaphson iteration.
The original Komissarov’s system can be manipulated (Leismann et al., 2005) to reduce the recovery of primitive variables to the simultaneous solution of only two nonlinear equations for the unknowns Z = _{ρh}hW^{2} and υ^{2}
where \({B^2}v_ \bot ^2 = {B^2}{v^2}  {({\bf{v}} \cdot {\bf{B}})^2} = {B^2}{v^2}  {({\bf{S}} \cdot {\bf{B}})^2}/{Z^2}\).
This system is valid for general equations of state of the form p = p(ρ, h), because ρ and h can be expressed explicitly in terms of Z, υ^{2}, and the conserved variables. For an ideal gas, Eq. (94) becomes a cubic in Z with coefficients depending on υ^{2} only, which can be solved analytically. Inserting the analytic solution Z (υ^{2}) into Eq. (93), one can solve it for υ^{2} (Del Zanna et al., 2003).
With some modifications, the above described methodology is the basis of several procedures for the recovery of primitive variables (Leismann et al., 2005; Antón et al., 2006; Giacomazzo and Rezzolla, 2007).
Assuming an ideal gas EOS, Noble et al. (2006) analyzed the computational efficiency, accuracy and robustness of the recovery of primitive variables for six different methods, which they labeled 5D, 2D, 1D_{W}, 1D_{υ2}, \(1{\rm{D}}_{{v^2}}^\ast\), and polynomial, respectively. Their survey covered a parameter space of primitive variables given by
and any relative orientation between flow velocity and magnetic field.
In the 5D method, also applicable for a general EOS, one directly solves the full set of five nonlinear equations with a NewtonRaphson scheme. In the other five methods one reduces the 5 × 5 system to either one or two nonlinear equations that are solved numerically as described in the following.
In the 2D method, applicable also for general equations of state, one solves Eqs. (93) and (94) simultaneously with a 2D NewtonRaphson method. In the 1D_{W} method one solves Eq. (94) for Z substituting the square of the velocity υ by
The 1D_{υ2} method, restricted to an ideal gas EOS, is similar to the method of Del Zanna et al. (2003). However, because the cubic equation used in the latter method can sometimes have two positive real solutions for Z, Noble et al. (2006) introduced another cubic that has only one, positive (i.e., physically admissible) solution. In the related \(1{\rm{D}}_{{v^2}}^\ast\) method, instead of the cubic, Eq. (94) is solved for using a 1D NewtonRaphson iteration and the latest value of υ^{2} obtained from Eq. (93). In this way the method also works for general equations of state.
Finally, in the polynomial method one solves the eightorder polynomial in that one obtains when inserting Eq. (95) into Eq. (94) and assuming an ideal gas EOS. The eight roots of the polynomial are found using a general polynomial rootfinding method. The physical root is identified by requiring that it is also a solution of the original 5 × 5 system.
According to the survey of Noble et al. (2006) the 2D method is the fastest and has the smallest failure rate (≈ 9 × 10^{−7}), whereas the polynomial method and the 5D method are the slowest and have an unacceptably high failure rate (≈ 4 × 10^{−2} and 4 × 10^{−1}, respectively). Source codes of the methods discussed by Noble et al. (2006) can be downloaded from the Astrophysical Code Library of the Astrophysical Fluid Dynamics Group at the University of Illinois (AFDG’s web).
Mizuno et al. (2006) implemented both Koide’s and Noble’s et al. 2D methods for primitive variable recovery in RAISHIN. The ECHO code incorporates the 2D, 1D_{W}, 1D_{υ2} and \(1{\rm{D}}_{{v^2}}^\ast\) methods of Noble et al., and the RMHD versions of PLUTO and AMRVAC use variations of the 1D_{W} method for an ideal gas EOS described in Mignone and Bodo (2006) and Bergmans et al. (2005), respectively. Nagataki (2009) considered Noble’s et al. 1D_{W} and 2D methods and discussed a procedure to obtain lower and upper limits for the (physical) solution of Z, while Etienne et al. (2010) used just the 2D method. The Mara code employs the 1D_{W} method (for an ideal gas EOS), but switches to the 2D method, if a suitable solution is not obtained with the former one. The algorithm implemented in ATHENA is the 1D_{W} method for an ideal gas EOS, and TESS incorporates a 3D solver based on the 2D method with an additional iteration for the temperature. The codes of Neilsen et al. (2006), Anderson et al. (2006) and Giacomazzo and Rezzolla (2007) use alternative 1D algorithms for an ideal gas EOS.
For a polytropic EOS (p = K_{ρΓ};), the integration of the total energy equation is unnecessary, because the energy density can be computed algebraically from other flow quantities, and the recovery problem reduces to the numerical solution of Eq. (93) with Z = DW + ΓKD^{Γ}W^{2−Γ}/(Γ − 1) (Antón et al., 2006; Giacomazzo and Rezzolla, 2007). Casse et al. (2013) discuss briefly a variable switch for isothermal RMHD.
Mignone and McKinney (2007) developed an inversion procedure that allows for a general EOS and avoids problems due to loss of precision in the nonrelativistic and ultrarelativistic limits. They used the total energy minus the restmass energy instead of the total energy density itself as one of the conserved variables, and Noble’s et al. 1D_{W} method, but with Z′ = Z − D and u^{2} = W^{2}υ^{2} instead of Z and υ^{2} as unknowns. The variable Z′, properly written as
(where χ= ρε+ p), is introduced to avoid machine accuracy problems in the nonrelativistic limit. In order to perform the inversion with a NewtonRaphson iteration, one has to compute the derivative
Mignone and McKinney provided explicit expressions of the thermodynamic derivatives ∂p/∂χ∣_{ρ} and ∂p/∂ρ∣_{χ} that avoid catastrophic cancellation in the nonrelativistic limit (χ/ρ,p/ρ → 0) for the approximate Synge EOS (Mathews, 1971; Mignone et al., 2005b; Ryu et al., 2006). The authors claim that their inversion method is accurate in the ultrarelativistic limit as long as \(W \leq \varepsilon _{{\rm{mp}}}^{  1/2}\) and p/(_{ρ}W^{2}) ≥ ε_{mp}, where ε_{mp} is the machine precision. The upgraded version of HARM incorporates this inversion method as well as the 2D method of Noble et al. (2006).
In addition to the accuracy problems in the ultrarelativistic and nonrelativistic (both kinematic and thermodynamic) limits, conservative RMHD codes also may encounter problems in the strong magnetization limit, when B^{2} ≫ ρε. In this limit relatively small truncation errors in the evolution of the conserved variables lead to large (relative) errors in the computation of the internal energy density and other primitive variables. To ease these problems, in codes based on CT schemes, at the end of every time step one recomputes the conserved variables to make them consistent with the cellcentered magnetic fields computed from the averages of the staggered fields (see Section 5.7.3). The resulting small correction of the conserved quantities has turned out to be essential in simulations of flows with a magnetization of one hundred or larger.
5.9 AMR
The application of AMR in RMHD was pioneered by Balsara (2001a,b,c). He pointed out the necessity that adaptive mesh MHD schemes should obey the divergencefree property of the magnetic field on the entire AMR hierarchy. As in hydrodynamics, he argued, it is essential for divergencefree AMRMHD based on HRSC methods to prolong and restrict the data using the same reconstruction strategy as for the underlying HRSC schemes. He has implemented a divergencefree reconstruction strategy (of vector fields) into his RIEMANN framework, which supports multidimensional simulations of both Newtonian and relativistic MHD flows on parallel computing architectures (Balsara, 2001b). Divergencefree prolongation of magnetic fields on an AMR hierarchy requires a slight extension of the reconstruction scheme, while divergencefree restriction involves areaweighted averaging of magnetic fields over faces of fine grid patches.
Because Balsara’s work is based on an integral formulation of the MHD equations, divergencefree restriction and prolongation can be carried out on AMR grids with any integral refinement ratio. In order to efficiently evolve the MHD equations on AMR grids, the refined patches are evolved with time steps that are a fraction of their parent patch’s time step. The RIEMANN framework has been validated by performing a set of 3D AMRMHD tests with strong discontinuities.
Adopting a local discontinuous Galerkin predictor method together with a spacetime AMR based on a “cellbycell” approach and local time stepping, Zanotti and Dumbser (2015) obtained a high order onestep time discretization for the integration of the special relativistic hydrodynamic and magnetohydrodynamic equations, with no need for RungeKutta substeps. They explore the scheme’s ability to resolve the propagation of relativistic hydrodynamic and magnetohydrodynamic waves in different physical regime by performing a set of numerical tests in one, two and three spatial dimensions.
The GRMHD code of Anderson et al. (2006) and Neilsen et al. (2006) uses the AMR method of Berger and Colella (1989) with WENO interpolation for prolongation (see Section 8.3.5), and both hyperbolic and elliptic divergence cleaning to enforce a divergencefree magnetic field. They do not consider constrained transport, because it requires that neighboring grids align in a structured manner, precluding its application to overlapping grids with arbitrary coordinates, resolutions and/or orientation.
The (G)RMHD codes COSMOS++, WhiskyMHD, and the one developed by Etienne et al. (2010) have AMR capabilities, too. In COSMOS++ individual cells are refined rather than introducing patches of subgrids. The framework is similar to that of Khokhlov (1998), i.e., based on a fully threaded octtree (in 3D), but generalized to unstructured grids. The robustness of the numerical algorithms and the AMR framework implemented in COSMOS++ was demonstrated by several tests including relativistic shock tubes, shock collisions, magnetosonic shocks, and Alfvén wave propagation.
The code of Etienne et al. (2010) uses the Cactus parallelization environment and the Carpet infrastructure to implement movingbox AMR. The induction equation is recast into an evolution equation for the magnetic vector potential (Del Zanna et al., 2003) to keep the magnetic field divergencefree, in particular at AMR refinement boundaries. Prolongation and restriction are applied to the unconstrained vector potential components instead of the magnetic field components, which gives flexibility in choosing different interpolation schemes for prolongation and restriction. In simulations with uniform grids, the scheme is numerically equivalent to the constrainedtransport scheme based on a staggeredmesh algorithm (Evans and Hawley, 1988). Several tests including nonlinear Alfvén waves and cylindrical explosions validated the proper working of the code (Etienne et al., 2010).
WhiskyMHD also uses the Cactus parallelization environment and the Carpet infrastructure to implement a “boxinbox” mesh refinement strategy (Schnetter et al., 2004). It adopts a BergerOliger prescription for the refinement of meshes on different levels (Berger and Oliger, 1984). In addition to this, a simplified form of adaptivity allows for new refined levels to be added at predefined positions during the evolution or for refinement boxes to be moved across the domain to follow, for instance, regions where higher resolution is needed.
We note that the relativistic AMR codes AMRVAC and PLUTO discussed in Section 4.7 can simulate special relativistic magnetized flows, too. The latter also holds for the code ATHENA that offers static mesh refinement.
5.10 Summary of existing codes
Table 2 lists the multidimensional codes based on HRSC methods in chronological order both for FD and FV schemes, summarizing the basic algorithms implemented in the codes (type of spatial reconstruction, Riemann solvers and flux formulas, time advance, multidimensional schemes, and ∇ · B = 0 scheme). The table includes codes specifically developed for RMHD and those GRMHD codes for fixed spacetimes that were also used or tested in RMHD. Moreover, we include several GRMHD codes for dynamical spacetimes (Duez et al., 2005; Shibata and Sekiguchi, 2005; Neilsen et al., 2006; Anderson et al., 2006; Giacomazzo and Rezzolla, 2007; Etienne et al., 2010) that were widely tested in RMHD. AMRVAC, PLUTO, and ATHENA are multipurpose codes for computational astrophysics that have RMHD modules.
The AMRVAC, PLUTO, and ATHENA codes are publicly available and provide extensive online information about their usage. They can be downloaded from the corresponding webpages (VAC; AMRVAC, PLUTO, ATHENA). The original 2D GRMHD accretion code HARM can be downloaded from the Astrophysical Code Library of the Astrophysical Fluid Dynamics Group at the University of Illinois (AFDG’s web).
6 Test Bench
This section contains a detailed discussion of most of the numerical tests presented in the literature assessing the capabilities and limits of different HRSC methods and codes in RHD and RMHD. We review the results published by different groups including onedimensional and multidimensional tests, with and without flow discontinuities.
In most relativistic codes one sets the speed of light equal to one, and one absorbs a factor \(\sqrt {4\pi } \) in the definition of the magnetic field in RMHD codes. Hence, lengths and times have the same dimension, and this also holds for mass and energy densities, i.e., [ρ] = [p] = [ B^{2} ]. These are the units we use throughout the review, and particularly in this section.
In order to convert code to physical units, one has to complete the system of units with two independent units in addition to the velocity unit (u_{υ}, the speed of light, c). A common choice is to fix the unit of density, u_{ρ}, and the unit of length, u_{l}. In this system, the units of p or B^{2} (both have dimension of energy density) are u_{ρ}c^{2}. For example, with u_{ρ} = 1 g cm ^{−3} and u_{l} = 1 cm, the unit of p is (2.99 × 10^{10})^{2} g cm^{−1} s^{−2} or 8.94 × 10^{20} erg cm^{−3}, and that of the magnetic field 1.06 × 10^{11} G (the square root of the pressure unit multiplied by \(\sqrt {4\pi } \))
6.1 Numerical RHD: Testing the order of convergence on smooth flows
Modern HRSC codes have been mainly developed to describe strong (relativistic) shocks properly and robustly, i.e., most tests in the literature are concerned with the shock capturing capabilities of these codes. However, it is also very important to test the accuracy of HRSC codes in handling smooth flows. This is specially relevant for codes based on highorder schemes, which are in general computationally expensive.
6.1.1 Isentropic smooth flows in one dimension
This test consists of a 1D isentropic pulse set up in a uniform reference state. The pulse is initially smooth and symmetric but steepens on one side during its propagation forming a shock in a finite time. The width and height of the pulse does not change before the shock forms (see Figure 13). Details of the initial state and the analytic solution of its evolution can be found in Zhang and MacFadyen (2006). The test is a relativistic counterpart of the convergence test performed by Colella et al. (2006) with their Newtonian hydrodynamics code.
Zhang and MacFadyen (2006) considered this test to evaluate the accuracy of the various optional schemes that are implemented in their code RAM. In RAM one can combine any of the spatial schemes FWENO, FPLM, UPPM, and UPLM) with one of the following RungeKutta methods for time integration: a thirdorder TVDRK method (Shu and Osher, 1988), or standard fourth and fifthorder RungeKutta methods (Lambert, 1991), RK4 and RK5, respectively. The optimal order of convergence was obtained with the combination FWENO and RK4, while combining UPPM (formally fourthorder accurate for smooth flows) and the thirdorder TVDRK or RK4 resulted only in secondorder convergence.
Morsony et al. (2007) used the same test problem to determine the order of convergence of the FLASH code. The RHD module of this code utilizes PP interpolation within cells and a twoshock Riemann solver to compute the numerical fluxes. The time evolution is secondorder accurate (for details, see Mignone et al., 2005b). The study showed that FLASH achieves global secondorder accuracy for this test problem. Secondorder convergence is also obtained with the moving grid code TESS (Duffell and MacFadyen, 2011).
6.1.2 Isentropic smooth flows in two dimensions
Several authors (Zhang and MacFadyen, 2006; Morsony et al., 2007; Duffell and MacFadyen, 2011) simulated the previous test in 2D (using Cartesian coordinates) to validate the order of accuracy of the multidimensional scheme (spatial reconstruction and time advance). The semidiscrete approach followed in RAM leads to fourthorder accuracy for the FWENO schemes, if combined with the RK4 method, as in the 1D case. In FLASH, the secondorder accurate time integration again limits the global accuracy of the code to second order (Morsony et al., 2007). Duffell and MacFadyen (2011) obtained a slightly higher than secondorder accuracy in a nonrelativistic limit of this test with a different shape of the isentropic pulse. The 2D test further showed that the convergence rate of TESS remains unchanged even when the nonuniform flow distorts the moving mesh (Duffell and MacFadyen, 2011).
To verify the order of convergence of WHAM in two dimensions, Tchekhovskoy et al. (2007) studied the advection of smooth oblique sound and density waves on a Cartesian mesh. A sinusoidal planar wave is set to propagate on a uniform background state at rest with an angle α = tan^{−1} (2) with respect to the xaxis. A polytropic EOS p = Kρ^{Γ} with Γ = 5/3 is used. The amplitude of either the sound wave or the density wave is chosen so that it remains within the linear regime during the whole simulation. The results show that WHAM converges at fifthorder. For comparison, the authors also performed the test with the WENOIFV scheme, implemented in a simplified version of WHAM, in which the averaging and deaveraging procedures of conserved variables, fluxes and sources between average and point values, are disabled. They found that the convergence rate of this scheme is only of secondorder.
6.2 Numerical RHD: Relativistic shock heating in planar, cylindrical and spherical geometry
Shock heating of a cold fluid in planar, cylindrical or spherical geometry has been used since the early developments of numerical RHD as a test case for hydrodynamic codes, because it has an analytic solution (Blandford and McKee, 1976 for planar geometry; Martí et al., 1997 for cylindrical and spherical geometry), and involves the propagation of a strong relativistic shock wave.
In planar geometry, an initially homogeneous, cold (i.e., ε ≈ 0) gas with velocity υ_{1} and Lorentz factor W_{1} is supposed to hit a wall (or to collide against a similar and opposite flow), while in the case of cylindrical and spherical geometry the gas flow converges towards the symmetry axis or the center of symmetry. In all three cases the reflection causes compression and heating of the gas as kinetic energy is converted into internal energy. This occurs in a shock wave, which propagates upstream. Behind the shock the gas is at rest (see Figure 14). Due to conservation of energy across the shock the gas has a specific internal energy given by
The compression ratio of shocked to unshocked gas, σ, follows from
where γ is the adiabatic index of the EOS.
In the Newtonian case the compression ratio σ of shocked to unshocked gas cannot exceed a value of σ_{max} = (γ +1)/(γ−1) independently of the inflow velocity. This is different for relativistic flows, where σ grows linearly with the flow Lorentz factor and becomes infinite as the inflowing gas velocity approaches to speed of light.
The maximum flow Lorentz factor achievable for a hydrodynamic code with acceptable errors in the compression ratio σ is a measure of the code’s quality. Explicit finitedifference techniques based on a nonconservative formulation of the hydrodynamic equations and on nonconsistent (Centrella and Wilson, 1984; Hawley et al., 1984) or consistent artificial viscosity (Anninos and Fragile, 2003) were able to handle flow Lorentz factors up to ≈ 10 with moderately large errors (σ_{error} ≈ 1−3%) at best. Norman and Winkler (