Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <cstddef>
7 :
8 : #include "DataStructures/DataBox/Prefixes.hpp"
9 : #include "DataStructures/Tensor/TypeAliases.hpp"
10 : #include "Evolution/Systems/NewtonianEuler/TagsDeclarations.hpp"
11 : #include "PointwiseFunctions/Hydro/Tags.hpp"
12 : #include "Utilities/TMPL.hpp"
13 :
14 : /// \cond
15 : namespace gsl {
16 : template <typename T>
17 : class not_null;
18 : } // namespace gsl
19 :
20 : class DataVector;
21 : /// \endcond
22 :
23 : namespace NewtonianEuler {
24 :
25 : /*!
26 : * \brief Compute the fluxes of the conservative variables of the
27 : * Newtonian Euler system
28 : *
29 : * The fluxes are \f$(\text{Dim} + 2)\f$ vectors of
30 : * dimension \f$\text{Dim}\f$. Denoting the flux of the conservative
31 : * variable \f$u\f$ as \f$F(u)\f$, one has
32 : *
33 : * \f{align*}
34 : * F^i(\rho) &= S^i\\
35 : * F^i(S^j) &= S^i v^j + \delta^{ij}p\\
36 : * F^i(e) &= (e + p)v^i
37 : * \f}
38 : *
39 : * where \f$S^i\f$ is the momentum density, \f$e\f$ is the energy density,
40 : * \f$v^i\f$ is the velocity, \f$p\f$ is the pressure, and \f$\delta^{ij}\f$
41 : * is the Kronecker delta. This form of the fluxes combines conservative and
42 : * primitive variables (while the velocity appears explicitly, the pressure
43 : * implicitly depends, for instance, on the mass density and the specific
44 : * internal energy), so the conversion from one variable set to the other
45 : * must be known prior to calling this function.
46 : */
47 : template <size_t Dim>
48 1 : struct ComputeFluxes {
49 0 : using return_tags = tmpl::list<
50 : ::Tags::Flux<Tags::MassDensityCons, tmpl::size_t<Dim>, Frame::Inertial>,
51 : ::Tags::Flux<Tags::MomentumDensity<Dim>, tmpl::size_t<Dim>,
52 : Frame::Inertial>,
53 : ::Tags::Flux<Tags::EnergyDensity, tmpl::size_t<Dim>, Frame::Inertial>>;
54 :
55 0 : using argument_tags =
56 : tmpl::list<Tags::MomentumDensity<Dim>, Tags::EnergyDensity,
57 : hydro::Tags::SpatialVelocity<DataVector, Dim>,
58 : hydro::Tags::Pressure<DataVector>>;
59 :
60 0 : static void apply(
61 : gsl::not_null<tnsr::I<DataVector, Dim>*> mass_density_cons_flux,
62 : gsl::not_null<tnsr::IJ<DataVector, Dim>*> momentum_density_flux,
63 : gsl::not_null<tnsr::I<DataVector, Dim>*> energy_density_flux,
64 : const tnsr::I<DataVector, Dim>& momentum_density,
65 : const Scalar<DataVector>& energy_density,
66 : const tnsr::I<DataVector, Dim>& velocity,
67 : const Scalar<DataVector>& pressure);
68 : };
69 :
70 : } // namespace NewtonianEuler
|