Equations.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
9 
10 // IWYU pragma: no_forward_declare Tensor
11 
12 /// \cond
13 namespace gsl {
14 template <typename T>
15 class not_null;
16 } // namespace gsl
17 
18 class DataVector;
19 /// \endcond
20 
21 namespace RelativisticEuler {
22 namespace Valencia {
23 
24 /*!
25  * \brief Compute the source terms for the flux-conservative Valencia
26  * formulation of the relativistic Euler system.
27  *
28  *
29  * A flux-conservative system has the generic form:
30  * \f[
31  * \partial_t U_i + \partial_m F^m(U_i) = S(U_i)
32  * \f]
33  *
34  * where \f$F^a()\f$ denotes the flux of a conserved variable \f$U_i\f$ and
35  * \f$S()\f$ denotes the source term for the conserved variable.
36  *
37  * For the Valencia formulation:
38  * \f{align*}
39  * S({\tilde D}) = & 0\\
40  * S({\tilde S}_i) = & \frac{1}{2} \alpha {\tilde S}^{mn} \partial_i \gamma_{mn}
41  * + {\tilde S}_m \partial_i \beta^m - ({\tilde D} + {\tilde \tau}) \partial_i
42  * \alpha \\ S({\tilde \tau}) = & \alpha {\tilde S}^{mn} K_{mn}
43  * - {\tilde S}^m \partial_m \alpha
44  * \f}
45  *
46  * where
47  * \f{align*}
48  * {\tilde S}^i = & {\tilde S}_m \gamma^{im} \\
49  * {\tilde S}^{ij} = & {\tilde S}^i v^j + \sqrt{\gamma} p \gamma^{ij}
50  * \f}
51  * where \f${\tilde D}\f$, \f${\tilde S}_i\f$, and \f${\tilde \tau}\f$ are a
52  * generalized mass-energy density, momentum density, and specific internal
53  * energy density as measured by an Eulerian observer, \f$\gamma\f$ is the
54  * determinant of the spatial metric \f$\gamma_{ij}\f$, \f$\rho\f$ is the rest
55  * mass density, \f$W\f$ is the Lorentz factor, \f$h\f$ is the specific
56  * enthalpy, \f$v^i\f$ is the spatial velocity, \f$p\f$ is the pressure,
57  * \f$\alpha\f$ is the lapse, \f$\beta^i\f$ is the shift, and \f$K_{ij}\f$ is
58  * the extrinsic curvature.
59  */
60 template <size_t Dim>
62  gsl::not_null<Scalar<DataVector>*> source_tilde_d,
63  gsl::not_null<Scalar<DataVector>*> source_tilde_tau,
64  gsl::not_null<tnsr::i<DataVector, Dim, Frame::Inertial>*> source_tilde_s,
65  const Scalar<DataVector>& tilde_d, const Scalar<DataVector>& tilde_tau,
66  const tnsr::i<DataVector, Dim, Frame::Inertial>& tilde_s,
67  const tnsr::I<DataVector, Dim, Frame::Inertial>& spatial_velocity,
68  const Scalar<DataVector>& pressure, const Scalar<DataVector>& lapse,
69  const tnsr::i<DataVector, Dim, Frame::Inertial>& d_lapse,
70  const tnsr::iJ<DataVector, Dim, Frame::Inertial>& d_shift,
71  const tnsr::ijj<DataVector, Dim, Frame::Inertial>& d_spatial_metric,
72  const tnsr::II<DataVector, Dim, Frame::Inertial>& inv_spatial_metric,
73  const Scalar<DataVector>& sqrt_det_spatial_metric,
74  const tnsr::ii<DataVector, Dim, Frame::Inertial>&
75  extrinsic_curvature) noexcept;
76 } // namespace Valencia
77 } // namespace RelativisticEuler
Implementations from the Guideline Support Library.
Definition: ConservativeFromPrimitive.hpp:10
void compute_source_terms_of_u(gsl::not_null< Scalar< DataVector > *> source_tilde_d, gsl::not_null< Scalar< DataVector > *> source_tilde_tau, gsl::not_null< tnsr::i< DataVector, Dim, Frame::Inertial > *> source_tilde_s, const Scalar< DataVector > &tilde_d, const Scalar< DataVector > &tilde_tau, const tnsr::i< DataVector, Dim, Frame::Inertial > &tilde_s, const tnsr::I< DataVector, Dim, Frame::Inertial > &spatial_velocity, const Scalar< DataVector > &pressure, const Scalar< DataVector > &lapse, const tnsr::i< DataVector, Dim, Frame::Inertial > &d_lapse, const tnsr::iJ< DataVector, Dim, Frame::Inertial > &d_shift, const tnsr::ijj< DataVector, Dim, Frame::Inertial > &d_spatial_metric, const tnsr::II< DataVector, Dim, Frame::Inertial > &inv_spatial_metric, const Scalar< DataVector > &sqrt_det_spatial_metric, const tnsr::ii< DataVector, Dim, Frame::Inertial > &extrinsic_curvature) noexcept
Compute the source terms for the flux-conservative Valencia formulation of the relativistic Euler sys...
Items related to evolving the relativistic Euler system.
Definition: Characteristics.hpp:21
tnsr::ii< DataVector, 3, Frame > extrinsic_curvature(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.
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.
Definition: ComputeSpacetimeQuantities.cpp:98
Defines a list of useful type aliases for tensors.
Stores a collection of function values.
Definition: DataVector.hpp:46
Tensor< T, Symmetry<>, index_list<> > Scalar
Scalar type.
Definition: TypeAliases.hpp:21
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12