Equations of State
In this chapter on equations of state, we list the EOS routines available for your use, and then we describe the correct structure of an EOS module in case you want to build your own.
Available Equations of State
The following equations of state are available in Microphysics.
Except where noted, each of these EOSs will provide the full
thermodynamic data (including all derivatives) in the eos_t
type.
gamma_law
gamma_law
represents a gamma law gas, with
equation of state:
eos_gamma
. For
an ideal gas, this represents the ratio of specific heats. The gas is
assumed to be ideal, with the pressure given by
where assume_neutral = T
),
giving:
or completely ionized (assume_neutral = F
), giving:
The entropy comes from the Sackur-Tetrode equation. Because of the
complex way that composition enters into the entropy, the entropy
formulation here is only correct for a
Note that the implementation provided in Microphysics is the same as
the version shipped with MAESTRO, but more general than the
gamma_law
EOS provided with CASTRO. CASTRO’s default EOS only
fills the thermodynamic information in eos_t
that is required
by the hydrodynamics module in CASTRO.
polytrope
polytrope
represents a polytropic fluid, with equation of
state:
The gas is also assumed to obey the above gamma law relation
connecting the pressure and internal energy. Therefore polytrope_K
and polytrope_gamma
.
The runtime parameter polytrope_type
selects the pre-defined
polytropic relations. The options are:
polytrope_type = 1
: sets andwhere
is the mean molecular weight per electron, specified viapolytrope_mu_e
This is the form appropriate for a non-relativistic fully-degenerate electron gas.
polytrope_type = 2
: sets andThis is the form appropriate for a relativistic fully-degenerate electron gas.
ztwd
ztwd
is the zero-temperature degenerate electron equation
of state of Chandrasekhar (1935), which is designed to describe
white dward material. The pressure satisfies the equation:
with
The enthalpy was worked out by Hachisu (1986):
(note the unfortunate notation here, but this
Since the pressure-density relationship does not admit a closed-form solution for the density in terms of the pressure, if we call the EOS with pressure as a primary input then we do Newton-Raphson iteration to find the density that matches this pressure.
multigamma
multigamma
is an ideal gas equation of state where each
species can have a different value of
We recognize that the usual astrophysical
The specific heats are constructed as usual,
and it can be seen that the specific gas constant,
and
This equation of state takes several runtime parameters that can set
the
eos_gamma_default
: the default to apply for all speciesspecies_X_name
andspecies_X_gamma
: set the for the species whose name is given asspecies_X_name
to the value provided byspecies_X_gamma
. Here,X
can be one of the letters:a
,b
, orc
, allowing us to specify custom for up to three different species.
helmholtz
helmholtz
contains a general, publicly available stellar
equation of state based on the Helmholtz free energy, with
contributions from ions, radiation, and electron degeneracy, as
described in [TimmesArnett99], [TimmesSwesty00], [FryxellOlsonRicker+00].
We have modified this EOS a bit to fit within the context of our
codes. The vectorization is explicitly thread-safe for use with OpenMP
and OpenACC. In addition, we have added the ability to perform a
Newton-Raphson iteration so that if we call the EOS with density and
energy (say), then we will iterate over temperature until we find the
temperature that matches this density–energy combination. If we
cannot find an appropriate temperature, we will reset it to
small_temp
, which needs to be set in the equation of state wrapper
module in the code calling this. However, there is a choice of whether
to update the energy to match this temperature, respecting
thermodynamic consistency, or to leave the energy alone, respecting
energy conservation. This is controlled through the
eos.eos_input_is_constant
parameter in your inputs file.
We thank Frank Timmes for permitting us to modify his code and publicly release it in this repository.
stellarcollapse
stellarcollapse
is the equation of state module provided
on http://stellarcollapse.org. It is designed
to be used for core-collapse supernovae and is compatible with a
large number of equations of state that are designed to describe
matter near nuclear density. You will need to download an
appropriate interpolation table from that site to use this.
Interface and Modes
The EOS is called as:
eos(mode, eos_type)
where mode determines which thermodynamic quantities are inputs, and is one of:
eos_input_rt
: density and temperature are inputseos_input_rh
: density and specific enthalpy are inputseos_input_tp
: temperature and pressure are inputseos_input_rp
: density and pressure are inputseos_input_re
: density and specific internal energy are inputseos_input_ps
: pressure and entropy are inputseos_input_ph
: pressure and specific enthalpy are inputseos_input_th
: temperature and specific enthalpy are inputs
The eos_type passed in is one of
eos_t
: provides access to all available thermodynamic information, including derivatives.eos_re_t
: only provides the energy-based thermodynamic information, including energy derivatives.eos_rep_t
: expands oneos_re_t
to include pressure information
In general, you should use the type that has the smallest set of
information needed, since we optimize out needless quantities at
compile type (via C++ templating) for eos_re_t
and eos_rep_t
.
Note
All of these modes require composition as an input. Usually this is
via the set of mass fractions, eos_t.xn[]
, but if USE_AUX_THERMO
is set to TRUE
, then we instead use the auxiliary quantities
stored in eos_t.aux[]
.
Auxiliary Composition
With USE_AUX_THERMO=TRUE
, we interpret the composition from the auxiliary variables.
The auxiliary variables are
eos_state.aux[iye]
: electron fraction, defined aseos_state.aux[iabar]
: the average mass of the nuclei, , defined as:In many stellar evolutions texts, this would be written as
.eos_state.aux[ibea]
: the binding energy per nucleon (units of MeV), defined aswhere
is the binding energy of nucleus
Given a composition of mass fractions, the function
set_aux_comp_from_X(state_t& state)
will initialize these
auxiliary quantities.
The equation of state also needs
Initialization and Cutoff Values
Input Validation
The EOS will make sure that the inputs are within an acceptable range,
(e.g., small_temp
maxT
). If they are not, then it
resets them silently—no error is thrown.
If you are calling the EOS with eos_input_re
, and if eos_input_rt
with T =
max ( small_temp
, T ).
User’s are encourage to do their own validation of inputs before calling the EOS.
EOS Structure
Each EOS should have two main routines by which it interfaces to the
rest of CASTRO. At the beginning of the simulation,
actual_eos_init
will perform any initialization steps and save
EOS variables (mainly smallt
, the temperature floor, and
smalld
, the density floor). These variables are stored in the
main EOS module of the code calling these routines. This would be the
appropriate time for, say, loading an interpolation table into memory.
The main evaluation routine is called actual_eos
. It should
accept an eos_input and an eos_t state; see Section Data Structures.