ryujin 2.1.1 revision feb53359f0c9a08baf43c3dfe847d8a9f7d6893a
|
#include <source/euler_aeos/riemann_solver.h>
Public Types | |
using | View = HyperbolicSystemView< dim, Number > |
using | primitive_type = std::array< Number, riemann_data_size > |
using | state_type = typename View::state_type |
using | precomputed_state_type = typename View::precomputed_state_type |
using | ScalarNumber = typename View::ScalarNumber |
using | Parameters = RiemannSolverParameters< ScalarNumber > |
Public Member Functions | |
Compute wavespeed estimates | |
RiemannSolver (const HyperbolicSystem &hyperbolic_system, const Parameters ¶meters, const MultiComponentVector< ScalarNumber, n_precomputed_values > &precomputed_values) | |
Number | compute (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const |
Number | compute (const state_type &U_i, const state_type &U_j, const unsigned int i, const unsigned int *js, const dealii::Tensor< 1, dim, Number > &n_ij) const |
Static Public Attributes | |
static constexpr unsigned int | problem_dimension = View::problem_dimension |
static constexpr unsigned int | riemann_data_size = 5 |
static constexpr unsigned int | n_precomputed_values |
Internal functions used in the Riemann solver | |
Number | c (const Number gamma_Z) const |
Number | alpha (const Number &rho, const Number &gamma, const Number &a) const |
Number | p_star_RS_full (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 | p_star_failsafe (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j) const |
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 |
Number | lambda1_minus (const primitive_type &riemann_data, const Number p_star) const |
Number | lambda3_plus (const primitive_type &primitive_state, const Number p_star) const |
Number | compute_lambda (const primitive_type &riemann_data_i, const primitive_type &riemann_data_j, const Number p_star) const |
primitive_type | riemann_data_from_state (const state_type &U, const Number &p, const dealii::Tensor< 1, dim, Number > &n_ij) const |
A fast approximative solver for the 1D Riemann problem. The solver ensures that the estimate \(\lambda_{\text{max}}\) that is returned for the maximal wavespeed is a strict upper bound.
The solver is based on [2].
Definition at line 40 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::View = HyperbolicSystemView<dim, Number> |
A view of the HyperbolicSystem that makes methods available for a given dimension dim
and choice of number type Number
(which can be a scalar float, or double, as well as a VectorizedArray holding packed scalars.
Intended usage:
Definition at line 46 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::primitive_type = std::array<Number, riemann_data_size> |
The array type to store the expanded primitive state for the Riemann solver \([\rho, v, p, a]\)
Definition at line 63 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::state_type = typename View::state_type |
The storage type used for a (conserved) state \(\boldsymbol U\).
Definition at line 68 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::precomputed_state_type = typename View::precomputed_state_type |
Array type used for precomputed values.
Definition at line 79 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::ScalarNumber = typename View::ScalarNumber |
The underlying scalar number type.
Definition at line 84 of file riemann_solver.h.
using ryujin::EulerAEOS::RiemannSolver< dim, Number >::Parameters = RiemannSolverParameters<ScalarNumber> |
Definition at line 89 of file riemann_solver.h.
|
inline |
Constructor taking a HyperbolicSystem instance as argument
Definition at line 99 of file riemann_solver.h.
Number ryujin::EulerAEOS::RiemannSolver< dim, Number >::compute | ( | const primitive_type & | riemann_data_i, |
const primitive_type & | riemann_data_j | ||
) | const |
For two given 1D primitive states riemann_data_i and riemann_data_j, compute an estimate for an upper bound of the maximum wavespeed lambda.
Definition at line 536 of file riemann_solver.template.h.
|
inline |
For two given states U_i a U_j and a (normalized) "direction" n_ij compute an estimate for an upper bound of the maximum wavespeed lambda.
Definition at line 621 of file riemann_solver.template.h.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Compute the best available, but expensive, upper bound on the expansion-shock case as described in §5.4, Eqn. (5.7) and (5.8) in [2]
Cost: 5x pow, 11x division, 1x sqrt
Definition at line 102 of file riemann_solver.template.h.
References ryujin::positive_part(), and ryujin::pow().
|
inlineprotected |
Compute the best available, but expensive, upper bound on the shock-shock case as described in §5.5, Eqn. (5.10) and (5.12) in [2]
Cost: 2x pow, 9x division, 3x sqrt
Definition at line 198 of file riemann_solver.template.h.
References ryujin::positive_part(), and ryujin::pow().
|
inlineprotected |
Definition at line 241 of file riemann_solver.template.h.
|
inlineprotected |
Definition at line 290 of file riemann_solver.template.h.
References ryujin::positive_part(), and ryujin::pow().
|
inlineprotected |
See [2]
The approximate Riemann solver is based on a function phi(p) that is montone increasing in p, concave down and whose (weak) third derivative is non-negative and locally bounded. Because we actually do not perform any iteration for computing our wavespeed estimate we can get away by only implementing a specialized variant of the phi function that computes phi(p_max). It inlines the implementation of the "f" function and eliminates all unnecessary branches in "f".
Cost: 0x pow, 2x division, 2x sqrt
Definition at line 419 of file riemann_solver.template.h.
|
inlineprotected |
See [6] page 912, (3.7)
Cost: 0x pow, 1x division, 1x sqrt
Definition at line 449 of file riemann_solver.template.h.
References ryujin::positive_part().
|
inlineprotected |
See [6] page 912, (3.8)
Cost: 0x pow, 1x division, 1x sqrt
Definition at line 465 of file riemann_solver.template.h.
References ryujin::positive_part().
|
inlineprotected |
See [6] page 912, (3.9)
For two given primitive states riemann_data_i
and riemann_data_j
, and a guess p_2, compute an upper bound for lambda.
Cost: 0x pow, 2x division, 2x sqrt (inclusive)
Definition at line 481 of file riemann_solver.template.h.
References ryujin::negative_part(), and ryujin::positive_part().
|
inlineprotected |
For a given (2+dim dimensional) state vector U
, and a (normalized) "direction" n_ij, first compute the corresponding projected state in the corresponding 1D Riemann problem, and then compute and return the Riemann data [rho, u, p, a] (used in the approximative Riemann solver).
Definition at line 495 of file riemann_solver.template.h.
References AssertThrowSIMD.
|
staticconstexpr |
The dimension of the state space.
Definition at line 51 of file riemann_solver.h.
|
staticconstexpr |
Number of components in a primitive state, we store \([\rho, v, p, a, gamma]\), thus, 5.
Definition at line 57 of file riemann_solver.h.
|
staticconstexpr |
The number of precomputed values.
Definition at line 73 of file riemann_solver.h.