Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
riemann_solver.h
Go to the documentation of this file.
1
12#ifndef RIEMANN_SOLVER_H
13#define RIEMANN_SOLVER_H
14
15#include <string>
16#include <unordered_map>
17
18#include <Kokkos_Core.hpp>
19
20#include "common_typedef.h"
21#include "common_math.h"
22#include "teno.h"
23
25 RUSANOV,
26 HLL,
27 HLLC,
28 ROE,
29 RHLL,
30};
31
32static const std::unordered_map<std::string, RiemannSolverType> RIEMANN_SOLVER_TYPES = {
33 {"Rusanov", RiemannSolverType::RUSANOV},
38};
39
40static const std::unordered_map<RiemannSolverType, std::string> RIEMANN_SOLVER_NAMES = {
41 {RiemannSolverType::RUSANOV, "Rusanov"},
46};
47
53namespace riemann {
54
59void physical_flux(const rtype * W, const rtype * n, const rtype gamma,
60 rtype * U, rtype * F) {
61 constexpr uint8_t E = N_DIM + 1;
62 const rtype u_n = dot<N_DIM>(W + 1, n);
63 U[0] = W[0];
64 FOR_I_DIM U[1 + i] = W[0] * W[1 + i];
65 U[E] = W[E] / (gamma - 1.0_r) + 0.5_r * W[0] * dot<N_DIM>(W + 1, W + 1);
66 F[0] = U[0] * u_n;
67 FOR_I_DIM F[1 + i] = U[1 + i] * u_n + W[E] * n[i];
68 F[E] = (U[E] + W[E]) * u_n;
69}
70
76void wave_speeds_einfeldt(const rtype * W_l, const rtype * W_r, const rtype u_l_n, const rtype u_r_n,
77 const rtype gamma, rtype & S_l, rtype & S_r) {
78 const rtype a_l = Kokkos::sqrt(gamma * W_l[N_DIM + 1] / W_l[0]);
79 const rtype a_r = Kokkos::sqrt(gamma * W_r[N_DIM + 1] / W_r[0]);
80 const rtype s_l = Kokkos::sqrt(W_l[0]);
81 const rtype s_r = Kokkos::sqrt(W_r[0]);
82 const rtype H_l = a_l * a_l / (gamma - 1.0_r) + 0.5_r * dot<N_DIM>(W_l + 1, W_l + 1);
83 const rtype H_r = a_r * a_r / (gamma - 1.0_r) + 0.5_r * dot<N_DIM>(W_r + 1, W_r + 1);
85 FOR_I_DIM u_roe[i] = (s_l * W_l[1 + i] + s_r * W_r[1 + i]) / (s_l + s_r);
86 const rtype H_roe = (s_l * H_l + s_r * H_r) / (s_l + s_r);
87 const rtype un_roe = (s_l * u_l_n + s_r * u_r_n) / (s_l + s_r);
88 const rtype a_roe = Kokkos::sqrt(Kokkos::fmax((gamma - 1.0_r) * (H_roe - 0.5_r * dot<N_DIM>(u_roe, u_roe)), 0.0_r));
89 S_l = Kokkos::fmin(u_l_n - a_l, un_roe - a_roe);
90 S_r = Kokkos::fmax(u_r_n + a_r, un_roe + a_roe);
91}
92
116
121void physical_flux(const rtype * W, const rtype * n, const SideThermo & th, rtype * U, rtype * F) {
122 constexpr uint8_t E = N_DIM + 1;
123 const rtype u_n = dot<N_DIM>(W + 1, n);
124 U[0] = W[0];
125 FOR_I_DIM U[1 + i] = W[0] * W[1 + i];
126 U[E] = W[E] / (th.gamma - 1.0_r) + W[0] * th.e0 + 0.5_r * W[0] * dot<N_DIM>(W + 1, W + 1);
127 F[0] = U[0] * u_n;
128 FOR_I_DIM F[1 + i] = U[1 + i] * u_n + W[E] * n[i];
129 F[E] = (U[E] + W[E]) * u_n;
130}
131
139void wave_speeds_einfeldt(const rtype * W_l, const rtype * W_r, const rtype u_l_n, const rtype u_r_n,
140 const SideThermo & th_l, const SideThermo & th_r, rtype & S_l, rtype & S_r) {
141 const rtype a_l = Kokkos::sqrt(th_l.gamma_waves * W_l[N_DIM + 1] / W_l[0]);
142 const rtype a_r = Kokkos::sqrt(th_r.gamma_waves * W_r[N_DIM + 1] / W_r[0]);
143 const rtype s_l = Kokkos::sqrt(W_l[0]);
144 const rtype s_r = Kokkos::sqrt(W_r[0]);
145 const rtype H_l = a_l * a_l / (th_l.gamma_waves - 1.0_r) + th_l.e0_waves + 0.5_r * dot<N_DIM>(W_l + 1, W_l + 1);
146 const rtype H_r = a_r * a_r / (th_r.gamma_waves - 1.0_r) + th_r.e0_waves + 0.5_r * dot<N_DIM>(W_r + 1, W_r + 1);
148 FOR_I_DIM u_roe[i] = (s_l * W_l[1 + i] + s_r * W_r[1 + i]) / (s_l + s_r);
149 const rtype H_roe = (s_l * H_l + s_r * H_r) / (s_l + s_r);
150 const rtype gamma_roe = (s_l * th_l.gamma_waves + s_r * th_r.gamma_waves) / (s_l + s_r);
151 const rtype e0_roe = (s_l * th_l.e0_waves + s_r * th_r.e0_waves) / (s_l + s_r);
152 const rtype un_roe = (s_l * u_l_n + s_r * u_r_n) / (s_l + s_r);
153 const rtype a_roe = Kokkos::sqrt(
154 Kokkos::fmax((gamma_roe - 1.0_r) * (H_roe - e0_roe - 0.5_r * dot<N_DIM>(u_roe, u_roe)), 0.0_r));
155 S_l = Kokkos::fmin(u_l_n - a_l, un_roe - a_roe);
156 S_r = Kokkos::fmax(u_r_n + a_r, un_roe + a_roe);
157}
158
159struct Rusanov {
162 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
163 const SideThermo & th_l, const SideThermo & th_r) {
168 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
169 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
170 const rtype a_l = Kokkos::sqrt(th_l.gamma_waves * W_l[N_DIM + 1] / W_l[0]);
171 const rtype a_r = Kokkos::sqrt(th_r.gamma_waves * W_r[N_DIM + 1] / W_r[0]);
172 const rtype S_max = Kokkos::fmax(Kokkos::fabs(u_l_n) + a_l, Kokkos::fabs(u_r_n) + a_r);
173 FOR_I_CONSERVATIVE flux[i] = 0.5_r * (F_l[i] + F_r[i] - S_max * (U_r[i] - U_l[i]));
174 }
175
177 static void calc_flux(rtype * flux, const rtype * n,
178 const rtype * W_l, const rtype * W_r, const rtype gamma) {
181 physical_flux(W_l, n, gamma, U_l, F_l);
182 physical_flux(W_r, n, gamma, U_r, F_r);
183 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
184 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
185 const rtype a_l = Kokkos::sqrt(gamma * W_l[N_DIM + 1] / W_l[0]);
186 const rtype a_r = Kokkos::sqrt(gamma * W_r[N_DIM + 1] / W_r[0]);
187 const rtype S_max = Kokkos::fmax(Kokkos::fabs(u_l_n) + a_l, Kokkos::fabs(u_r_n) + a_r);
188 FOR_I_CONSERVATIVE flux[i] = 0.5_r * (F_l[i] + F_r[i] - S_max * (U_r[i] - U_l[i]));
189 }
190};
191
192struct HLL {
195 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
196 const SideThermo & th_l, const SideThermo & th_r) {
201 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
202 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
203 rtype S_l, S_r;
205 if (0.0_r <= S_l) {
207 } else if (S_r <= 0.0_r) {
209 } else {
211 flux[i] = (S_r * F_l[i] - S_l * F_r[i] + S_l * S_r * (U_r[i] - U_l[i])) / (S_r - S_l);
212 }
213 }
214 }
215
217 static void calc_flux(rtype * flux, const rtype * n,
218 const rtype * W_l, const rtype * W_r, const rtype gamma) {
221 physical_flux(W_l, n, gamma, U_l, F_l);
222 physical_flux(W_r, n, gamma, U_r, F_r);
223 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
224 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
225 rtype S_l, S_r;
227 if (0.0_r <= S_l) {
229 } else if (S_r <= 0.0_r) {
231 } else {
233 flux[i] = (S_r * F_l[i] - S_l * F_r[i] + S_l * S_r * (U_r[i] - U_l[i])) / (S_r - S_l);
234 }
235 }
236 }
237};
238
239struct HLLC {
245 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
246 const SideThermo & th_l, const SideThermo & th_r) {
251 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
252 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
253 rtype S_l, S_r;
255 if (0.0_r <= S_l) {
257 return;
258 }
259 if (S_r <= 0.0_r) {
261 return;
262 }
263 const rtype m_l = W_l[0] * (S_l - u_l_n);
264 const rtype m_r = W_r[0] * (S_r - u_r_n);
265 constexpr uint8_t E = N_DIM + 1;
266 const rtype S_star = (W_r[E] - W_l[E] + u_l_n * m_l - u_r_n * m_r) / (m_l - m_r);
267 const bool left = (S_star >= 0.0_r);
268 const rtype * W = left ? W_l : W_r;
269 const rtype * U = left ? U_l : U_r;
270 const rtype * F = left ? F_l : F_r;
271 const rtype S = left ? S_l : S_r;
272 const rtype u_n = left ? u_l_n : u_r_n;
273 const rtype coeff = W[0] * (S - u_n) / (S - S_star);
275 U_star[0] = coeff;
276 FOR_I_DIM U_star[1 + i] = coeff * (W[1 + i] + (S_star - u_n) * n[i]);
277 U_star[E] = coeff * (U[E] / W[0] + (S_star - u_n) * (S_star + W[E] / (W[0] * (S - u_n))));
278 FOR_I_CONSERVATIVE flux[i] = F[i] + S * (U_star[i] - U[i]);
279 }
280
282 static void calc_flux(rtype * flux, const rtype * n,
283 const rtype * W_l, const rtype * W_r, const rtype gamma) {
286 physical_flux(W_l, n, gamma, U_l, F_l);
287 physical_flux(W_r, n, gamma, U_r, F_r);
288 const rtype u_l_n = dot<N_DIM>(W_l + 1, n);
289 const rtype u_r_n = dot<N_DIM>(W_r + 1, n);
290 rtype S_l, S_r;
292 if (0.0_r <= S_l) {
294 return;
295 }
296 if (S_r <= 0.0_r) {
298 return;
299 }
300 // Toro 10.37 and 10.38-10.39 (star states, "variant 1")
301 const rtype m_l = W_l[0] * (S_l - u_l_n);
302 const rtype m_r = W_r[0] * (S_r - u_r_n);
303 constexpr uint8_t E = N_DIM + 1;
304 const rtype S_star = (W_r[E] - W_l[E] + u_l_n * m_l - u_r_n * m_r) / (m_l - m_r);
305 const bool left = (S_star >= 0.0_r);
306 const rtype * W = left ? W_l : W_r;
307 const rtype * U = left ? U_l : U_r;
308 const rtype * F = left ? F_l : F_r;
309 const rtype S = left ? S_l : S_r;
310 const rtype u_n = left ? u_l_n : u_r_n;
311 const rtype coeff = W[0] * (S - u_n) / (S - S_star);
313 U_star[0] = coeff;
314 FOR_I_DIM U_star[1 + i] = coeff * (W[1 + i] + (S_star - u_n) * n[i]);
315 U_star[E] = coeff * (U[E] / W[0] + (S_star - u_n) * (S_star + W[E] / (W[0] * (S - u_n))));
316 FOR_I_CONSERVATIVE flux[i] = F[i] + S * (U_star[i] - U[i]);
317 }
318};
319
324struct Roe {
337 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
338 const SideThermo & th_l, const SideThermo & th_r) {
339 constexpr uint8_t E = N_DIM + 1;
344
345 const rtype s_l = Kokkos::sqrt(W_l[0]);
346 const rtype s_r = Kokkos::sqrt(W_r[0]);
347 const rtype w_l = s_l / (s_l + s_r);
348 const rtype w_r = s_r / (s_l + s_r);
349 rtype u[N_DIM];
350 FOR_I_DIM u[i] = w_l * W_l[1 + i] + w_r * W_r[1 + i];
351 const rtype H = w_l * (U_l[E] + W_l[E]) / W_l[0] + w_r * (U_r[E] + W_r[E]) / W_r[0];
352 const rtype gamma = w_l * th_l.gamma + w_r * th_r.gamma;
353 const rtype e0 = w_l * th_l.e0 + w_r * th_r.e0;
354 const rtype a2 = Kokkos::fmax((gamma - 1.0_r) * (H - e0 - 0.5_r * dot<N_DIM>(u, u)), 1e-14_r);
355 const rtype a = Kokkos::sqrt(a2);
356 const rtype rho = s_l * s_r;
357 const rtype u_n = dot<N_DIM>(u, n);
358
359 const rtype dp = W_r[E] - W_l[E];
360 const rtype du_n = dot<N_DIM>(W_r + 1, n) - dot<N_DIM>(W_l + 1, n);
361 const rtype delta = 0.1_r * a;
362 const rtype l_c = Kokkos::fabs(u_n);
363 FOR_I_CONSERVATIVE flux[i] = l_c * (U_r[i] - U_l[i]);
364 for (uint8_t k = 0; k < 2; k++) {
365 const rtype sign = k ? 1.0_r : -1.0_r;
366 rtype l = Kokkos::fabs(u_n + sign * a);
367 if (l < delta) l = 0.5_r * (l * l + delta * delta) / delta;
368 const rtype c = (l - l_c) * (dp + sign * rho * a * du_n) / (2.0_r * a2);
369 flux[0] += c;
370 FOR_I_DIM flux[1 + i] += c * (u[i] + sign * a * n[i]);
371 flux[E] += c * (H + sign * a * u_n);
372 }
373 FOR_I_CONSERVATIVE flux[i] = 0.5_r * (F_l[i] + F_r[i] - flux[i]);
374 }
375
377 static void calc_flux(rtype * flux, const rtype * n,
378 const rtype * W_l, const rtype * W_r, const rtype gamma) {
381 physical_flux(W_l, n, gamma, U_l, F_l);
382 physical_flux(W_r, n, gamma, U_r, F_r);
383
384 // Roe-averaged state, expressed as W = [rho, u, p] with a matching sound speed
385 constexpr uint8_t E = N_DIM + 1;
386 const rtype s_l = Kokkos::sqrt(W_l[0]);
387 const rtype s_r = Kokkos::sqrt(W_r[0]);
388 const rtype H_l = (U_l[E] + W_l[E]) / W_l[0];
389 const rtype H_r = (U_r[E] + W_r[E]) / W_r[0];
391 W_roe[0] = s_l * s_r;
392 FOR_I_DIM W_roe[1 + i] = (s_l * W_l[1 + i] + s_r * W_r[1 + i]) / (s_l + s_r);
393 const rtype H = (s_l * H_l + s_r * H_r) / (s_l + s_r);
394 const rtype a2 = Kokkos::fmax((gamma - 1.0_r) * (H - 0.5_r * dot<N_DIM>(W_roe + 1, W_roe + 1)), 1e-14_r);
395 W_roe[E] = W_roe[0] * a2 / gamma;
396 const rtype a = Kokkos::sqrt(a2);
397
399 teno::eigenvectors(W_roe, n, gamma, L, R);
400 const rtype u_n = dot<N_DIM>(W_roe + 1, n);
403 lambda[0] = u_n - a;
404 lambda[2] = u_n + a;
405 const rtype delta = 0.1_r * a;
406 for (uint8_t k = 0; k < N_CONSERVATIVE; k++) {
407 rtype l = Kokkos::fabs(lambda[k]);
408 if ((k == 0 || k == 2) && l < delta) l = 0.5_r * (l * l + delta * delta) / delta;
409 lambda[k] = l;
410 }
413 strength[i] = 0.0;
414 for (uint8_t j = 0; j < N_CONSERVATIVE; j++) strength[i] += L[i][j] * (U_r[j] - U_l[j]);
415 }
417 rtype dissipation = 0.0;
418 for (uint8_t k = 0; k < N_CONSERVATIVE; k++) dissipation += R[i][k] * lambda[k] * strength[k];
419 flux[i] = 0.5_r * (F_l[i] + F_r[i] - dissipation);
420 }
421 }
422};
423
430struct RHLL {
432 static void calc_flux(rtype * flux, const rtype * n,
433 const rtype * W_l, const rtype * W_r, const rtype gamma) {
434 const rtype a_ref = Kokkos::sqrt(gamma * Kokkos::fmax(W_l[N_DIM + 1] / W_l[0], W_r[N_DIM + 1] / W_r[0]));
435 shock_blended(flux, n, W_l, W_r, a_ref, gamma);
436 }
437
440 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
441 const SideThermo & th_l, const SideThermo & th_r) {
442 const rtype a_ref = Kokkos::sqrt(Kokkos::fmax(th_l.gamma_waves * W_l[N_DIM + 1] / W_l[0],
443 th_r.gamma_waves * W_r[N_DIM + 1] / W_r[0]));
445 }
446
457 template <typename... Thermo>
458 KOKKOS_INLINE_FUNCTION static void shock_blended(rtype * flux, const rtype * n, const rtype * W_l,
459 const rtype * W_r, const rtype a_ref, const Thermo &... th) {
460 rotated(flux, n, W_l, W_r, a_ref, th...);
461 const rtype ratio = Kokkos::fmin(W_l[N_DIM + 1] / W_r[N_DIM + 1], W_r[N_DIM + 1] / W_l[N_DIM + 1]);
462 const rtype w = ratio * ratio * ratio;
463 if (w >= 1.0_r) return;
465 HLL::calc_flux(f_hll, n, W_l, W_r, th...);
466 FOR_I_CONSERVATIVE flux[i] = w * flux[i] + (1.0_r - w) * f_hll[i];
467 }
468
474 template <typename... Thermo>
475 KOKKOS_INLINE_FUNCTION static void rotated(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
476 const rtype a_ref, const Thermo &... th) {
477 if constexpr (N_DIM == 3) {
478 rotated_3d(flux, n, W_l, W_r, a_ref, th...);
479 return;
480 }
481 const rtype dq[N_DIM] = {W_r[1] - W_l[1], W_r[2] - W_l[2]};
482 const rtype dq_mag = Kokkos::sqrt(dq[0] * dq[0] + dq[1] * dq[1]);
483 rtype n1[N_DIM];
484 if (dq_mag > precision_tol(1e-12, 1e-5) * a_ref) {
485 n1[0] = dq[0] / dq_mag;
486 n1[1] = dq[1] / dq_mag;
487 } else {
488 // No velocity jump: fall back to the face normal (pure HLL)
489 n1[0] = n[0];
490 n1[1] = n[1];
491 }
492 rtype alpha1 = n1[0] * n[0] + n1[1] * n[1];
493 if (alpha1 < 0.0_r) {
494 n1[0] = -n1[0];
495 n1[1] = -n1[1];
496 alpha1 = -alpha1;
497 }
498 rtype n2[N_DIM] = {-n1[1], n1[0]};
499 rtype alpha2 = n2[0] * n[0] + n2[1] * n[1];
500 if (alpha2 < 0.0_r) {
501 n2[0] = -n2[0];
502 n2[1] = -n2[1];
503 alpha2 = -alpha2;
504 }
506 HLL::calc_flux(f1, n1, W_l, W_r, th...);
507 Roe::calc_flux(f2, n2, W_l, W_r, th...);
509 }
510
516 template <typename... Thermo>
517 KOKKOS_INLINE_FUNCTION static void rotated_3d(rtype * flux, const rtype * n, const rtype * W_l,
518 const rtype * W_r, const rtype a_ref, const Thermo &... th) {
520 FOR_I_DIM dq[i] = W_r[1 + i] - W_l[1 + i];
521 const rtype dq_mag = norm_2<N_DIM>(dq);
522 FOR_I_DIM n1[i] = (dq_mag > precision_tol(1e-12, 1e-5) * a_ref) ? dq[i] / dq_mag : n[i];
524 if (alpha1 < 0.0_r) {
525 FOR_I_DIM n1[i] = -n1[i];
526 alpha1 = -alpha1;
527 }
528 FOR_I_DIM n2[i] = n[i] - alpha1 * n1[i];
529 const rtype alpha2 = norm_2<N_DIM>(n2);
531 HLL::calc_flux(f1, n1, W_l, W_r, th...);
532 if (alpha2 <= precision_tol(1e-12, 1e-6)) {
534 return;
535 }
536 FOR_I_DIM n2[i] /= alpha2;
538 Roe::calc_flux(f2, n2, W_l, W_r, th...);
540 }
541};
542
553struct KEEP {
555 static void central(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r, const rtype e_l,
556 const rtype e_r) {
557 constexpr uint8_t E = N_DIM + 1;
558 rtype u[N_DIM];
559 FOR_I_DIM u[i] = 0.5_r * (W_l[1 + i] + W_r[1 + i]);
560 const rtype C = 0.5_r * (W_l[0] + W_r[0]) * dot<N_DIM>(u, n);
561 const rtype p = 0.5_r * (W_l[E] + W_r[E]);
562 flux[0] = C;
563 FOR_I_DIM flux[1 + i] = C * u[i] + p * n[i];
564 flux[E] = C * (0.5_r * (e_l + e_r) + 0.5_r * dot<N_DIM>(W_l + 1, W_r + 1)) +
565 0.5_r * (W_l[E] * dot<N_DIM>(W_r + 1, n) + W_r[E] * dot<N_DIM>(W_l + 1, n));
566 }
567
569 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r, const rtype gamma) {
570 constexpr uint8_t E = N_DIM + 1;
571 central(flux, n, W_l, W_r, W_l[E] / ((gamma - 1.0_r) * W_l[0]), W_r[E] / ((gamma - 1.0_r) * W_r[0]));
572 }
573
576 static void calc_flux(rtype * flux, const rtype * n, const rtype * W_l, const rtype * W_r,
577 const SideThermo & th_l, const SideThermo & th_r) {
578 constexpr uint8_t E = N_DIM + 1;
579 central(flux, n, W_l, W_r, W_l[E] / ((th_l.gamma - 1.0_r) * W_l[0]) + th_l.e0,
580 W_r[E] / ((th_r.gamma - 1.0_r) * W_r[0]) + th_r.e0);
581 }
582};
583
584} // namespace riemann
585
586#endif // RIEMANN_SOLVER_H
Common math functions.
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