SoundSpeedSquared.hpp
2 // See LICENSE.txt for details.
3
4 #pragma once
5
6 #include <cstddef>
7
8 #include "DataStructures/DataBox/Tag.hpp"
10 #include "PointwiseFunctions/Hydro/TagsDeclarations.hpp"
11 #include "Utilities/Gsl.hpp"
12 #include "Utilities/TMPL.hpp"
13
14 /// \cond
15 namespace EquationsOfState {
16 template <bool IsRelativistic, size_t ThermodynamicDim>
17 class EquationOfState;
18 } // namespace EquationsOfState
19 /// \endcond
20
21 namespace hydro {
22 //@{
23 /*!
24  * \ingroup EquationsOfStateGroup
25  * \brief Computes the relativistic sound speed squared
26  *
27  * The relativistic sound speed squared is given by
28  * \f$c_s^2 = \left(\chi + p\kappa / \rho^2\right)/h\f$, where
29  * \f$p\f$ is the fluid pressure, \f$\rho\f$ is the rest mass density,
30  * \f$h = 1 + \epsilon + p / \rho\f$ is the specific enthalpy
31  * \f$\chi = (\partial p/\partial\rho)_\epsilon\f$ and
32  * \f$\kappa = (\partial p/ \partial \epsilon)_\rho\f$, where
33  * \f$\epsilon\f$ is the specific internal energy.
34  */
35 template <typename DataType, size_t ThermodynamicDim>
38  const Scalar<DataType>& rest_mass_density,
39  const Scalar<DataType>& specific_internal_energy,
40  const Scalar<DataType>& specific_enthalpy,
42  equation_of_state) noexcept;
43
44 template <typename DataType, size_t ThermodynamicDim>
46  const Scalar<DataType>& rest_mass_density,
47  const Scalar<DataType>& specific_internal_energy,
48  const Scalar<DataType>& specific_enthalpy,
50  equation_of_state) noexcept;
51 //@}
52
53 namespace Tags {
54 /// Compute item for the sound speed squared \f$c_s^2\f$.
55 /// \see hydro::sound_speed_squared
56 ///
57 /// Can be retrieved using hydro::Tags::SoundSpeedSquared
58 template <typename DataType>
60  using argument_tags = typename tmpl::list<
63
64  using return_type = Scalar<DataType>;
65
66  template <typename EquationOfStateType>
67  static void function(const gsl::not_null<Scalar<DataType>*> result,
68  const Scalar<DataType>& rest_mass_density,
69  const Scalar<DataType>& specific_internal_energy,
70  const Scalar<DataType>& specific_enthalpy,
71  const EquationOfStateType& equation_of_state) noexcept {
72  sound_speed_squared(result, rest_mass_density, specific_internal_energy,
73  specific_enthalpy, equation_of_state);
74  }
75
77 };
78 } // namespace Tags
79 } // namespace hydro
EquationsOfState
Contains all equations of state, including base class.
Definition: DarkEnergyFluid.hpp:26
db::ComputeTag
Marks a DataBoxTag as being a compute item that executes a function.
Definition: Tag.hpp:109
hydro::sound_speed_squared
void sound_speed_squared(gsl::not_null< Scalar< DataType > * > result, const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &specific_enthalpy, const EquationsOfState::EquationOfState< true, ThermodynamicDim > &equation_of_state) noexcept
Computes the relativistic sound speed squared.
hydro::Tags::SpecificInternalEnergy
The specific internal energy .
Definition: Tags.hpp:173
hydro::Tags::SoundSpeedSquaredCompute
Compute item for the sound speed squared .
Definition: SoundSpeedSquared.hpp:59
EquationsOfState::EquationOfState
Base class for equations of state depending on whether or not the system is relativistic,...
Definition: EquationOfState.hpp:63
cstddef
hydro::Tags::SpecificEnthalpy
The relativistic specific enthalpy .
Definition: Tags.hpp:167
hydro
Items related to hydrodynamic systems.
Definition: LorentzFactor.hpp:20
hydro::Tags::SoundSpeedSquared
The sound speed squared .
Definition: Tags.hpp:131
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
TypeAliases.hpp
hydro::Tags::EquationOfStateBase
Base tag for the equation of state.
Definition: Tags.hpp:53
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183
hydro::Tags::RestMassDensity
The rest-mass density .
Definition: Tags.hpp:125