16#include <unordered_map>
18#include <Kokkos_Core.hpp>
29static const std::unordered_map<std::string, PhysicsType> PHYSICS_TYPES = {
34static const std::unordered_map<PhysicsType, std::string> PHYSICS_NAMES = {
126 return p / (rho *
R);
141 return Kokkos::sqrt(
gamma * p / rho);
149 const rtype * conservatives)
const {
150 const rtype rho = conservatives[0];
156 primitives[
N_DIM] = p;
158 primitives[
N_DIM + 2] =
e + p / rho;
166 const rtype rho = conservatives[0];
177 conservatives[0] = W[0];
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
float rtype
Definition common_typedef.h:39
#define N_DIM
Definition common_typedef.h:28
#define FOR_I_DIM
Definition common_typedef.h:32
Console output: rank-0 info lines, aligned sections and tables, warnings and errors on stderr,...
std::vector< std::pair< std::string, std::string > > Items
Key-value lines of a setup section, in display order.
Definition log.h:27
ViscosityModel
Definition physics.h:39
PhysicsType
Definition physics.h:24
Calorically perfect gas, inviscid (Euler) or viscous and heat conducting (Navier-Stokes,...
Definition physics.h:54
rtype gamma
Definition physics.h:55
rtype cv
Definition physics.h:58
KOKKOS_INLINE_FUNCTION void compute_W_from_conservatives(rtype *W, const rtype *conservatives) const
Conservatives -> W = [rho, u, p].
Definition physics.h:165
KOKKOS_INLINE_FUNCTION rtype conductivity(const rtype mu) const
Thermal conductivity for dynamic viscosity mu.
Definition physics.h:108
KOKKOS_INLINE_FUNCTION rtype get_gamma() const
Definition physics.h:111
rtype R
Definition physics.h:56
KOKKOS_INLINE_FUNCTION rtype get_sound_speed_from_pressure_density(const rtype p, const rtype rho) const
Definition physics.h:140
KOKKOS_INLINE_FUNCTION bool is_viscous() const
Definition physics.h:85
KOKKOS_INLINE_FUNCTION rtype get_pressure_from_density_temperature(const rtype rho, const rtype T) const
Definition physics.h:130
KOKKOS_INLINE_FUNCTION rtype get_energy_from_temperature(const rtype T) const
Definition physics.h:114
KOKKOS_INLINE_FUNCTION rtype get_pressure_from_density_energy(const rtype rho, const rtype e) const
Definition physics.h:135
KOKKOS_INLINE_FUNCTION void compute_conservatives_from_W(rtype *conservatives, const rtype *W) const
W = [rho, u, p] -> conservatives.
Definition physics.h:176
KOKKOS_INLINE_FUNCTION rtype get_density_from_pressure_temperature(const rtype p, const rtype T) const
Definition physics.h:120
KOKKOS_INLINE_FUNCTION PhysicsType get_type() const
Definition physics.h:80
KOKKOS_INLINE_FUNCTION rtype get_temperature_from_energy(const rtype e) const
Definition physics.h:117
logging::Items summary() const
Display lines for the run log.
Definition physics.cpp:70
rtype T_mu_ref
Definition physics.h:61
rtype mu_ref
Definition physics.h:60
ViscosityModel viscosity_model
Definition physics.h:59
static Euler from_reference(rtype gamma, rtype p_ref, rtype T_ref, rtype rho_ref)
Construct from gamma and a reference state (p_ref = rho_ref * R * T_ref).
Definition physics.cpp:19
KOKKOS_INLINE_FUNCTION rtype viscosity(const rtype T) const
Dynamic viscosity at temperature T.
Definition physics.h:91
static Euler from_input(const toml::value &input)
Construct from the [physics] table of an input file.
Definition physics.cpp:28
rtype Pr
Definition physics.h:64
rtype cp
Definition physics.h:57
rtype S_mu
Definition physics.h:62
rtype n_mu
Definition physics.h:63
KOKKOS_INLINE_FUNCTION void compute_primitives_from_conservatives(rtype *primitives, const rtype *conservatives) const
Conservatives [rho, rho u, rho E] -> primitives [u, p, T, h].
Definition physics.h:148
KOKKOS_INLINE_FUNCTION rtype get_temperature_from_density_pressure(const rtype rho, const rtype p) const
Definition physics.h:125