Christian D. Ott <cott@tapir.caltech.edu>,
Erik Schnetter <eschnetter@perimeterinstitute.ca>

February 24, 2013


This thorn provides a unified EOS (Equation Of State) interface and implements multiple analytic EOS, and also provides table reader and interpolation routines for finite-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.

1 Introduction

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 ρ, specific internal energy 𝜖 (or temperature T), and electron fraction Y e being the independent variables. EOS_Omni can be called on arrays or on single grid points.

2 Units

This thorn uses solar units where c = G = M = 1. Temperatures are measured in MeV.

3 Using This Thorn

3.1 Basic Usage

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)


3.2 Parameter Settings

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:


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 different 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 ([K] = N m2 m3 kg Γ) depend on poly_gamma this is not fully trivial.

Check param.ccl for parameters for the other EOS.

4 Equations of State Details

4.1 Polytropic

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

p = Kργ (1)

where p is the pressure, ρ the density, K the polytropic constant set via poly_k, and γ is the adiabatic index set via poly_gamma.

If the internal energy 𝜖 is to be “calculated from the temperature” (havetemp = 1), then this is done using the relation

𝜖 = K γ 1ργ1 (2)

(which actually ignores the temperature).

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

4.2 Gamma-Law

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

p = (γ 1)ρ𝜖 (3)

where p is the pressure, ρ the density, 𝜖 the internal energy, and γ is the adiabatic index set via gl_gamma.

At the initial data stage, it may be necessary to set up initial values for 𝜖. 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.

4.3 Hybrid

The hybrid EOS was introduced by [1] for use in simplified simulations of stellar collapse to mimic (1) the stiffening of the nuclear EOS at nuclear density and (2) to include thermal pressure in the postbounce phase. It consists of two polytropes characterized by (K1, γ1) and (K2, γ2) and a thermal γlaw component described by γth. Polytrope 1 is soft and describes a gas of relativistic degenerate electrons with γ1 43. It is used below nuclear density (ρnuc 2 × 1014gcm3), and is smoothly matched to polytrope 2 which applies above ρnuc, is stiff, and models the repulsive core of the strong force above nuclear density (γ2 2.5). K2 is completely determined by P1(ρnuc) = P2(ρnuc) and K1,γ1, and γ2. The full functional form of the EOS P = P(ρ,𝜖) with the thermal component (which takes into account shock heating) is given by

P = γ γth γ 1 Kρnucγ1γργ (γth 1)(γ γ1) (γ1 1)(γ2 1) Kρnucγ11ρ + (γ th 1)ρ𝜖. (4)

The EOS_Omni parameters for the hybrid EOS are the following:

hybrid_gamma1 γ1, γ1 = 1.325 is an appropriate choice.
hybrid_gamma2 γ2, γ2 = 2.5 is an appropriate choice.
hybrid_gamma_thγth, perhaps 1.5.
hybrid_k1 K1, 0.4640517 in solar units for relativistic degenerate e.
hybrid_rho_nuc nuclear density, standard is 3.238607 × 104 in solar units.

4.4 Finite-Temperature Nuclear EOS

Complex microphysical finite-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 finite-temperature nuclear EOS are the following:

nuceos_read_tableBOOLEANSet to yes to read table.
do_energy_shift BOOLEANSet to yes to subtract the energy shift
stored in the table to get correctly normalized 𝜖.
nuceos_table_name STRING Path/Name of the table file.

4.5 Cold Tabulated Nuclear EOS with Gamma Law

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 = (Γ

th - 1)ρ𝜖


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 [34], which was generated according to the prescription in [56]). All EOS parameters are read from the ASCII file, 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

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

thofthethermalgammalaw.Thetabulatedcolumnsare𝜖, Γ, cs (the speed of sound of the cold component of the EOS). The pressure is obtained via P = κρΓ, where κ is the Kappa scaling parameter.

Generally, P = P(ρ,𝜖) in this EOS, but note that 𝜖

th = 𝜖 𝜖

cold.EOS_OmniuseslinearinterpolationtofirstfindP(ρ) and 𝜖

cold(ρ) and then computes the thermal component analytically.

coldeos_read_table BOOLEANSet to yes to read table.
coldeos_use_thermal_gamma_lawBOOLEANSet to yes to use the thermal gamma law (default).
coldeos_table_name STRING Path/Name of the table file.

5 Converting Old Parameter Files

If you have a parameter file 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.

  1. 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).
  2. Activate EOS_Omni in the parameter file: Add EOS_Omni to your active thorns, and do not activate any other EOS_* thorns.
  3. Translate all EOS parameters according to table 1.
  4. 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 ValueNew 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_fluid_gamma EOS_Omni::gl_gamma
TODO: complete this table

Table 1: Parameter conversion table

EOS Description Old NameNew Name

poly polytropic ??? 2D_Polytrope
gl gamma-law ??? Ideal_Fluid
hybridhybrid ??? Hybrid
nuc finite-temperature nuclear??? nuc_eos

Table 2: EOS name conversion table