Notebook Status: Validated
Validation Notes: This module has been validated to exhibit convergence to zero of the Hamiltonian and momentum constraint violation at the expected order to the exact solution (see plots at bottom of the exact initial data validation start-to-finish tutorial notebook; momentum constraint violation in non-ϕ directions is zero), and all quantities have been validated against the original SENR code.
UIUC black holes have the advantage of finite coordinate radius in the maximal spin limit. It is therefore excellent for studying very highly spinning black holes. This module sets the UIUC black hole at the origin.
BSSN.UIUCBlackHole
NRPy+ moduleFirst, we will import the core modules of Python/NRPy+ and specify the main gridfunctions that we will need. Second, we set some basic NRPy+ parameters. E.g., set the spatial dimension parameter to 3.
Inputs for initial data:
Additional variables needed for spacetime evolution:
# Step P0: Load needed modules
import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends
import NRPy_param_funcs as par # NRPy+: Parameter interface
import indexedexp as ixp # NRPy+: Symbolic indexed expression (e.g., tensors, vectors, etc.) support
# All gridfunctions will be written in terms of spherical coordinates (r, th, ph):
r,th,ph = sp.symbols('r th ph', real=True)
thismodule = "UIUCBlackHole"
# Step 0: Set spatial dimension (must be 3 for BSSN)
DIM = 3
par.set_parval_from_str("grid::DIM",DIM)
# Step 1: Set psi, the conformal factor:
# The UIUC initial data represent a Kerr black hole with mass M
# and dimensionless spin chi in UIUC quasi-isotropic coordinates,
# see https://arxiv.org/abs/1001.4077
# Input parameters:
M,chi = par.Cparameters("REAL", thismodule, ["M","chi"],[1.0,0.99])
# Spin per unit mass
a = M*chi
Boyer-Lindquist radii of the outer (+) and inner (−) horizons of the BH, defined under equation 1 in Liu, Etienne, & Shapiro (2009) as r±=M±√M2−a2
# Defined under equation 1 in Liu, Etienne, & Shapiro (2009)
# https://arxiv.org/pdf/1001.4077.pdf
# Boyer - Lindquist outer horizon
rp = M + sp.sqrt(M**2 - a**2)
# Boyer - Lindquist inner horizon
rm = M - sp.sqrt(M**2 - a**2)
Define rBL, equation 11 of Liu, Etienne, & Shapiro (2009), using the radial coordinate r:
rBL=r(1+r+4r)2.# Boyer - Lindquist radius in terms of UIUC radius
# Eq. 11
# r_{BL} = r * ( 1 + r_+ / 4r )^2
rBL = r*(1 + rp / (4*r))**2
Quantities used to calculate the spatial metric γij, found under equation 2 of Liu, Etienne, & Shapiro (2009): Σ=r2BL+a2cos2θ,
# Expressions found below Eq. 2
# Sigma = r_{BL}^2 + a^2 cos^2 theta
SIG = rBL**2 + a**2*sp.cos(th)**2
# Delta = r_{BL}^2 - 2Mr_{BL} + a^2
DEL = rBL**2 - 2*M*rBL + a**2
# A = (r_{BL}^2 + a^2)^2 - Delta a^2 sin^2 theta
AA = (rBL**2 + a**2)**2 - DEL*a**2*sp.sin(th)**2
The line element, defined in equation 13 of Liu, Etienne, & Shapiro (2009):
ds2=Σ(r+r+4)2r3(rBL−r−)dr2+Σdθ2+Asin2θΣdϕ2# *** The ADM 3-metric in spherical basis ***
gammaDD = ixp.zerorank2()
# Declare the nonzero components of the 3-metric (Eq. 13):
# ds^2 = Sigma (r + r_+/4)^2 / ( r^3 (r_{BL} - r_- ) * dr^2 +
# Sigma d theta^2 + (A sin^2 theta) / Sigma * d\phi^2
gammaDD[0][0] = ((SIG*(r + rp/4)**2)/(r**3*(rBL - rm)))
gammaDD[1][1] = SIG
gammaDD[2][2] = AA/SIG*sp.sin(th)**2
Nonzero components of the extrinsic curvature, equation 14 of Liu, Etienne, & Shapiro (2009):
Krϕ=Kϕr=Masin2θΣ√AΣ [3r4BL+2a2r2BL−a4−a2(r2BL−a2)sin2θ] (1+r+4r)1√r(rBL−r−)# *** The physical trace-free extrinsic curvature in spherical basis ***
# Nonzero components of the extrinsic curvature K, given by
# Eq. 14 of Liu, Etienne, & Shapiro, https://arxiv.org/pdf/1001.4077.pdf:
KDD = ixp.zerorank2() # K_{ij} = 0 for these initial data
# K_{r phi} = K_{phi r} = (Ma sin^2 theta) / (Sigma sqrt{A Sigma}) *
# [3r^4_{BL} + 2a^2 r^2_{BL} - a^4 - a^2 (r^2_{BL} - a^2) sin^2 theta] *
# (1 + r_+ / 4r) (1 / sqrt{r(r_{BL} - r_-)})
KDD[0][2] = KDD[2][0] = (M*a*sp.sin(th)**2)/(SIG*sp.sqrt(AA*SIG))*\
(3*rBL**4 + 2*a**2*rBL**2 - a**4- a**2*(rBL**2 - a**2)*\
sp.sin(th)**2)*(1 + rp/(4*r))*1/sp.sqrt(r*(rBL - rm))
Nonzero components of the extrinsic curvature, equation 15 of Liu, Etienne, & Shapiro (2009):
Kθϕ=Kϕθ=−2a3MrBLcosθsin3θΣ√AΣ(r−r+4)√rBL−r−r# Components of the extrinsic curvature K, given by
# Eq. 15 of Liu, Etienne, & Shapiro, https://arxiv.org/pdf/1001.4077.pdf:
# K_{theta phi} = K_{phi theta} = -(2a^3 Mr_{BL} cos theta sin^3 theta) /
# (Sigma sqrt{A Sigma}) x (r - r_+ / 4) sqrt{(r_{BL} - r_-) / r }
KDD[1][2] = KDD[2][1] = -((2*a**3*M*rBL*sp.cos(th)*sp.sin(th)**3)/ \
(SIG*sp.sqrt(AA*SIG)))*(r - rp/4)*sp.sqrt((rBL - rm)/r)
betaU = ixp.zerorank1() # We generally choose \beta^i = 0 for these initial data
BU = ixp.zerorank1() # We generally choose B^i = 0 for these initial data
# Finally set alpha. We generally choose alpha = 1/psi**2 (psi = BSSN conformal factor)
# for these initial data
import BSSN.BSSN_quantities as Bq # Sets default for EvolvedConformalFactor_cf
import BSSN.BSSN_in_terms_of_ADM as BitoA
import reference_metric as rfm
rfm.reference_metric()
try:
cf_type = par.parval_from_str("EvolvedConformalFactor_cf")
except:
print("UIUCBlackHole Error: Must set BSSN_quantities::EvolvedConformalFactor_cf;")
print(" the lapse is set in terms of the BSSN conformal factor")
sys.exit(1)
BitoA.cf_from_gammaDD(gammaDD)
cf = BitoA.cf
# Let's choose alpha = 1/psi**2 (psi = BSSN conformal factor) for these initial data,
# where psi = exp(phi); chi = 1/psi**4; W = 1/psi**2
if cf_type == "phi":
alpha = sp.exp(-2*cf)
elif cf_type == "chi":
alpha = sp.sqrt(cf)
elif cf_type == "W":
alpha = cf
else:
print("Error EvolvedConformalFactor_cf type = \""+cf_type+"\" unknown.")
sys.exit(1)
# Validated against original SENR: KDD[0][2], KDD[1][2], gammaDD[2][2], gammaDD[0][0], gammaDD[1][1]
# print(sp.mathematica_code(gammaDD[1][1]))
BSSN.UIUCBlackHole
NRPy+ module [Back to top]¶Here, as a code validation check, we verify agreement in the SymPy expressions for UIUC black hole initial data between
# Step 3: Code Validation against BSSN.UIUCBlackHole NRPy+ module
import BSSN.UIUCBlackHole as uibh
uibh.UIUCBlackHole()
def compare(q1, q2, q1name, q2name):
if sp.simplify(q1 - q2) != 0:
print("Error: "+q1name+" - "+q2name+" = "+str(sp.simplify(q1 - q2)))
sys.exit(1)
print("Consistency check between UIUCBlackHole tutorial and NRPy+ BSSN.UIUCBlackHole module.")
compare(alpha, uibh.alpha, "alpha", "uibh.alpha")
for i in range(DIM):
compare(betaU[i], uibh.betaU[i], "betaU"+str(i), "uibh.betaU"+str(i))
compare(BU[i], uibh.BU[i], "BU"+str(i), "uibh.BU"+str(i))
for j in range(DIM):
compare(gammaDD[i][j], uibh.gammaDD[i][j], "gammaDD"+str(i)+str(j), "uibh.gammaDD"+str(i)+str(j))
compare(KDD[i][j], uibh.KDD[i][j], "KDD"+str(i)+str(j), "uibh.KDD"+str(i)+str(j))
print("ALL TESTS PASS")
Consistency check between UIUCBlackHole tutorial and NRPy+ BSSN.UIUCBlackHole module. ALL TESTS PASS
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-ADM_Initial_Data-UIUC_BlackHole.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-ADM_Initial_Data-UIUC_BlackHole")
Created Tutorial-ADM_Initial_Data-UIUC_BlackHole.tex, and compiled LaTeX file to PDF file Tutorial-ADM_Initial_Data-UIUC_BlackHole.pdf