Many codes used to simulate core collapse supernova events use the equations of state (EOS) for nuclear matter that comes from or are tabulated in the format of stellarcollapse. However, CompOSE provides a large database of EOSs as well as a code to generate EOS tables both in ASCII and h5 formats.
This script takes a CompOSE EOS table in h5 format and reshapes it in the format of the stellarcollapse tables, always in h5. It was meant to work for general purpose EOSs, so I did not test for the other families.
It does not interpolate any quantity in the EOS table. If you want to interpolate, you have to do with the CompOSE code before using this script.
This script requires the following python packages:
to install them, you can use pip and the provided requirements.txt
file:
pip install -r requirements.txt
The scripts requires the following files:
eoscompose.h5
: the CompOSE EOS table in h5 format, needed to read in the dataeos.info.json
: the indices dictionary, needed to read in the data and to know which index corresponds to which quantity
There is one additional file that is not required, but it is needed to have a more consistent table conversion:
eos.thermo
: from this file is only needed the first row, where the neutron and proton masses used to generate this particular EOS table are stored. If it is not present, the masses are set to the default values of 939.56542052 Mev and 938.2720813 Mev, respectively.
The three independent variables temperature (
-
Thermodynamic quantities
- Pressure (
$P$ ) - Entropy per baryon (
$s$ ) - Shifted baryon chemical potential
$\mu_b-m_n$ - Scaled internal energy per baryon
$\frac{\varepsilon}{m_n}-1$ - Square of speed of sound
$c_s^2$ - Charge chemical potential
$\mu_q$ - Lepton chemical potential
$\mu_l$ - Epsilon (energy density)
- Pressure (
-
Chemical composition
- Proton (
$p$ ) - Neutron (
$n$ ) - Alpha (
$\alpha$ ) - Heavy nuclei (
$A>4$ )
- Proton (
Just run the reshape_EOS.py
, it will ask you to provide the path of the folder where the files are stored and the how you wish to name the output file. The output file will be stored in the same folder as the input files.
If you renamed any of the files, fear not, it will ask you to provide the new names.
The output file contains at least:
- The three independent variables temperature (
$T$ ), density ($\rho$ ), inlogscale
, and electron fraction ($Y_e$ ) - Mass fraction of proton, neutrons and alpha particles (
$X_*$ ) - Mass fraction, average mass number and average proton number of heavy nuclei (
$X_A$ ,$\overline{A}$ ,$\overline{Z}$ ) - pressure and internal energy (in
logscale
), an energy shift is applied to the internal energy to make it always positive - entropy per baryon (
$s$ ), square of speed of sound ($c_s^2$ ) and adiabatic index ($\Gamma$ ) - chemical potential of proton, neutron and electron including their rest masses (
$\mu_*$ ) -
$\hat{\mu} = \mu_n - \mu_p$ and$\mu_\nu = \mu_e - \hat{\mu}$ In addition it could contain(dependin on what is stored in theeoscompose.h5
): - Mass fraction of any additional particle with
$A\leq 4$ - Fractions of any subatomic particles
$Y_*$ - Derivatives of the thermodynamic quantities
CompOSE tables are given in natural units
CompOSE tables store the adiabatic index as
CompOSE does not use the electron fraction as an independent variable, rather it uses the charge fraction
Some CompOSE tables store heavy nuclei as two different quantities (one for
Please note that the scripts provided here come with absolutely no warranty and I will not guarantee that mistake have not been made during conversions. If you decided to use it anyway, please check the output file and make sure that the results are physical. If you find any mistake, please let me know and I will try to fix it. I do not make any claim on the EOS tables provided here, they are provided as they are, and all the rights goes to CompOSE and stellarcollapse for their standards.