A General Relativistic Magnetohydrodynamics Extension To Mesh-Less Schemes in The Code GIZMO
A General Relativistic Magnetohydrodynamics Extension To Mesh-Less Schemes in The Code GIZMO
1
Como Lake centre for AstroPhysics, DiSAT, Università dell’Insubria, via Valleggio 11, 22100 Como, Italy
2
INFN, Sezione di Milano-Bicocca, Piazza della Scienza 3, I-20126 Milano, Italy
3
INAF - Osservatorio di Astrofisica e Scienza dello Spazio di Bologna, Via Gobetti 93/3, I-40129 Bologna, Italy
arXiv:2506.15775v1 [astro-ph.HE] 18 Jun 2025
ABSTRACT
The profound comprehension of the evolution and phenomenology of an Active Galactic Nucleus requires an accurate exploration
of the dynamics of the magnetized gaseous disk surrounding the massive black hole in the centre. Many numerical simulations have
studied this environment using elaborate grid-based codes, but in recent years, new mesh-less schemes have exhibited excellent con-
servation properties and good accuracy at a more moderate computational cost. Still, none implement general relativistic magnetic
fields, a fundamental ingredient to model an accretion disk around a massive black hole. We present here a general relativistic mag-
netohydrodynamics (GRMHD) scheme working within the mesh-less framework of the code GIZMO. We implement the hyperbolic
divergence cleaning procedure, consistently extended to general relativistic effects, to keep the magnetic field divergence under safe
levels. We benchmark the scheme against various relativistic magnetohydrodynamics stress tests, considering different dimensional-
ities and both a Minkowski or a Schwarzchild/Kerr background. To date, this is the first GRMHD scheme working in a mesh-free
environment.
1. Introduction (Valentini 2024, OpenGADGET). In particular, GIZMO has been
extensively used in many astrophysical scenarios, ranging from
In the last decades, the scientific community has witnessed a the study of AGN accretion disks and circumbinary disks forma-
remarkable improvement in numerical techniques, which has tion and evolution (Franchini et al. 2022, 2024; Garg et al. 2024)
been particularly useful in the astrophysical hydrodynamics sce- to tidal disruption events (Mainetti et al. 2017), to star forming
nario for the possibility of modelling the Universe with un- regions (Grudić et al. 2021; Lupi et al. 2021), to cosmological
precedented accuracy and of numerically exploring previously galaxy formation simulations (Lupi et al. 2017; Hopkins et al.
inaccessible systems. Between the huge variety of techniques 2018, 2023), proving its accuracy and effectiveness.
exploited in the astrophysical context, the most widely used All these inquiries were treated with Newtonian physics, yet
surely are those relying on smoothed particle hydrodynam- only recently a general relativistic hydrodynamics (GRHD) ex-
ics (SPH; Lucy 1977; Gingold & Monaghan 1977; Price 2008, tension has been introduced in GIZMO (Lupi 2023). However,
2012; Cullen & Dehnen 2010; Read & Hayfield 2012) or on an implementation of general relativistic magnetohydrodynam-
grid based finite-volume methods (e.g. Berger & Colella 1989; ics (GRMHD) in GIZMO was missing. Magnetic fields are ubiq-
Stone & Norman 1992). Both these approaches have their ad- uitous in astrophysical plasma and many works studied the im-
vantages and disadvantages; for example, while SPH codes have portance of highly magnetized regions in the proximity of com-
continuous adaptive resolution due to their Lagrangian nature, pact objects. In facts, the magnetic field is a critical ingredi-
great conservation properties and provide a framework easily ent for the development of magnetorotational instabilities, po-
coupled with N-body gravity, they suffer from extra computa- tentially explaining the angular momentum transfer in AGN
tional cost in neighbour finding and some resolution-scale noise accretion disks (Balbus & Hawley 1991; Igumenshchev et al.
associated with particle rearrangement that could cause fluid in- 2003; Narayan et al. 2003). In addition, magnetically domi-
stabilities (Lecoanet et al. 2016). nated funnels close to the event horizon of single or binary
On the other hand, grid based codes are numerically sta- black holes appear to be sources of relativistic jets of mate-
ble and provide good shock capture; however, they suffer from rial, representing important features to look for in electromag-
bad mass and angular momentum conservation, grid align- netic (EM) surveys (Palenzuela et al. 2010; Giacomazzo et al.
ment effects, large artificial diffusion related to advection er- 2012; Bogdanović et al. 2022; Cattorini & Giacomazzo 2024;
rors (Gardiner & Stone 2005) and wasted computational time Fedrigo et al. 2024). Tidal disruption events are other important
in empty regions, usually addressed with ‘adaptive mesh re- scenarios in which magnetic fields play an important role; in fact,
finement’ (AMR) implementations (Berger & Colella 1989). when a star equilibrium gets destroyed by a close-by compact
Lately, a number of hybrid methods have tried to get the object, the initially confined magnetic field eventually perme-
best of both approaches, as moving mesh schemes based on a ates the inflowing stream of gas, affecting its dynamics and con-
Voronoi tessellation of the domain (Springel 2010; Pakmor et al. tributing to potential signature EM emissions. Finally, a series
2011), Particle-in-Cell (PIC) simulations (Aunai et al. 2024) of works presenting a recent GIZMO simulation (Hopkins et al.
and mesh-less methods (Lanson & Vila 2008a,b). The lat- 2024c,a,d,b) studies the formation and evolution of magnetically
ter have been then implemented in astrophysical codes by dominated AGN accretion disks originating from cosmological
(Gaburov & Nitadori 2011, Weighted Particle MHD), (Hopkins initial conditions and resolving a dynamical range spanning from
2015; Hopkins & Raives 2016; Hopkins 2016, GIZMO), and ∼ 100 Mpc down to ∼ 100 au in a consistent run. The accretion
Article number, page 1
A&A proofs: manuscript no. main
disk innermost region remains however unresolved and has been four-dimensional quantities, while Latin indices are used for
studied using the code H-AMR in Kaaz et al. (2024). three-dimensional ones. We also employ natural units, where
These considerations motivate us to implement a GRMHD G = c = M⊙ = 1 and we make use of Einstein notation for
scheme in the GIZMO code. Although many other codes that repeated indices.
evolve the GRMHD set of equations exist (Gammie et al. We assume a 3+1 spacetime decomposition in the Arnowitt-
2003; Del Zanna et al. 2007; Giacomazzo & Rezzolla 2007; Deser-Misner (ADM) formalism (Arnowitt et al. 2008) as
Mösta et al. 2014; Etienne et al. 2015; Fragile et al. 2019;
Kidder et al. 2017; Cipolletta et al. 2020; Liska et al. 2022), ds2 = gµν dxµ dxν = (−α2 + βi βi )dt2 + 2βi dxi dt + γi j dxi dx j , (1)
none of them do it in a Lagrangian framework. To date, our
scheme is the first one to solve the GRMHD equations exploiting where gµν is the 4-dimensional metric, α is the lapse function, βi
the benefits of a mesh-less scheme. With our implementation, is the shift vector and γi j is the 3-dimensional spatial metric. We
GIZMO can now self-consistently simulate the Universe from cos- concentrate on ideal GRMHD, i.e. we assume infinite conductiv-
mological down to the black hole (BH) event horizon scales, ity of the fluid and neglect viscosity and heat conduction. This
including a plethora of physical prescriptions, such as: cosmo- corresponds to imposing uν F µν = 0, where uν is the four-velocity
logical integration, dark matter, radiative heating and cooling of the fluid and F µν is the Faraday tensor. Under this assumption,
(Hopkins 2017), stellar and BH formation and feedback (e.g. the electric field as seen by a Eulerian observer can be written as
Grudić et al. 2021; Guszejnov et al. 2021; Hopkins et al. 2023; a function of the magnetic field Bi as E i = −αε0i jk v j Bk , while
Bollati et al. 2024) chemistry, dust and now also GRMHD ef- it vanishes in the fluid rest frame, as expected for a perfect con-
fects. ductor (Banyuls et al. 1997; Antón et al. 2006; Font 2008).
However, a solid implementation of magnetic fields repre- To describe the fluid, we use the following quantities: ρ is
sents a serious challenge due to the need to keep the magnetic the fluid rest mass density, ϵ the specific internal energy, P the
field numerical divergence as low as possible. In fact, a non-zero gas pressure and vi = ui /W + βi /α is the fluid three-velocity. In
∇ · B can lead to wrong results or to code breaking; a relativistic the latter we identify W = (1 − vi vi )−1/2 as the Lorentz factor,
scheme is even more sensible to this issue due to the necessity of where vi vi = γi j v j vi . With the addition of the following defini-
retrieving the primitive physical quantities from conserved ones tions for the time and spatial components of the magnetic field
via a numerical iterative method (the conservative-to-primitive in the fluid’s rest frame,
algorithm). It is easy to understand that a non-zero magnetic field
divergence would break the convergence of the latter. W B jv j
There are two methods commonly employed to control the b0 ≡ ,
α
spurious ∇ · B buildup: the constrained transport (CT) scheme Bi βi
!
(Evans & Hawley 1988), which is able to maintain ∇ · B constant bi ≡ + W(B j v j ) vi − ,
to machine precision, and the evolution of the vector potential W α
(Etienne et al. 2012). However, these methods are not straight- BjBj
forward to implement in a mesh-less scheme (Tu et al. 2022). b2 ≡ + (B j v j )2 , (2)
W2
Therefore, we opt here for a hyperbolic divergence cleaning ap-
proach (Powell et al. 1999; Dedner et al. 2002), taking inspira- we can write the stress-energy tensor of ideal GRMHD as
tion from the Newtonian implementation already present in the
(P + b2 ) µ ν b2 µν
! !
original version of GIZMO (Hopkins & Raives 2016). We show µν
T =ρ 1+ϵ+ u u + P+ g − bµ bν
that our scheme can pass several special and general relativistic ρ 2
MHD stress tests, keeping the magnetic field divergence value
≡ ρh∗ uµ uν + P∗ gµν − bµ bν , (3)
under safe levels.
This paper is organized as follows: in Sec. 2 we recall the
where in the second line we have defined the magnetically mod-
GRMHD set of equations, written according to the 3+1 Valencia
ified enthalpy h∗ ≡ 1 + ϵ + (P + b2 )/ρ and the total pressure
formulation; in Sec. 3 we present our numerical implementation
P∗ ≡ P + b2 /2.
of the scheme, quickly reviewing the GIZMO mesh-less method,
The equations of GRMHD are then derived from the mass
and then focusing on the MHD additions to the GRHD imple-
density conservation law
mentation (Lupi 2023); in Sec. 3.3 we explain in detail our di-
vergence cleaning approach; then, in Sec. 4 we show the results 1 √
from several validation tests, both in special and general relativ- √ ∂µ ( −gρuµ ) = 0, (4)
ity. Finally, we draw our conclusions in Sec. 5. −g
here U is the conserved quantities vector defined as mesh-generating point position x, an infinitesimal volume dx can
be described by
√
D ≡ γρW,
X
√ dx = Ψi (x, h(x)), (12)
S j ≡ γ(ρh∗ W 2 v j − αb0 b j ),
U=
√ (8) i
τ ≡ γ(ρh∗ W 2 − P∗ − (αb0 )2 ) − D,
B j ≡ √γB j ,
where h(x) is the kernel size. The latter is evaluated from the
code for each particle to encompass a user-defined number of
where γ =det(γi j ) is the determinant of the spatial metric, F is neighbors. The weighting function Ψi is defined as
the flux vector
W(xi − x, h(x))
Ψi (x, h(x)) = P , (13)
Dṽi ,
j W(x j − x, h(x))
√
S j ṽi + α γP∗ δij − αb j Bi /W,
F =
i
√ (9) where W is any continuous, symmetric kernel function with
τṽi + α γP∗ vi − α2 b0 Bi /W, compact support (for instance, we usually employ a cubic spline
B j ṽi − Bi ṽ j ,
kernel function, unless otherwise indicated). The sum at the de-
nominator normalizes the function Ψi so that the volumes always
where ṽi = αvi − βi , and S is the sources vector (Duez et al. 2005; sum correctly.
Chang & Etienne 2020) As in the GRHD case (Lupi 2023), we decide to solve Eq.s
(7) in the lab reference frame, as
0, dU
+ ∇ · (F − w ⊗ U) = S,
1 αβ (14)
2 T ∇gαβ ,
√
S = α γ
dt
(T 00 βi β j + 2T 0i β j + T i j )Ki j − (T 00 βi + T 0i )∂i α,
where w is the frame velocity. As described in the original meth-
0,
ods paper (Hopkins 2015), we can discretize Eq.s (14) over the
(10) discrete elements defined above, by integrating over the domain
volume, obtaining
where Ki j is the extrinsic curvature of the metric. We note that
the source terms depend on the derivative of the metric and d(Vi Ui ) X
+ F̃i j · Ai j = Vi Si , (15)
we do not have any modification in form from the GRHD case dt j
(note however that the stress-energy also considers the magnetic
energy-momentum contribution now). where F̃i j is the solution of the Riemann problem Rbetween the
Finally, the time component of Eq.s (6) yields the divergence-
i-th particle and the j-th interacting neighbor, Vi = Ψi (x)dx is
free condition of the magnetic field
the particle volume and Ai j is the normal vector to the ‘effective
1 face area’ between i-th and j-th interacting cells.
√ ∂i Bi = 0; (11) In principle, the frame velocity w in Eq.s (14) can be chosen
γ arbitrarily. GIZMO defines two different methods which depend
on the assumption made for the frame velocities, as described
numerically, this constraint needs to be ensured during the sys-
in the original paper. One assumes the interacting face to be
tem evolution. We enforce this condition with a ‘divergence
moving with the average fluid velocity of the interacting cells
cleaning’ technique, which we describe in Sec. 3.3.
wi j = (ṽi + ṽ j )/2, defining the mesh-less Finite Volume (MFV)
An equation of state (EoS) is required to close the system of
method, which resembles a standard moving-mesh finite volume
Eq.s (7). In our work, we always use a Γ-law EoS of the form P =
scheme. The other assumes instead the frame velocity to be that
(Γ − 1)ρϵ, albeit our scheme also allows for different equations
of the contact discontinuity, i.e. the velocity which preserves the
of state.
mass on both sides of the moving interface. This second choice
defines the mesh-less Finite Mass (MFM) method, in which the
3. Numerical implementation particle masses are always preserved throughout the evolution of
the system (more on that in Sec. 3.2.1).
In this section, we describe the numerical methods used to solve
the GRMHD set of Eq.s (7), mainly focusing on the differences
3.2. MHD modifications
between the GRHD version of the scheme, presented in Lupi
(2023), and the current implementation. After a brief recall of In this section, we describe the main method modifications from
the GIZMO mesh-free methods, we describe the new volume evo- the GRHD version of the scheme, extensively described in Lupi
lution prescription, the GRMHD Riemann solver, and, finally, (2023). The first difference resides in the implementation of the
the methods used to ensure the divergence-free condition. Riemann solver, which we describe in the following subsection.
(2006) or Miyoshi & Kusano (2005), in order to correctly re- This guarantees that the local conservative quantities are consis-
solve contact discontinuities. tently passed to the conservative-to-primitive solver.
The fluxes given by the solver can be written as This procedure boils down to how to explicitly compute the
updated volume Vit+∆t . We decided to estimate it by exploit-
FL − wn̂ UL ; wn̂ < λmin
ing the continuity equation as Vit+∆t = Vit exp(V̇i ∆t/Vit ), where
F̃ = FHLL − w UHLL ; λmin ≤ wn̂ ≤ λmax
n̂
(16) V̇i = j Ai j · (v part,i − wi j ); here v part,i is the i-th particle velocity
P
FR − w UR ;
n̂
wn̂ > λmax (which is equal to the fluid velocity in the MFM scheme), wi j
the velocity of the Riemann problem interface1 , and Ai j is the
where UHLL are the intermediate states evaluated as effective face area between particles i and j.2 For consistency,
λmax UR − λmin UL + FL − FR the same prescription is employed in the density prediction step,
UHLL = (17) i.e. Dt+∆t = Dt exp(−V̇∆t/V t ).
λmax − λmin
and FHLL are the corresponding fluxes
3.2.3. Other code modifications
λmax FL − λmin FR + λmax λmin (UR − UL )
FHLL = . (18) In this section, we discuss other code modifications implemented
λmax − λmin in our GRMHD extension of GIZMO.
In these equations, wn̂ is the face velocity perpendicular to the
1. Despite the use of slope limiters, the process of reconstruct-
interface, whereas λmin and λmax are the slowest and the fastest
ing the primitive velocity at the position of the face might
wave speeds of the Riemann problem, i.e. the magnetosonic
yield a resulting fluid velocity slightly larger than unity. In
speeds. We evaluate such velocities by solving the quadratic dis-
the GRHD version of the code, this was prevented by means
persion relation
of a user-defined limiter on the maximum Lorentz factor
λ2 [W 2 (V 2 − 1) − V 2 ] − 2λ[W 2 ṽn̂ (V 2 − 1) + V 2 βn̂ ]+ allowed by the code. Here instead, we have found more
convenient to reconstruct the quantity Wvi at the face posi-
[(W ṽn̂ )2 (V 2 − 1) + V 2 (α2 γn̂n̂ − βn̂ βn̂ )] = 0 (19) tion, as this quantity has physical values ranging in (−∞, ∞),
thus naturally avoiding causality violation. After reconstruc-
where V 2 ≡ v2A + c2s (1 − v2A ), with vA = b2 /(ρh∗ ) the Alfvén
p
tion, the corresponding Eulerian vi is then easily recovered
velocity and c s the fluid sound speed. (Noble et al. 2006) and passed to the Riemann solver. Note
In order to guarantee the stability of the scheme, the Courant- that the implementation of a limiter in the evaluation of the
Friedrisch-Levy (CFL) condition must be fulfilled during the cal- Lorentz factor is still available in the code, but it is now op-
culation. Even though the solution of λ should be used in this tional, and not employed in any of the tests presented in this
case, for computational efficiency we employ V as the maximum work.
signal velocity. This represents an approximate evaluation of the 2. Because of the presence of the Lorentz factor in the definition
signal speed, but gives a good enough estimate for our purpose. of the conservatives variables, primitive quantities cannot be
To conclude this subsection, we recall that when GIZMO is recovered analytically, but only through iterative numerical
running in MFM mode, the face velocity wn̂ is assumed to be techniques for the inversion of Eq.s (8). Here, we implement
moving with the zero-mass flux velocity, which for our HLL the 2D inversion scheme by Noble et al. (2006), suitably
solver is defined as adapted to our scheme, which recovers the GRMHD prim-
FD,HLL itive variables via a Newton-Raphson method. This scheme
wn̂ = . (20) considers the presence of magnetic fields, can be easily ex-
DHLL
tended to generic EoS and provides a stable and computa-
tionally efficient solution to this inversion problem. We note
3.2.2. Time integration and volumes evolution that keeping the divergence of the magnetic field low is cru-
cial for the correct behaviour of the conservative-to-primitive
After the flux computation, we need to evolve the conserved vari-
solver.
ables in time according to the generalized leap-frog scheme, as
described in Lupi (2023). The only difference with the GRHD 3. In some pathological cases, when the magnetic field con-
scheme lies in the explicit update of the conserved variables tributes to a significant fraction of the total energy of the
through Eq.s (15), both for the "kick" procedure on active parti- fluid, the recovery of the specific internal energy ϵ from the
cles over half a timestep ∆t/2 and the prediction operation over a conserved energy τ can become a non-trivial numerical task,
full timestep ∆t. In fact, in the GRHD scheme, all the conserved yielding significant errors on the evolution of the primitive
quantities (D, S j , τ)i are proportional to the particle density Di , quantities. In our tests, we encountered this problem only
i.e. proportional to the particle mass mi once volume-integrated. in the magnetized Bondi accretion test, when dealing with
This results in just a normalization factor in the conservative- a strong gravitational field (Sec. 4.2.2). For this reason, we
to-primitive inversion algorithm, irrelevant to its solution (Sec. implement an optional energy-entropy switch, as suggested
3.2.3). However, in the volume-integrated GRMHD conserved in Del Zanna et al. (2007). When active, we evaluate the en-
variables, a proportionality to Vi2 appears in the terms contain- tropy function s ≡ P/ρΓ , which we evolve through the con-
ing B2i in the momentum and energy density definitions, break- 1
We note that, in order to be consistent throughout the whole evo-
ing the inversion scheme. For this reason, we modify our scheme lution, wi j must be the frame velocity actually used in the Riemann
introducing an explicit evolution of the volume Vi , as problem, i.e. it must be evaluated according to Eq. (20) in MFM mode.
h i P t
2
Actually, in the second half-step kick we start from Vit+∆t =
Vit Uti + S(Uti )∆t − j Ati j F̃i j ∆t Mi /Dt+∆t
t+∆t
at the end of the step and we estimate Vit+∆t/2 =
Ui =
t+∆t
. (21) i
Vit+∆t Vi exp(−V̇i ∆t/Vit+∆t ) back at the beginning of the half-kick.
t+∆t
servation equation only valuable choice is to compute the divergence term directly
from the Riemann solver outputs as
∇µ (ρsuµ ) = 0, (22) X
(V∂k Bk )i = − B̄⊥i j |Ai j |, (25)
that can be rewritten as j
∂t (Ds) + ∂i (Dsṽ ) = 0.
i
(23) where
We note that the last equation only holds for adiabatic flows, B⊥i + B⊥j
in the absence of shocks or any other energy dissipation B̄⊥i j = (26)
2
mechanisms. During the fluid evolution, for each particle,
the code checks whether the magnetic field contributes to a is the average magnetic field perpendicular to the face between
significant fraction of the total energy and if any shock is each i- j interacting pair of particles. This prescription alone can
present in its interaction with neighbors particles.3 If the first complete all of our tests without the code breaking. However,
condition is met and shocks are absent, the internal energy is some test problems (e.g. the magnetic rotor, Sec. 4.1.4) yield
directly recovered from the entropy s. Otherwise, if the first wrong solutions. In order to address these inconsistencies and re-
condition is false or a shock is present in any direction, we duce the errors in the solutions, we add a hyperbolic divergence
evaluate the internal energy relying on the standard evolution cleaning on top of the Powell’s prescription. Presented for the
Eq.s 7). first time in Dedner et al. (2002) in its Newtonian formulation
and later extended to special and general relativity (Neilsen et al.
2006; Anderson et al. 2006; Liebling et al. 2010; Penner 2011;
3.3. Divergence cleaning Mösta et al. 2014; Fambri et al. 2018), the method consists in
The ideal GRMHD Eq.s (7) are derived using Eq. (11), i.e. the the addition of a scalar field ψ used to advect divergence errors
no-monopole constrain. It is well established, however, that such away from their source location as fast as possible while damp-
constraint is not always guaranteed in numerical schemes. In- ing them.
deed, the numerical approximations performed during the calcu- To consistently derive the equations governing the evolution
lations can easily result in the divergence of the magnetic field of the ψ field, we start from a modification of Maxwell’s equa-
significantly differing from zero, thus leading to an incorrect and tion (following Mösta et al. 2014)
unphysical evolution of the conserved quantities or, worse, to
∇µ ∗ F µν + gµν ψ̂ = σnν ch ψ̂,
code breaking. Keeping the emerging errors in Eq. (11) under (27)
control is therefore crucial for a correct evolution of the systems
considered. This is usually achieved with numerical techniques where ψ̂ = ψ/ch , nν = (1/α, −β j /α) is the normal vector to the
such as the constrained transport (CT; Evans & Hawley 1988) hypersurface of the 3+1 formulation of spacetime and where we
or the vector potential evolution (Etienne et al. 2012) methods. have introduced the advection velocity ch and the damping factor
While successful implementations of these methods in moving- σ. As suggested in Tricco et al. (2016), we follow the ψ̂ quantity
mesh relativistic MHD schemes exist (e.g. He & Tang 2012; to take in consideration the variability of the advection velocity
Fragile et al. 2019), we opt here for a divergence cleaning tech- ch , obtaining a better evolution of the energy of the system. We
nique, to maintain consistency with the Newtonian MHD version can now solve Eq.s (27) for ν = j (spatial components) and ν = 0
of the code (Hopkins & Raives 2016). To date, this is the first im- (time component), obtaining
plementation of a divergence cleaning method in a GRMHD set √
∂t B j + ∂i (ṽi B j − ṽ j Bi ) = −α γγi j ∂i ψ̂ + β j ∂i Bi ,
(
of equations solved on a mesh-less scheme.
(28)
We now describe our divergence cleaning implementations, ∂t ψ̂ − βi ∂i ψ̂ = −αγ−1/2 ∂i Bi − ασch ψ̂.
starting from the Powell’s “8-wave” cleaning prescription. As
described in the original paper (Powell et al. 1999), a set of As suggested in Dedner et al. (2002) and implemented in the
source terms is needed to stabilize the MHD equations against MHD version of GIZMO, we consider an additional advection
the development of spurious magnetic divergence when the term αvi ∂i ψ̂ in the scalar field ψ̂ evolution equation, which gives
fluxes are evaluated. A special relativistic version of this scheme
is analyzed in depth by Wu & Shu (2020). Here, we write a √
∂t B j + ∂i (ṽi B j − ṽ j Bi ) = − γ(β j vi + αγi j )∂i ψ̂ + β j ∂i Bi ,
(
general relativistic analogue, similar to the one presented in
Liebling et al. (2010). ∂t ψ̂ + ṽi ∂i ψ̂ = −αγ−1/2 ∂i Bi − ασch ψ̂.
We extend the set of Eq.s (7) with additional source terms in
(29)
the form
If we now multiply the second equation by the conserved density
0,
Bj D and we rearrange the terms using the mass continuity Eq. (7),
W 2 + v j Bk vk ,
we can rewrite the evolution equation for ψ̂ as
SPowell = −α(∂i Bi )
(24)
Bk vk ,
αD∂i Bi
v j − β j .
∂t (Dψ̂) + ∂i (ṽi Dψ̂) = − − ασch Dψ̂.
α √ (30)
γ
The critical point here resides in the need to consistently
evaluate the ∂i Bi term. As also reported in the original MHD Once averaged over the volume Vi , Eq. (30) yields the evolution
GIZMO paper (and suggested by Gaburov & Nitadori 2011), the of the mass-based ψ̂ field as implemented in our code, which
translates into a much easier evaluation of the flux term.
3
If the local fluid velocity is greater than the local sound speed, the As done for the ∂i Bi term in Eq. (26), we need to evaluate
code assumes that the interaction produces a shock. the gradient of ψ̂ in a consistent way. In our implementation, this
Article number, page 5
A&A proofs: manuscript no. main
∂i B i
-4.6 -1 -0.1 -0.01 0 0.01 0.1 1 4.6
1 1
0 0
y
−1 −1
−2 −2
K=1
1 1
0 0
y
−1 −1
−2 −2
−2 −1 0 1 −2 −1 0 1 −2 −1 0 1 −2 −1 0 1 2
x x x x
Fig. 1. Evolution of the monopole test. Two-dimensional slice at z = 0 of the magnetic field divergence at the initial time (left) and at three later
times. Top panels display the solution with damping parameter K = 0.1 and the bottom panels with K = 1.
is done by considering the Rusanov fluxes between each pair of i.e. ch = vms (1 + f )/(1 + f v2ms ).4 In our tests, we typically as-
interacting particles sume f = 1 (except for the magnetized TOV equilibrium test
where we use f = 2.5), which represents a compromise between
1 λ̃ computational efficiency and an effective divergence cleaning.5
FHLL = (FL + FR ) − (UR − UL ), (31)
2 2 We note that, while ch in Eq.s (32) is evaluated from the local
quantities entering the Riemann problem for the considered pair
for the decoupled (B⊥ , ψ̂) system, where λ̃ p is the eigenvalue of of particles, the maximum among all ch values from the inter-
the two-dimensional problem. Here, λ̃ = α γ⊥⊥ , where γ⊥⊥ is acting particles pair is employed in Eq.s (29)-(30). We also note
the spatial metric component perpendicular to the interface, and that when hyperbolic divergence cleaning is employed, the addi-
from Eq. (31) we obtain tional advection speed must be considered when evaluating the
system time-step through the CFL condition.
B̄⊥i j = 21 (B⊥L + B⊥R ) − 12 γγ⊥⊥ (ψ̂R − ψ̂L ),
p
Finally, in order to stabilize the scheme, we need to include
(32) two additional source terms in the evolution of the momentum
ψ̄i j = 12 (ψ̂L + ψ̂R ) − 21 (γγ⊥⊥ )−1/2 (B⊥R − B⊥L ).
density S j and energy density τ, yielding a Dedner source vector
of the form
Finally, B̄⊥i j and ψ̄i j are used to evaluate the divergence of B j
with Eq. (25) and the gradient of ψ̂ as
0, h i
Ξ h2Bk v j − B j vk − γk j (B vii) ,
X
k i
(V∂k ψ̂)i = − ψ̄i j Ai j . S Dedner =
(33) (34)
j
Ξk 2Bk (1 − 2W 1
) − vk (Bi vi ) ,
Ξ j ,
In principle, we are free to choose the Dedner parameters ch
and σ arbitrarily. After extensive tests of the scheme, we have where
opted for defining σ = K/∆x, with K = 0.1 (except for the h √
blast wave tests where we use K = 0.75), where ∆x is the inter-
i
Ξk ≡ − γ(βk vi + αγki )∂i ψ̂ + βk ∂i Bi . (35)
particle spacing/effective cell size. In a relativistic scheme, the
advection velocity is usually set equal to the speed of light, i.e. This concludes the description of our divergence cleaning
ch = 1, since this is the largest value permitted that does not procedure.
violate causality. This choice, however, would break the hier-
archical time-stepping in GIZMO, thus requiring the entire sys- 4
Note that the augmented speed is simply the relativistic composition
tem to advance at the smallest possible pace. In our implemen- of vms with itself multiplied by f .
tation, instead, we decided to employ the local magnetosonic 5
Note that the user is allowed to force ch = 1 at compile-time. In
speed vms , similar to what is done in the Newtonian MHD ver- our tests, this choice yields the best cleaning of ∂i Bi , but negligible
sion of the code, suitably augmented by a user-defined factor f , differences in the evolution of the conserved quantities.
4. Code validation tests 2297 particles are sampling the x-direction. To determine the two
different states’ rest-mass densities, the left state has a particle
We now test the robustness and accuracy of our implementa- number density eight times higher than the right. Because of pe-
tion against some standard tests, both in special and general rel- riodicity, two discontinuities are present, one at the centre of the
ativistic MHD. Unless otherwise indicated, all the tests are run box, and one at the edge. We focus here only on the central one,
with the complete divergence cleaning scheme (with parameters as the other is simply a mirrored version of it, hence we limit our
K = 0.1 and f = 1). "active" region to the central half of the box. This translates in
a number of "active" particles along the x-direction of ∼ 1148.
4.1. Special relativistic magnetohydrodynamics For the MFV case, we discretize the fluid with a close packed
lattice with 2000 particles along the x-direction (1000 "active"
4.1.1. Monopole particles).
To test the behaviour and the effectiveness of our divergence In Fig. 2, we plot our solution of the Balsara1 test at t = 0.4
cleaning prescription, we perform a simple test where we ini- performed in both MFM and MFV modes, using Powell terms
tialize a magnetic monopole in a static fluid. The initial setup only and with the complete cleaning scheme (Powell+Dedner).
is similar to the one presented in Mösta et al. (2014): a distribu- In the latter, we employ K = 0.1 and f = 1. The exact solution
tion of 1003 particles initially placed on a Cartesian mesh fills a reported in the panels is computed with the exact RMHD Rie-
periodic cubic box of side length 4. The fluid is uniform in den- mann Solver by Giacomazzo & Rezzolla (2006). Our scheme is
sity and pressure and it is initially at rest. The magnetic field is able to reproduce the correct solution with good accuracy. We
set equal to zero everywhere except in a central region where a recognize some small oscillations on the left of the rarefaction
monopole is introduced in the form fan and on the right of the fast magnetosonic wave front in all
( −r2 /R our runs; these artifacts can be controlled with more diffusive
e c
− e−1 ; r < Rc slope limiters when performing the reconstruction of the prim-
Bx = (36)
0; r ≥ Rc . itive quantities on the interacting faces. In this test, the specific
internal energy ϵ is slightly overestimated at the contact discon-
where Rc = 0.2. The adiabatic index Γ is set to 5/3 during tinuity; close to the discontinuity, this effect is more severe in
the evolution, we assume a Minkowski flat background and we the MFM case, but exhibits an overall higher value in the MFV
choose the Dedner parameter to be ch = 1 and either K = one. At the shock front (at x ≃ 1.15) oscillations develop in the
(0.1, 1). We report the results of the test performed in MFM velocity and the specific internal energy evolution; this effect is
mode but we find no difference in the MFV case. probably related to the high volume compression the particles
In Fig. 1 we show a two-dimensional slice of the magnetic witness when the shock front is approaching. We can attenuate
field divergence evaluated according to Eq. (25) at four times, this artifact with more stringent slope limiters, lower order re-
t = 0, 0.5, 1, 1.5, for both the K = 0.1 and the K = 1 cases. Our constructions of the primitive quantities, by employing bigger
scheme can correctly remove spurious monopoles, advecting and particle kernels (e.g. the Wendland C4 kernel function) or go-
damping them in a relatively short time. As expected, the K = ing to higher resolution, but some oscillations are always present
1 run displays a stronger reduction of ∂i Bi ; however, a slightly when particle motion is allowed. Furthermore, initializing a par-
slower suppression of ψ̂ is recommended so that the evolution ticle configuration without sharp mass gradients relieves these
of the magnetic field itself is better affected by the corrective difficulties.
terms in Eq. (29). This analysis and the following tests show
that higher K values result in inefficient cleaning while too low In the bottom panel of Fig. 2, we display the specific internal
K values lead to system instabilities. We also note that even in energy when the problem is initialized with equal-mass particles
this simple test, the corrective terms in Eq.s (34) are necessary and evolved with the MFV scheme. When compared with the
to keep the other evolved quantities stable. For completeness, in same problem initialized with equal-volume particles (orange
Appendix B we show results of the same test performed with the circles in the second panel of Fig. 2), the quantity ϵ exhibits a
Powell scheme only. better agreement with the exact solution in the region between
the contact wave and the right-going slow shock, resembling the
MFM solution. Finally, in the same panel, we show results ob-
4.1.2. MHD shocktubes tained using more stringent slope limiters; while being more dif-
We report here the results of two one-dimensional special rela- fusive, the solution has significantly fewer numerical artifacts;
tivistic MHD tests. Presented for the first time in Balsara (2001), in fact, both the oscillations on the fast wave and the right slow
these tests consist of two-state (left and right) Riemann prob- wave, and the overestimation of ϵ in front of the contact discon-
lems, particularly useful to demonstrate the ability of the code to tinuity are attenuated.
capture shocks. In particular, we performed the relativistic ana- In a planar shock test, the B x evolution is a direct indication
logue of the Brio-Wu shock tube problem (Brio & Wu 1988), of the ability of the code to maintain a low magnetic field diver-
usually called “Balsara1” test, and a relativistic MHD collision, gence, as it should remain constant in space and time. We recog-
called “Balsara4” test. nize a good evolution of this quantity in all our runs, with only
The initial conditions of the Balsara1 problem a moderate spike at the contact discontinuity in the MFM mode;
consist of a left state (ρ, v x , vy , vz , ϵ, Bx , By , Bz )L = however, with the addition of the Dedner divergence cleaning,
(1.0, 0, 0, 0, 1.0, 0.5, 1.0, 0) and a right state the B x evolution is improved overall. Finally, in the MFM runs,
(ρ, v x , vy , vz , ϵ, Bx , By , Bz )R = (0.125, 0, 0, 0, 0.8, 0.5, −1.0, 0), the magnetic field witnesses a slow noise build-up in regions yet
with Γ = 2. The discontinuity exists in the x-direction. The unaffected by the shock; this is due to the volume discretiza-
domain is a periodic 2D box of length 2 along the x direction tion of the domain being performed on a 2D Cartesian grid in
and 0.05 along the y-direction. our initial conditions, which is not optimal for our ∂i Bi and flux
To perform the test in the MFM mode, we initialize a distri- evaluations. Indeed, a better mapping of the simulated volume
bution of equal-mass particles placed on a Cartesian grid, so that via a closed packed lattice, as done in the MFV case, completely
Article number, page 7
A&A proofs: manuscript no. main
Fig. 2. Slice at y = y0 of primitive quantities at time t = 0.4 of the Balsara1 test. The magnetic field divergence in units of the magnetic field
intensity is plotted in the seventh panel. Blue squares (Powell) and red triangles (Dedner) mark the MFM solutions, while cyan stars (Powell) and
orange circles (Dedner) indicate the MFV ones. In the bottom panel, we display the specific internal energy when the problem is initialized with
equal-mass particles and evolved with the MFV scheme; gold diamonds mark the solution employing standard slope limiters, while olive triangles
show the results using more diffusive slope limiters. The correct solution, evaluated through the exact Riemann Solver by Giacomazzo & Rezzolla
(2006), is plotted with a black dashed line.
removes this artifact.6 As a check of our implementation, we lution, but at the same time introduces some spurious oscillations
also performed this test with a fixed particle distribution (sim- (Hopkins 2015).
ilar to a classical finite-volume scheme on a grid). The results, For the Balsara4 problem, we initialize a left-state
despite not shown, are in perfect agreement with the exact so- (ρ, v x , vy , vz , ϵ, Bx , By , Bz )L = (1.0, 0.999, 0, 0, 0.15, 10, 7.0, 7.0)
lution, without any of the numerical artifacts mentioned above, and a right-state (ρ, v x , vy , vz , ϵ, Bx , By , Bz )R =
suggesting that their origin has to be ascribed to the particle mo- (1.0, −0.999, 0, 0, 0.15, 10, −7.0, −7.0) with Γ = 5/3. Since
tion, which reduces numerical diffusivity at relatively low reso- the initial Lorentz factor is W = 22.366, this test is highly
relativistic. We fill a two-dimensional (3, 0.05) periodic box
6
Note that it is non-trivial to initialize an equal-mass particle distri- with a closely packed lattice so that there are 500 “active”
bution with two different density states using a closely packed lattice particles sampling the x-direction.
without introducing numerical artifacts at the discontinuity. Therefore, In Fig. 3, we plot our solution at time t = 0.4 performed in
we opted for a simpler Cartesian distribution. MFM mode, using either the Powell terms only or with the com-
Article number, page 8
Giacomo Fedrigo1,2 and Alessandro Lupi1,2,3 : GIZMO-GRMHD
Fig. 3. Slice at time t = 0.4 and constant y of the primitive quantities from the Balsara4 test performed in the MFM mode. The magnetic field
divergence in units of its intensity is plotted in the bottom panel. Blue squares mark the solution computed with Powell terms only, while red
triangles indicate the one computed with the complete divergence cleaning scheme. The high resolution run is displayed with orange circles.
Quantities vz and Bz are not plotted but exhibit analogous behaviors to vy and By . The correct solution, evaluated through the exact Riemann Solver
by Giacomazzo & Rezzolla (2006), is plotted with a black dashed line.
plete cleaning scheme, alongside the exact solution of the prob- sufficiently to perfectly resolve the large density jump, which re-
lem. Quantities vz and Bz are not plotted but exhibit analogue quires an even higher resolution.
behaviours to vy and By . Our code is able to correctly compute
the evolution of the quantities, with only a small overestimation
of the specific internal energy and an underestimation of the rest 4.1.3. Loop advection
mass density (yielding a correct evaluation of the pressure) in the We now test our code against the loop advection problem. This
central regions. The positions of the shock fronts are slightly off, test is particularly challenging for grid based code due to the ne-
becoming more accurate with the Dedner cleaning scheme. The cessity to continuously evaluate strong fluxes, resulting from the
outer shocks remain instead slightly offset, because of the poor fluid advection (Gardiner & Stone 2005). The Lagrangian nature
sampling around the strong density jump, which is reflected in a of GIZMO, on the other hand, allows to naturally follow the uni-
smoothing of the discontinuity across a few neighbors. To verify formly moving fluid, reducing the effective fluxes between par-
this hypothesis, we performed a high resolution run with ∼ 1166 ticles to the minimum. For this setup, we initialize 2.5 × 105 par-
active particles sampling the x-direction. The solution yielded ticles on a Cartesian grid, filling a periodic two-dimensional box
sharper discontinuities and a better B x conservation, but still not of unit length. The fluid is given a uniform density (ρ = 1) and
specific internal energy (ϵ = 4.5), with Γ = 5/3. The magnetic
Article number, page 9
A&A proofs: manuscript no. main
field is set to zero everywhere in the domain, but for a central the MFM case in Fig. 5. Our solution exhibits good behavior
circular region with radius Rloop = 0.3, in which we set an az- overall: the center of the disk is quickly emptied of gas, while
imuthal magnetic field loop of the form an overdensity propagates outside. The presence of the mag-
netic field slows down the rotation of the fluid, yielding a max-
r < Rloop
(
Aloop (−y/r, x/r, 0); imum Lorentz factor of W ≃ 2.48 at the final time; due to the
(Bx , By , Bz ) = (37)
(0, 0, 0); r ≥ Rloop flux-freeze effect, magnetic field lines are twisted by the fluid
in the central region. When compared to results from grid based
where Aloop = 10−3 and r = x2 + y2 is the cylindrical radius.
p
codes (e.g. Del Zanna et al. 2003; Duffell & MacFadyen 2011;
Finally, we assign a bulk velocity (v x , vy , vz ) = (1/2, 1/12, 0) to Mösta et al. 2014), our evolution scheme yields higher maxi-
the fluid. We let the system evolve until t = 24 in the MFM mum values of the rest mass density and of the Lorentz factor,
mode. peaked on the oblate shear front. This behavior is better quanti-
In Fig. 4, we plot Bx and the magnetic pressure Pmag = b2 /2 fied in Fig. 6, where we plot the most important quantities along
at the initial and final times. Despite the presence of some smear- horizontal and vertical slices, at the output time t = 0.4. For
ing, due to the diffusive nature of our HLL solver, the magnetic a more comprehensive view, we display here the results from
field intensity and shape are well conserved throughout the ad- the MFV run too, alongside the ones computed with fixed parti-
vection. As also observed in many other codes (Tóth & Odstrčil cle positions for reference. While our MFV results show a good
1996; Stone et al. 2008; Pakmor et al. 2011; Fragile et al. 2019; agreement with the reference run and with the ones presented in
Fambri et al. 2018; Cipolletta et al. 2020) a magnetic pressure Mösta et al. (2014), the MFM run yields higher rest mass den-
drop in a small central region is present. We note that, during sity and Lorentz factor peaks by a factor ∼ 1.5 and ∼ 1.3 respec-
this test, our scheme keeps the magnetic field divergence well tively; these features produce a slightly faster expansion of the
controlled, reaching maximum values of h(∂i Bi ) at ∼ 1% the rotor. We note that the resolution in regions with higher densities
magnetic field intensity. in our MFM run is ∼ 2 times higher than the MFV one (and than
the resolution used in the referenced grid based codes), which
could therefore better resolve the compression of the fluid.7
4.1.4. Magnetic rotor
As a second multidimensional stress test, we perform the rela- 4.1.5. Cylindrical blast wave
tivistic version of the magnetic rotor (Del Zanna et al. 2003). A
2D disk of radius rd = 0.1 and density ρd = 10 is initially ro- One of the most demanding special relativistic tests for a
tating with a uniform angular velocity Ωd = 9.95. The rest of multidimensional code is the blast wave explosion. We test
the domain is filled with a fluid of uniform density ρext = 1, ini- our scheme against the magnetized cylindrical case presented
tially at rest. The gas pressure is P = 1 everywhere (Γ = 5/3) in Komissarov (1999) and later performed as a test for var-
and a magnetic field aligned with the x-direction of magnitude ious codes (Del Zanna et al. 2007; Beckwith & Stone 2011;
Bx = 1 permeates the entire simulated box. This setup usually Mösta et al. 2014; Cipolletta et al. 2020). In this problem an ini-
represents a really difficult test for numerical schemes, due to tial overdense and overpressurised gas of ρin = 10−2 and Pin = 1
the high Lorentz factor W ≃ 10, the formation of low density is confined inside a radius rin = 0.8. The external medium is in-
regions in the center of the rotor and the presence of strong dis- stead uniform with rest mass density ρext = 10−4 and pressure
continuities in the initial condition. To slightly alleviate this last Pext = 3 × 10−5 . Between the inner rin and an external radius
point, we apply a smoothed transition on the rest mass density rext = 1, we apply a transition on the rest mass density of the
and on the velocity radial profiles between rd and rext = 0.115 of form
the form f (r) = (rext − r)/(rext − rd ) so that
ρext
! !
rin − r
ln ρ(r) = ln ρin +
ρd ;
ln (40)
r ≤ rd rin − rext ρin
ρ(r) = 1 + 9 f (r); r d < r < rext (38)
ρ0 ;
r ≥ rext and an equivalent one on the pressure profile. A magnetic field
B = (0.1, 0, 0) permeates the entire domain and the adiabatic
and index is set to Γ = 4/3.
r ≤ rd As done for the magnetic rotor test (Sec. 4.1.4), for the MFM
rΩd ;
run we initialize ∼ 1.6 × 105 equal-mass particles in a closely
|v(r)| = rd Ωd f (r); rd < r < rext (39)
packed lattice and we then stretch their radial position to match
r ≥ rext .
0;
the integrated mass cumulative function M(R < r) up to r = rext .
Outside this radius, we do not perform any stretching, initializing
From these, we can compute the Lorentz factor W(r) and the
the fluid with a uniform density ρext . For the MFV run, we place
conserved density D(r) radial profiles and we integrate the cu-
∼ 2.6 × 106 particles on a closely packed lattice and assign the
mulative mass function M(R < r). For the MFM run, we first
particle mass to match the ρ(r) profile.8 We let the system evolve
place ∼ 1.2 × 105 particles on a closely packed lattice and we
until t = 3 in a periodic box of side length 6, using a Dedner
then stretch their radial position to match the cumulative mass
damping parameter K = 0.75. Our code is able to evolve this
function M(R < r) up to r = rext , assuming equal-mass parti-
cles. Finally, outside of radius rext we initialize a close packed 7
We tested this hypothesis by performing a high resolution (4×) run
lattice distribution of particles with uniform density ρext . For the using the MFV method and obtaining a rest mass density peak of ρmax >
MFV case, we do not perform the radial stretch but we assign 9 and a maximum Lorentz factor W > 1.8. These values exceed those
the particle mass to match D(r) = ρ(r)W(r) instead, yielding an of the low-resolution reference case by factors of approximately 1.3 and
equal-volume particles distribution. 1.25, respectively.
Our code can evolve the system without breaking in both 8
The higher particles number is needed to obtain a resolution on the
MFM and MFV modes. We show our results at time t=0.4 for blast wave front similar to the MFM run.
Bx Bx 1.0
0.4
0.4
0.5
0.2 0.2
0.0 0.0
y
0.0
y
−0.2 −0.2
−0.5
−0.4 −0.4
−1.0
−0.4 −0.2 0.0 0.2 0.4 −0.4 −0.2 0.0 0.2 0.4
x x
4.0
0.2 0.2
3.5
2.5
−0.2 −0.2
2.0
1.5
−0.4 −0.4
1.0
−0.4 −0.2 0.0 0.2 0.4 −0.4 −0.2 0.0 0.2 0.4
x x
Fig. 4. Magnetic field loop advection performed in MFM mode. The top panels display the magnetic field intensity along the x direction multiplied
by 103 , whereas the bottom panels show the magnetic pressure Pmag = b2 /2 multiplied by 107 . Snapshots are taken at the initial time (left column)
and at time t = 24 (right column).
difficult test in both MFV and MFM mode, with and without the kernel (Wendland C4, Wendland 1995; Dehnen & Aly 2012)
Dedner divergence cleaning scheme.9 yields slightly smaller oscillations in amplitude but with more
We plot the MFM run results in Fig. 7. Our solution ex- diffusion. Finally, we show our result evolved with fixed parti-
hibits some oscillations in the direction aligned with initial mag- cle positions (as in a fixed grid setup); this last plot is compara-
netic field; their intensity is initially more relevant on the ve- ble with results from other grid-based codes (Mösta et al. 2014;
locity evolution but later affects the other quantities. This is Del Zanna et al. 2003).
the same numerical artifact discussed in Sec. 4.1.2 for the Bal- In Fig. 9, we plot the results evaluated along horizontal and
sara1 test, caused by the strong volume compression of parti- vertical slices. We can recognize an small drop in the magnetic
cles ahead of the shock front. Again, this effect can be atten- pressure in the MFV equal-volumes run in the direction aligned
uated employing lower-order reconstruction10 of the magnetic with the initial magnetic field. The MFM run slightly underes-
field or a larger kernel. In Fig. 8, we display the pressure distri- timates the velocity of the shock in the x-direction, yielding a
bution resulting from three additional runs. Our MFV run shows lower Lorentz factor. The configuration evolved using the Wend-
fewer oscillations outside the blast wave, due to the smaller vol- land C4 kernel seems to produce the best solution overall (more
ume gradient on the shock in the initial condition, but with a similar to the fixed grid case).
small background pressure enhancement. The equal-mass parti-
cle configuration evolved in the MFV mode and using a larger
4.1.6. Spherical blast wave
9
In the MFV case, the velocity of each particle is ‘smoothed’ with the
velocities of the interacting neighbors, assuming a contribution of 20% As a final special relativistic test, we perform the spherical blast
instead of the standard 30%. wave, an extension of the 2D cylindrical blast wave discussed
10
Note that the default slope limiters in gizmo have larger tolerance in Sec. 4.1.5, another very challenging problem for GRMHD
on the reconstruction compared to those commonly employed in other codes. We initialize the system as in Cipolletta et al. (2020), i.e.
codes. an inner region (r ≤ rin = 0.8) is filled with a fluid with den-
Article number, page 11
A&A proofs: manuscript no. main
ρ 10 P
0.4 0.4 3.5
8
3.0
0.2 0.2
6 2.5
0.0 0.0
y
y
2.0
4
1.0
1.3
−0.2 −0.2
1.2
0.5
1.1
−0.4 −0.4
0.0 1.0
−0.4 −0.2 0.0 0.2 0.4 −0.4 −0.2 0.0 0.2 0.4
x x
Fig. 5. The relativistic magnetic rotor problem at time t=0.4, performed in MFM mode. We plot 2D maps for the rest mass density (top-left), the
gas pressure (top-right), the magnetic pressure (bottom-left) and the Lorentz factor with magnetic field lines (bottom-right).
sity ρin = 10−2 and pressure Pin = 1. At r ≥ rext = 1, the 4.2. General relativistic magnetohydrodynamics
gas density is ρext = 10−4 and the pressure Pext = 3 × 10−5 .
A smooth transition links the two regions, as in the cylindrical In this section, we present two general relativistic MHD tests,
case. The magnetic field, aligned with the z-direction, is set to that allow us to determine the robustness of our scheme in non-
B = (0, 0, 0.1), and fills the whole domain. The adiabatic index Minkowskian background spacetimes.
is Γ = 4/3 everywhere. We initialize ∼ 1.8 × 106 equal-mass par-
ticles in a stretched closely packed lattice and we let the system 4.2.1. Magnetized TOV star
evolve until t = 4, with a Dedner damping parameter K = 0.75.
As a first test, we consider the evolution of a magne-
tized, non-rotating Tolman-Oppenheimer-Volkoff (TOV) star
(Oppenheimer & Volkoff 1939; Tolman 1939). With this prob-
lem, we can test the correct implementation
√ of the terms pro-
portional to the metric functions γ and α defined in the ADM
formalism. The initial magnetized setup is presented in many
Because of the intrinsically larger number of neighbors em- GRMHD codes (Duez et al. 2006; Liu et al. 2008; Mösta et al.
ployed in 3D, both the ‘cell’ volumes and the magnetic field di- 2014; Cipolletta et al. 2020) and represents a perturbation of
vergence error (Eq. 25) estimates improve in accuracy. Nonethe- the pure GRHD configuration, already tested in the relativistic
less, some spurious oscillation in the Lorentz factor ahead of the GIZMO paper (Lupi 2023); hence, we use the same initial con-
shock are still observed, affecting the density and pressure evo- figuration with ∼ 106 particles, adding a poloidal magnetic field
lution. Despite these artefacts, which we expect can be alleviated resulting from a purely toroidal vector potential Aϕ given by
by suitably tuning the kernel shape, extension, and the slope lim-
ited employed (as already discussed), the code is able to evolve Aϕ = Ab ω2 max(P − Pcut , 0)ξ , (41)
this challenging test without breaking and without significantly
where ω = x2 + y2 is the cylindrical radius. Here we employ
p
ruining the solution within the shock front. Moreover, we do not
observe any grid alignment effect or diagonal artifacts (usually ξ = 2, which ensure that the pressure’s derivative is continuous at
found in other GRMHD codes (Del Zanna et al. 2003)). all radii, Ab = 15, to have a maximum magnetic-to-gas pressure
Article number, page 12
Giacomo Fedrigo1,2 and Alessandro Lupi1,2,3 : GIZMO-GRMHD
Fig. 6. Magnetic rotor test 1D slices along y = 0.5 (left panels) and x = 0.5 (right panels) of (from top to bottom) rest mass density, gas pressure,
magnetic pressure, Lorentz factor and magnetic field divergence normalized to the magnetic field intensity, at time t = 0.4. We show results from
the MFM run (red triangles), MFV (orange circles) and from a fixed particle positions one (black squares) for reference.
parameter β−1 ∼ 8 × 10−4 , and Pcut = 0.04Pmax , that gives the with the exact solution and we do not recognize big differences
radius at which the magnetic field goes to zero, where Pmax is from the hydrodynamical case presented in Lupi (2023). At the
the maximum initial gas pressure (at the center of the star). We end of the MFV run the central density has lowered by ∼ 2%
ϕ
then project Aϕ on the Cartesian directions as Ai = ∂x A =
∂xi ϕ
from its initial value, while we witness a small increase in the
(−yAϕ /ω2 , xAϕ /ω2 , 0) and compute the magnetic field as Bi = MFM run.
√ √
γnµ εµi jk ∂ j Ak = γαεi jk ∂ j Ak , obtaining
To better understand the evolution of the system we plot the
xy
∂ P̃; central rest mass density and maximum magnetic field intensity
yzr r
√
evolution in Fig. 13. As mentioned above, in the MFV case,
B = γαAb r ∂r P̃;
i
(42)
the ρc evolution is comparable with the hydrodynamical case,
−( ω2 ∂r P̃ + 2P̃);
r exhibiting a slow decay over time; the magnetic field displays
a similar behavior: after an initial drop in the central region,
where we have defined P̃ ≡ max(P − Pcut , 0)ξ . We plot the result- the magnetic field intensity witnesses a slow decay, approaching
ing magnetic configuration (magnetic pressure distribution and ∼ 30% at the end of the run. As also studied in Cipolletta et al.
magnetic field lines) on the x − z plane in Fig. 11. This prescrip- (2020), this trend is related to the drop in the central rest mass
tion represents a small perturbation of the pure hydrodynamical density and stabilizes with increasing resolution. The initial part
equilibrium studied in Lupi (2023). of the MFM evolution can be compared with the corresponding
We evolve the TOV star using both MFM and MFV modes, pure hydrodynamics run. However, after ∼ 13 dynamical times,
with and without the Dedner cleaning scheme. We note that the magnetic field witnesses a topological rearrangement and an
our solution is stable even when employing the Powell clean- increase of its maximum intensity by a factor ∼ 1.6. When using
ing terms only, although we do not report the results here. In the MFM scheme to evolve an equilibrium configuration, setting
the fiducial case, that employs the complete divergence cleaning the frame velocity in the Riemann problems to cancel out the
scheme, we employ K = 0.1 and f = 2.5; since we are evolving mass fluxes introduces small perturbations in the fluid velocity.
an equilibrium configuration with low magnetization, the esti- In a pure GRHD scenario, this effect does not pose significant
mated signal velocities are very slow, hence the need to over- issues, as the quantities readjust correctly without notable con-
estimate the cleaning speed by a higher factor f . We note that sequences. In the GRMHD case, instead, these perturbations sig-
evolving the system using f = 1 does not corrupt the GRMHD nificantly affect the evolution of the magnetic fields, leading to
solution and only produce slightly higher ∂i Bi values. the aforementioned increase; as a consequence, the central rest
We let the runs evolve for√t ≃ 28tdyn , where we have defined mass density also increase by ∼ 2%, with a delay. In order to
the dynamical time tdyn ≡ 1/ ρc (as in the GRHD test, the cen- assess the long-term effect of this hitch, we let the system evolve
tral rest mass density of the TOV star is ρc ≈ 0.129285). In Fig. up to t ≈ 50tdyn . Despite the artificial rearrangement of the mag-
12 we show the radial rest mass density profile at three different netic field, the configuration does not appear to diverge; the TOV
snapshots, both for the MFV and MFM runs. Our results agree star remains stable and both the B maximum value and the cen-
Article number, page 13
A&A proofs: manuscript no. main
P W
10−1 4.5
4 4
3 4.0
3
10−2 2
2 3.5
1 1
3.0
10−3 0
y
0
y
2.5
−1 −1
−2 −2 2.0
10−4
−3 −3
1.5
−4 −4
10−5 1.0
−4 −2 0 2 4 −4 −2 0 2 4
x x
Bx 0.36
By
4 4
0.15
3 0.30 3
0.10
2 2
0.05
1 1
0.20
0 0 0.00
y
−1 −1
−0.05
−2 0.10 −2
−0.10
−3 −3
−0.15
−4 −4
0.00
−4 −2 0 2 4 −4 −2 0 2 4
x x
Fig. 7. The cylindrical blast wave problem at time t = 3, performed in MFM mode. We plot 2D maps for the rest mass density (top-left), the gas
pressure (top-right), the magnetic field x-component (bottom-left) and its y-component (bottom-right).
3 3 3
10−2 10−2 10−2
2 2 2
1 1 1
−1 −1 −1
−2 −2 −2
10−4 10−4 10−4
−3 −3 −3
−4 −4 −4
10−5 10−5 10−5
−4 −2 0 2 4 −4 −2 0 2 4 −4 −2 0 2 4
x x x
Fig. 8. Pressure distributions in the blast wave problem for three different run: (left) MFV mode, equal-volume particles, using a cubic spline as
kernel function; (center) MFV mode, equal-mass particles, using a Wendland C4 as kernel function; (right) fixed particle positions run.
tral density eventually (slowly) decay towards their initial value, resents the relativistic generalization of the Bondi accretion so-
albeit with a noisier spatial configuration. lution (Michel 1972; Hawley et al. 1984), with the addition of a
radial magnetic field given by
4.2.2. Magnetized Bondi accretion 2
B0 MBH
Br = , (43)
As a final test, we consider the magnetized spherical accretion r2
flow onto a non-spinning BH with mass MBH , as a GRMHD ex- where r is the coordinate radius and B0 is a free parameter that
tension of the test performed in Lupi (2023). The solution rep- controls the magnetic field strength. This spatial configuration
Article number, page 14
Giacomo Fedrigo1,2 and Alessandro Lupi1,2,3 : GIZMO-GRMHD
Fig. 9. Cylindrical blast wave test 1D slices along y = 0 (left panels) and x = 0 (right panels) of (from top to bottom) rest mass density, gas
pressure, magnetic pressure, Lorentz factor and magnetic field divergence in units of the magnetic field intensity, at time t = 3. We show results
from the MFM run (red triangles), MFV with initially equal volumes particles (orange circles), MFV with initially equal masses particles evolved
using the Wendland C4 kernel (cyan stars) and from a fixed-grid one (black squares) for reference.
P W
6 100 6 10
10−1 9
4 4
8
10−2
2 2 7
10−3
6
0
z
0
z
10−4 5
−2 −2 4
10−5
3
−4 10−6 −4
2
−7
−6 10 −6 1
−6 −4 −2 0 2 4 6 −6 −4 −2 0 2 4 6
x x
Fig. 10. Two dimensional slices at t = 4 and y = 0 of the spherical blast wave problem, evolved in MFM mode. We report the gas pressure in the
left panel and the Lorentz factor with the magnetic field lines distribution overlaid in the right panel.
of B does not alter the hydrodynamical solution and satisfies the where ζ ≡ (Γ − 1)ϵ and n ≡ 1/(Γ − 1). By assuming a critical
divergence-free constraint (11). radius rc , where
We recall that the steady-state solution can be written as r
(Liptai & Price 2019) MBH
uc ≡ ur (rc ) = ;
2rc
s
C1 u2c
u (r) = 2 n ;
r
vc ≡ v (rc ) =
r
;
r ζ (r) 1 − 3u2c
ρ(r) = K0 ζ n (r); nv2c
ϵ(r) = nζ(r), ζc ≡ ζ(rc ) = , (45)
(44) 1 + n(1 − v2c ) − n2 v2c
Article number, page 15
A&A proofs: manuscript no. main
1.0
Pmag
10−5 In our test problem, we set a = 0, hence r = R. Note that, in
B cutoff this coordinate system, the shift vector βi = gi0 differs from zero
Star radius
even for a non-spinning BH, allowing us to directly test the cor-
rect implementation of the shift vector-dependent terms in our
0.5 10−6 scheme.
For our initial condition, we consider a critical radius rc =
8M, a K0 value that gives ρ(rc ) = 1/16 and an adiabatic in-
dex Γ = 4/3. We perform runs with two different magnetic
0.0 10−7 field intensities B0 = (2.0, 6.25), yielding a magnetic-to-gas
z
Fig. 12. Radial profile of TOV equilibrium at t = 0, t ≈ 16tdyn and t ≈ 28tdyn for the MFM (purple circles) and the MFV (red triangles) run. The
black dashed line marks the exact solution. The MFM solution at time t ≈ 50tdyn is displayed as a lime dashed line.
1.01 confirm that the MFV mode is better at maintaining the magnetic
1.00 field topology intact, even though the code can preserve the star
0.99 hydrodynamical equilibrium in both modes. For the second test,
0.98
we implemented the horizon-penetrating Kerr-Schild coordinate
0.009
MFM system and, employing the energy-entropy switch, we achieved
MFV
0.008 an accurate steady-state solution.
log(Bmax)
Fig. 14. Rest-mass density ρ, coordinate velocity ṽr , specific internal energy ϵ and magnetic field Br radial profile of the magnetized Bondi
accretion test, performed both in the MFM (purple circles) and MFV (orange triangles) modes, at time t = 100M. We plot results of the run
performed with low (top row) and high magnetization (bottom row). In each panel, we display the exact solution with a dashed line.
Berger, M. J. & Colella, P. 1989, Journal of Computational Physics, 82, 64 Gammie, C. F., McKinney, J. C., & Tóth, G. 2003, The Astrophysical Journal,
Blakely, P., Nikiforakis, N., & Henshaw, W. 2015, Astronomy and Astrophysics, 589, 444
575, A103 Gardiner, T. A. & Stone, J. M. 2005, Journal of Computational Physics, 205, 509
Bogdanović, T., Miller, M. C., & Blecha, L. 2022, Living Reviews in Relativity, Garg, M., Franchini, A., Lupi, A., Bonetti, M., & Mayer, L. 2024, arXiv e-prints
25, 3 [arXiv:2410.17305]
Bollati, F., Lupi, A., Dotti, M., & Haardt, F. 2024, Astronomy and Astrophysics, Giacomazzo, B., Baker, J. G., Miller, M. C., Reynolds, C. S., & van Meter, J. R.
690, A194 2012, Astrophysical Journal, Letters, 752, L15
Brio, M. & Wu, C. C. 1988, Journal of Computational Physics, 75, 400 Giacomazzo, B. & Rezzolla, L. 2006, Journal of Fluid Mechanics, 562, 223
Cattorini, F. & Giacomazzo, B. 2024, Astroparticle Physics, 154, 102892 Giacomazzo, B. & Rezzolla, L. 2007, Classical and Quantum Gravity, 24, S235
Chang, P. & Etienne, Z. B. 2020, Monthly Notices of the RAS, 496, 206 Gingold, R. & Monaghan, J. 1977, Monthly Notices of the RAS, 181, 375
Cipolletta, F., Kalinani, J. V., Giacomazzo, B., & Ciolfi, R. 2020, Classical and Grudić, M. Y., Guszejnov, D., Hopkins, P. F., Offner, S. S. R., & Faucher-
Quantum Gravity, 37, 135010 Giguère, C. 2021, Monthly Notices of the RAS, 506, 2199
Combi, C. & Ressler, S. M. 2024, A binary black hole metric approximation Guszejnov, D., Grudić, M. Y., Hopkins, P. F., Offner, S. S. R., & Faucher-
from inspiral to merger Giguère, C. 2021, Monthly Notices of the RAS, 502, 3646
Combi, L., Armengol, F. G. L., Campanelli, M., et al. 2021, Physical Review D, Harten, A., Lax, P. D., & Leer, B. 1983, SIAM Review, 25, 35
104, 044041 Hawley, J., Smarr, L. L., & Wilson, J. 1984, Astrophysical Journal, 277, 296
Cullen, L. & Dehnen, W. 2010, Monthly Notices of the RAS, 408, 669 He, P. & Tang, H. 2012, Computers & Fluids, 60, 1
De Villiers, J. & Hawley, J. F. 2003, The Astrophysical Journal, 589, 458 Hopkins, P., Squire, J., Su, K., et al. 2024a, The Open Journal of Astrophysics, 7
Dedner, A., Kemm, F., Kröner, D., et al. 2002, Journal of Computational Physics, Hopkins, P. F. 2015, Monthly Notices of the RAS, 450, 53
175, 645 Hopkins, P. F. 2016, Monthly Notices of the RAS, 462, 576
Dehnen, W. & Aly, H. 2012, Monthly Notices of the RAS, 425, 1068 Hopkins, P. F. 2017, arXiv e-prints, arXiv:1712.01294
Del Zanna, L., Bucciantini, N., & Londrillo, P. 2003, Astronomy and Astro- Hopkins, P. F., Grudic, M. Y., Kremer, K., et al. 2024b, The Open Journal of
physics, 400, 397 Astrophysics, 7, 71
Del Zanna, L., Zanotti, O., Bucciantini, N., & Londrillo, P. 2007, Astronomy and Hopkins, P. F., Grudic, M. Y., Su, K., et al. 2024c, The Open Journal of Astro-
Astrophysics, 473, 11 physics, 7, 18
Duez, M. D., Liu, Y. T., Shapiro, S. L., Shibata, M., & Stephens, B. C. 2006, Hopkins, P. F. & Raives, M. J. 2016, Monthly Notices of the RAS, 455, 51
Physical Review Letters, 96, 031101 Hopkins, P. F., Squire, J., Quataert, E., et al. 2024d, The Open Journal of Astro-
Duez, M. D., Liu, Y. T., Shapiro, S. L., & Stephens, B. C. 2005, Physical Review physics, 7, 20
D, 72, 024028 Hopkins, P. F., Wetzel, A., Kereš, D., et al. 2018, Monthly Notices of the RAS,
Duffell, P. C. & MacFadyen, A. I. 2011, The Astrophysical Journal Supplement 480, 800
Series, 197, 15 Hopkins, P. F., Wetzel, A., Wheeler, C., et al. 2023, Monthly Notices of the RAS,
Etienne, Z. B., Paschalidis, V., Haas, R.and Mösta, P., & Shapiro, S. L. 2015, 519, 3154
Classical and Quantum Gravity, 32, 175009 Igumenshchev, I. V., Narayan, R., & Abramowicz, M. A. 2003, Astrophysical
Etienne, Z. B., Paschalidis, V., Liu, Y. T., & Shapiro, S. L. 2012, Physical Review Journal, 592, 1042
D, 85, 024013 Kaaz, N., Liska, M., Tchekhovskoy, A., Hopkins, P. F., & Jacquemin-Ide, J.
Evans, C. R. & Hawley, J. F. 1988, Astrophysical Journal, 332, 659 2024, arXiv e-prints, arXiv:2410.01877
Fambri, F., Dumbser, M., Köppel, S., Rezzolla, L., & Zanotti, O. 2018, Monthly Kerr, R. P. 1963, Phys. Rev. Lett., 11, 237
Notices of the RAS, 477, 4543 Kidder, L. E., Field, S. E., Foucart, F., et al. 2017, Journal of Computational
Fedrigo, G., Cattorini, F., Giacomazzo, B., & Colpi, M. 2024, Physical Review Physics, 335, 84–114
D, 109, 103024 Koide, S., Meier, D. L., Shibata, K., & Kudoh, T. 2000, The Astrophysical Jour-
Font, J. A. 2008, Living Reviews in Relativity, 11, 7 nal, 536, 668
Fragile, P. C., Nemergut, D., Shaw, P. L., & Anninos, P. 2019, Journal of Com- Koide, S., Shibata, K., & Kudoh, T. 1999, The Astrophysical Journal, 522, 727
putational Physics: X, 2, 100020 Koide, S., Shibata, K., Kudoh, T., & Meier, D. L. 2002, Science, 295, 1688
Franchini, A., Bonetti, M., Lupi, A., & Sesana, A. 2024, Astronomy and Astro- Komissarov, S. S. 1999, Monthly Notices of the RAS, 303, 343
physics, 686, A288 Lanson, N. & Vila, J. 2008a, SIAM Journal on Numerical Analysis, 46, 1912
Franchini, A., Lupi, A., & Sesana, A. 2022, The Astrophysical Journal Letters, Lanson, N. & Vila, J. 2008b, SIAM Journal on Numerical Analysis, 46, 1935
929, L13 Lecoanet, D., McCourt, M., Quataert, E., et al. 2016, Monthly Notices of the
Gaburov, E. & Nitadori, K. 2011, Monthly Notices of the RAS, 414, 129 RAS, 455, 4274
Liebling, S. L., Lehner, L., Neilsen, D., & Palenzuela, C. 2010, Physical Review
D, 81, 124023
Liptai, D. & Price, D. J. 2019, Monthly Notices of the RAS, 485, 819
Liska, M. T. P., Chatterjee, K., Issa, D., et al. 2022, The Astrophysical Journal
Supplement Series, 263, 26
Liu, Y. T., Shapiro, S. L., Etienne, Z. B., & Taniguchi, K. 2008, Physical Review
D, 78, 024012
Lucy, L. 1977, Astronomical Journal, 82, 1013
Lupi, A. 2023, Monthly Notices of the RAS, 519, 1115
Lupi, A., Bovino, S., & Grassi, T. 2021, Astronomy and Astrophysics, 654, L6
Lupi, A., Volonteri, M., & Silk, J. 2017, Monthly Notices of the RAS, 470, 1673
Mainetti, D., Lupi, A., Campana, S., et al. 2017, Astronomy and Astrophysics,
600, A124
Michel, F. C. 1972, Astrophysics and Space Science, 15, 153
Mignone, A. & Bodo, G. 2006, Monthly Notices of the RAS, 368, 1040
Mignone, A., Ugliano, M., & Bodo, G. 2009, Monthly Notices of the RAS, 393,
1141
Miyoshi, T. & Kusano, K. 2005, Journal of Computational Physics, 208, 315
Mizuno, Y. & Rezzolla, L. 2024, arXiv e-prints, arXiv:2404.13824
Mösta, P., Mundim, B. C., Faber, J. A., et al. 2014, Classical and Quantum Grav-
ity, 31, 015005
Narayan, R., Igumenshchev, I. V., & Abramowicz, M. A. 2003, Publications of
the Astronomical Society of Japan, 55, L69
Neilsen, D., Hirschmann, E. W., & Millward, R. S. 2006, Classical and Quantum
Gravity, 23, S505
Noble, S. C., Gammie, C. F., McKinney, J. C., & Del Zanna, L. 2006, Astrophys-
ical Journal, 641, 626
Oppenheimer, J. R. & Volkoff, G. M. 1939, Physical Review, 55, 374
Pakmor, R., Bauer, A., & Springel, V. 2011, Monthly Notices of the RAS, 418,
1392
Palenzuela, C., Lehner, L., & Liebling, S. L. 2010, Science, 329, 927
Penner, A. J. 2011, Monthly Notices of the RAS, 414, 1467
Powell, K. G., Roe, P. L., Linde, T. J., Gombosi, T. I., & De Zeeuw, D. L. 1999,
Journal of Computational Physics, 154, 284
Price, D. J. 2008, Journal of Computational Physics, 227, 10040
Price, D. J. 2012, Journal of Computational Physics, 231, 759
Read, J. & Hayfield, T. 2012, Monthly Notices of the RAS, 422, 3037
Springel, V. 2010, Monthly Notices of the RAS, 401, 791
Stone, J., Gardiner, T. A., Teuben, P., Hawley, J. F., & Simon, J. B. 2008, The
Astrophysical Journal Supplement Series, 178, 137
Stone, J. M. & Norman, M. L. 1992, Astrophysical Journal, Supplement, 80, 753
Tolman, R. C. 1939, Physical Review, 55, 364
Tricco, T. S., Price, D. J., & Bate, M. R. 2016, Journal of Computational Physics,
322, 326
Tu, X., Wang, Q., Zheng, H., & Gao, L. 2022, Journal of Computational Physics,
470, 111596
Tóth, G. & Odstrčil, D. 1996, Journal of Computational Physics, 128, 82
Valentini, M. 2024, Cosmological simulations with the Open GADGET 3 code
Visser, M. 2007, in Kerr Fest: Black Holes in Astrophysics, General Relativity
and Quantum Gravity
Wendland, H. 1995, Advances in Computational Mathematics, 4, 389–396
Wu, K. & Shu, C. 2020, SIAM Journal on Scientific Computing, 42, A2230
Fig. A.1. Radial profiles of the rest-mass density ρ, the radial coordinate
velocity ṽr , the specific internal energy ϵ, and the radial component of
the magnetic field Br of the magnetized Bondi accretion test, performed Fig. B.1. Evolution of the monopole test performed with the Powell
without the energy-entropy switch. We show the results obtained with scheme only. We plot a two-dimensional slice at z = 0 of the magnetic
the MFV (orange triangles) and MFM mode (purple circles), at time field divergence at the initial time and at three later times. Note the
t = 10M in the low-magnetization case. The exact solution is reported different color-map scale with respect to Fig. 1.
in each panel by a dashed black line.
Eq. (24) only. The initial setup is analogous to the one presented
Appendix A: Magnetized Bondi accretion without in the main text. We let the system evolve until t = 10 and we
energy-entropy switch plot the resulting ∂i Bi in Fig. B.1, at four different times. At
the beginning of the evolution, the Powell scheme is highly ef-
We report here the results for the magnetized Bondi accretion fective and quickly damps part of the monopole. After t = 5 it
evolved without the energy-entropy switch discussed in Sec. starts to slow down due to the less pronounced B gradients en-
3.2.3. The initial setup is identical to the one presented in Sec. tering Eq. (24). By the final time, the monopole is damped by
4.2.2. Here, we evolve the conserved total energy τ through the an order of magnitude and, as expected, we see no advection
usual conservation Eq. (7), instead of using the entropy conser- of the divergence over time. The small ∂i Bi diffusion along the
vation (23). In this case, we let the system evolve until t = 10M y-direction is a consequence of the induction and the moment
and we plot the results in Fig. A.1. Despite the earlier time, we density equations reacting to the presence of an initial non-zero
already observe a significant increase (1.5x) of the specific inter- magnetic field along the x-direction. The overall behavior of this
nal energy ϵ at the event horizon, in the MFV run. As mentioned solution was expected; in fact, while the Powell prescription can
in the main text, this effect is due to an incorrect retrieval of the in principle correct large magnetic field divergences over time, it
specific internal energy from the conserved energy, when deal- is better suited to remove the instantaneous formation of spuri-
ing with supersonic flows, strong gravitational fields and rela- ous errors emerging from the fluxes evaluation. The cleaning of
tively high magnetic field pressures b2 /2. Despite this hitch, the a strong monopole, such as the one in this test, is best handled
rest-mass density, the coordinate velocity, and the magnetic field by the Dedner hyperbolic cleaning.
remain consistent with the expected solution overall, but for a
small scatter around r = 10M. A subtle underestimation of the
radial velocity is found near the event horizon, which is a direct
consequence of the incorrect internal energy density estimation.
The MFM run yields good results overall, with only a larger scat-
ter in the internal energy and the magnetic field when compared
with Fig. (14).