12#ifndef RIEMANN_SOLVER_H
13#define RIEMANN_SOLVER_H
16#include <unordered_map>
18#include <Kokkos_Core.hpp>
32static const std::unordered_map<std::string, RiemannSolverType> RIEMANN_SOLVER_TYPES = {
40static const std::unordered_map<RiemannSolverType, std::string> RIEMANN_SOLVER_NAMES = {
207 }
else if (
S_r <= 0.0
_r) {
229 }
else if (
S_r <= 0.0
_r) {
364 for (
uint8_t k = 0; k < 2; k++) {
457 template <
typename...
Thermo>
463 if (w >= 1.0
_r)
return;
474 template <
typename...
Thermo>
477 if constexpr (
N_DIM == 3) {
516 template <
typename...
Thermo>
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
Typedefs for common types.
float rtype
Definition common_typedef.h:39
#define N_DIM
Definition common_typedef.h:28
#define FOR_I_CONSERVATIVE
Definition common_typedef.h:33
KOKKOS_INLINE_FUNCTION constexpr T precision_tol(double double_tol, double single_tol)
A tolerance that depends on rtype's precision: double_tol in double builds, single_tol in single....
Definition common_typedef.h:53
#define N_CONSERVATIVE
Definition common_typedef.h:29
#define FOR_I_DIM
Definition common_typedef.h:32
Definition riemann_solver.h:53
KOKKOS_INLINE_FUNCTION void wave_speeds_einfeldt(const rtype *W_l, const rtype *W_r, const rtype u_l_n, const rtype u_r_n, const rtype gamma, rtype &S_l, rtype &S_r)
Einfeldt (HLLE) wave speed estimates using Roe averages (Einfeldt et al. 1991; Toro 10....
Definition riemann_solver.h:76
KOKKOS_INLINE_FUNCTION void physical_flux(const rtype *W, const rtype *n, const rtype gamma, rtype *U, rtype *F)
Physical Euler flux of state W through unit normal n.
Definition riemann_solver.h:59
KOKKOS_INLINE_FUNCTION void eigenvectors(const rtype *W, const rtype *n, const rtype gamma, rtype L[N_CONSERVATIVE][N_CONSERVATIVE], rtype R[N_CONSERVATIVE][N_CONSERVATIVE])
Left (L) and right (R) eigenvectors of the Euler flux Jacobian in direction n for conservative variab...
Definition teno.h:284
RiemannSolverType
Definition riemann_solver.h:24
Definition riemann_solver.h:239
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:282
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics. The star states (Toro 10.38-10.39) hold for any equation o...
Definition riemann_solver.h:245
Definition riemann_solver.h:192
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:217
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics.
Definition riemann_solver.h:195
Kinetic-energy- and entropy-preserving central flux (KEEP; Kuya, Totani & Kawai, J....
Definition riemann_solver.h:553
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:569
static KOKKOS_INLINE_FUNCTION void central(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype e_l, const rtype e_r)
Definition riemann_solver.h:555
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics, e = p / ((gamma - 1) rho) + e0.
Definition riemann_solver.h:576
Rotated-hybrid HLL-Roe solver (Nishikawa & Kitamura, J. Comput. Phys. 227, 2008): HLL along the direc...
Definition riemann_solver.h:430
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:432
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics.
Definition riemann_solver.h:440
static KOKKOS_INLINE_FUNCTION void rotated(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype a_ref, const Thermo &... th)
The hybrid for either form of the thermodynamics th, passed on to HLL and Roe; a_ref scales the thres...
Definition riemann_solver.h:475
static KOKKOS_INLINE_FUNCTION void shock_blended(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype a_ref, const Thermo &... th)
The rotated hybrid, blended toward HLL along the face normal by the pressure jump across the face: w ...
Definition riemann_solver.h:458
static KOKKOS_INLINE_FUNCTION void rotated_3d(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype a_ref, const Thermo &... th)
3D variant: n1 is the unit velocity difference (or n), n2 the unit vector orthogonal to n1 in the pla...
Definition riemann_solver.h:517
Roe's approximate Riemann solver with Harten's entropy fix on the acoustic waves.
Definition riemann_solver.h:324
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics, in jump form: F = (F_l + F_r - |u_n| dU - sum_+- (|lambda_...
Definition riemann_solver.h:337
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:377
Definition riemann_solver.h:159
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const SideThermo &th_l, const SideThermo &th_r)
Mixture flux with per-side thermodynamics.
Definition riemann_solver.h:162
static KOKKOS_INLINE_FUNCTION void calc_flux(rtype *flux, const rtype *n, const rtype *W_l, const rtype *W_r, const rtype gamma)
Definition riemann_solver.h:177
Thermodynamics of one side of a face for a gas mixture: the frozen ratio of specific heats and the en...
Definition riemann_solver.h:102
rtype e0_waves
Definition riemann_solver.h:106
KOKKOS_INLINE_FUNCTION SideThermo(const rtype gamma_in, const rtype e0_in)
Definition riemann_solver.h:109
KOKKOS_INLINE_FUNCTION SideThermo(const SideThermo &eos, const SideThermo &waves)
Definition riemann_solver.h:113
rtype e0
Definition riemann_solver.h:104
rtype gamma_waves
Definition riemann_solver.h:105
rtype gamma
Definition riemann_solver.h:103
Device helpers for the TENO-E reconstruction.
CellSetup< ExecSpace > c
Definition teno_setup.cpp:1810
std::vector< double > delta
Definition transport.cpp:285