Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

General Relativity

Chris White edited this page Sep 18, 2019 · 9 revisions

Governing equations

Let gμν be the components of a stationary metric with time coordinate x 0, so ∂0gμν = 0. We can define the lapse α = (-g 00)-1/2. Then the unit future-pointing timelike normal to surfaces of constant x 0 has components nμ = -αδ0μ. Projection onto the spatial part of the tangent space can be accomplished with the components jμν = gμν + nμnν.

When working with general relativity, the primitive variables in Athena++ are taken to be

  • comoving rest mass density ρ,
  • gas pressure pgas,
  • spatial components of the projected 4-velocity i = jiμuμ, and
  • comoving passive scalar concentration χ (one for each species).

In MHD there will also be the magnetic field components Bi = (★F)i0, where F is the electromagnetic field tensor. Note that these are not the projected variables ℬi = -jiμnν(★F)μν = αBi.

The following quantities are useful to define:

  • projected field components bμ = uν(★F)νμ, in particular
    • b 0 = giμBiuμ,
    • bi = (Bi + b 0ui)/u 0;
  • magnetic pressure pmag = bμbμ/2;
  • total pressure ptot = pgas + pmag;
  • adiabatic index Γ;
  • gas enthalpy wgas = ρ + Γ/(Γ−1) × pgas;
  • magnetic enthalpy wmag = 2pmag;
  • total enthalpy wtot = wgas + wmag;
  • stress-energy components Tμν = wtotuμuν + ptotgμν − bμbν;
  • metric determinant g;
  • connection coefficients Γσμν = 1/2 × gσλ(∂μgνλ + ∂νgμλ − ∂λgμν).

The evolution equations are

  • 0 ((-g)1/2ρu 0) + ∂j ((-g)1/2ρuj) = 0,
  • 0 ((-g)1/2T 0μ) + ∂j((-g)1/2Tjμ) = (-g)1/2TνσΓσμν,
  • 0 ((-g)1/2(★F)i0) + ∂j ((-g)1/2(★F)ij) = 0, and
  • 0 ((-g)1/2χρu 0) + ∂j ((-g)1/2χρuj) = 0 (one equation for each species).

Athena++ considers the conserved variables to be

  • conserved density D = ρu 0,
  • energy density E = T 00,
  • momentum density Mi = T 0i, and
  • conserved species density S = χρu 0 (one for each species),

as well as the magnetic fields Bi. In particular, the factors of (-g)1/2 are not included in the output data, nor should they be included when setting conserved variables in problem generators. Also, these are coordinate-frame quantities, not quantities in the normal frame often seen in 3+1 decompositions. This is the difference between components Aμ (coordinate frame) and -nμAμ and jiμAμ (normal frame).

Considerations for GR in Athena++

To enable GR, add the -g flag when configuring. The -s flag should not be used, as this is reserved for SR without GR. There are several important choices one must make, detailed here.

Coordinates (--coord option)

Coordinate systems for GR are entirely distinct from those used in SR or Newtonian simulations. In particular, cartesian, cylindrical, and spherical_polar coordinates do not function in GR. Instead choices include:

  • minkowski (t,x,y,z): ds 2 = -dt 2 + dx 2 + dy 2 + dz 2;
  • schwarzschild (t,r,θ,ϕ): ds 2 = -(1−2M/r)dt 2 + (1−2M/r)-1dr 2 + r 2dθ 2 + r 2sin2(θ)dϕ 2;
  • kerr-schild (t,r,θ,ϕ): ds 2 = gμνdxμdxν, with:
    • Σ = r 2 + a 2cos2(θ),
    • g00 = -(1−2Mr/Σ),
    • g01 = 2Mr/Σ,
    • g03 = -(2Mar/Σ)sin2(θ),
    • g11 = 1 + 2Mr/Σ,
    • g13 = -(1 + 2Mr/Σ)a sin2(θ),
    • g22 = Σ,
    • g33 = (r 2 + a 2 + (2Ma 2r/Σ)sin2(θ))sin2(θ),
    • g02 = g12 = g23 = 0;
  • gr_user: user-defined coordinates.

Kerr-Schild coordinates are a standard choice for black holes, since they are horizon penetrating.

Note that all primitive and conserved variables are in the coordinate basis. The natural basis vectors are not normalized, even in cases where it would be easy to do so such as Schwarzschild.

Equation of state (--eos option)

GR in Athena++ only works with an adiabatic (gamma-law) equation of state.

Riemann solver (--flux option)

In order of decreasing numerical diffusion, the Riemann solvers compatible with GR are llf (local Lax-Friedrichs), hlle, hllc, and hlld. HLLC only works for hydrodynamics, and HLLD only works for MHD. In addition, HLLC and HLLD can only work using frame transformations at interfaces to use SR-compatible algorithms (see the Athena++ GRMHD method paper), and thus they require the -t option. Frame transformations can be either on or off when using LLF or HLLE.

At the polar axis coordinate singularity in Schwarzschild and Kerr-Schild coordinates, frame transformations become singular. The Riemann solver will use the appropriate non-transforming method (LLF in that case, HLLE in all other cases) at those interfaces automatically.

Mesh refinement

Athena++'s mesh refinement, both static and adaptive, is designed to be fully compatible with GR. Note however that GR simulations often involve spherical coordinate systems, and polar boundaries require careful consideration.

Timestep size

The size of a timestep is set by the shortest light crossing time in the grid. It does not change even if the sound (hydrodynamics) or fast magnetosonic (MHD) speeds are considerably slower than unity (i.e. the speed of light). The x 1-width of cells is defined to be ∫(g11)1/2dx 1 along the line of constant x 2 and x 3 from one face to the other passing through the cell center. The x 2- and x 3-widths are defined likewise. In coordinate systems where the integral has no simple antiderivative, lower bounds are used instead. Also, in complex coordinate systems the cell center may be defined as the arithmetic mean of the face coordinates rather than the halfway point in volume.

Floors and ceilings on variables

As with SR, the complexity of the equations of GR can prove troublesome for robustness. There are a number of ways in which a simulation can produce problematic values, often manifesting in recovering negative densities, negative pressures, or superluminal velocities in the conserved-to-primitive variable inversion.

In order to help robustness, various limits are available in the <hydro> section of the input file, described below:

Name Default Value Description
dfloor ≈10-35 ρfloor = max(dfloor, rho_min × (x 1)rho_pow)
rho_min dfloor
rho_pow 0
pfloor ≈10-35 pgas,floor = max(pfloor, pgas_min × (x 1)pgas_pow)
pgas_min pfloor
pgas_pow 0
sfloor ≈10-35 floor on χ
gamma_max 1000 ceiling on γ
sigma_max 0 ceiling on 2pmag/ρ; only used if positive
beta_min 0 floor on pgas/pmag; only used if positive

The power-law scalings of ρfloor and pgas,floor are meant to be used in spherical-like coordinates, where x 1 is the radial coordinate. These scaling components of the floors are ignored if the exponents are 0.

The Lorentz factor is in the normal frame: γ = -nμuμ = αu 0 = (1 + gijij)1/2. If a value γ > γmax is found, the velocity components i are each multiplied by ((γmax2−1)/(γ 2−1))1/2 to make γ = γmax.

For the limits on plasma σ and β, ρ and pgas are adjusted and the magnetic field is left alone in order to preserve ∂i ((-g)1/2Bi) = 0.

Clone this wiki locally