Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
equations/perfect_gas/ExactRiemannSolver.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_EXACT_RIEMANN_SOLVER_HPP
22 #define FUB_EQUATIONS_PERFECT_GAS_EXACT_RIEMANN_SOLVER_HPP
23 
26 #include "fub/Duration.hpp"
27 
28 namespace fub {
29 
30 template <int Dim> class ExactRiemannSolver<PerfectGas<Dim>> {
31 public:
34 
35  explicit ExactRiemannSolver(const PerfectGas<Dim>& equation)
36  : equation_{equation} {}
37 
38  /// Returns either left or right, depending on the upwind velocity.
40  Complete& state, const Complete& left, const Complete& right, double, double, Duration dt, double dx,
41  Direction dir);
42 
43  void SolveRiemannProblem(Complete& state, const Complete& left,
44  const Complete& right, Direction dir);
45 
47  const CompleteArray& right, Direction dir);
48 
50  const CompleteArray& right, MaskArray mask,
51  Direction dir);
52 
53  /// Returns the upwind velocity in the specified direction.
54  std::array<double, 2> ComputeSignals(const Complete&, const Complete&,
55  Direction dir);
56 
57  std::array<Array1d, 2> ComputeSignals(const CompleteArray&,
58  const CompleteArray&, Direction dir);
59 
60  std::array<double, 2> ComputeMiddleState(const Complete& left,
61  const Complete& right,
62  Direction dir);
63 
64 private:
66 };
67 
68 extern template class ExactRiemannSolver<PerfectGas<1>>;
69 extern template class ExactRiemannSolver<PerfectGas<2>>;
70 extern template class ExactRiemannSolver<PerfectGas<3>>;
71 
72 }
73 
74 #endif
void SolveRiemannProblem(Complete &state, const Complete &left, const Complete &right, double, double, Duration dt, double dx, Direction dir)
Returns either left or right, depending on the upwind velocity.
ExactRiemannSolver(const PerfectGas< Dim > &equation)
Definition: equations/perfect_gas/ExactRiemannSolver.hpp:35
std::array< double, 2 > ComputeMiddleState(const Complete &left, const Complete &right, Direction dir)
typename PerfectGas< Dim >::CompleteArray CompleteArray
Definition: equations/perfect_gas/ExactRiemannSolver.hpp:33
void SolveRiemannProblem(CompleteArray &state, const CompleteArray &left, const CompleteArray &right, MaskArray mask, Direction dir)
void SolveRiemannProblem(Complete &state, const Complete &left, const Complete &right, Direction dir)
typename PerfectGas< Dim >::Complete Complete
Definition: equations/perfect_gas/ExactRiemannSolver.hpp:32
std::array< double, 2 > ComputeSignals(const Complete &, const Complete &, Direction dir)
Returns the upwind velocity in the specified direction.
std::array< Array1d, 2 > ComputeSignals(const CompleteArray &, const CompleteArray &, Direction dir)
void SolveRiemannProblem(CompleteArray &state, const CompleteArray &left, const CompleteArray &right, Direction dir)
PerfectGas< Dim > equation_
Definition: equations/perfect_gas/ExactRiemannSolver.hpp:65
Definition: ExactRiemannSolver.hpp:26
The fub namespace.
Definition: AnyBoundaryCondition.hpp:31
std::chrono::duration< double > Duration
Definition: Duration.hpp:31
Direction
This is a type safe type to denote a dimensional split direction.
Definition: Direction.hpp:30
Array< bool, 1 > MaskArray
Definition: Eigen.hpp:59
Definition: PerfectGas.hpp:164