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 : #include <string> 8 : 9 : #include "DataStructures/DataBox/Tag.hpp" 10 : #include "DataStructures/Tensor/TypeAliases.hpp" 11 : #include "Evolution/Systems/NewtonianEuler/Sources/Source.hpp" 12 : #include "Evolution/Systems/NewtonianEuler/TagsDeclarations.hpp" 13 : #include "Evolution/Tags.hpp" 14 : #include "Options/String.hpp" 15 : 16 : /// \cond 17 : class DataVector; 18 : /// \endcond 19 : 20 : namespace NewtonianEuler { 21 : /// %OptionTags for the conservative formulation of the Newtonian Euler system 22 1 : namespace OptionTags { 23 : template <size_t Dim> 24 0 : struct SourceTerm { 25 0 : using type = std::unique_ptr<NewtonianEuler::Sources::Source<Dim>>; 26 0 : static constexpr Options::String help = "The source term to be used."; 27 0 : using group = ::evolution::OptionTags::SystemGroup; 28 : }; 29 : } // namespace OptionTags 30 : 31 : /// %Tags for the conservative formulation of the Newtonian Euler system 32 : namespace Tags { 33 : /// The mass density of the fluid (as a conservative variable). 34 1 : struct MassDensityCons : db::SimpleTag { 35 0 : using type = Scalar<DataVector>; 36 : }; 37 : 38 : /// The momentum density of the fluid. 39 : template <size_t Dim, typename Fr> 40 1 : struct MomentumDensity : db::SimpleTag { 41 0 : using type = tnsr::I<DataVector, Dim, Fr>; 42 0 : static std::string name() { return Frame::prefix<Fr>() + "MomentumDensity"; } 43 : }; 44 : 45 : /// The energy density of the fluid. 46 1 : struct EnergyDensity : db::SimpleTag { 47 0 : using type = Scalar<DataVector>; 48 : }; 49 : 50 : /// The sound speed. 51 : template <typename DataType> 52 1 : struct SoundSpeed : db::SimpleTag { 53 0 : using type = Scalar<DataType>; 54 : }; 55 : 56 : /// The characteristic speeds. 57 : template <size_t Dim> 58 1 : struct CharacteristicSpeeds : db::SimpleTag { 59 0 : using type = std::array<DataVector, Dim + 2>; 60 : }; 61 : 62 : /// @{ 63 : /// The characteristic fields of the NewtonianEuler system. 64 1 : struct VMinus : db::SimpleTag { 65 0 : using type = Scalar<DataVector>; 66 : }; 67 : template <size_t Dim> 68 0 : struct VMomentum : db::SimpleTag { 69 0 : using type = tnsr::I<DataVector, Dim>; 70 : }; 71 0 : struct VPlus : db::SimpleTag { 72 0 : using type = Scalar<DataVector>; 73 : }; 74 : /// @} 75 : 76 : /// The internal energy density. 77 : template <typename DataType> 78 1 : struct InternalEnergyDensity : db::SimpleTag { 79 0 : using type = Scalar<DataType>; 80 : }; 81 : 82 : /// The kinetic energy density. 83 : template <typename DataType> 84 1 : struct KineticEnergyDensity : db::SimpleTag { 85 0 : using type = Scalar<DataType>; 86 : }; 87 : 88 : /// The local Mach number of the flow 89 : template <typename DataType> 90 1 : struct MachNumber : db::SimpleTag { 91 0 : using type = Scalar<DataType>; 92 : }; 93 : 94 : /// The ram pressure of the fluid. 95 : template <typename DataType, size_t Dim, typename Fr> 96 1 : struct RamPressure : db::SimpleTag { 97 0 : using type = tnsr::II<DataType, Dim, Fr>; 98 0 : static std::string name() { return Frame::prefix<Fr>() + "RamPressure"; } 99 : }; 100 : 101 : /// The specific kinetic energy. 102 : template <typename DataType> 103 1 : struct SpecificKineticEnergy : db::SimpleTag { 104 0 : using type = Scalar<DataType>; 105 : }; 106 : 107 : /// The source term in the evolution equations 108 : template <size_t Dim> 109 1 : struct SourceTerm : db::SimpleTag { 110 0 : using type = std::unique_ptr<NewtonianEuler::Sources::Source<Dim>>; 111 : 112 0 : using option_tags = tmpl::list<OptionTags::SourceTerm<Dim>>; 113 : 114 0 : static constexpr bool pass_metavariables = false; 115 0 : static type create_from_options(const type& source_term) { 116 : return source_term->get_clone(); 117 : } 118 : }; 119 : 120 : } // namespace Tags 121 : } // namespace NewtonianEuler