Finite Volume Solver  prototype
A framework to build finite volume solvers for the AG Klein at the Freie Universität Berlin.
ThirdOrderRungeKuttaMethod.hpp
Go to the documentation of this file.
1 // Copyright (c) 2020 Maikel Nadolski
2 // Copyright (c) 2020 Abbas Gholami Poshtehani
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 // SOFTWARE.
21 
22 #ifndef FUB_EQUATIONS_PERFECT_GAS_THIRD_ORDER_RUNGE_KUTTA_HPP
23 #define FUB_EQUATIONS_PERFECT_GAS_THIRD_ORDER_RUNGE_KUTTA_HPP
24 
27 
28 namespace fub::perfect_gas {
29 
30 
31 /// \ingroup FluxMethod
32 template <int Dim> struct ThirdOrderRungeKutta {
37 
38  ThirdOrderRungeKutta(const PerfectGas<Dim>& equation) : equation_{equation} {}
39 
40  const PerfectGas<Dim>& GetEquation() const noexcept { return equation_; }
41 
42  static constexpr int GetStencilWidth() noexcept { return 6; }
43 
45  Duration dt, double dx, Direction dir);
46 
47  void ComputeNumericFlux(ConservativeArray& flux, Array1d face_fractions,
49  span<const Array1d, 12> volume_fractions, Duration dt,
50  double dx, Direction dir);
51 
54  double dx, Direction dir);
55 
56  double ComputeStableDt(span<const Complete, 12> states, double dx,
57  Direction dir);
58 
60  Direction dir);
61 
63  Array1d face_fraction, span<const Array1d, 2>,
64  double dx, Direction dir);
65 
67  double k_0{0.0};
68  double eta_0{0.0};
69 };
70 
71 extern template struct ThirdOrderRungeKutta<1>;
72 
73 /// \ingroup FluxMethod
75 
76 } // namespace fub::perfect_gas
77 
78 namespace fub {
79 
81 
82 } // namespace fub
83 
84 #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: ThirdOrderRungeKuttaMethod.hpp:32
void ComputeNumericFlux(ConservativeArray &flux, Array1d face_fractions, span< const CompleteArray, 12 > stencil, span< const Array1d, 12 > volume_fractions, Duration dt, double dx, Direction dir)
Array1d ComputeStableDt(span< const CompleteArray, 12 > states, double dx, Direction dir)
double k_0
Definition: ThirdOrderRungeKuttaMethod.hpp:67
void ComputeNumericFlux(ConservativeArray &flux, span< const CompleteArray, 12 > stencil, Duration dt, double dx, Direction dir)
double ComputeStableDt(span< const Complete, 12 > states, double dx, Direction dir)
Array1d ComputeStableDt(span< const CompleteArray, 12 > states, Array1d face_fraction, span< const Array1d, 2 >, double dx, Direction dir)
double eta_0
Definition: ThirdOrderRungeKuttaMethod.hpp:68
void ComputeNumericFlux(Conservative &flux, span< const Complete, 12 > stencil, Duration dt, double dx, Direction dir)
PerfectGas< Dim > equation_
Definition: ThirdOrderRungeKuttaMethod.hpp:66
const PerfectGas< Dim > & GetEquation() const noexcept
Definition: ThirdOrderRungeKuttaMethod.hpp:40
ThirdOrderRungeKutta(const PerfectGas< Dim > &equation)
Definition: ThirdOrderRungeKuttaMethod.hpp:38
static constexpr int GetStencilWidth() noexcept
Definition: ThirdOrderRungeKuttaMethod.hpp:42