EOS_Omni

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

February 24, 2013

Abstract

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)

Here,

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:

eos_omni::poly_gamma  
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 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)ρ𝜖

th.

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

References

[1]   Janka, H.-T., Zwerger, T., & Moenchmeyer, R. 1993, Astron. Astrophys., 268, 360

[2]   O’Connor, E., & Ott, C. D. 2010, Class. Quantum Grav., 27, 114103

[3]   Douchin, F., & Haensel, P. 2001, Astron. Astrophys., 380, 151

[4]   Haensel, P., & Potekhin, A. Y. 2004, Astron. Astrophys., 428, 191

[5]   Shibata, M., Taniguchi, K., & Uryū, K. 2005, Phys. Rev. D, 71, 084021

[6]   Corvino, G., Rezzolla, L., Bernuzzi, S., De Pietri, R., & Giacomazzo, B. 2010, Class. Quantum Grav., 27, 114104

6 Parameters




barotropiceos_gammath
Scope: restricted  REAL



Description: thermal gamma for barotropic EOS



Range   Default: 2.0
1.0:*
something






barotropiceos_read_table
Scope: restricted  BOOLEAN



Description: Read in barotropic EOS table?



  Default: No






barotropiceos_table_name
Scope: restricted  STRING



Description: table name for barotropic EOS (ASCII)



Range   Default: blah.asc
.*
Can be anything






barotropiceos_use_thermal_gamma_law
Scope: restricted  BOOLEAN



Description: use an additional thermal gamma?



  Default: Yes






coldeos_read_table
Scope: restricted  BOOLEAN



Description: Read in cold EOS table?



  Default: No






coldeos_table_name
Scope: restricted  STRING



Description: table name for cold EOS (ASCII)



Range   Default: blah.asc
.*
Can be anything






coldeos_use_thermal_gamma_law
Scope: restricted  BOOLEAN



Description: use an additional thermal gamma?



  Default: Yes






do_energy_shift
Scope: restricted  BOOLEAN



Description: shift energies around?



  Default: yes






dump_nuceos_table
Scope: restricted  BOOLEAN



Description: Dump table in ASCII at beginning



  Default: No






dump_nuceos_table_name
Scope: restricted  STRING



Description: nuceos dump table name (ASCII)



Range   Default: blah.asc
.*
Can be anything






gl_gamma
Scope: restricted  REAL



Description: Adiabatic Index for gamma-law EOS



Range   Default: 2.0
:






gl_k
Scope: restricted  REAL



Description: Polytropic constant in c=G=Msun=1 for gamma-law EOS



Range   Default: 100.0
:






hybrid_gamma1
Scope: restricted  REAL



Description: subnuclear adiabatic Index for hybrid EOS



Range   Default: 1.325
:






hybrid_gamma2
Scope: restricted  REAL



Description: subnuclear adiabatic Index for hybrid EOS



Range   Default: 2.5
:






hybrid_gamma_th
Scope: restricted  REAL



Description: Thermal gamma for hybrid EOS



Range   Default: 1.5
:






hybrid_k1
Scope: restricted  REAL



Description: Polytropic constant in c=G=Msun=1 for hybrid EOS



Range   Default: 0.4640517
:






hybrid_rho_nuc
Scope: restricted  REAL



Description: Density at which to switch between gammas; c=G=Msun=1



Range   Default: 3.238607e-4
:






nuceos_read_table
Scope: restricted  BOOLEAN



Description: Read in EOS table?



  Default: No






nuceos_table_name
Scope: restricted  STRING



Description: nuceos table name (hdf5)



Range   Default: blah.h5
.*
Can be anything






poly_gamma
Scope: restricted  REAL



Description: Adiabatic Index for poly EOS



Range   Default: 2.0
:






poly_gamma_initial
Scope: restricted  REAL



Description: Initial Adiabatic Index for poly EOS



Range   Default: -1
-1
use poly_gamma, ie no change in gamma during ID
(0:*
assume that ID used this adiabiatic index, keep poly_k constant in cgs units






poly_k
Scope: restricted  REAL



Description: Polytropic constant in c=G=Msun=1



Range   Default: 100.0
:






read_table_on_single_process
Scope: restricted  BOOLEAN



Description: read table on one process only and bcast data



  Default: no






reader_process
Scope: restricted  INT



Description: read table on this process and bcast data



Range   Default: (none)
0:*
read on process N






out_dir
Scope: shared from IO STRING



7 Interfaces

General

Implements:

eos_omni

Provides:

EOS_Omni_GetHandle to

EOS_Omni_press to

EOS_Omni_press_cs2 to

EOS_Omni_pressOMP to

EOS_Omni_DPressByDEps to

EOS_Omni_DPressByDRho to

EOS_Omni_dpderho_dpdrhoe to

EOS_Omni_cs2 to

EOS_Omni_EpsFromPress to

EOS_Omni_RhoFromPressEpsTempEnt to

EOS_Omni_PressEpsTempYe_from_Rho to

EOS_Omni_short to

EOS_Omni_full to

EOS_Omni_DEpsByDRho_DEpsByDPress to

EOS_Omni_press_f_hrho_v2_rhoW to

EOS_Omni_dpdhrho_f_hrho_v2_rhoW to

EOS_Omni_dpdv2_f_hrho_v2_rhoW to

8 Schedule

This section lists all the variables which are assigned storage by thorn EinsteinEOS/EOS_Omni. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage

NONE

Scheduled Functions

CCTK_WRAGH

  eos_omni_startup

  set up conversion factors and other fun stuff

 

 Language:fortran
 Options: global
 Type: function

CCTK_BASEGRID (conditional)

  nuc_eos_readtable_cactus_wrapper

  read eos hdf5 table

 

 Language:c
 Options: global
 Type: function

CCTK_BASEGRID (conditional)

  eos_omni_get_energy_shift

  setup energy_shift in eos_omni_module

 

 After: nuc_eos_readtable_cactus_wrapper
 Language:fortran
 Options: global
 Type: function

CCTK_BASEGRID (conditional)

  eos_omni_dumptable

  dump eos hdf5 table in ascii

 

 After: nuc_eos_readtable_cactus_wrapper
 Language:c
 Options: global
 Type: function

CCTK_BASEGRID (conditional)

  eos_omni_readcoldtable

  read cold eos ascii table

 

 Language:fortran
 Options: global
 Type: function

CCTK_BASEGRID (conditional)

  eos_omni_barotropicreadtable

  read barotropic eos ascii table

 

 Language:fortran
 Options: global
 Type: function