xx EOSOmni

EOSxOmni

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 n-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.

EOSxOmni 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 ), and electron fraction being the independent variables. EOSxOmni can be called on arrays or on single grid points.

2 Units

This thorn uses solar units where . Temperatures are measured in MeV.

3 Using This Thorn

3.1 Basic Usage

EOSxOmni 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:

voidxFUNCTIONxEOS_Omni_press(CCTK_INTxINxeoskey,xxxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_INTxINxhavetemp,xxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxINxrf_precision,xx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_INTxINxnpoints,xxxxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxINxARRAYxrho,xxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxINOUTxARRAYxeps,xx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxINOUTxARRAYxtemp,x\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxINxARRAYxye,xxxxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_REALxOUTxARRAYxpressxxx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_INTxOUTxARRAYxkeyerr,xx\
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxCCTK_INTxOUTxanyerr)

Here,

eoskey is the type of EOS to be used in this call.

havetemp determines whether the EOS is to be called as a function of (havetemp = 0), or as a function of (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 ) to obtain initial values for . In the case of a finite-temperature EOS (that usually is a function of ), a call with havetemp = 0 will first lead to the solution of ) via a Newton-Raphson-type iteration (using the supplied value of as the starting point) and will then calculate the requested dependent variable as a function of . Both and the updated are returned.

npoints tells the EOS how many data points are passed in,

     rho,eps,temp,ye,press are obvious,

rfxprecision is a real number telling the root finding algorithm (for finding ) at what relative error to terminate the iteration. is a good value. keyerr is an array (with entries for data points) containing error codes (relevant only for tabulated microphysical EOS), anyerr is an integer in case any error occured.

The eoskey is obtained by calling EOSxOmnixGetHandle with the name of desired EOS. The currently available EOS are: 2DxPolytrope

Polytropic EOS, IdealxFluid

Gamma-Law EOS, Hybrid

Hybrid EOS (N Polys, 1 Gamma-Law), used for stellar core collapse simulations, nucxeos

Finite-temperature microphysical EOSm coldxtabulated

Cold tabulated EOS with Gamma-Lawm barotropicxtabulated

Tabulated barotropic EOS.

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 EOSxOmni 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 polyxgammaxinitial. 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, polyxgamma should be the evolution value, and polyxgammaxinitial should be the initial data value. EOSxOmni then rescales polyxk such that the cgs value of polyxk is the same for initial data and evolution. Since the units of polyxk () depend on polyxgamma 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:

where is the pressure, the density, the polytropic constant set via polyxk, and is the adiabatic index set via

polyxgamma.

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

(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:

where is the pressure, the density, the internal energy, and is the adiabatic index set via glxgamma.

At the initial data stage, it may be necessary to set up initial values for . For this, the gl EOS implements equation (??) just like the poly EOS and the parameters polyxgammaxini and glxk 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 nxpieces polytropes (cold) characterized by (, ) and a thermal law component described by . Polytrope is used below the dividing density hybridxrho[i] and is smoothly matched to polytrope at the dividing density. Because of this for is completely determined by requiring continuity of across

hybridxrho[i], , and .

where is determined by requiring continuity of . The full functional form of the EOS includes a thermal component, which takes into account shock heating:

The EOSxOmni parameters for the hybrid EOS are the following:

11nxpieces      11number of piecewise polytropic pieces,

11hybridxgamma   11, ,
11hybridxgammaxth11,
11hybridxk0      11,

11hybridxrho     11dividing densities, .

For example for a simple 2-piece piecewise polytropic EOS mimicking a nuclear equation of state:

11hybridxgamma[0]11 is an appropriate choice.
11hybridxgamma[1] 11 is an appropriate choice.

11hybridxgammaxth 11, perhaps .

11hybridxk0       11, in solar units for relativistic degenerate e.
11hybridxrho[0]   11nuclear density, standard is in solar units.

4.4 Finite-Temperature Nuclear EOS

Complex microphysical finite-temperature equations of state come usually in tabulated form. EOSxOmni comes with routines provided as part of the nucxeos 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:

 11nuceosxreadxtable11BOOLEAN11Set to yes to read table.

11doxenergyxshift   11BOOLEAN11Set to yes to subtract the energy shift
11                  11          11stored in the table to get correctly normalized .
11nuceosxtablexname 11STRING 11Path/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: .

EOSxOmni 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,x4], which was generated according to the prescription in [5,x6]). All EOS parameters are read from the ASCII file, which has the following format:

EoSTypex=xTabulated
Nrhox=x600xxxxNYex=x1xxxxxNTx=x1
RhoMinx=x1e-09xxRhoMaxx=x0.01
HeatCapacityEx=x1
GammaThx=x2
Kappax=x1
RhoSpacingx=xLog
xxxx1.57940636422747e-03xxxx1.38773826035349e+00xxxx2.62139412738900e-02
[...]
xxxx2.81804006881059e+00xxxx6.89967555695907e-01xxxx8.30537612378975e-01

The header completely determines the range in baryon rest mass density (in units), gives the number of zones

(currently only NYe = 1, NT = 1, HeatCapacityE = 1, and RhoSpacing = Log are supported).

GammaTh is the of the thermal gamma law. The tabulated columns are , , (the speed of sound of the cold component of the EOS). The pressure is obtained via , where is the Kappa scaling parameter.

Generally, in this EOS, but note that . EOSxOmni uses linear interpolation to first find and and then computes the thermal component analytically.

 11coldeosxreadxtable          11BOOLEAN11Set to yes to read table.

11coldeosxusexthermalxgammaxlaw11BOOLEAN11Set to yes to use the thermal gamma law (default).
11coldeosxtablexname           11STRING 11Path/Name of the table file.

11

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 EOSxOmni. The following describes a set of simple rules for this conversion.

Add EOSxOmni to the thorn list. You can then remove all other EOSx* thorns from the thorn list (or you can leave them in; they are unused). Activate EOSxOmni in the parameter file: Add EOSxOmni to your active thorns, and do not activate any other EOSx* 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

11Old Parameter  11Old Value11New Parameter  11New Value
11EOSxPolytrope::eosxgamma  11        11EOSxOmni::polyxgamma 11
11EOSxPolytrope::eosxk  11        11EOSxOmni::polyxk  11
11EOSxPolytrope::usexcgs  11yes  11—  11
11EOSxPolytrope::usexcgs  11no  11unsupported  11
11EOSxPolytrope::gammaxini  11        11EOSxOmni::polyxgammaxini11
11EOSxIdealxFluid::eosxidealxfluidxgamma11        11EOSxOmni::glxgamma  11

11TODO: complete this table Tablex1: Parameter conversion table

11EOS 11Description  11Old Name11New Name
11poly 11polytropic  11???  112DxPolytrope
11gl  11gamma-law  11???  11IdealxFluid
11hybrid11hybrid  11???  11Hybrid
11nuc 11finite-temperature nuclear11???  11nucxeos

Tablex2: EOS name conversion table References

[1]xxxJanka, H.-T., Zwerger, T., & Moenchmeyer, R.x1993, Astron. Astrophys., 268, 360 [2]xxxO’Connor, E., & Ott, C.xD.x2010, Class. Quantum Grav., 27, 114103 [3]xxxDouchin, F., & Haensel, P.x2001, Astron.xAstrophys., 380, 151 [4]xxxHaensel, P., & Potekhin, A.xY.x2004, Astron.xAstrophys., 428, 191 [5]xxxShibata, M., Taniguchi, K., & Uryu, K.x2005, Phys.xRev.xD, 71, 084021 [6]xxxCorvino, G., Rezzolla, L., Bernuzzi, S., De Pietri, R., & Giacomazzo, B.x2010, Class. Quantum

Grav., 27, 114104

6 Parameters

11barotropiceosxgammath 10Scope: restrictedx01 REAL

11Description: thermal gamma for barotropic EOS

11 Range 10 x01 Default: 2.0
111.0:*  10something

11barotropiceosxreadxtable  10Scope: restrictedx01  BOOLEAN

11Description: Read in barotropic EOS table?

11                              10  x01  Default: No

11

11barotropiceosxtablexname  10Scope: restrictedx01  STRING

11Description: table name for barotropic EOS (ASCII)

11 Range 10 x01 Default: blah.asc
11.+  10Can be anything

11

11barotropiceosxusexthermalxgammaxlaw 10Scope: restrictedx01  BOOLEAN

11Description: use an additional thermal gamma?

11                              10  x01  Default: Yes

11

11coldeosxreadxtable  10Scope: restrictedx01  BOOLEAN

11Description: Read in cold EOS table?

11                              10  x01  Default: No

11

11coldeosxtablexname  10Scope: restrictedx01  STRING

11Description: table name for cold EOS (ASCII)

11 Range 10 x01 Default: blah.asc
11.+  10Can be anything

11

11coldeosxusexthermalxgammaxlaw 10Scope: restrictedx01  BOOLEAN

11Description: use an additional thermal gamma?

11                              10  x01  Default: Yes

11

11doxenergyxshift  10Scope: restrictedx01  BOOLEAN

11Description: shift energies around?

11                              10  x01  Default: yes

11

11dumpxnuceosxtable  10Scope: restrictedx01  BOOLEAN

11Description: Dump table in ASCII at beginning

11                              10  x01  Default: No

11

11dumpxnuceosxtablexname  10Scope: restrictedx01  STRING

11Description: nuceos dump table name (ASCII)

11 Range 10 x01 Default: blah.asc
11.+  10Can be anything

11

11glxgamma  10Scope: restrictedx01  REAL

11Description: Adiabatic Index for gamma-law EOS

11 Range 10 x01 Default: 2.0
11(0:*  10any positive number

11

11glxk  10Scope: restrictedx01  REAL

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

11 Range 10 x01 Default: 100.0
11(0:*  10any positive number

11

11hybridxgamma  10Scope: restrictedx01  REAL

11Description: Adiabatic index of each piece

11 Range 10 x01 Default: 0.0
11                              10unset
11(0:*  10Any positive

11hybridxgamma1  10Scope: restrictedx01  REAL

11Description: subnuclear adiabatic Index for hybrid EOS

11 Range 10 x01 Default: 1.325
11(0:*  10Any positive

11

11hybridxgamma2  10Scope: restrictedx01  REAL

11Description: subnuclear adiabatic Index for hybrid EOS

11 Range 10 x01 Default: 2.5
11(0:*  10Any positive

11

11hybridxgammaxth  10Scope: restrictedx01  REAL

11Description: Thermal gamma for hybrid EOS

11 Range 10 x01 Default: 1.5
11(0:*  10any positive number

11

11hybridxk0  10Scope: restrictedx01  REAL

11Description: K coefficent of the first piece

11 Range 10 x01 Default: 0.0
11                              10unset
11(0:*  10Any positive

11

11hybridxk1  10Scope: restrictedx01  REAL

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

11 Range 10 x01 Default: 0.4640517
11(0:*  10Any positive

11

11hybridxrho  10Scope: restrictedx01  REAL

11Description: Density values at separation points

11 Range 10 x01 Default: 0.0
11                              10unset
11(0:*  10Any positive

11

11hybridxrhoxnuc  10Scope: restrictedx01  REAL

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

11 Range 10 x01 Default: 3.238607e-4
11(0:*  10Any positive

11

11nxpieces  10Scope: restrictedx01  INT

11Description: Number of polytropic pieces

11 Range 10 x01 Default: 2
111:10  10Max 10 pieces

11

11nuceosxreadxtable  10Scope: restrictedx01  BOOLEAN

11Description: Read in EOS table?

11                              10  x01  Default: No

11

11nuceosxtablexname  10Scope: restrictedx01  STRING

11Description: nuceos table name (hdf5)

11 Range 10 x01 Default: blah.h5
11.+  10Can be anything

11polyxgamma  10Scope: restrictedx01  REAL

11Description: Adiabatic Index for poly EOS

11 Range 10 x01 Default: 2.0
11(0:*  10any positive number

11

11polyxgammaxinitial  10Scope: restrictedx01  REAL

11Description: Initial Adiabatic Index for poly and hybrid EOS

11 Range 10 x01 Default: -1
11-1  10”use polyxgamma/hybridxga mma, ie no change in gamma during ID”
11(0:*  10assume that ID used this adiabiatic index, change K accordingly

11

11polyxk  10Scope: restrictedx01  REAL

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

11  Range  10  x01  Default: 100.0

11:  10

11

11readxtablexonxsinglexprocess  10Scope: restrictedx01  BOOLEAN

11Description: read table on one process only and bcast data

11                              10  x01  Default: no

11

11readerxprocess  10Scope: restrictedx01  INT

11Description: read table on this process and bcast data

11 Range 10 x01 Default: (none)
110:*  10read on process N

11

11outxdir  10Scope: shared from IOx01STRING

11

7 Interfaces

General Implements: eosxomni

Provides: EOSxOmnixGetHandle to EOSxOmnixpress to EOSxOmnixpressxcs2 to EOSxOmnixpressOMP to EOSxOmnixDPressByDEps to EOSxOmnixDPressByDRho to EOSxOmnixdpderhoxdpdrhoe to EOSxOmnixcs2 to EOSxOmnixEpsFromPress to EOSxOmnixRhoFromPressEpsTempEnt to EOSxOmnixPressEpsTempYexfromxRho to EOSxOmnixshort to EOSxOmnixfull to EOSxOmnixDEpsByDRhoxDEpsByDPress to EOSxOmnixpressxfxhrhoxv2xrhoW to EOSxOmnixdpdhrhoxfxhrhoxv2xrhoW to EOSxOmnixdpdv2xfxhrhoxv2xrhoW to

8 Schedule This section lists all the variables which are assigned storage by thorn EinsteinEOS/EOSxOmni. 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

CCTKxSTARTUP x eosxomnixstartup x set up conversion factors and other fun stuff x

11x11Language:11fortran
11 x 11Options: 11global
11 x 11Type: 11function

11

CCTKxBASEGRID (conditional) x nucxeosxreadtablexcactusxwrapper x read eos hdf5 table

11x11Language:11c
11 x 11Options: 11global
11 x 11Type: 11function

11

CCTKxBASEGRID (conditional) x eosxomnixgetxenergyxshift x setup energyxshift in eosxomnixmodule x

11x11After: 11nucxeosxreadtablexcactusxwrapper
11 x 11Language:11fortran
11 x 11Options: 11global
11 x 11Type: 11function

11

CCTKxBASEGRID (conditional) x eosxomnixdumptable x dump eos hdf5 table in ascii x

11x11After: 11nucxeosxreadtablexcactusxwrapper
11 x 11Language:11c
11 x 11Options: 11global
11 x 11Type: 11function

11

CCTKxBASEGRID (conditional) x eosxomnixreadcoldtable x read cold eos ascii table x

11x11Language:11fortran
11 x 11Options: 11global
11 x 11Type: 11function

11

CCTKxBASEGRID (conditional) x eosxomnixbarotropicreadtable x read barotropic eos ascii table x

11x11Language:11fortran
11 x 11Options: 11global
11 x 11Type: 11function