{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "# [UIUC Black Hole](https://arxiv.org/abs/1001.4077) Initial data\n", "\n", "## Authors: Terrence Pierre Jacques, Zach Etienne, & Ian Ruchlin\n", "\n", "### Formatting improvements courtesy Brandon Clark\n", "\n", "## This notebook introduces a module for setting up UIUC Black Hole initial data for studying highly spinning black holes ([Liu, Etienne, & Shapiro, PRD 80 121503, 2009](https://arxiv.org/abs/1001.4077)). Using the [Exact ADM Spherical-or-Cartesian-to-BSSNCurvilinear converter module](Tutorial-ADM_Initial_Data-Converting_Exact_ADM_Spherical_or_Cartesian_to_BSSNCurvilinear.ipynb), it supports transitions from spherical to any defined coordinate system.\n", "\n", "**Notebook Status:** Validated \n", "\n", "**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](Tutorial-Start_to_Finish-BSSNCurvilinear-Exact_Initial_Data.ipynb); momentum constraint violation in non-$\\phi$ directions is zero), and all quantities have been validated against the [original SENR code](https://bitbucket.org/zach_etienne/nrpy).\n", "\n", "### NRPy+ Source Code for this module: [BSSN/UIUCBlackHole.py](../edit/BSSN/UIUCBlackHole.py)\n", "\n", "## Introduction:\n", "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. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Table of Contents: \n", "$$\\label{toc}$$\n", "\n", "1. [Step 1](#initializenrpy): Set up the needed NRPy+ infrastructure and declare core gridfunctions\n", "1. [Step 2](#bl_radius): The Boyer-Lindquist Radius\n", " 1. [Step 2.a](#define_inner_outer_radii): Define the inner and outer radii\n", " 1. [Step 2.b](#define_bl_radius): Define the Boyer-Lindquist radius\n", "1. [Step 3](#line_element): Define the line element, and extract components of $\\gamma_{ij}$\n", "1. [Step 4](#extrinsic_curvature): Define and construct nonzero components of the extrinsic curvature $K_{ij}$\n", "1. [Step 5](#lapse_shift): Construct Lapse function $\\alpha$ and components of shift vector $\\beta$\n", "1. [Step 6](#code_validation): Code Validation against `BSSN.UIUCBlackHole` NRPy+ module\n", "1. [Step 7](#latex_pdf_output) Output this notebook to $\\LaTeX$-formatted PDF file\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 1: Set up the needed NRPy+ infrastructure and declare core gridfunctions \\[Back to [top](#toc)\\]\n", "$$\\label{initializenrpy}$$\n", "\n", "First, we will import the core modules of Python/NRPy+ and specify the main gridfunctions that we will need.\n", "Second, we set some basic NRPy+ parameters. E.g., set the spatial dimension parameter to 3.\n", "\n", "**Inputs for initial data**:\n", "\n", "* The black hole mass $M$.\n", "* The dimensionless spin parameter $\\chi = a/M$\n", "\n", "**Additional variables needed for spacetime evolution**:\n", "\n", "* Desired coordinate system Boyer-Lindquist coordinates $(r_{BL}, \\theta, \\phi)$\n", "
\n", "* Desired initial lapse $\\alpha$ and shift $\\beta^i$. We will choose our gauge conditions as $\\alpha=1$ and $\\beta^i=B^i=0$. $\\alpha = \\psi^{-2}$ will yield much better behavior, but the conformal factor $\\psi$ depends on the desired *destination* coordinate system (which may not be spherical coordinates)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.492737Z", "iopub.status.busy": "2021-03-07T17:06:32.491924Z", "iopub.status.idle": "2021-03-07T17:06:32.822125Z", "shell.execute_reply": "2021-03-07T17:06:32.822665Z" } }, "outputs": [], "source": [ "# Step P0: Load needed modules\n", "import sympy as sp # SymPy: The Python computer algebra package upon which NRPy+ depends\n", "import NRPy_param_funcs as par # NRPy+: Parameter interface\n", "import indexedexp as ixp # NRPy+: Symbolic indexed expression (e.g., tensors, vectors, etc.) support\n", "\n", "# All gridfunctions will be written in terms of spherical coordinates (r, th, ph):\n", "r,th,ph = sp.symbols('r th ph', real=True)\n", "\n", "thismodule = \"UIUCBlackHole\"\n", "\n", "# Step 0: Set spatial dimension (must be 3 for BSSN)\n", "DIM = 3\n", "par.set_parval_from_str(\"grid::DIM\",DIM)\n", "\n", "# Step 1: Set psi, the conformal factor:\n", "\n", "# The UIUC initial data represent a Kerr black hole with mass M\n", "# and dimensionless spin chi in UIUC quasi-isotropic coordinates,\n", "# see https://arxiv.org/abs/1001.4077\n", "# Input parameters:\n", "M,chi = par.Cparameters(\"REAL\", thismodule, [\"M\",\"chi\"],[1.0,0.99])\n", "\n", "# Spin per unit mass\n", "a = M*chi" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 2: The Boyer-Lindquist Radius \\[Back to [top](#toc)\\]\n", "$$\\label{bl_radius}$$\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 2.a: Defining the Inner and Outer Radii \\[Back to [top](#toc)\\]\n", "$$\\label{define_inner_outer_radii}$$\n", "\n", "\n", "\n", "Boyer-Lindquist radii of the outer (+) and inner (−) horizons of the BH, defined under equation 1 in [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077) as \n", "$$ r_{\\pm} = M \\pm \\sqrt{M^2 - a^2}$$" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.829588Z", "iopub.status.busy": "2021-03-07T17:06:32.828320Z", "iopub.status.idle": "2021-03-07T17:06:32.867080Z", "shell.execute_reply": "2021-03-07T17:06:32.867628Z" } }, "outputs": [], "source": [ "# Defined under equation 1 in Liu, Etienne, & Shapiro (2009)\n", "# https://arxiv.org/pdf/1001.4077.pdf\n", "\n", "# Boyer - Lindquist outer horizon\n", "rp = M + sp.sqrt(M**2 - a**2)\n", "# Boyer - Lindquist inner horizon\n", "rm = M - sp.sqrt(M**2 - a**2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "## Step 2.b: Define the Boyer-Lindquist Radius \\[Back to [top](#toc)\\]\n", "$$\\label{define_bl_radius}$$\n", "\n", "Define $r_{BL}$, equation 11 of [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077), using the radial coordinate $r$:\n", "\n", "$$ r_{BL} = r \\left( 1 + \\frac{r_+}{4r}\\right)^2. $$" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.878522Z", "iopub.status.busy": "2021-03-07T17:06:32.877444Z", "iopub.status.idle": "2021-03-07T17:06:32.880181Z", "shell.execute_reply": "2021-03-07T17:06:32.879548Z" } }, "outputs": [], "source": [ "# Boyer - Lindquist radius in terms of UIUC radius\n", "# Eq. 11\n", "# r_{BL} = r * ( 1 + r_+ / 4r )^2\n", "rBL = r*(1 + rp / (4*r))**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Quantities used to calculate the spatial metric $\\gamma_{ij}$, found under equation 2 of [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077):\n", "$$ \\Sigma = r_{BL}^2 + a^2 \\cos^2 \\theta, $$\n", "\n", "$$ \\Delta = r_{BL}^2 - 2Mr_{BL} + a^2, $$ \n", "\n", "$$ A = \\left(r_{BL}^2 + a^2\\right)^2 - \\Delta a^2 \\sin^2 \\theta. $$ " ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.892240Z", "iopub.status.busy": "2021-03-07T17:06:32.890863Z", "iopub.status.idle": "2021-03-07T17:06:32.903836Z", "shell.execute_reply": "2021-03-07T17:06:32.903081Z" } }, "outputs": [], "source": [ "# Expressions found below Eq. 2\n", "# Sigma = r_{BL}^2 + a^2 cos^2 theta\n", "SIG = rBL**2 + a**2*sp.cos(th)**2\n", "\n", "# Delta = r_{BL}^2 - 2Mr_{BL} + a^2\n", "DEL = rBL**2 - 2*M*rBL + a**2\n", "\n", "# A = (r_{BL}^2 + a^2)^2 - Delta a^2 sin^2 theta\n", "AA = (rBL**2 + a**2)**2 - DEL*a**2*sp.sin(th)**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 3: Define the Line element and extract components of $\\gamma_{ij}$ \\[Back to [top](#toc)\\]\n", "$$\\label{line_element}$$\n", "\n", "The line element, defined in equation 13 of [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077):\n", "\n", "$$ ds^2 = \\frac{\\Sigma\\left(r + \\frac{r_+}{4}\\right)^2 } {r^3 \\left(r_{BL} - r_- \\right)} dr^2 + \\Sigma d\\theta^2 + \\frac{ A \\sin^2 \\theta }{\\Sigma} d\\phi^2 $$" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.931939Z", "iopub.status.busy": "2021-03-07T17:06:32.930978Z", "iopub.status.idle": "2021-03-07T17:06:32.934063Z", "shell.execute_reply": "2021-03-07T17:06:32.933512Z" } }, "outputs": [], "source": [ "# *** The ADM 3-metric in spherical basis ***\n", "gammaDD = ixp.zerorank2()\n", "# Declare the nonzero components of the 3-metric (Eq. 13):\n", "\n", "# ds^2 = Sigma (r + r_+/4)^2 / ( r^3 (r_{BL} - r_- ) * dr^2 +\n", "# Sigma d theta^2 + (A sin^2 theta) / Sigma * d\\phi^2\n", "\n", "gammaDD[0][0] = ((SIG*(r + rp/4)**2)/(r**3*(rBL - rm)))\n", "gammaDD[1][1] = SIG\n", "gammaDD[2][2] = AA/SIG*sp.sin(th)**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 4: Define and construct nonzero components of extrinsic curvature $K_{ij}$ \\[Back to [top](#toc)\\]\n", "$$\\label{extrinsic_curvature}$$\n", "\n", "\n", "\n", "Nonzero components of the extrinsic curvature, equation 14 of [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077):\n", "\n", "$$ K_{r\\phi} = K_{\\phi r} = \\frac{Ma\\sin^2\\theta}{\\Sigma\\sqrt{A\\Sigma}} \\ \n", " \\left[3r^4_{BL} + 2a^2 r^2_{BL} - a^4 - a^2 \\left(r^2_{BL} - a^2\\right) \\sin^2 \\theta\\right] \\\n", " \\left(1 + \\frac{r_+}{4r}\\right) \\frac{1}{\\sqrt{r(r_{BL} - r_-)}} $$" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:32.987406Z", "iopub.status.busy": "2021-03-07T17:06:32.986774Z", "iopub.status.idle": "2021-03-07T17:06:32.989057Z", "shell.execute_reply": "2021-03-07T17:06:32.989538Z" } }, "outputs": [], "source": [ "# *** The physical trace-free extrinsic curvature in spherical basis ***\n", "# Nonzero components of the extrinsic curvature K, given by\n", "# Eq. 14 of Liu, Etienne, & Shapiro, https://arxiv.org/pdf/1001.4077.pdf:\n", "KDD = ixp.zerorank2() # K_{ij} = 0 for these initial data\n", "\n", "\n", "# K_{r phi} = K_{phi r} = (Ma sin^2 theta) / (Sigma sqrt{A Sigma}) *\n", "# [3r^4_{BL} + 2a^2 r^2_{BL} - a^4 - a^2 (r^2_{BL} - a^2) sin^2 theta] *\n", "# (1 + r_+ / 4r) (1 / sqrt{r(r_{BL} - r_-)})\n", "\n", "KDD[0][2] = KDD[2][0] = (M*a*sp.sin(th)**2)/(SIG*sp.sqrt(AA*SIG))*\\\n", " (3*rBL**4 + 2*a**2*rBL**2 - a**4- a**2*(rBL**2 - a**2)*\\\n", " sp.sin(th)**2)*(1 + rp/(4*r))*1/sp.sqrt(r*(rBL - rm))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Nonzero components of the extrinsic curvature, equation 15 of [Liu, Etienne, & Shapiro (2009)](https://arxiv.org/abs/1001.4077):\n", "\n", "$$ K_{\\theta\\phi} = K_{\\phi\\theta} = -\\frac{2a^3 Mr_{BL}\\cos\\theta \\sin^3\\theta} {\\Sigma \\sqrt{A\\Sigma} } \\left(r - \\frac{r_+}{4}\\right) \\sqrt {\\frac{r_{BL} - r_-}{r} } $$" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:33.003460Z", "iopub.status.busy": "2021-03-07T17:06:33.002780Z", "iopub.status.idle": "2021-03-07T17:06:33.006239Z", "shell.execute_reply": "2021-03-07T17:06:33.005739Z" } }, "outputs": [], "source": [ "# Components of the extrinsic curvature K, given by\n", "# Eq. 15 of Liu, Etienne, & Shapiro, https://arxiv.org/pdf/1001.4077.pdf:\n", "\n", "# K_{theta phi} = K_{phi theta} = -(2a^3 Mr_{BL} cos theta sin^3 theta) /\n", "# (Sigma sqrt{A Sigma}) x (r - r_+ / 4) sqrt{(r_{BL} - r_-) / r }\n", "\n", "KDD[1][2] = KDD[2][1] = -((2*a**3*M*rBL*sp.cos(th)*sp.sin(th)**3)/ \\\n", " (SIG*sp.sqrt(AA*SIG)))*(r - rp/4)*sp.sqrt((rBL - rm)/r)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 5: Construct Lapse function $\\alpha$ and components of shift vector $\\beta$ \\[Back to [top](#toc)\\]\n", "$$\\label{lapse_shift}$$\n", "\n", "$$\\alpha=W=e^{-2\\phi}$$, and\n", "\n", "$$\\beta^i=B^i=0$$\n", "\n", "where $\\phi$ is the BSSN conformal factor." ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:33.011211Z", "iopub.status.busy": "2021-03-07T17:06:33.010561Z", "iopub.status.idle": "2021-03-07T17:06:33.013332Z", "shell.execute_reply": "2021-03-07T17:06:33.012791Z" } }, "outputs": [], "source": [ "betaU = ixp.zerorank1() # We generally choose \\beta^i = 0 for these initial data\n", "BU = ixp.zerorank1() # We generally choose B^i = 0 for these initial data\n", "\n", "# Finally set alpha. We generally choose alpha = 1/psi**2 (psi = BSSN conformal factor)\n", "# for these initial data\n", "import BSSN.BSSN_quantities as Bq # Sets default for EvolvedConformalFactor_cf\n", "import BSSN.BSSN_in_terms_of_ADM as BitoA\n", "import reference_metric as rfm\n", "rfm.reference_metric()\n", "try:\n", " cf_type = par.parval_from_str(\"EvolvedConformalFactor_cf\")\n", "except:\n", " print(\"UIUCBlackHole Error: Must set BSSN_quantities::EvolvedConformalFactor_cf;\")\n", " print(\" the lapse is set in terms of the BSSN conformal factor\")\n", " sys.exit(1)\n", "\n", "BitoA.cf_from_gammaDD(gammaDD)\n", "cf = BitoA.cf\n", "\n", "# Let's choose alpha = 1/psi**2 (psi = BSSN conformal factor) for these initial data,\n", "# where psi = exp(phi); chi = 1/psi**4; W = 1/psi**2\n", "if cf_type == \"phi\":\n", " alpha = sp.exp(-2*cf)\n", "elif cf_type == \"chi\":\n", " alpha = sp.sqrt(cf)\n", "elif cf_type == \"W\":\n", " alpha = cf\n", "else:\n", " print(\"Error EvolvedConformalFactor_cf type = \\\"\"+cf_type+\"\\\" unknown.\")\n", " sys.exit(1)\n", "\n", "# Validated against original SENR: KDD[0][2], KDD[1][2], gammaDD[2][2], gammaDD[0][0], gammaDD[1][1]\n", "# print(sp.mathematica_code(gammaDD[1][1]))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 6: Code Validation against `BSSN.UIUCBlackHole` NRPy+ module \\[Back to [top](#toc)\\]\n", "$$\\label{code_validation}$$\n", "\n", "\n", "Here, as a code validation check, we verify agreement in the SymPy expressions for UIUC black hole initial data between\n", "\n", "1. this tutorial and \n", "2. the NRPy+ [BSSN.UIUCBlackHole](../edit/BSSN/UIUCBlackHole.py) module." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:33.022506Z", "iopub.status.busy": "2021-03-07T17:06:33.021809Z", "iopub.status.idle": "2021-03-07T17:06:34.244043Z", "shell.execute_reply": "2021-03-07T17:06:34.244572Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Consistency check between UIUCBlackHole tutorial and NRPy+ BSSN.UIUCBlackHole module.\n", "ALL TESTS PASS\n" ] } ], "source": [ "# Step 3: Code Validation against BSSN.UIUCBlackHole NRPy+ module\n", "\n", "import BSSN.UIUCBlackHole as uibh\n", "uibh.UIUCBlackHole()\n", "\n", "def compare(q1, q2, q1name, q2name):\n", " if sp.simplify(q1 - q2) != 0:\n", " print(\"Error: \"+q1name+\" - \"+q2name+\" = \"+str(sp.simplify(q1 - q2)))\n", " sys.exit(1) \n", "\n", "print(\"Consistency check between UIUCBlackHole tutorial and NRPy+ BSSN.UIUCBlackHole module.\")\n", "compare(alpha, uibh.alpha, \"alpha\", \"uibh.alpha\")\n", "for i in range(DIM):\n", " compare(betaU[i], uibh.betaU[i], \"betaU\"+str(i), \"uibh.betaU\"+str(i))\n", " compare(BU[i], uibh.BU[i], \"BU\"+str(i), \"uibh.BU\"+str(i))\n", " for j in range(DIM):\n", " compare(gammaDD[i][j], uibh.gammaDD[i][j], \"gammaDD\"+str(i)+str(j), \"uibh.gammaDD\"+str(i)+str(j))\n", " compare(KDD[i][j], uibh.KDD[i][j], \"KDD\"+str(i)+str(j), \"uibh.KDD\"+str(i)+str(j))\n", "print(\"ALL TESTS PASS\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "# Step 7: Output this notebook to $\\LaTeX$-formatted PDF file \\[Back to [top](#toc)\\]\n", "$$\\label{latex_pdf_output}$$\n", "\n", "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\n", "[Tutorial-ADM_Initial_Data-UIUC_BlackHole.pdf](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.)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2021-03-07T17:06:34.250057Z", "iopub.status.busy": "2021-03-07T17:06:34.249357Z", "iopub.status.idle": "2021-03-07T17:06:37.789008Z", "shell.execute_reply": "2021-03-07T17:06:37.787992Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Created Tutorial-ADM_Initial_Data-UIUC_BlackHole.tex, and compiled LaTeX\n", " file to PDF file Tutorial-ADM_Initial_Data-UIUC_BlackHole.pdf\n" ] } ], "source": [ "import cmdline_helper as cmd # NRPy+: Multi-platform Python command-line interface\n", "cmd.output_Jupyter_notebook_to_LaTeXed_PDF(\"Tutorial-ADM_Initial_Data-UIUC_BlackHole\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.1" } }, "nbformat": 4, "nbformat_minor": 4 }