MUCUR GRMHD 2D Meridional Plane
An axisymmetric general-relativistic magnetohydrodynamics code for accretion flows and jets around rotating (Kerr) black holes. It evolves the full meridional plane (r, θ), from pole to pole, with all three components of velocity and magnetic field.
- Release v4o
- Fortran 90 · MPI · PARAMESH
- Kerr space-time, Boyer–Lindquist and Kerr–Schild
- 70 modified-gravity and alternative space-times
- Validated: Blandford–Znajek power, Michel inflow
What the code does
The code solves the equations of ideal GRMHD for a perfect fluid with an ideal-gas equation of state on a fixed, stationary, axisymmetric black-hole background. All quantities depend on (t, r, θ), with 0 ≤ θ ≤ π. Every velocity, momentum and magnetic-field component is evolved, so the gas can rotate and poloidal field can be wound into a toroidal component. Frame dragging creates toroidal field from poloidal field in exactly this way, so the Blandford–Znajek process works self-consistently in the code.
Integrated rates are totals through a sphere, so the results compare directly with 3D simulations and with analytic accretion formulae.
The release comes with five ready-to-run set-ups and five test problems with exact or published solutions to compare with.
Typical applications
- Bondi–Hoyle–Lyttleton accretion of a wind moving along the spin axis onto a Kerr black hole, with or without magnetic field
- Spherical (Bondi, Michel) accretion, with or without a radial field
- Feeding a spinning hole through an equatorial window with both poles open
- Magnetised black holes (split monopole), extraction of rotational energy by the Blandford–Znajek process, and jet formation
- Any axisymmetric initial state: tori, shells, clouds, custom magnetic fields
Physics and numerical method
| Component | Implementation |
|---|---|
| Equations | Ideal GRMHD in the Valencia 3+1 conservative formulation. Conserved variables D, Sj, τ, B̃k; geometric sources from the Christoffel symbols; the Sφ source is exactly zero, so angular momentum changes only through boundary fluxes. |
| Space-time | Kerr black hole in Boyer–Lindquist coordinates, or in horizon-penetrating ingoing Kerr–Schild coordinates with the inner boundary inside the horizon. The full θ dependence of the metric is evaluated at cell centres and on both kinds of faces. Any spin, prograde or retrograde. In addition, 70 alternative black-hole space-times from modified gravity and other theories, with the full θ dependence, in Boyer–Lindquist-type coordinates. |
| Equation of state | Ideal gas, p = (Γ − 1)ρε, with adjustable adiabatic index Γ |
| Reconstruction and fluxes | Minmod reconstruction of ρ, p, vi, Bi; HLLE Riemann solver with the fast-magnetosonic characteristic speeds |
| Divergence of B | Flux-constrained transport keeps ∇·B = 0 to round-off (relative ~10−14), including the cells on the polar axis |
| Time integration | Second-order Runge–Kutta with Strang-type splitting of the source terms; Courant time step |
| Primitive recovery | One-dimensional Newton–Raphson iteration safeguarded by bisection (Noble et al. type), with an entropy-based fallback where the energy equation has no physical root (highly magnetised cells) |
| Robustness | Density and magnetisation floors that add mass at rest in the normal-observer frame; a pressure floor, with a temperature floor set automatically from the injected gas, and an entropy floor; Lorentz-factor and temperature ceilings; optional magnetised atmosphere; optional limits for the cells inside the horizon (Kerr–Schild); a safety stop and full bookkeeping of what the floors add; a start-up check that the Kerr–Schild inner boundary lies outside the inner horizon |
| Initial states | Grid filled with the injected wind, a Fishbone–Moncrief torus, or your own state; magnetic field none, uniform vertical, split monopole, Wald field, or a torus field loop, with an optional toroidal part |
| Boundaries | Reflection at the polar axis θ = 0 and π (zero flux, zero EMF); outflow inner boundary; outer boundary with injection of a BHL wind, spherical inflow, or an equatorial feeding window, with zero-gradient outflow elsewhere; optional absorbing layer near rmax that removes outgoing waves without reflection |
| Grid and parallelism | PARAMESH blocks of 32 × 32 cells, uniform resolution, MPI parallel. Nθ = 256 and Nr = 256 × n (e.g. 512 × 256 up to 2048 × 256) |
| Run control | Checkpoint and restart, including a wall-clock limit for queue systems; all problem parameters in a single user header file |
Beyond Kerr: 70 modified-gravity and alternative space-times
The code is not limited to the Kerr metric. Besides Kerr, it evolves the flow in 70 further black-hole space-times from modified theories of gravity, quantum-corrected and regular black holes, nonlinear electrodynamics, and black holes surrounded by dark matter. With the same code, the same set-up and the same diagnostics, you can see directly how the theory of gravity changes accretion, outflows and jets.
- Schwarzschild
- Einstein–Gauss–Bonnet
- Proca–Gauss–Bonnet
- Hartle–Thorne
- Horndeski
- DHOST
- Hořava
- f(R, T)
- Bumblebee
- Kalb–Ramond
- Barrow
- Weyl
- Lee–Wick
- Disformal Kerr
- Konoplya–Zhidenko
- Johannsen–Psaltis
- Hairy Kerr
- Kerr–Sen
- Kerr–EMDA
- Kerr–Bertotti–Robinson
- Euler–Heisenberg
- ModMax
- Magnetic (confining NLED)
- Yang–Mills
- SU(N) sigma model
- Dyonic
- Freund–Nambu
- Yukawa
- Global monopole
- Hayward
- Dymnikova
- Ghosh–Kumar
- Generalised Ghosh
- Quantum-corrected
- Covariant quantum-corrected
- Quantum-improved Kerr in PFDM
- qOS
- Non-commutative
- Dunkl
- CBH
- Perfect-fluid dark matter (PFDM)
- Dark-matter halos
- … and more
How the metrics are implemented
- Every space-time has the full θ dependence of the metric, so the whole (r, θ) plane is evolved consistently, not just the equator.
- The metric derivatives come from the complex-step method, which is exact to round-off.
- Each metric was checked against the formulas in the literature, its derivatives against finite differences, its north–south symmetry, and its Kerr or Schwarzschild limit.
Good to know
- The alternative space-times use Boyer–Lindquist-type coordinates, so the grid lies outside the horizon. The code checks this at start-up.
- The parameters of each theory (couplings, charges, hair, dark-matter density and so on) are set in the user header file.
- A new space-time can be added from a template and is checked the same way. If the metric you need is not in the list, we can add it.
The computational domain
All set-ups share one grid: the full meridional half-plane rmin ≤ r ≤ rmax, 0 ≤ θ ≤ π, with uniform cells in r and θ. Both halves of the spin axis are reflection boundaries, so outflows along the axis in both directions are part of the solution.
In Boyer–Lindquist coordinates the inner boundary lies outside the horizon. In Kerr–Schild coordinates it lies inside the horizon, so the ergosphere and the horizon are both on the grid, the natural choice for jet launching. The code checks at start-up that this boundary stays outside the inner horizon.
At rmax gas is injected where the set-up feeds it: on the upstream hemisphere for a wind along the axis, at all angles for spherical inflow, or through a window around the equator. Elsewhere the boundary lets gas leave freely, and an absorbing layer inside rmax removes outgoing waves without reflection.
Ready-to-run set-ups
The code comes with five complete set-ups, plus the headers of every test problem. Each set-up is one user header file with all its initial and boundary values. To start a new problem, pick the closest set-up and change what you need.
| Set-up | Coordinates and grid | Magnetic field at t = 0 | Purpose |
|---|---|---|---|
| GRHD | Boyer–Lindquist, 2.3 ≤ r ≤ 100 M, 512 × 256 | None | Hydrodynamic Bondi–Hoyle–Lyttleton accretion along the spin axis; reference for the magnetised runs |
| GRMHD (default) | Boyer–Lindquist, 2.3 ≤ r ≤ 100 M, 512 × 256 | Uniform vertical field, β0 = 10, also carried by the wind | Magnetised BHL accretion; flux accumulating on the hole |
| GRMHD_BHfield | Boyer–Lindquist, 2.3 ≤ r ≤ 100 M, 512 × 256 | Split monopole on the hole (β = 1 at rmin); unmagnetised wind | Magnetised black hole in an unmagnetised wind |
| GRMHD_jet_KS | Kerr–Schild, 1.0 ≤ r ≤ 100 M, 1024 × 256 | Uniform vertical field, β0 = 10 | Jet launching by the Blandford–Znajek process, with the ergosphere and the horizon on the grid |
| GRMHD_jet_equatorial | Kerr–Schild, 1.0 ≤ r ≤ 100 M, 1024 × 256 | Uniform vertical field, β0 = 10; gas injected only in 3π/8 ≤ θ ≤ 5π/8 | Jets along both open poles, fed by gas that drags magnetic flux onto the hole |
The first four inject the same wind along the spin axis onto a Kerr hole with a = 0.9: v∞ = 0.2, cs,∞ = 0.1, ρ∞ = 1, Γ = 4/3 (Mach 2, accretion radius 40 M).
Beyond these, the code can start from a Fishbone–Moncrief torus with a poloidal field loop, a split monopole, the Wald field of a Kerr hole in a uniform field, or any axisymmetric state you write yourself: tori, shells, clouds, custom fields and perturbations.
Validation: five test problems
The compiled code is tested on five problems, each with an exact solution, a conserved quantity or published results to compare with. Every test has a ready header, a script that builds and runs it, pass criteria and an analysis script.
| Test | Runs | What it tests | Status |
|---|---|---|---|
| Blandford–Znajek power of a split monopole | V1–V3 | Rotating magnetosphere of a Kerr hole, extraction of rotational energy, magnetic terms in Kerr–Schild coordinates | Passed |
| Spherical accretion: Michel and Bondi flow | V4a–c, V5, V6 | Hydrodynamics and gravity against an exact solution, flow through the horizon, order of convergence | V4a passed; V4b, V4c, V5 running; V6 to be run |
| Bondi–Hoyle–Lyttleton accretion along the spin axis | B1–B4 | Shocks in curved space, dependence on Γ and spin, against published axisymmetric runs | To be run |
| Kerr black hole in a uniform magnetic field (Wald) | W1–W4 | Magnetic field around a Kerr hole: static field, horizon flux, Blandford–Znajek power | To be run |
| Magnetised Fishbone–Moncrief torus | FM1–FM4 | MRI-driven accretion: accretion rate, horizon flux, efficiency and spin-up against published 2D runs | To be run |
Blandford–Znajek power of a split monopole (V1–V3): passed
The standard test for jet physics around a spinning black hole is a split-monopole magnetic field on the hole, in a strongly magnetised plasma (σ = b²/ρ = 50). Frame dragging forces the field lines to rotate, and they carry an outgoing Poynting flux that must match the Blandford–Znajek formula:
We ran the test for three spins in Kerr–Schild coordinates, with the horizon and the ergosphere on the grid: V1 (a = 0.9) and V2 (a = 0.5) on 1024 × 256 cells, and V3 (a = 0.99) on 2048 × 256 cells with rmax = 100 M, to t = 80 M.
| Test | Spin a | ΩH | PEM / PBZ | ΩF / ΩH | North–south difference | max relative ∇·B |
|---|---|---|---|---|---|---|
| V2 | 0.5 | 0.134 | 0.93 | 0.49 | ≤ 0.7 % | 4 × 10−14 |
| V1 | 0.9 | 0.313 | 0.96 | 0.50 | ≤ 0.4 % | 5 × 10−14 |
| V3 | 0.99 | 0.434 | 0.99 | 0.48 | ≤ 0.1 % | 3 × 10−13 |
Power ratio measured just outside the horizon (r ≈ 1.1 r+) at t = 50 M; field-line rotation is the median over θ = 10°–80° at r = 3 M. Behind the outgoing front the power ratio is flat in radius to within a few per cent; V3 stays at 0.99 near the horizon at t = 70 M and reproduces an earlier run with rmax = 50 M. At a = 0.99 the measured power agrees with the formula above, including its high-spin correction, to within 1 %; the simple second-order formula ΩH²/6π overestimates it by 8 %.
Michel inflow onto a black hole (V4a): passed
Spherical accretion of an ideal gas (Γ = 4/3) onto a non-rotating black hole has an exact solution: the flow is subsonic far out, passes the sonic point (here at 8 M) and falls supersonically through the horizon. The exact state is injected at rmax = 100 M at all angles, and the code must relax to the solution, with the accretion rate Ṁ = 876.13 and the Bernoulli constant −hut = 1.17180 the same at every radius. The test checks the gravitational source terms, the radial fluxes through the horizon in Kerr–Schild coordinates, and the inner and outer boundaries against an answer known to all digits.
Run V4a: Kerr–Schild coordinates, a = 0, 1.4 ≤ r ≤ 100 M, 512 × 256 cells, to t = 3000 M (292 008 steps). The results below are averaged over t = 2000–3000 M.
In the subsonic region (r > 8 M) the code reproduces the Michel solution to a few 10−4, and Ṁ and the Bernoulli constant are flat to the same accuracy. The largest deviation, 0.4–0.7 % in ρ, p and Ṁ at r = 2.3–3 M next to the horizon, is the truncation error of this coarsest grid; the runs on 1024 × 256 and 2048 × 256 cells (V4b, V4c) will give the order of convergence. The flow stays spherical to |ρ/⟨ρ⟩θ − 1| ≤ 3.7 × 10−4 for r > 3 M, with north and south identical to round-off.
Checks of the scheme
- Before compilation, every new formula was checked against a line-by-line Python transcription of the scheme. The metric derivatives match finite differences to 2 × 10−10, and the 3+1 split and geometric sources are exact to round-off.
- Steady geodesic inflow onto a Kerr hole, in both coordinate systems and through the horizon, converges with resolution.
- Equatorial symmetry, the polar-axis boundary conditions and the corner ∇·B on the axis are preserved to round-off; no mass leaks through the axis.
- Every run is checked for relative ∇·B < 10−12, no failed inversions, and mass added by the floors below 1 % of the accretion rate.
What a run produces
- Accretion rates of mass, energy and angular momentum (Ṁ, Ė, L̇) through spheres at four radii, as functions of time
- Binary VTK snapshots with 50 quantities on the (R, z) half-plane, ready for VisIt and ParaView: densities, velocities, four-velocities, Lorentz factor, Mach numbers, Bernoulli parameter, fluxes, magnetic field, magnetisation, plasma β, the magnetic flux function ψ and more
- A time series of the magnetic flux on the hole and the MAD parameter φBH
- Floor statistics, so the effect of numerical floors can be checked
- Python tools for maps, radial profiles, time series and the Blandford–Znajek analysis
Physics extracted from the output
- Accretion rate, efficiency and angular-momentum transport
- Shock structure, sonic surfaces, bound and unbound gas
- Magnetic flux on the horizon and the magnetically arrested state
- Blandford–Znajek power and identification of the jet
All quantities are in geometrised units, G = c = M = 1, with lengths and times in M. The manual gives the conversion to physical units.
Working with the code: collaboration
The source code is not publicly distributed. The tests above show that the code works reliably in the (r, θ) plane around Kerr black holes. If you have an astrophysical problem that fits this framework, we are happy to solve it together as a collaboration.
- You
Describe the problem
The physical system, spin, initial state, magnetic field, how gas is fed, and the quantities you want to measure. - We
Check feasibility
We check that the problem is axisymmetric and fits the meridional-plane code, and agree on a plan. - We
Prepare the set-up
We write the user header file and the initial and boundary data for your problem. - You
Run the simulations
You run the code with the prepared set-up, following the user manual. - Together
Analyse and publish
We interpret the results together, and they go into a joint publication.
Contact
To discuss a collaboration, write to us with a short description of your problem.
E-mail: orhan.donmez71@gmail.com
Coming soon
Results and movies will be added to this page.
Methods the code builds on
- M. Abramowicz, M. Jaroszyński, M. Sikora, Relativistic, accreting disks, A&A 63, 221 (1978)
- L. Antón et al., Numerical 3+1 general relativistic magnetohydrodynamics: a local characteristic approach, ApJ 637, 296 (2006)
- R. D. Blandford, R. L. Znajek, Electromagnetic extraction of energy from Kerr black holes, MNRAS 179, 433 (1977)
- L. G. Fishbone, V. Moncrief, Relativistic fluid disks in orbit around Kerr black holes, ApJ 207, 962 (1976)
- J. A. Font, Numerical hydrodynamics and magnetohydrodynamics in general relativity, Living Rev. Relativ. 11, 7 (2008)
- C. F. Gammie, J. C. McKinney, G. Tóth, HARM: a numerical scheme for general relativistic magnetohydrodynamics, ApJ 589, 444 (2003)
- S. S. Komissarov, General relativistic magnetohydrodynamic simulations of monopole magnetospheres of black holes, MNRAS 350, 1431 (2004)
- J. C. McKinney, C. F. Gammie, A measurement of the electromagnetic luminosity of a Kerr black hole, ApJ 611, 977 (2004)
- F. C. Michel, Accretion of matter by condensed objects, Ap&SS 15, 153 (1972)
- P. Mösta et al., GRHydro: a new open-source general-relativistic magnetohydrodynamics code for the Einstein toolkit, Class. Quantum Grav. 31, 015005 (2014)
- S. C. Noble, C. F. Gammie, J. C. McKinney, L. Del Zanna, Primitive variable solvers for conservative general relativistic magnetohydrodynamics, ApJ 641, 626 (2006)
- A. J. Penner, General relativistic magnetohydrodynamic Bondi–Hoyle accretion, MNRAS 414, 1467 (2011)
- A. Tchekhovskoy, R. Narayan, J. C. McKinney, Black hole spin and the radio loud/quiet dichotomy of active galactic nuclei, ApJ 711, 50 (2010)
- A. Tchekhovskoy, R. Narayan, J. C. McKinney, Efficient generation of jets from magnetically arrested accretion on a rapidly spinning black hole, MNRAS 418, L79 (2011)
- G. Tóth, The ∇·B = 0 constraint in shock-capturing magnetohydrodynamics codes, J. Comput. Phys. 161, 605 (2000)
- R. M. Wald, Black hole in a uniform magnetic field, Phys. Rev. D 10, 1680 (1974)