![]() |
Equation of State Sub-Library: Version 0.910
|
A base class for the supernova EOSs [abstract]. More...
#include <gen_sn_eos.h>
This class is experimental.
The EOSs are stored in a set of tensor_grid3 objects on grids with density in , electron fraction (unitless) and temperature in MeV.
Some tabulated EOSs do not store data for gen_sn_eos::E, gen_sn_eos::F, gen_sn_eos::S, and gen_sn_eos::P. In that case, the grid is set for these objects but the data is set to zero. To compute these from the data after loading the EOS table, use gen_sn_eos::compute_eg().
The function load() loads the entire EOS into memory. Memory allocation is automatically performed by load(), but not deallocated until free() or the destructor is called.
After loading, you can interpolate the EOS by using tensor_grid3::interp directly. For example, the following returns the mass number at an arbitrary baryon density, electron fraction, and temperature assuming the table is stored in skm.dat
:
ls_eos ls; ls.load("skm.dat"); double nb=0.01, Ye=0.2, T=10.0; cout << A.interp(nb,Ye,T) << endl;
Interpolation for all EOSs is linear by default.
Ensure all chemical potentials are based on the same rest masses?
Allow logarithmic grids for any of nb, Ye, or T.
Definition at line 84 of file gen_sn_eos.h.
Public Member Functions | |
int | check_free_energy (test_mgr &tm) |
Test the free energy and store results in tm . | |
virtual void | beta_eq_T0 (size_t i, double &nb, double &E_beta, double &P_beta, double &Ye_beta, double &Z_beta, double &A_beta)=0 |
Compute energy per baryon of matter in beta equilibrium at zero temperature at a fixed grid point [abstract]. | |
virtual void | beta_eq_sfixed (size_t i, double entr, double &nb, double &E_beta, double &P_beta, double &Ye_beta, double &Z_beta, double &A_beta, double &T_beta) |
Compute properties of matter in beta equilibrium at s=4. | |
Memory allocation | |
int | alloc () |
Allocate memory. | |
int | free () |
Free allocated memory. | |
Data Fields | |
int | verbose |
Verbosity parameter (default 1) | |
Data | |
tensor_grid3 | F |
Total free energy per baryon in MeV. | |
tensor_grid3 | Fint |
Free energy per baryon without lepton and photon contributions in MeV. | |
tensor_grid3 | E |
Total internal energy per baryon in MeV. | |
tensor_grid3 | Eint |
Internal energy per baryon without lepton and photon contributions in MeV. | |
tensor_grid3 | P |
Total pressure in ![]() | |
tensor_grid3 | Pint |
Pressure without lepton and photon contributions in ![]() | |
tensor_grid3 | S |
Total entropy per baryon. | |
tensor_grid3 | Sint |
Entry per baryon without lepton and photon contributions. | |
tensor_grid3 | mun |
Neutron chemical potential in MeV. | |
tensor_grid3 | mup |
Proton chemical potential in MeV. | |
tensor_grid3 | Z |
Proton number. | |
tensor_grid3 | A |
Mass number. | |
tensor_grid3 | Xn |
Neutron fraction. | |
tensor_grid3 | Xp |
Proton fraction. | |
tensor_grid3 | Xalpha |
Alpha particle fraction. | |
tensor_grid3 | Xnuclei |
Fraction of heavy nuclei. | |
tensor_grid3 | other [20] |
Other data sets. | |
tensor_grid3 * | arr [n_base+20] |
List of pointers to data. | |
Load table | |
bool | loaded |
If true, a EOS table was successfully loaded (default false) | |
bool | with_leptons_loaded |
True if thermodynamics with leptons has been loaded. | |
bool | baryons_only_loaded |
True if baryon-only thermodynamics has been loaded. | |
virtual void | load (std::string fname)=0 |
Load table from filename fname . | |
Grid and data sizes | |
size_t | n_nB |
Size of baryon density grid. | |
size_t | n_Ye |
Size of electron fraction grid. | |
size_t | n_T |
Size of temperature grid. | |
size_t | n_oth |
Number of additional data sets. | |
static const size_t | n_base = 16 |
Number of base data sets. | |
Interpolation | |
def_interp_mgr< uvector_base, linear_interp > | dim1 |
Default interpolation object. | |
def_interp_mgr < uvector_const_subvector, linear_interp > | dim2 |
Default interpolation object. | |
int | set_interp (base_interp_mgr< uvector_base > &bi1, base_interp_mgr< uvector_const_subvector > &bi2) |
Set interpolation managers. | |
Electron and photon contribution | |
boson | photon |
Photon. | |
fermion | electron |
Electron;. | |
rel_fermion | relf |
Desc. | |
eff_boson | effb |
Desc. | |
int | compute_eg () |
Compute the electron and photon contribution for the full grid. |
int gen_sn_eos::compute_eg | ( | ) |
This function computes the data for E, P, S,
and F
by adding electrons and photons to the baryon contributions stored in Eint, Pint, Sint,
and Fint
.
The electron contribution to the internal energy and free energy computed by this function includes the electron rest mass.
int gen_sn_eos::check_free_energy | ( | test_mgr & | tm | ) |
This checks that the data in Fint
is consistent with that in Eint
and Sint
.
virtual void gen_sn_eos::beta_eq_T0 | ( | size_t | i, |
double & | nb, | ||
double & | E_beta, | ||
double & | P_beta, | ||
double & | Ye_beta, | ||
double & | Z_beta, | ||
double & | A_beta | ||
) | [pure virtual] |
Given an index i
for the baryon grid, between 0 and n_nB (inclusive), this computes the properties of matter in beta equilibrium at zero temperature by finding the electron fraction grid point which minimizes E. The baryon density is returned in nb
, the energy per baryon in E_beta
, the pressure in P_beta
, the electron fraction in Ye_beta
, the proton number in Z_beta
and the mass number of the nucleus in A_beta
.
Some tables explicitly contain zero-temperature data which is used when it is available. Otherwise, linear interpolation is used to extrapolate down to zero from the lowest temperature grid points.
Implemented in hfsl_eos, sht_eos, stos_eos, oo_eos, and ls_eos.
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).