NRPy+'s original purpose was to be an easy-to-use code capable of generating Einstein's equations in a broad class of singular, curvilinear coordinate systems, where the user need only input the scale factors of the underlying reference metric. Upon generating these equations, NRPy+ would then leverage SymPy's common-expression-elimination (CSE) and C code generation routines, coupled to its own single-instruction, multiple-data (SIMD) functions, to generate highly-optimized C code.
As is standard in NRPy+,
As a corollary, any expressions involving mixed Greek and Latin indices will need to offset one set of indices by one: A Latin index in a four-vector will be incremented and a Greek index in a three-vector will be decremented (however, the latter case does not occur in this tutorial notebook).
This module lays out the mathematical foundation for the BSSN formulation of Einstein's equations, as detailed in the references in the above Background Reading/Lectures section. It is meant to provide an overview of the basic equations and point of reference for full tutorial notebooks linked below:
The covariant "Lagrangian" BSSN formulation of Brown (2009), which requires
∂tˉγ=0,results in the BSSN equations taking the following form (Eqs. 11 and 12 in Ruchlin, Etienne, and Baumgarte (2018)):
∂⊥ˉγij=23ˉγij(αˉAkk−ˉDkβk)−2αˉAij,∂⊥ˉAij=−23ˉAijˉDkβk−2αˉAikˉAkj+αˉAijK+e−4ϕ{−2αˉDiˉDjϕ+4αˉDiϕˉDjϕ+4ˉD(iαˉDj)ϕ−ˉDiˉDjα+αˉRij}TF,∂⊥ϕ=16(ˉDkβk−αK),∂⊥K=13αK2+αˉAijˉAij−e−4ϕ(ˉDiˉDiα+2ˉDiαˉDiϕ),∂⊥ˉΛi=ˉγjkˆDjˆDkβi+23ΔiˉDjβj+13ˉDiˉDjβj−2ˉAij(∂jα−6∂jϕ)+2ˉAjkΔijk−43αˉγij∂jKwhere
* The related quantity $\Delta^i$ is defined $\Delta^i \equiv \bar{\gamma}^{jk} \Delta^i_{jk}$.
where K is the trace of the extrinsic curvature Kij.
Regarding the numerical implementation of the above equations, first notice the left-hand sides of the equations include the time derivatives. Numerically, these equations are solved using as an initial value problem, where data are specified at a given time t, so that the solution at any later time can be obtained using the Method of Lines (MoL). MoL requires that the equations be written in the form:
∂t→U=→f(→U,∂i→U,∂i∂j→U,...),for the vector of "evolved quantities" →U, where the right-hand side vector →f does not contain explicit time derivatives of →U.
Thus we must first rewrite the above equations so that only partial derivatives of time appear on the left-hand sides of the equations, meaning that the Lie derivative terms must be moved to the right-hand sides of the equations.
In this Step, we provide explicit expressions for the Lie derivatives Lβ appearing inside the ∂⊥=∂t−Lβ operators for {ˉγij,ˉAij,W,K,ˉΛi}.
In short, the Lie derivative of tensor weight w is given by (from the wikipedia article on Lie derivatives) (LXT)a1…arb1…bs=Xc(∂cTa1…arb1…bs)−(∂cXa1)Tca2…arb1…bs−…−(∂cXar)Ta1…ar−1cb1…bs+(∂b1Xc)Ta1…arcb2…bs+…+(∂bsXc)Ta1…arb1…bs−1c+w(∂cXc)Ta1…arb1…bs
Thus to evaluate the Lie derivative, one must first know the tensor density weight w for each tensor. In this formulation of Einstein's equations, all evolved quantities have density weight w=0, so according to the definition of Lie derivative above, Lβˉγij=βk∂kˉγij+∂iβkˉγkj+∂jβkˉγik,LβˉAij=βk∂kˉAij+∂iβkˉAkj+∂jβkˉAik,Lβϕ=βk∂kϕ,LβK=βk∂kK,LβˉΛi=βk∂kˉΛi−∂kβiˉΛk
With these definitions, the BSSN equations for the un-rescaled evolved variables in the form ∂t→U=f(→U,∂i→U,∂i∂j→U,...) become
∂tˉγij=[βk∂kˉγij+∂iβkˉγkj+∂jβkˉγik]+23ˉγij(αˉAkk−ˉDkβk)−2αˉAij,∂tˉAij=[βk∂kˉAij+∂iβkˉAkj+∂jβkˉAik]−23ˉAijˉDkβk−2αˉAikˉAkj+αˉAijK+e−4ϕ{−2αˉDiˉDjϕ+4αˉDiϕˉDjϕ+4ˉD(iαˉDj)ϕ−ˉDiˉDjα+αˉRij}TF,∂tϕ=[βk∂kϕ]+16(ˉDkβk−αK),∂tK=[βk∂kK]+13αK2+αˉAijˉAij−e−4ϕ(ˉDiˉDiα+2ˉDiαˉDiϕ),∂tˉΛi=[βk∂kˉΛi−∂kβiˉΛk]+ˉγjkˆDjˆDkβi+23ΔiˉDjβj+13ˉDiˉDjβj−2ˉAij(∂jα−6∂jϕ)+2αˉAjkΔijk−43αˉγij∂jKwhere the terms moved from the right-hand sides to the left-hand sides are enclosed in square braces.
Notice that the shift advection operator βk∂k{ˉγij,ˉAij,ϕ,K,ˉΛi,α,βi,Bi} appears on the right-hand side of every expression. As the shift determines how the spatial coordinates xi move on the next 3D slice of our 4D manifold, we find that representing ∂k in these shift advection terms via an upwinded finite difference stencil results in far lower numerical errors. This trick is implemented below in all shift advection terms.
As discussed in the NRPy+ tutorial notebook on BSSN quantities, tensorial expressions can diverge at coordinate singularities, so each tensor in the set of BSSN variables
{ˉγij,ˉAij,ϕ,K,ˉΛi,α,βi,Bi},is written in terms of the corresponding rescaled quantity in the set
{hij,aij,cf,K,λi,α,Vi,Bi},respectively, as defined in the BSSN quantities tutorial.
As described in the Background Reading/Lectures linked to above, the gauge quantities α and βi specify how coordinate time and spatial points adjust from one spatial hypersurface to the next, in our 3+1 decomposition of Einstein's equations.
As choosing α and βi is equivalent to choosing coordinates for where we sample our solution to Einstein's equations, we are completely free to choose α and βi on any given spatial hypersuface. It has been found that fixing α and βi to constant values in the context of dynamical spacetimes results in instabilities, so we generally need to define expressions for ∂tα and ∂tβi and couple these equations to the rest of the BSSN time-evolution equations.
Though we are free to choose the form of the right-hand sides of the gauge time evolution equations, very few have been found robust in the presence of (puncture) black holes.
The most commonly adopted gauge conditions for BSSN (i.e., time-evolution equations for the BSSN gauge quantities α and βi) are the
where ∂0 is the advection operator; i.e., ∂0Ai=∂tAi−βj∂jAi. Note that ∂0ˉΛi in the right-hand side of the ∂0Bi equation is computed by adding βj∂jˉΛi to the right-hand side expression given for ∂tˉΛi, so no explicit time dependence occurs in the right-hand sides of the BSSN evolution equations and the Method of Lines can be applied directly.
While it is incredibly robust in Cartesian coordinates, Brown pointed out that the above time-evolution equation for the shift is not covariant. In fact, we have found this non-covariant version to result in very poor results when solving Einstein's equations in spherical coordinates for a spinning black hole with spin axis pointed in the ˆx direction. Therefore we adopt Brown's covariant version as described in the full time-evolution equations for the BSSN gauge quantities α and βi tutorial notebook.
In a way analogous to Maxwell's equations, the BSSN decomposition of Einstein's equations are written as a set of time-evolution equations and a set of constraint equations. In this step we present the BSSN constraints
H=0Mi=0,where H=0 is the Hamiltonian constraint, and Mi=0 is the momentum constraint. When constructing our spacetime from the initial data, one spatial hypersurface at a time, to confirm that at a given time, the Hamiltonian and momentum constraint violations converge to zero as expected with increased numerical resolution.
The Hamiltonian constraint is written (Eq. 13 of Baumgarte et al.): H=23K2−ˉAijˉAij+e−4ϕ(ˉR−8ˉDiϕˉDiϕ−8ˉD2ϕ)
The momentum constraint is written (Eq. 47 of Ruchlin, Etienne, & Baumgarte):
Mi=e−4ϕ(1√ˉγˆDj(√ˉγˉAij)+6ˉAij∂jϕ−23ˉγij∂jK+ˉAjkΔΓijk+ˉAikΔΓjjk)Notice the momentum constraint as written in Baumgarte et al. is missing a term, as described in Ruchlin, Etienne, & Baumgarte.
Brown's covariant Lagrangian formulation of BSSN, which we adopt, requires that ∂tˉγ=0, where ˉγ=detˉγij. We generally choose to set ˉγ=ˆγ in our initial data.
Numerical errors will cause ˉγ to deviate from a constant in time. This actually disrupts the hyperbolicity of the PDEs (causing crashes), so to cure this, we adjust ˉγij at the end of each Runge-Kutta timestep, so that its determinant satisfies ˉγ=ˆγ at all times. We adopt the following, rather standard prescription (Eq. 53 of Ruchlin, Etienne, and Baumgarte (2018)):
ˉγij→(ˆγˉγ)1/3ˉγij.Notice the expression on the right is guaranteed to have determinant equal to ˆγ.
The following code cell converts this Jupyter notebook into a proper, clickable LATEX-formatted PDF file. After the cell is successfully run, the generated PDF may be found in the root NRPy+ tutorial directory, with filename Tutorial-BSSN_formulation.pdf (Note that clicking on this link may not work; you may need to open the PDF file through another means.)
import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface
cmd.output_Jupyter_notebook_to_LaTeXed_PDF("Tutorial-BSSN_formulation")
Created Tutorial-BSSN_formulation.tex, and compiled LaTeX file to PDF file Tutorial-BSSN_formulation.pdf