Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
perfect_gas/MusclHancockPrimMethod.hpp
Go to the documentation of this file.
1 // Copyright (c) 2020 Maikel Nadolski
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 // SOFTWARE.
20 
21 #ifndef FUB_EQUATIONS_PERFECT_GAS_MUSCL_PRIM_HPP
22 #define FUB_EQUATIONS_PERFECT_GAS_MUSCL_PRIM_HPP
23 
26 
27 namespace fub::perfect_gas {
28 
29 /// \ingroup FluxMethod
30 template <int Dim> struct MusclHancockPrim {
35 
36  MusclHancockPrim(const PerfectGas<Dim>& equation) : equation_{equation} {}
37 
38  const PerfectGas<Dim>& GetEquation() const noexcept { return equation_; }
39 
40  static constexpr int GetStencilWidth() noexcept { return 2; }
41 
43  Duration dt, double dx, Direction dir);
44 
45  void ComputeNumericFlux(ConservativeArray& flux, Array1d face_fractions,
47  span<const Array1d, 4> volume_fractions, Duration dt,
48  double dx, Direction dir);
49 
52  double dx, Direction dir);
53 
54  double ComputeStableDt(span<const Complete, 4> states, double dx,
55  Direction dir);
56 
58  Direction dir);
59 
61  Array1d face_fraction, span<const Array1d, 4>,
62  double dx, Direction dir);
63 
65 };
66 
67 extern template struct MusclHancockPrim<1>;
68 extern template struct MusclHancockPrim<2>;
69 extern template struct MusclHancockPrim<3>;
70 
71 } // namespace fub::perfect_gas
72 
73 namespace fub {
74 
75 extern template class FluxMethod<perfect_gas::MusclHancockPrim<1>>;
76 extern template class FluxMethod<perfect_gas::MusclHancockPrim<2>>;
77 extern template class FluxMethod<perfect_gas::MusclHancockPrim<3>>;
78 
79 }
80 
81 #endif
This class applies a base flux nethod on a view of states.
Definition: flux_method/FluxMethod.hpp:57
A span is a view over a contiguous sequence of objects, the storage of which is owned by some other o...
Definition: span.hpp:81
Definition: perfect_gas/HllemMethod.hpp:27
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
std::chrono::duration< double > Duration
Definition: Duration.hpp:31
Array< double, 1 > Array1d
Definition: Eigen.hpp:53
Direction
This is a type safe type to denote a dimensional split direction.
Definition: Direction.hpp:30
Definition: StateArray.hpp:178
This type has a constructor which takes an equation and might allocate any dynamically sized member v...
Definition: State.hpp:335
Definition: StateArray.hpp:135
This type has a constructor which takes an equation and might allocate any dynamically sized member v...
Definition: State.hpp:251
Definition: perfect_gas/MusclHancockPrimMethod.hpp:30
const PerfectGas< Dim > & GetEquation() const noexcept
Definition: perfect_gas/MusclHancockPrimMethod.hpp:38
MusclHancockPrim(const PerfectGas< Dim > &equation)
Definition: perfect_gas/MusclHancockPrimMethod.hpp:36
double ComputeStableDt(span< const Complete, 4 > states, double dx, Direction dir)
void ComputeNumericFlux(Conservative &flux, span< const Complete, 4 > stencil, Duration dt, double dx, Direction dir)
Array1d ComputeStableDt(span< const CompleteArray, 4 > states, double dx, Direction dir)
void ComputeNumericFlux(ConservativeArray &flux, span< const CompleteArray, 4 > stencil, Duration dt, double dx, Direction dir)
void ComputeNumericFlux(ConservativeArray &flux, Array1d face_fractions, span< const CompleteArray, 4 > stencil, span< const Array1d, 4 > volume_fractions, Duration dt, double dx, Direction dir)
Array1d ComputeStableDt(span< const CompleteArray, 4 > states, Array1d face_fraction, span< const Array1d, 4 >, double dx, Direction dir)
static constexpr int GetStencilWidth() noexcept
Definition: perfect_gas/MusclHancockPrimMethod.hpp:40
PerfectGas< Dim > equation_
Definition: perfect_gas/MusclHancockPrimMethod.hpp:64