General Relativity - PrincetonUniversity/athena-public-version GitHub Wiki
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 uΜβiβ=βjiΞΌuβΞΌ, and
- comoving passive scalar concentration Ο (one for each species).
In MHD there will also be the magnetic field components Bβiβ=β(β F)i0, where F is the electromagnetic field tensor. Note that these are not the projected variables β¬iβ=β-jβiΞΌnΞ½(β F)ΞΌΞ½β=βΞ±Bβi.
The following quantities are useful to define:
- projected field components bβΞΌβ=βuΞ½(β
F)Ξ½ΞΌ, in particular
- bβ0β=βgiΞΌBβiuβΞΌ,
- bβiβ=β(Bβiβ+βbβ0uβi)/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Οuβj)β=β0,
- β0β((-g)1/2Tβ0ΞΌ)β+ββj((-g)1/2TβjΞΌ)β=β(-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ΟΟuβj)β=β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 Bβi. 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 jβiΞΌAβΞΌ (normal frame).
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.
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.
GR in Athena++ only works with an adiabatic (gamma-law) equation of state.
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.
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.
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.
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β+βgijuΜβiuΜβj)1/2. If a value Ξ³β>βΞ³max is found, the velocity components uΜβ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/2Bβi)β=β0.