# The equations of general relativistic hydrodynamics (GRHD) in Gkeyll¶

For the purpose of supporting the (prototype) general relativistic hydrodynamics capabilities currently available within the Moment app, Gkeyll solves a particular hyperbolic conservation law form of the hydrodynamics equations in curved spacetime known colloquially as the \({3 + 1}\) “Valencia” formulation, due originally to [Banyuls1997], and based (as the name suggests) on the \({3 + 1}\) “ADM” formalism of [Arnowitt1959]. This technical note details exactly how Gkeyll performs and represents the \({3 + 1}\) decomposition of the general relativistic hydrodynamics equations, and hence introduces the specific form of the equations solved by the Moment app’s finite-volume numerical algorithms. Einstein summation convention (in which repeated tensor indices are implicitly summed over) is assumed throughout. The Greek indices \(\mu, \nu, \rho, \sigma\) range over the full spacetime coordinate directions \(\left\lbrace 0, \dots 3 \right\rbrace\), while the Latin indices \(i, j, k, l\) range over the spatial coordinate directions \(\left\lbrace 1, \dots 3 \right\rbrace\) only. The coordinate \(x^0 = t\) is assumed to be timelike, with the remaining coordinates \(\left\lbrace x^1, x^2, x^3 \right\rbrace\) being spacelike.

See also this note on the complete eigensystem for the GRHD equations (as implemented as part of Gkeyll’s stable time-step calculation), this note on Gkeyll’s handling of general black hole spacetimes and the Kerr-Schild coordinate system, and this note on Gkeyll’s “robustified” conservative to primitive variable reconstruction algorithm for both special and general relativity.

## The general \({3 + 1}\) split for the hydrodynamics equations¶

Assuming a smooth 4-dimensional Lorentzian manifold structure \(\left( \mathcal{M}, g \right)\) for spacetime, the law of conservation of energy-momentum can be expressed as the statement that the covariant divergence of the rank-2 stress-energy tensor \(T^{\mu \nu}\) vanishes identically:

On the other hand, the law of conservation of baryon number can be expressed as the statement that the covariant divergence of the rank-1 (rest) mass current vector \(J^{\mu}\) also vanishes identically:

The spacetime covariant derivative \({\nabla_{\mu}}\) can then be represented explicitly in terms of the coefficients \(\Gamma_{\mu \nu}^{\rho}\) of the Levi-Civita connection \(\nabla\) (i.e. the rank-3 Christoffel symbols), thus yielding:

and:

respectively, which are themselves represented in terms of partial derivatives of the rank-2 spacetime metric tensor \(g_{\mu \nu}\) as:

For the particular case of a perfect relativistic fluid in thermodynamic equilibrium (in the absence of heat conduction effects, and assuming vanishing fluid viscosity and shear stresses), the stress-energy tensor \(T^{\mu \nu}\) and (rest) mass current vector \(J^{\mu}\) take the forms:

and:

respectively, where \(\rho\) is the fluid (rest) mass density, \(P\) is the hydrostatic pressure of the fluid, \(u^{\mu}\) is its 4-velocity, and \(h\) is its specific relativistic enthalpy:

with \(\varepsilon \left( \rho, P \right)\) designating the specific internal energy of the fluid, which is determined by the equation of state. Once specified, the local fluid sound speed \(c_s\) may then be calculated as:

We can now decompose our 4-dimensional spacetime \(\left( \mathcal{M}, g \right)\) into a time-ordered sequence of 3-dimensional spacelike (Riemannian) hypersurfaces, each with an induced/spatial metric tensor \(\gamma_{i j}\). For this purpose, we employ the particular form of the ADM decomposition due to [York1979], in which the coordinate \(x^0 = t\) is assumed to correspond to a distinguished time direction. The overall spacetime line element/first fundamental form \(d s^2\) (in terms of \(g_{\mu \nu}\)):

thus decomposes into (in terms of \(\gamma_{i j}\)):

The scalar field \(\alpha\) and 3-dimensional vector field \(\beta^i\)
constitute the Lagrange multipliers of the ADM formalism, and are known as the *lapse
function* and *shift vector*, respectively. The lapse function \(\alpha\) is a gauge
variable determining the proper time distance \(d \tau\) between corresponding points
on neighboring spacelike hypersurfaces in the decomposition (labeled by coordinate time
values \(t = t_0\) and \(t = t_0 + dt\)):

as measured in the normal direction \(\mathbf{n}\) to the \(t = t_0\) hypersurface. On the other hand, the shift vector \(\beta^i\) is a gauge variable determining the relabeling of the spatial coordinate basis \(x^i \left( t_0 \right)\) as one moves from the \(t = t_0\) hypersurface to the \(t = t_0 + dt\) hypersurface:

The timelike unit vector \(\mathbf{n}\) that is normal to each spacelike hypersurface may be calculated as the spacetime contravariant derivative \({}^{\left( 4 \right)} \nabla^{\mu}\) of the distinguished time coordinate \(t\):

where the bracketed \(\left( 4 \right)\) is used to distinguish the full spacetime covariant derivative \({}^{\left( 4 \right)} \nabla_{\mu}\) from the purely spatial covariant derivative \({}^{\left( 3 \right)} \nabla_i\). If the components of the spatial metric tensor \(\gamma_{i j}\) represent the dynamical variables of the ADM formalism (regarded here, following [Alcubierre2008], as a Hamiltonian formulation of general relativity), then the components of the extrinsic curvature tensor/second fundamental form \(K_{i j}\) represent the corresponding conjugate momenta, calculated in terms of the Lie derivative \(\mathcal{L}\) of the spatial metric tensor \(\gamma_{i j}\) in the direction of the normal vector \(\mathbf{n}\):

which we can expand out to yield, explicitly:

where we have, as before, represented the spatial covariant derivative \({}^{\left( 3 \right)} \nabla_i\) in terms of the coefficients \({}^{\left( 3 \right)} \Gamma_{i j}^{k}\) of the spatial Levi-Civita connection:

The energy density \(E\), momentum density (in covector form) \(p_i\), and Cauchy stress tensor \(S_{i j}\), perceived by an observer moving in the direction \(\mathbf{n}\) normal to the spacelike hypersurfaces can then be calculated by evaluating the following componentwise projections of the full (spacetime) stress-energy tensor \(T^{\mu \nu}\):

and:

respectively, where the \(\bot_{i}^{\mu}\) denote the components of the orthogonal projector (i.e. the projection operator in the normal direction \(\mathbf{n}\)):

By projecting the continuity equations for the full stress-energy tensor \(T^{\mu \nu}\):

in the purely timelike direction (and expanding out the resulting Lie derivative term \(\mathcal{L}_{\boldsymbol\beta} E\)), we obtain the following energy conservation equation:

On the other hand, by projecting in the 3 purely spacelike directions (and expanding out the resulting Lie derivative terms \(\mathcal{L}_{\boldsymbol\beta} p_i\)), we obtain instead the following momentum conservation equations:

In the above, \(K\) denotes the trace of the extrinsic curvature tensor \(K_{i j}\):

Note moreover that, in all of the above, the indices of the spacetime quantities \(T^{\mu \nu}\) and \(n^{\mu}\) are raised and lowered using the spacetime metric tensor \(g_{\mu \nu}\), while the purely spatial quantities \(\beta^i\), \(K_{i j}\), \(p^i\), and \(S_{i j}\), are raised and lowered using the spatial metric tensor \(\gamma_{i j}\). For any spacetime \(\left( \mathcal{M}, g \right)\) satisfying the Einstein field equations:

with cosmological constant \(\Lambda\), the satisfaction of the energy and momentum conservation equations described above is algebraically equivalent to the satisfaction of the ADM Hamiltonian:

and momentum:

constraint equations. These constraint equations are obtained from the timelike and spacelike projections of the constracted Bianchi identities:

respectively.

## The \({3 + 1}\) “Valencia” formulation¶

The \({3 + 1}\) “Valencia” formulation of [Banyuls1997] is now derived by considering the specific case of the ADM energy and momentum conservation equations for a perfect relativistic fluid, and expressing the resulting equations in terms of the spatial fluid velocity \(\mathbf{v}\) (i.e. the fluid velocity perceived by an observer moving in the direction \(\mathbf{n}\) normal to the spacelike hypersurfaces):

where \(\alpha u^0\) represents the Lorentz factor of the fluid:

The resulting system of equations constitutes a purely hyperbolic, conservation law form of the general relativistic hydrodynamics equations, whose primitive variables are the fluid (rest) mass density \(\rho\), the (spatial) fluid velocity components perceived by normal observers \(v^i\), and the fluid pressure \(P\). The ADM energy conservation equation (obtained from the timelike projection of the stress-energy continuity equations) now becomes:

The ADM momentum conservation equations (obtained from the 3 spacelike projections of the stress-energy continuity equations) now become:

Here, and henceforth, \(g\) and \(\gamma\) denote the determinants of the spacetime and spatial metric tensors respectively:

and:

Finally, the baryon number continuity equation:

becomes, within this formulation:

The conserved quantity appearing in the baryon number conservation equation represents the (rest) mass density \(D\) of the fluid, as measured by an observer moving in the normal direction \(\mathbf{n}\):

The conserved quantity appearing in the energy conservation equation represents the difference between the energy density \(E\) of the fluid, as measured by a normal observer, and the (rest) mass density \(D\) of the fluid, as measured by the same observer:

Finally, the conserved quantities appearing in the momentum conservation equations are the components of the momentum density \(p_k\) (represented in covector form), as measured by a normal observer:

Since the source terms appearing on the right-hand-sides of the energy and momentum conservation equations do not contain any derivatives of the primitive variables \(\rho\), \(v^i\) and \(P\), it follows that the hyperbolic nature of the equations is strongly preserved. Note that the indices of the spatial fluid velocity \(v^i\) are raised and lowered using the spatial metric tensor \(\gamma_{i j}\), as expected.

## Gkeyll-specific modifications¶

In order to avoid any explicit dependence of the equations upon the overall spacetime metric tensor \(g_{\mu \nu}\), its partial derivatives, or its corresponding Christoffel symbols \({}^{\left( 4 \right)} \Gamma_{\mu \nu}^{\rho}\) (since, in a fully dynamic spacetime context, these quantities may not be known a priori), we make a number of modifications within the Gkeyll code to the standard \({3 + 1}\) Valencia formulation, thus ensuring that the only metric quantities appearing in the equations are instead the spatial metric tensor \(\gamma_{i j}\), the extrinsic curvature tensor \(K_{i j}\), and the ADM gauge variables \(\alpha\) and \(\beta^i\), all of which, along with the primitive variables of the fluid (i.e. \(\rho\), \(v^i\) and \(P\)), we are guaranteed to know at every time-step. Eliminating the dependence upon the determinant of the spacetime metric tensor \(g\) is straightforward by the geometry of the ADM decomposition:

For the elimination of spacetime metric-dependent quantities from the source terms on the right-hand-sides of the energy and momentum conservation equations, we follow the approach taken by the Whisky code of [Baiotti2003], in which it is noted that, for any spacetime metric \(g_{\mu \nu}\) satisfying the ADM constraint equations, one necessarily has the following decompositions:

for the energy source terms, and:

for the momentum source terms.

## The full (modified) GRHD system¶

Combining all of the modifications described above, the full system of general relativistic hydrodynamics equations solved by the Gkeyll moment app consists of the energy conservation equation:

the momentum conservation equations:

and the baryon number conservation equation:

## References¶

F. Banyuls, J. A. Font, J. M. Ibáñez, J. M. Martí and
J. A. Miralles, “Numerical {3 + 1} General Relativistic Hydrodynamics:
A Local Characteristic Approach”, *The Astrophysical Journal* **476**
(1): 221-231, 1997.

R. L. Arnowitt, S. Deser and C. W. Misner, “Dynamical
Structure and Definition of Energy in General Relativity”, *Physical
Review* **116** (5): 1322-1330. 1959.

J. W. York, Jr., “Kinematics and Dynamics of General
Relativity”, *Sources of Gravitational Radiation*: 83-126. 1979.

M. Alcubierre, *Introduction to 3 + 1 Numerical
Relativity*, Oxford University Press. 2008.

L. Baiotti, I. Hawke, P. J. Montero and L. Rezzolla, “A
new three-dimensional general-relativistic hydrodynamics code”, *Memorie
della Societa Astronomica Italiana Supplement* **1**: 210-210. 2003.