SpECTRE
v2024.12.16
|
Base class for equations of state which need three independent thermodynamic variables in order to determine the pressure. More...
#include <EquationOfState.hpp>
Public Types | |
using | creatable_classes = typename detail::DerivedClasses< IsRelativistic, 3 >::type |
Public Member Functions | |
EquationOfState (const EquationOfState &)=default | |
EquationOfState & | operator= (const EquationOfState &)=default |
EquationOfState (EquationOfState &&)=default | |
EquationOfState & | operator= (EquationOfState &&)=default |
EquationOfState (CkMigrateMessage *msg) | |
WRAPPED_PUPable_abstract (EquationOfState) | |
virtual std::unique_ptr< EquationOfState< IsRelativistic, 3 > > | get_clone () const =0 |
virtual bool | is_equal (const EquationOfState< IsRelativistic, 3 > &rhs) const =0 |
virtual std::unique_ptr< EquationOfState< IsRelativistic, 3 > > | promote_to_3d_eos () |
virtual bool | is_barotropic () const =0 |
Returns true if the EOS is barotropic. More... | |
virtual bool | is_equilibrium () const =0 |
Returns true if the EOS is in beta-equilibrium. More... | |
virtual double | electron_fraction_lower_bound () const =0 |
The lower bound of the electron fraction that is valid for this EOS. More... | |
virtual double | electron_fraction_upper_bound () const =0 |
The upper bound of the electron fraction that is valid for this EOS. More... | |
virtual double | rest_mass_density_lower_bound () const =0 |
The lower bound of the rest mass density that is valid for this EOS. More... | |
virtual double | rest_mass_density_upper_bound () const =0 |
The upper bound of the rest mass density that is valid for this EOS. More... | |
virtual double | specific_internal_energy_lower_bound (const double rest_mass_density, const double electron_fraction) const =0 |
The lower bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\). More... | |
virtual double | specific_internal_energy_upper_bound (const double rest_mass_density, const double electron_fraction) const =0 |
The upper bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\). More... | |
virtual double | specific_enthalpy_lower_bound () const =0 |
The lower bound of the specific enthalpy that is valid for this EOS. More... | |
virtual double | temperature_lower_bound () const =0 |
The lower bound of the temperature that is valid for this EOS. More... | |
virtual double | temperature_upper_bound () const =0 |
The upper bound of the temperature that is valid for this EOS. More... | |
virtual double | baryon_mass () const |
The vacuum mass of a baryon for this EOS. More... | |
virtual Scalar< double > | equilibrium_electron_fraction_from_density_temperature (const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | equilibrium_electron_fraction_from_density_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
virtual Scalar< double > | pressure_from_density_and_energy (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | pressure_from_density_and_energy (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
virtual Scalar< double > | pressure_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | pressure_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
virtual Scalar< double > | temperature_from_density_and_energy (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | temperature_from_density_and_energy (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
virtual Scalar< double > | specific_internal_energy_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | specific_internal_energy_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
virtual Scalar< double > | sound_speed_squared_from_density_and_temperature (const Scalar< double > &, const Scalar< double > &, const Scalar< double > &) const =0 |
virtual Scalar< DataVector > | sound_speed_squared_from_density_and_temperature (const Scalar< DataVector > &, const Scalar< DataVector > &, const Scalar< DataVector > &) const =0 |
Static Public Attributes | |
static constexpr bool | is_relativistic = IsRelativistic |
static constexpr size_t | thermodynamic_dim = 3 |
Base class for equations of state which need three independent thermodynamic variables in order to determine the pressure.
The template parameter IsRelativistic
is true
for relativistic equations of state and false
for non-relativistic equations of state.
|
inlinevirtual |
The vacuum mass of a baryon for this EOS.
Reimplemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
The lower bound of the electron fraction that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
The upper bound of the electron fraction that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes the electron fraction in beta-equilibrium \(Y_e^{\rm eq}\) from the rest mass density \(\rho\) and the temperature \(T\).
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes the electron fraction in beta-equilibrium \(Y_e^{\rm eq}\) from the rest mass density \(\rho\) and the temperature \(T\).
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Returns true
if the EOS is barotropic.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Returns true
if the EOS is in beta-equilibrium.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes the pressure \(p\) from the rest mass density \(\rho\), the specific internal energy \(\epsilon\) and electron fraction \(Y_e\).
|
pure virtual |
Computes the pressure \(p\) from the rest mass density \(\rho\), the specific internal energy \(\epsilon\) and electron fraction \(Y_e\).
|
pure virtual |
Computes the pressure \(p\) from the rest mass density \(\rho\), the temperature \(T\), and electron fraction \(Y_e\).
|
pure virtual |
Computes the pressure \(p\) from the rest mass density \(\rho\), the temperature \(T\), and electron fraction \(Y_e\).
|
pure virtual |
The lower bound of the rest mass density that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
The upper bound of the rest mass density that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes adiabatic sound speed squared
\[ c_s^2 \equiv \frac{\partial p}{\partial e} |_{s, Y_e} = \frac{\rho}{h}\frac{\partial p}{\partial \rho} |_{e, Y_e} + \frac{\partial p}{\partial e}|_{\rho, Y_e} \]
. With \(p, e\) the pressure and energy density respectively, \(s\) the entropy density, \(Y_e\) the electron fraction \(\rho\) the rest-mass density, and \(h\) the enthalpy density. Note that \(e\) is the total energy density and not the internal energy, therefore
\[ \frac{\partial p}{\partial \rho} |_{e, Y_e} \neq \chi \equiv \frac{\partial p}{\partial \rho} |_{\epsilon, Y_e} \]
as defined in the 2-d EoS above. By definition \( e = (1+\epsilon) \rho \) so holding \(e\) constant
\[ 0 = \frac{d e}{d \rho} = \frac{\partial e}{\partial \rho} + \frac{\partial e}{\partial \epsilon} \frac{\partial \epsilon}{\rho}. \]
(where we have suppressed \( Y_e\) dependence) So \( \partial \epsilon / \partial \rho |_{e} = (1 + \epsilon)/\rho \) and we can expand
\[ \frac{\partial p}{\partial \rho} |_{e, Y_e} = \frac{\partial e}{\partial \rho}_{\epsilon, Y_e} + \frac{(1 + \epsilon)}{\rho} \frac{\partial e}{\partial \epsilon}|_{\rho, Y_e} \]
Finally, we can rewrite the entire sound speed using only the rest-mass density, specific internal energy, and electron fraction as variables, by using \( \frac{\partial e}{\partial \epsilon}|_{\rho, Y_e} = 1 \)
\[ c_s^2 = \frac{\rho}{h}\frac{\partial p}{\partial \rho} |_{\epsilon, Y_e} + \frac{1}{\rho} \frac{\partial p}{\partial \epsilon}|_{\rho, Y_e} \left( 1 - \frac{(1 + \epsilon)\rho}{h}\right) \]
Which reduces to our preferred form
\[ c_s^2 = \frac{\rho}{h}(\chi + \kappa) \]
Computed as a function of temperature, rest-mass density and electron fraction. Note that this will break thermodynamic consistency if the pressure and internal energy interpolated separately. The precise impact of this will depend on the EoS and numerical scheme used for the evolution.
|
pure virtual |
Computes adiabatic sound speed squared
\[ c_s^2 \equiv \frac{\partial p}{\partial e} |_{s, Y_e} = \frac{\rho}{h}\frac{\partial p}{\partial \rho} |_{e, Y_e} + \frac{\partial p}{\partial e}|_{\rho, Y_e} \]
. With \(p, e\) the pressure and energy density respectively, \(s\) the entropy density, \(Y_e\) the electron fraction \(\rho\) the rest-mass density, and \(h\) the enthalpy density. Note that \(e\) is the total energy density and not the internal energy, therefore
\[ \frac{\partial p}{\partial \rho} |_{e, Y_e} \neq \chi \equiv \frac{\partial p}{\partial \rho} |_{\epsilon, Y_e} \]
as defined in the 2-d EoS above. By definition \( e = (1+\epsilon) \rho \) so holding \(e\) constant
\[ 0 = \frac{d e}{d \rho} = \frac{\partial e}{\partial \rho} + \frac{\partial e}{\partial \epsilon} \frac{\partial \epsilon}{\rho}. \]
(where we have suppressed \( Y_e\) dependence) So \( \partial \epsilon / \partial \rho |_{e} = (1 + \epsilon)/\rho \) and we can expand
\[ \frac{\partial p}{\partial \rho} |_{e, Y_e} = \frac{\partial e}{\partial \rho}_{\epsilon, Y_e} + \frac{(1 + \epsilon)}{\rho} \frac{\partial e}{\partial \epsilon}|_{\rho, Y_e} \]
Finally, we can rewrite the entire sound speed using only the rest-mass density, specific internal energy, and electron fraction as variables, by using \( \frac{\partial e}{\partial \epsilon}|_{\rho, Y_e} = 1 \)
\[ c_s^2 = \frac{\rho}{h}\frac{\partial p}{\partial \rho} |_{\epsilon, Y_e} + \frac{1}{\rho} \frac{\partial p}{\partial \epsilon}|_{\rho, Y_e} \left( 1 - \frac{(1 + \epsilon)\rho}{h}\right) \]
Which reduces to our preferred form
\[ c_s^2 = \frac{\rho}{h}(\chi + \kappa) \]
Computed as a function of temperature, rest-mass density and electron fraction. Note that this will break thermodynamic consistency if the pressure and internal energy interpolated separately. The precise impact of this will depend on the EoS and numerical scheme used for the evolution.
|
pure virtual |
The lower bound of the specific enthalpy that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes the specific internal energy \(\epsilon\) from the rest mass density \(\rho\), the temperature \(T\), and electron fraction \(Y_e\).
|
pure virtual |
Computes the specific internal energy \(\epsilon\) from the rest mass density \(\rho\), the temperature \(T\), and electron fraction \(Y_e\).
|
pure virtual |
The lower bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\).
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
The upper bound of the specific internal energy that is valid for this EOS at the given rest mass density \(\rho\) and electron fraction \(Y_e\).
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
Computes the temperature \(T\) from the rest mass density \(\rho\), the specific internal energy \(\epsilon\), and electron fraction \(Y_e\).
|
pure virtual |
Computes the temperature \(T\) from the rest mass density \(\rho\), the specific internal energy \(\epsilon\), and electron fraction \(Y_e\).
|
pure virtual |
The lower bound of the temperature that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.
|
pure virtual |
The upper bound of the temperature that is valid for this EOS.
Implemented in EquationsOfState::Tabulated3D< IsRelativistic >.