Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
chemistry::ThermoTable< MemorySpace > Struct Template Reference

Species thermodynamics of a mechanism on the device, in double precision in every build: per species its NASA-9 form ranges (SpeciesThermo), and the ideal-gas mixture properties per unit mass. More...

#include <thermo.h>

Classes

struct  Powers
 Powers of T shared by all species. More...
 

Public Member Functions

KOKKOS_INLINE_FUNCTION uint32_t range (const uint32_t k, const double T) const
 
KOKKOS_INLINE_FUNCTION double cp_R (const uint32_t k, const Powers &p) const
 cp_k / R.
 
KOKKOS_INLINE_FUNCTION double dcp_R_dT (const uint32_t k, const Powers &p) const
 d(cp_k / R) / dT.
 
KOKKOS_INLINE_FUNCTION double h_RT (const uint32_t k, const Powers &p) const
 h_k / (R T), molar enthalpy including the formation enthalpy.
 
KOKKOS_INLINE_FUNCTION double s_R (const uint32_t k, const Powers &p) const
 s_k / R at the standard pressure.
 
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double gas_constant (const F_Y &y) const
 Mixture gas constant R_u sum_k Y_k / W_k [J/(kg K)].
 
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double cp_mass (const double T, const F_Y &y) const
 Mixture cp [J/(kg K)].
 
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double h_mass (const double T, const F_Y &y) const
 Mixture enthalpy [J/kg].
 
template<typename F_Y >
KOKKOS_INLINE_FUNCTION void e_cv (const double T, const F_Y &y, double &e, double &cv) const
 Mixture internal energy e [J/kg] and cv [J/(kg K)] at T.
 
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double T_from_e (const double e, const F_Y &y, const double T_guess) const
 Temperature at which the mixture has internal energy e: Newton from T_guess (300 K if outside the bracket), safeguarded by bisection within [T_low, T_high], until the update is below 1e-10 T.
 

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION Powers powers (const double T)
 

Public Attributes

uint32_t n_species = 0
 
Kokkos::View< double *, MemorySpace > inv_W
 
Kokkos::View< uint32_t *, MemorySpace > range_offset
 
Kokkos::View< double *, MemorySpace > range_upper
 
Kokkos::View< uint8_t *, MemorySpace > upper_closed
 
Kokkos::View< double *[9], Kokkos::LayoutRight, MemorySpace > coeffs
 
double T_low = 1.0
 
double T_high = 1.0e5
 

Detailed Description

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
struct chemistry::ThermoTable< MemorySpace >

Species thermodynamics of a mechanism on the device, in double precision in every build: per species its NASA-9 form ranges (SpeciesThermo), and the ideal-gas mixture properties per unit mass.

A plain aggregate of Views in MemorySpace (the device by default, or the host for setup), captured by value in kernels. Mixture functions take the mass fractions as any callable y(k).

Member Function Documentation

◆ cp_mass()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::cp_mass ( const double  T,
const F_Y &  y 
) const
inline

Mixture cp [J/(kg K)].

◆ cp_R()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::cp_R ( const uint32_t  k,
const Powers &  p 
) const
inline

cp_k / R.

◆ dcp_R_dT()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::dcp_R_dT ( const uint32_t  k,
const Powers &  p 
) const
inline

d(cp_k / R) / dT.

◆ e_cv()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename F_Y >
KOKKOS_INLINE_FUNCTION void chemistry::ThermoTable< MemorySpace >::e_cv ( const double  T,
const F_Y &  y,
double &  e,
double &  cv 
) const
inline

Mixture internal energy e [J/kg] and cv [J/(kg K)] at T.

◆ gas_constant()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::gas_constant ( const F_Y &  y) const
inline

Mixture gas constant R_u sum_k Y_k / W_k [J/(kg K)].

◆ h_mass()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::h_mass ( const double  T,
const F_Y &  y 
) const
inline

Mixture enthalpy [J/kg].

◆ h_RT()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::h_RT ( const uint32_t  k,
const Powers &  p 
) const
inline

h_k / (R T), molar enthalpy including the formation enthalpy.

◆ powers()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
static KOKKOS_INLINE_FUNCTION Powers chemistry::ThermoTable< MemorySpace >::powers ( const double  T)
inlinestatic

◆ range()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION uint32_t chemistry::ThermoTable< MemorySpace >::range ( const uint32_t  k,
const double  T 
) const
inline

◆ s_R()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::s_R ( const uint32_t  k,
const Powers &  p 
) const
inline

s_k / R at the standard pressure.

◆ T_from_e()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename F_Y >
KOKKOS_INLINE_FUNCTION double chemistry::ThermoTable< MemorySpace >::T_from_e ( const double  e,
const F_Y &  y,
const double  T_guess 
) const
inline

Temperature at which the mixture has internal energy e: Newton from T_guess (300 K if outside the bracket), safeguarded by bisection within [T_low, T_high], until the update is below 1e-10 T.

Member Data Documentation

◆ coeffs

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Kokkos::View<double *[9], Kokkos::LayoutRight, MemorySpace> chemistry::ThermoTable< MemorySpace >::coeffs

◆ inv_W

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Kokkos::View<double *, MemorySpace> chemistry::ThermoTable< MemorySpace >::inv_W

◆ n_species

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
uint32_t chemistry::ThermoTable< MemorySpace >::n_species = 0

◆ range_offset

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Kokkos::View<uint32_t *, MemorySpace> chemistry::ThermoTable< MemorySpace >::range_offset

◆ range_upper

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Kokkos::View<double *, MemorySpace> chemistry::ThermoTable< MemorySpace >::range_upper

◆ T_high

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double chemistry::ThermoTable< MemorySpace >::T_high = 1.0e5

◆ T_low

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double chemistry::ThermoTable< MemorySpace >::T_low = 1.0

◆ upper_closed

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
Kokkos::View<uint8_t *, MemorySpace> chemistry::ThermoTable< MemorySpace >::upper_closed

The documentation for this struct was generated from the following file: