February 24, 2013

Abstract

This thorn provides a uniﬁed EOS (Equation Of State) interface and implements multiple analytic EOS, and also provides table reader and interpolation routines for ﬁnite-temperature microphysical EOS available from http://www.stellarcollapse.org. In addition cold and barotropic tabulated EOS are provided for use in initial data thorns. Currently, the implemented analytic EOS are the polytropic EOS, the gamma-law EOS, and a hybrid EOS consisting of a 2-piece piecewise-polytrope with a thermal, gamma-law component.

Equations of State (EOS) are crucial for hydrodynamics and hydro codes (as well as other codes needing/providing microphysics) are closely coupled to EOS and call EOS routines many times for each grid point during the calculation of a time update.

EOS_Omni is presently coded for cold and hot EOS, including those based on microphysical models. It does currently assume nuclear statistical equilibrium (NSE) with rest-mass density $\rho $, speciﬁc internal energy $\mathit{\epsilon}$ (or temperature $T$), and electron fraction ${Y}_{e}$ being the independent variables. EOS_Omni can be called on arrays or on single grid points.

This thorn uses solar units where $c=G={M}_{\odot}=1$. Temperatures are measured in MeV.

EOS_Omni works via the aliased-function interface, and EOS functions to be used must be declared in interface.ccl. Here is an example interface.ccl entry:

void FUNCTION EOS_Omni_press(CCTK_INT IN eoskey, \

CCTK_INT IN havetemp, \

CCTK_REAL IN rf_precision, \

CCTK_INT IN npoints, \

CCTK_REAL IN ARRAY rho, \

CCTK_REAL INOUT ARRAY eps, \

CCTK_REAL INOUT ARRAY temp, \

CCTK_REAL IN ARRAY ye, \

CCTK_REAL OUT ARRAY press \

CCTK_INT OUT ARRAY keyerr, \

CCTK_INT OUT anyerr)

CCTK_INT IN havetemp, \

CCTK_REAL IN rf_precision, \

CCTK_INT IN npoints, \

CCTK_REAL IN ARRAY rho, \

CCTK_REAL INOUT ARRAY eps, \

CCTK_REAL INOUT ARRAY temp, \

CCTK_REAL IN ARRAY ye, \

CCTK_REAL OUT ARRAY press \

CCTK_INT OUT ARRAY keyerr, \

CCTK_INT OUT anyerr)

Here,

- eoskey is the type of EOS to be used in this call.
- eoskey = 1: Polytropic EOS
- eoskey = 2: Gamma-Law EOS
- eoskey = 3: Hybrid EOS (2 Polys, 1 Gamma-Law), used for stellar core collapse simulations.
- eoskey = 4: Finite-temperature microphysical EOS
- eoskey = 5: Cold tabulated EOS with Gamma-Law
- eoskey = 6: Tabulated barotropic EOS

- havetemp determines whether the EOS is to be called as a function of $\left(\rho ,\mathit{\epsilon},{Y}_{e}\right)$ (havetemp = 0), or as a function of $\left(\rho ,T,{Y}_{e}\right)$ (havetemp = 1). havetemp = 0 is the method of choice for analytic EOS during evolution, but at the initial data stage one may need to set havetemp = 1 (with $T=0$) to obtain initial values for $\mathit{\epsilon}$. In the case of a ﬁnite-temperature EOS (that usually is a function of $\left(\rho ,T,{Y}_{e}\right)$), a call with havetemp = 0 will ﬁrst lead to the solution of $T(\rho ,\mathit{\epsilon},{Y}_{e}$) via a Newton-Raphson-type iteration (using the supplied value of $T$ as the starting point) and will then calculate the requested dependent variable as a function of $X=X\left(\rho ,T,{Y}_{e}\right)$. Both $X$ and the updated $T$ are returned.
- npoints tells the EOS how many data points are passed in,
- rho,eps,temp,ye,press are obvious,
- rf_precision is a real number telling the root ﬁnding algorithm (for ﬁnding $T\left(\rho ,\mathit{\epsilon},{Y}_{e}\right)$) at what relative error to terminate the iteration. $1{0}^{-10}$ is a good value.
- keyerr is an array (with $n$ entries for $n$ data points) containing error codes (relevant only for tabulated microphysical EOS),
- anyerr is an integer $>0$ in case any error occured.

Many hydro codes require a fallback EOS in case something goes wrong. This is also true for the Einstein Toolkit GR hydro code EinsteinEvolve/GRHydro. If you want to use EOS_Omni with GRHydro, you must set parameters for the EOS of your choice and, in addition, the following parameters must be set to sensible values:

eos_omni::poly_gamma

eos_omni::poly_gamma_initial

eos_omni::poly_k

eos_omni::poly_gamma_initial

eos_omni::poly_k

The only non-obvious parameter here is poly_gamma_initial. In most simulations it should not be set. In simulations that are run with a diﬀerent adiabatic index than what was used to set up the initial data, poly_gamma should be the evolution value, and poly_gamma_initial should be the initial data value. EOS_Omni then rescales poly_k such that the cgs value of poly_k is the same for initial data and evolution. Since the units of poly_k ($\left[K\right]=\frac{N}{{m}^{2}}{\left(\frac{{m}^{3}}{kg}\right)}^{\Gamma}$) depend on poly_gamma this is not fully trivial.

Check param.ccl for parameters for the other EOS.

The poly EOS is a polytropic equation of state, which does not allow for changes in entropy:

$$\begin{array}{rcll}p& =& K{\rho}^{\gamma}& \text{(1)}\text{}\text{}\end{array}$$

where $p$ is the pressure, $\rho $ the density, $K$ the polytropic constant set via poly_k, and $\gamma $ is the adiabatic index set via poly_gamma.

If the internal energy $\mathit{\epsilon}$ is to be “calculated from the temperature” (havetemp = 1), then this is done using the relation

$$\begin{array}{rcll}\mathit{\epsilon}& =& \frac{K}{\gamma -1}{\rho}^{\gamma -1}& \text{(2)}\text{}\text{}\end{array}$$

(which actually ignores the temperature).

Note: This polytropic EOS is also used as fall-back when other EOS fail.

The gl EOS is a gamma-law equation of state, corresponding to an ideal gas:

$$\begin{array}{rcll}p& =& \left(\gamma -1\right)\rho \mathit{\epsilon}& \text{(3)}\text{}\text{}\end{array}$$

where $p$ is the pressure, $\rho $ the density, $\mathit{\epsilon}$ the internal energy, and $\gamma $ is the adiabatic index set via gl_gamma.

At the initial data stage, it may be necessary to set up initial values for $\mathit{\epsilon}$. For this, the gl EOS implements equation (2) just like the poly EOS and the parameters poly_gamma_ini and gl_k must be set for this.

The hybrid EOS was introduced by [1] for use in simpliﬁed simulations of stellar collapse to mimic (1) the stiﬀening of the nuclear EOS at nuclear density and (2) to include thermal pressure in the postbounce phase. It consists of two polytropes characterized by (${K}_{1}$, ${\gamma}_{1}$) and (${K}_{2}$, ${\gamma}_{2}$) and a thermal $\gamma -$law component described by ${\gamma}_{th}$. Polytrope 1 is soft and describes a gas of relativistic degenerate electrons with ${\gamma}_{1}\approx 4\u22153$. It is used below nuclear density (${\rho}_{nuc}\approx 2\times 1{0}^{14}\phantom{\rule{0.3em}{0ex}}{g\phantom{\rule{0.3em}{0ex}}cm}^{-3}$), and is smoothly matched to polytrope 2 which applies above ${\rho}_{nuc}$, is stiﬀ, and models the repulsive core of the strong force above nuclear density (${\gamma}_{2}\gtrsim 2.5$). ${K}_{2}$ is completely determined by ${P}_{1}\left({\rho}_{nuc}\right)={P}_{2}\left({\rho}_{nuc}\right)$ and ${K}_{1},{\gamma}_{1},$ and ${\gamma}_{2}$. The full functional form of the EOS $P=P\left(\rho ,\mathit{\epsilon}\right)$ with the thermal component (which takes into account shock heating) is given by

$$\begin{array}{rcll}P& =& \frac{\gamma -{\gamma}_{th}}{\gamma -1}K{\rho}_{nuc}^{{\gamma}_{1}-\gamma}{\rho}^{\gamma}-\frac{\left({\gamma}_{th}-1\right)\left(\gamma -{\gamma}_{1}\right)}{\left({\gamma}_{1}-1\right)\left({\gamma}_{2}-1\right)}K{\rho}_{nuc}^{{\gamma}_{1}-1}\rho +\left({\gamma}_{th}-1\right)\rho \mathit{\epsilon}\phantom{\rule{0.3em}{0ex}}.& \text{(4)}\text{}\text{}\end{array}$$

The EOS_Omni parameters for the hybrid EOS are the following:

hybrid_gamma1 | ${\gamma}_{1}$, ${\gamma}_{1}=1.325$ is an appropriate choice. |

hybrid_gamma2 | ${\gamma}_{2}$, ${\gamma}_{2}=2.5$ is an appropriate choice. |

hybrid_gamma_th | ${\gamma}_{th}$, perhaps $1.5$. |

hybrid_k1 | ${K}_{1}$, $0.4640517$ in solar units for relativistic degenerate e${}^{-}$. |

hybrid_rho_nuc | nuclear density, standard is $3.238607\times 1{0}^{-4}$ in solar units. |

Complex microphysical ﬁnite-temperature equations of state come usually in tabulated form. EOS_Omni comes
with routines provided as part of the nuc_eos package described in [2] and available at

http://www.stellarcollapse.org. A variety of EOS tables for application in high-density astrophysical
situations (i.e. in stellar collapse or in compact star mergers) are also available from there in HDF5
format.

The parameters controlling the ﬁnite-temperature nuclear EOS are the following:

nuceos_read_table | BOOLEAN | Set to yes to read table. |

do_energy_shift | BOOLEAN | Set to yes to subtract the energy shift |

stored in the table to get correctly normalized $\mathit{\epsilon}$. | ||

nuceos_table_name | STRING | Path/Name of the table ﬁle. |

Many equations of state for neutron stars are generated under the assumption of zero temperature. This is perfectly appropriate for cold old neutron stars. In simulations of binary mergers, however, shocks will drive the temperature up, adding a thermal pressure component, which can be accounted for approximately with a Gamma-Law: ${P}_{}$

th = (${\Gamma}_{}$

th - 1)$\rho {\mathit{\epsilon}}_{}$

th$\phantom{\rule{0.3em}{0ex}}.$

EOS_Omni implements such an equation of state. It reads in an ASCII EOS table (see subdirector tables for an example table for the SLy EOS [3, 4], which was generated according to the prescription in [5, 6]). All EOS parameters are read from the ASCII ﬁle, which has the following format:

EoSType = Tabulated

Nrho = 600 NYe = 1 NT = 1

RhoMin = 1e-09 RhoMax = 0.01

HeatCapacityE = 1

GammaTh = 2

Kappa = 1

RhoSpacing = Log

1.57940636422747e-03 1.38773826035349e+00 2.62139412738900e-02

[...]

2.81804006881059e+00 6.89967555695907e-01 8.30537612378975e-01

Nrho = 600 NYe = 1 NT = 1

RhoMin = 1e-09 RhoMax = 0.01

HeatCapacityE = 1

GammaTh = 2

Kappa = 1

RhoSpacing = Log

1.57940636422747e-03 1.38773826035349e+00 2.62139412738900e-02

[...]

2.81804006881059e+00 6.89967555695907e-01 8.30537612378975e-01

The header completely determines the range in baryon rest mass density (in $c=G={M}_{\odot}=1$ units), gives the number of zones (currently only NYe = 1, NT = 1, HeatCapacityE = 1, and RhoSpacing = Log are supported). GammaTh is the ${\Gamma}_{}$

th$ofthethermalgammalaw.Thetabulatedcolumnsare$$\mathit{\epsilon}$, $\Gamma $, ${c}_{s}$ (the speed of sound of the cold component of the EOS). The pressure is obtained via $P=\kappa {\rho}^{\Gamma}$, where $\kappa $ is the Kappa scaling parameter.

Generally, $P=P\left(\rho ,\mathit{\epsilon}\right)$ in this EOS, but note that ${\mathit{\epsilon}}_{}$

th = $\mathit{\epsilon}-{\mathit{\epsilon}}_{}$

cold$.EOS\text{\_}Omniuseslinearinterpolationtofirstfind$P($\rho )$ and ${\mathit{\epsilon}}_{}$

cold($\rho )$ and then computes the thermal component analytically.

coldeos_read_table | BOOLEAN | Set to yes to read table. |

coldeos_use_thermal_gamma_law | BOOLEAN | Set to yes to use the thermal gamma law (default). |

coldeos_table_name | STRING | Path/Name of the table ﬁle. |

If you have a parameter ﬁle that uses the previous EOS interface in Cactus, you will have to convert it so that it runs with EOS_Omni. The following describes a set of simple rules for this conversion.

- Add EOS_Omni to the thorn list. You can then remove all other EOS_* thorns from the thorn list (or you can leave them in; they are unused).
- Activate EOS_Omni in the parameter ﬁle: Add EOS_Omni to your active thorns, and do not activate any other EOS_* thorns.
- Translate all EOS parameters according to table 1.
- All thorns using this EOS interface will have a parameter that determines which EOS to use, typically via a string/keyword parameter specifying an EOS name. Convert these names using table 2.

Old Parameter | Old Value | New Parameter | New Value |

EOS_Polytrope::eos_gamma | EOS_Omni::poly_gamma | ||

EOS_Polytrope::eos_k | EOS_Omni::poly_k | ||

EOS_Polytrope::use_cgs | yes | — | |

EOS_Polytrope::use_cgs | no | unsupported | |

EOS_Polytrope::gamma_ini | EOS_Omni::poly_gamma_ini | ||

EOS_Ideal_Fluid::eos_ideal_ﬂuid_gamma | EOS_Omni::gl_gamma | ||

TODO: complete this table |