ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
riemann_solver.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2024 by the ryujin authors
4//
5
6#pragma once
7
8#include "hyperbolic_system.h"
9
10#include <simd.h>
11
12#include <deal.II/base/point.h>
13#include <deal.II/base/tensor.h>
14
15namespace ryujin
16{
17 namespace EulerAEOS
18 {
19 template <typename ScalarNumber = double>
20 class RiemannSolverParameters : public dealii::ParameterAcceptor
21 {
22 public:
23 RiemannSolverParameters(const std::string &subsection = "/RiemannSolver")
24 : ParameterAcceptor(subsection)
25 {
26 }
27 };
28
29
39 template <int dim, typename Number = double>
41 {
42 public:
47
49
51
53
54 using state_type = typename View::state_type;
55
60 static constexpr unsigned int riemann_data_size = 5;
61
66 using primitive_type = typename std::array<Number, riemann_data_size>;
67
69
71
73
75
79
83 RiemannSolver(const HyperbolicSystem &hyperbolic_system,
84 const Parameters &parameters,
85 const PrecomputedVector &precomputed_values)
86 : hyperbolic_system(hyperbolic_system)
87 , parameters(parameters)
88 , precomputed_values(precomputed_values)
89 {
90 }
91
97 Number compute(const primitive_type &riemann_data_i,
98 const primitive_type &riemann_data_j) const;
99
105 Number compute(const state_type &U_i,
106 const state_type &U_j,
107 const unsigned int i,
108 const unsigned int *js,
109 const dealii::Tensor<1, dim, Number> &n_ij) const;
110
112
113 protected:
116
122 Number c(const Number &gamma_Z) const;
123
129 Number
130 alpha(const Number &rho, const Number &gamma, const Number &a) const;
131
139 Number p_star_RS_full(const primitive_type &riemann_data_i,
140 const primitive_type &riemann_data_j) const;
141
149 Number p_star_SS_full(const primitive_type &riemann_data_i,
150 const primitive_type &riemann_data_j) const;
151
152 /*
153 * Compute only the failsafe the failsafe bound for \f$\tilde
154 * p_2^\ast\f$ (5.11) in @cite ClaytonGuermondPopov-2022
155 *
156 * Cost: 0x pow, 3x division, 3x sqrt
157 */
158 Number p_star_failsafe(const primitive_type &riemann_data_i,
159 const primitive_type &riemann_data_j) const;
160
161 /*
162 * Compute a simultaneous upper bound on (5.7) second formula for
163 * \tilde p_2^\ast (5.8) first formula for \tilde p_1^\ast (5.11)
164 * formula for \tilde p_2^\ast in @cite ClaytonGuermondPopov-2022
165 *
166 * Cost: 3x pow, 9x division, 2x sqrt
167 *
168 * @todo improve documentation
169 */
170 Number p_star_interpolated(const primitive_type &riemann_data_i,
171 const primitive_type &riemann_data_j) const;
172
173
174#ifndef DOXYGEN
175 /*
176 * FIXME
177 */
178 Number f(const primitive_type &riemann_data, const Number p_star) const;
179
180
181 /*
182 * FIXME
183 */
184 Number phi(const primitive_type &riemann_data_i,
185 const primitive_type &riemann_data_j,
186 const Number p_in) const;
187#endif
188
189
204 Number phi_of_p_max(const primitive_type &riemann_data_i,
205 const primitive_type &riemann_data_j) const;
206
207
213 Number lambda1_minus(const primitive_type &riemann_data,
214 const Number p_star) const;
215
216
222 Number lambda3_plus(const primitive_type &primitive_state,
223 const Number p_star) const;
224
225
235 Number compute_lambda(const primitive_type &riemann_data_i,
236 const primitive_type &riemann_data_j,
237 const Number p_star) const;
238
239
249 const Number &p,
250 const dealii::Tensor<1, dim, Number> &n_ij) const;
251
252 private:
253 const HyperbolicSystem &hyperbolic_system;
254 const Parameters &parameters;
255 const PrecomputedVector &precomputed_values;
257 };
258 } // namespace EulerAEOS
259} /* namespace ryujin */
dealii::Tensor< 1, problem_dimension, Number > state_type
typename get_value_type< Number >::type ScalarNumber
static constexpr unsigned int problem_dimension
Vectors::MultiComponentVector< ScalarNumber, n_precomputed_values > PrecomputedVector
std::array< Number, n_precomputed_values > precomputed_type
RiemannSolverParameters(const std::string &subsection="/RiemannSolver")
Number p_star_RS_full(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
RiemannSolverParameters< ScalarNumber > Parameters
Number lambda1_minus(const primitive_type &riemann_data, const Number p_star) const
Number alpha(const Number &rho, const Number &gamma, const Number &a) const
primitive_type riemann_data_from_state(const state_type &U, const Number &p, const dealii::Tensor< 1, dim, Number > &n_ij) const
Number p_star_failsafe(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
Number p_star_SS_full(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
Number lambda3_plus(const primitive_type &primitive_state, const Number p_star) const
typename View::state_type state_type
static constexpr unsigned int riemann_data_size
typename std::array< Number, riemann_data_size > primitive_type
Number p_star_interpolated(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
Number phi_of_p_max(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
static constexpr auto problem_dimension
Number compute_lambda(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number p_star) const
RiemannSolver(const HyperbolicSystem &hyperbolic_system, const Parameters &parameters, const PrecomputedVector &precomputed_values)
typename View::precomputed_type precomputed_type
typename View::ScalarNumber ScalarNumber
Number c(const Number &gamma_Z) const
Number compute(const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const
typename View::PrecomputedVector PrecomputedVector