Sources.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 #include "Evolution/Systems/RelativisticEuler/Valencia/TagsDeclarations.hpp"
11 #include "PointwiseFunctions/GeneralRelativity/TagsDeclarations.hpp"
12 #include "PointwiseFunctions/Hydro/TagsDeclarations.hpp"
13 #include "Utilities/TMPL.hpp"
14 
15 // IWYU pragma: no_forward_declare Tensor
16 
17 /// \cond
18 class DataVector;
19 
20 namespace gsl {
21 template <typename T>
22 class not_null;
23 } // namespace gsl
24 
25 namespace Tags {
26 template <typename>
27 struct Source;
28 } // namespace Tags
29 /// \endcond
30 
31 namespace RelativisticEuler {
32 namespace Valencia {
33 
34 /*!
35  * \brief Compute the source terms for the flux-conservative Valencia
36  * formulation of the relativistic Euler system.
37  *
38  *
39  * A flux-conservative system has the generic form:
40  * \f[
41  * \partial_t U_i + \partial_m F^m(U_i) = S(U_i)
42  * \f]
43  *
44  * where \f$F^a()\f$ denotes the flux of a conserved variable \f$U_i\f$ and
45  * \f$S()\f$ denotes the source term for the conserved variable.
46  *
47  * For the Valencia formulation:
48  * \f{align*}
49  * S({\tilde D}) = & 0\\
50  * S({\tilde S}_i) = & \frac{1}{2} \alpha {\tilde S}^{mn} \partial_i \gamma_{mn}
51  * + {\tilde S}_m \partial_i \beta^m - ({\tilde D} + {\tilde \tau}) \partial_i
52  * \alpha \\ S({\tilde \tau}) = & \alpha {\tilde S}^{mn} K_{mn}
53  * - {\tilde S}^m \partial_m \alpha
54  * \f}
55  *
56  * where
57  * \f{align*}
58  * {\tilde S}^i = & {\tilde S}_m \gamma^{im} \\
59  * {\tilde S}^{ij} = & {\tilde S}^i v^j + \sqrt{\gamma} p \gamma^{ij}
60  * \f}
61  * where \f${\tilde D}\f$, \f${\tilde S}_i\f$, and \f${\tilde \tau}\f$ are a
62  * generalized mass-energy density, momentum density, and specific internal
63  * energy density as measured by an Eulerian observer, \f$\gamma\f$ is the
64  * determinant of the spatial metric \f$\gamma_{ij}\f$, \f$\rho\f$ is the rest
65  * mass density, \f$W\f$ is the Lorentz factor, \f$h\f$ is the specific
66  * enthalpy, \f$v^i\f$ is the spatial velocity, \f$p\f$ is the pressure,
67  * \f$\alpha\f$ is the lapse, \f$\beta^i\f$ is the shift, and \f$K_{ij}\f$ is
68  * the extrinsic curvature.
69  */
70 template <size_t Dim>
72  using return_tags = tmpl::list<
75 
76  using argument_tags = tmpl::list<
83  ::Tags::deriv<gr::Tags::Shift<Dim>, tmpl::size_t<Dim>, Frame::Inertial>,
85  Frame::Inertial>,
88 
89  static void apply(
90  gsl::not_null<Scalar<DataVector>*> source_tilde_tau,
91  gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> source_tilde_s,
92  const Scalar<DataVector>& tilde_d, const Scalar<DataVector>& tilde_tau,
93  const tnsr::i<DataVector, Dim, Frame::Inertial>& tilde_s,
94  const tnsr::I<DataVector, Dim, Frame::Inertial>& spatial_velocity,
95  const Scalar<DataVector>& pressure, const Scalar<DataVector>& lapse,
96  const tnsr::i<DataVector, Dim, Frame::Inertial>& d_lapse,
97  const tnsr::iJ<DataVector, Dim, Frame::Inertial>& d_shift,
98  const tnsr::ijj<DataVector, Dim, Frame::Inertial>& d_spatial_metric,
99  const tnsr::II<DataVector, Dim, Frame::Inertial>& inv_spatial_metric,
100  const Scalar<DataVector>& sqrt_det_spatial_metric,
101  const tnsr::ii<DataVector, Dim, Frame::Inertial>&
102  extrinsic_curvature) noexcept;
103 };
104 } // namespace Valencia
105 } // namespace RelativisticEuler
Prefix indicating a source term.
Definition: Prefixes.hpp:88
void extrinsic_curvature(const gsl::not_null< tnsr::ii< DataVector, 3, Frame > *> result, const tnsr::ii< DataVector, 3, Frame > &grad_normal, const tnsr::i< DataVector, 3, Frame > &unit_normal_one_form, const tnsr::I< DataVector, 3, Frame > &unit_normal_vector) noexcept
Extrinsic curvature of a 2D Strahlkorper embedded in a 3D space.
The densitized momentum density .
Definition: Tags.hpp:39
Implementations from the Guideline Support Library.
Definition: Gsl.hpp:79
The spatial velocity of the fluid, where . Here is the spatial part of the 4-velocity of the fluid...
Definition: Tags.hpp:142
The fluid pressure .
Definition: Tags.hpp:119
Items related to evolving the relativistic Euler system.
Definition: EvolveValenciaFwd.hpp:8
Definition: Tags.hpp:44
Compute the source terms for the flux-conservative Valencia formulation of the relativistic Euler sys...
Definition: Sources.hpp:71
Definition: Tags.hpp:52
Inverse of the spatial metric.
Definition: Tags.hpp:33
Prefix indicating spatial derivatives.
Definition: PartialDerivatives.hpp:54
Scalar< DataType > lapse(const tnsr::I< DataType, SpatialDim, Frame > &shift, const tnsr::aa< DataType, SpatialDim, Frame > &spacetime_metric) noexcept
Compute lapse from shift and spacetime metric.
The densitized rest-mass density .
Definition: Tags.hpp:28
Defines functions computing partial derivatives.
Definition: DataBoxTag.hpp:27
Defines a list of useful type aliases for tensors.
constexpr auto apply(F &&f, const DataBox< BoxTags > &box, Args &&... args) noexcept
Apply the invokable f with argument Tags TagsList from DataBox box
Definition: DataBox.hpp:1444
Stores a collection of function values.
Definition: DataVector.hpp:42
Wraps the template metaprogramming library used (brigand)
Definition: IndexType.hpp:44
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
The densitized energy density .
Definition: Tags.hpp:33
Require a pointer to not be a nullptr
Definition: Gsl.hpp:182
Definition: Tags.hpp:121