-
Notifications
You must be signed in to change notification settings - Fork 117
General Relativity
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 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 + gijũ iũ j)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/2B i) = 0.
Getting Started
User Guide
- Configuring
- Compiling
- The Input File
- Problem Generators
- Boundary Conditions
- Coordinate Systems and Meshes
- Running the Code
- Outputs
- Using MPI and OpenMP
- Static Mesh Refinement
- Adaptive Mesh Refinement
- Load Balancing
- Special Relativity
- General Relativity
- Passive Scalars
- Shearing Box
- Diffusion Processes
- General Equation of State
- FFT
- High-Order Methods
- Super-Time-Stepping
- Orbital Advection
- Rotating System
- Reading Data from External Files
Programmer Guide