SoundSpeedSquared.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
10 #include "PointwiseFunctions/Hydro/Tags.hpp"
11 #include "Utilities/TMPL.hpp"
12 
13 /// \cond
14 template <bool IsRelativistic, size_t ThermodynamicDim>
15 class EquationOfState;
16 /// \endcond
17 
18 namespace hydro {
19 /*!
20  * \ingroup EquationsOfStateGroup
21  * \brief Computes the relativistic sound speed squared
22  *
23  * The relativistic sound speed squared is given by
24  * \f$c_s^2 = \left(\chi + p\kappa / \rho^2\right)/h\f$, where
25  * \f$p\f$ is the fluid pressure, \f$\rho\f$ is the rest mass density,
26  * \f$h = 1 + \epsilon + p / \rho\f$ is the specific enthalpy
27  * \f$\chi = (\partial p/\partial\rho)_\epsilon\f$ and
28  * \f$\kappa = (\partial p/ \partial \epsilon)_\rho\f$, where
29  * \f$\epsilon\f$ is the specific internal energy.
30  */
31 template <typename DataType, size_t ThermodynamicDim>
33  const Scalar<DataType>& rest_mass_density,
34  const Scalar<DataType>& specific_internal_energy,
37  equation_of_state) noexcept;
38 
39 namespace Tags {
40 /// Compute item for the sound speed squared \f$c_s^2\f$.
41 /// \see hydro::sound_speed_squared
42 ///
43 /// Can be retrieved using `hydro::Tags::SoundSpeedSquared`
44 template <typename DataType>
46  template <typename EquationOfStateType>
47  static Scalar<DataType> function(
48  const Scalar<DataType>& rest_mass_density,
49  const Scalar<DataType>& specific_internal_energy,
51  const EquationOfStateType& equation_of_state) noexcept {
52  return sound_speed_squared(rest_mass_density, specific_internal_energy,
53  specific_enthalpy, equation_of_state);
54  }
55  using argument_tags =
56  tmpl::list<RestMassDensity<DataType>, SpecificInternalEnergy<DataType>,
58 };
59 } // namespace Tags
60 } // namespace hydro
The specific internal energy .
Definition: Tags.hpp:190
Base class for equations of state depending on whether or not the system is relativistic, and the number of independent thermodynamic variables (ThermodynamicDim) needed to determine the pressure.
Definition: EquationOfState.hpp:63
Compute item for the sound speed squared .
Definition: SoundSpeedSquared.hpp:45
Marks a DataBoxTag as being a compute item that executes a function.
Definition: DataBoxTag.hpp:154
Base tag for the equation of state.
Definition: Tags.hpp:57
Scalar< DataType > specific_enthalpy(const Scalar< DataType > &rest_mass_density, const Scalar< DataType > &specific_internal_energy, const Scalar< DataType > &pressure) noexcept
Computes the relativistic specific enthalpy as: where is the specific internal energy...
Scalar< DataType > sound_speed_squared(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.
Definition: DataBoxTag.hpp:29
Defines a list of useful type aliases for tensors.
Wraps the template metaprogramming library used (brigand)
Items related to hydrodynamic systems.
Definition: LorentzFactor.hpp:13
The sound speed squared .
Definition: Tags.hpp:145
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
The specific enthalpy .
Definition: Tags.hpp:183
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21