RamPressure.hpp
2 // See LICENSE.txt for details.
3
4 #pragma once
5
6 #include <cstddef>
7
8 #include "DataStructures/DataBox/Tag.hpp"
10 #include "Evolution/Systems/NewtonianEuler/Tags.hpp"
11 #include "PointwiseFunctions/Hydro/EquationsOfState/EquationOfState.hpp"
12 #include "PointwiseFunctions/Hydro/Tags.hpp"
13 #include "Utilities/Gsl.hpp"
14 #include "Utilities/TMPL.hpp"
15
16 namespace NewtonianEuler {
17 /// @{
18 /*!
19  * Compute the ram pressure, \f$\rho v^i v^j\f$, where \f$\rho\f$ is the
20  * mass density, and \f$v^i\f$ is the velocity.
21  */
22 template <typename DataType, size_t Dim, typename Fr>
23 void ram_pressure(gsl::not_null<tnsr::II<DataType, Dim, Fr>*> result,
24  const Scalar<DataType>& mass_density,
25  const tnsr::I<DataType, Dim, Fr>& velocity) noexcept;
26
27 template <typename DataType, size_t Dim, typename Fr>
28 tnsr::II<DataType, Dim, Fr> ram_pressure(
29  const Scalar<DataType>& mass_density,
30  const tnsr::I<DataType, Dim, Fr>& velocity) noexcept;
31 /// @}
32
33 namespace Tags {
34 /// Compute item for the ram pressure, \f$\rho v^i v^j\f$.
35 /// \see NewtonianEuler::ram_pressure
36 ///
37 /// Can be retrieved using NewtonianEuler::Tags::RamPressure
38 template <typename DataType, size_t Dim, typename Fr = Frame::Inertial>
39 struct RamPressureCompute : RamPressure<DataType, Dim, Fr>, db::ComputeTag {
41
42  using argument_tags =
43  tmpl::list<MassDensity<DataType>, Velocity<DataType, Dim, Fr>>;
44
45  using return_type = tnsr::II<DataType, Dim, Fr>;
46
47  static constexpr auto function = static_cast<void (*)(
49  const Scalar<DataType>&, const tnsr::I<DataType, Dim, Fr>&)>(
50  &ram_pressure<DataType, Dim, Fr>);
51 };
52 } // namespace Tags
53 } // namespace NewtonianEuler
db::ComputeTag
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
NewtonianEuler::Tags::RamPressure
The ram pressure of the fluid.
Definition: Tags.hpp:122
NewtonianEuler
Items related to evolving the Newtonian Euler system.
Definition: EvolveNewtonianEulerFwd.hpp:8
cstddef
Scalar
Tensor< T, Symmetry<>, index_list<> > Scalar
Definition: TypeAliases.hpp:21
Gsl.hpp
Tensor.hpp
NewtonianEuler::Tags::Velocity
The macroscopic or flow velocity of the fluid.
Definition: Tags.hpp:51
NewtonianEuler::Tags::RamPressureCompute
Compute item for the ram pressure, .
Definition: RamPressure.hpp:39
NewtonianEuler::ram_pressure
void ram_pressure(gsl::not_null< tnsr::II< DataType, Dim, Fr > * > result, const Scalar< DataType > &mass_density, const tnsr::I< DataType, Dim, Fr > &velocity) noexcept
TMPL.hpp
gsl::not_null
Require a pointer to not be a nullptr