## TOVSolver

March 31, 2019

Abstract

This thorn solves the Tolman-Oppenheimer-Volkov equations of hydrostatic equilibrium for a spherically symmetric static star.

### 1 Introduction

The Tolman-Oppenheimer-Volkoﬀ solution is a static perfect ﬂuid “star”. It is frequently used as a test of relativistic hydro codes. Here it is intended for use without evolving the matter terms. This provides a compact strong ﬁeld solution which is static but does not contain singularities.

### 2 Equations

The equations for a TOV star [123] are usually derived in Schwarzschild coordinates. In these coordinates, the metric can be brought into the form

 $d{s}^{2}=-{e}^{2\varphi }d{t}^{2}+{\left(1-\frac{2m}{r}\right)}^{-1}d{r}^{2}+{r}^{2}d{\Omega }^{2}\phantom{\rule{1em}{0ex}}.$ (1)

This thorn is based on the notes of Thomas Baumgarte [4] that have been partially included in this documentation. However the notation for the ﬂuid quantities follows [5]. Here we are assuming that the stress energy tensor is given by

 ${T}^{\mu \nu }=\left(\mu +P\right){u}^{\mu }{u}^{\nu }+P{g}^{\mu \nu },$ (2)

where $\mu$ is the total energy, $P$ the pressure, ${u}^{\mu }$ the ﬂuid four velocity, $\rho$ the rest-mass density, $𝜖$ the speciﬁc internal energy, and

$\begin{array}{rcll}\mu & =& \rho \left(1+𝜖\right),& \text{(3)}\text{}\text{}\\ P& =& \left(\Gamma -1\right)\rho 𝜖,& \text{(4)}\text{}\text{}\\ P& =& K{\rho }^{\Gamma }.& \text{(5)}\text{}\text{}\end{array}$

This enforces a polytropic equation of state. We note that in Cactus the units are $c=G={M}_{\odot }=1$.

The equations to give the initial data are solved (as usual) in the Schwarzschild-like coordinates with the areal radius labelled $r$. The equations of the relativistic hydrostatic equilibrium are

$\begin{array}{rcll}\frac{dP}{dr}& =& -\left(\mu +P\right)\frac{m+4\pi {r}^{3}P}{r\left(r-2m\right)},& \text{(6)}\text{}\text{}\\ \frac{dm}{dr}& =& 4\pi {r}^{2}\mu ,& \text{(7)}\text{}\text{}\\ \frac{d\varphi }{dr}& =& \frac{m+4\pi {r}^{3}P}{r\left(r-2m\right)}\phantom{\rule{1em}{0ex}}.& \text{(8)}\text{}\text{}\\ & & & \text{(9)}\text{}\text{}\end{array}$

Here $m$ is the gravitational mass inside the sphere radius $r$, and $\varphi$ the logarithm of the lapse. Once the integration is done for the interior of the star we match to the exterior (see below). In the exterior we have

$\begin{array}{lll}\hfill P& =TOV\text{_}atmosphere,\phantom{\rule{2em}{0ex}}& \hfill \text{(10)}\\ \hfill m& =M,\phantom{\rule{2em}{0ex}}& \hfill \text{(11)}\\ \hfill \varphi & =\frac{1}{2}log\left(1-2M∕r\right).\phantom{\rule{2em}{0ex}}& \hfill \text{(12)}\end{array}$

In order to impose initial data in cartesian coordinates, we want to transform this solution to isotropic coordinates, in which the metric takes the form

 $d{s}^{2}=-{e}^{2\varphi }d{t}^{2}+{e}^{2\Lambda }\left(d{\stackrel{̄}{r}}^{2}+{\stackrel{̄}{r}}^{2}d{\Omega }^{2}\right)\phantom{\rule{1em}{0ex}}.$ (13)

Here $\stackrel{̄}{r}$ denotes the isotropic radius. Matching the two metrics, one obviously ﬁnds

$\begin{array}{lll}\hfill {r}^{2}& ={e}^{2\Lambda }{\stackrel{̄}{r}}^{2}\phantom{\rule{1em}{0ex}},\phantom{\rule{2em}{0ex}}& \hfill \text{(14)}\\ \hfill {\left(1-\frac{2m}{r}\right)}^{-1}d{r}^{2}& ={e}^{2\Lambda }d{\stackrel{̄}{r}}^{2}\phantom{\rule{1em}{0ex}}.\phantom{\rule{2em}{0ex}}& \hfill \text{(15)}\end{array}$

As a result, we have an additional diﬀerential equation to solve in order to have $\stackrel{̄}{r}\left(r\right)$, that is

 $\frac{d\left(log\left(\stackrel{̄}{r}∕r\right)\right)}{\partial r}=\frac{{r}^{1∕2}-{\left(r-2m\right)}^{1∕2}}{r{\left(r-2m\right)}^{1∕2}}\phantom{\rule{1em}{0ex}}.$ (16)

Given such a solution, the missing metric potential is simply given by

 ${e}^{\Lambda }=\frac{r}{\stackrel{̄}{r}}\phantom{\rule{1em}{0ex}}.$ (17)

In the following section we concentrate on solving Eq. (16) in the exterior and in the interior of the star.

Then, given these one-dimensional data we interpolate to get data on the three-dimensional Cactus grid; that is, we interpolate on the three dimensional r given by the x, y, z variables the physical hydro and spacetime quantities that are function of the isotropic radius $\stackrel{̄}{r}$ computed above. Only linear interpolation is used. This avoids problems at the surface of the star, and does not cause problems if the number of points in the one dimensional array is suﬃcient ($1×1{0}^{5}$ is the default, which should be suﬃcient for medium-sized grids).

#### 2.1 Exterior

In the exterior of the star, $r>R$, the mass $M\equiv m\left(R\right)$ is constant, and Eq. (16) can be solved analytically up to a constant of integration. Fixing this constant such that $r$ and $\stackrel{̄}{r}$ agree at inﬁnity, we ﬁnd

 $\stackrel{̄}{r}=\frac{1}{2}\left(\sqrt{{r}^{2}-2Mr}+r-M\right)\phantom{\rule{1em}{0ex}},$ (18)

or, solving for $r$ [cfr. Exercise 31.7 of MTW [3]]

 $r=\stackrel{̄}{r}{\left(1+\frac{M}{2\stackrel{̄}{r}}\right)}^{2}\phantom{\rule{1em}{0ex}}.$ (19)

The metric potential as a function of $\stackrel{̄}{r}$ is obviously

 ${e}^{2\Lambda }={\left(1+\frac{M}{2\stackrel{̄}{r}}\right)}^{2}\phantom{\rule{1em}{0ex}}.$ (20)

#### 2.2 Interior

In the interior, Eq, (16) can not be integrated analytically, because $m$ is now a function of $r$. Instead, we have to integrate

 ${\int }_{0}^{\stackrel{̄}{r}}\frac{d\stackrel{̄}{r}}{\stackrel{̄}{r}}={\int }_{0}^{r}{\left(1-\frac{2m}{r}\right)}^{-1∕2}\frac{dr}{r}\phantom{\rule{1em}{0ex}}.$ (21)

The left hand side can be integrated analytically, and has a singular point at $\stackrel{̄}{r}=0$. The right hand side cannot be integrated analytically, but will also be singular at $r=0$, which poses problems when trying to integrate the equation numerically. We therefore rewrite the right hand side by adding and subracting a term $1∕r$, which yields

 ${\int }_{0}^{r}\frac{1}{r{\left(1-2m∕r\right)}^{1∕2}}dr={\int }_{0}^{r}\frac{1-{\left(1-2m∕r\right)}^{1∕2}}{r{\left(1-2m∕r\right)}^{1∕2}}dr+{\int }_{0}^{r}\frac{dr}{r}\phantom{\rule{1em}{0ex}}.$ (22)

Since $m\sim {r}^{3}$ close to the origin, the ﬁrst term on the right hand side is now regular and the second one can be integrated analytically. As a result, we ﬁnd

 ${\int }_{0}^{\stackrel{̄}{r}}dln\stackrel{̄}{r}-{\int }_{0}^{r}dlnr={\int }_{0}^{r}\frac{1-{\left(1-2m∕r\right)}^{1∕2}}{r{\left(1-2m∕r\right)}^{1∕2}}dr\phantom{\rule{1em}{0ex}}.$ (23)

Replacing the lower limits ($r=\stackrel{̄}{r}=0$) temporarily with ${r}_{0}$ and ${\stackrel{̄}{r}}_{0}$, we can integrate the right hand side and ﬁnd

 $ln\left(\frac{\stackrel{̄}{r}}{r}\right)-ln\left(\frac{{\stackrel{̄}{r}}_{0}}{{r}_{0}}\right)={\int }_{0}^{r}\frac{1-{\left(1-2m∕r\right)}^{1∕2}}{r{\left(1-2m∕r\right)}^{1∕2}}dr\phantom{\rule{1em}{0ex}},$ (24)

or

 $\stackrel{̄}{r}=Crexp\left[{\int }_{0}^{r}\frac{1-{\left(1-2m∕r\right)}^{1∕2}}{r{\left(1-2m∕r\right)}^{1∕2}}dr\right]\phantom{\rule{1em}{0ex}}.$ (25)

Here the constant of integration $C$ is related to the ratio ${\stackrel{̄}{r}}_{0}∕{r}_{0}$ evaluated at the origin (which is perfectly regular). It can be chosen such that the interior solution matches the exterior solution at the surface of the star. This requirement implies

 $C=\frac{1}{2R}\left(\sqrt{{R}^{2}-2MR}+R-M\right)exp\left[{\int }_{0}^{R}\frac{1-{\left(1-2m∕r\right)}^{1∕2}}{r{\left(1-2m∕r\right)}^{1∕2}}dr\right]\phantom{\rule{1em}{0ex}}.$ (26)

In this respect, let us recall how we do initial data for the system of equations at $r=0$. Given a value of the central density ${\rho }_{c}$ (in Cactus units) we pose ${P}_{0}=K{\rho }_{c}^{\Gamma }$, ${m}_{0}=0$, ${\varphi }_{0}=0$ and ${\stackrel{̄}{r}}_{0}=TOV\text{_}Tiny$, ${r}_{0}=TOV\text{_}Tiny$. The TOV_Tiny number is hardwired into the code to avoid divide by zero errors; it is $1{0}^{-20}$. Also the default parameters will give the TOV star used for the long term evolutions in [6]. That is, a nonrotating $N=1$ ($\gamma =1+1∕N=2$) polytropic star with gravitational mass $M=1.4{M}_{\odot }$, circumferential radius $R=14.15$km, central rest-mass density ${\rho }_{c}=1.28×1{0}^{-3}$ and $K=100$.

### 3 Use of this thorn

To use this thorn to provide initial data for the ADMBase variables $\alpha$, $\beta$, $g$ and $K$ just activate the thorn and set ADMBase:initial_data = ‘‘TOV’’.

There are two ways of coupling the matter sources to the thorn that evolves the Einstein equations. One is to use the CalcTmunu interface. This will give the components of the stress energy tensor pointwise across the grid. For an example of this, see thorn ADM in CactusEinstein.

To use the CalcTmunu interface you should

• put the lines

USES INCLUDE: CalcTmunu.inc
USES INCLUDE: CalcTmunu_temps.inc
USES INCLUDE: CalcTmunu_rfr.inc

You also have the possibility to use a parameter GRHydrotovsolver::TOV_Separation to obtain a spacetime consisting of one TOV-system for $x>0$ and a second (similar) for $x<0$. This parameter sets the separation of the centers of two neutron stars, has to be positive and should be larger than twice the radius of one star.