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

Adiabatic, constant-volume reactor at density rho with state y = (Y_1 .. Y_Ns, T): dY_k/dt = W_k omega_k / rho, dT/dt = -sum_k u_k omega_k / (rho cv), with u_k the molar internal energies. The ODE system of integrate(). More...

#include <reactor.h>

Public Member Functions

KOKKOS_INLINE_FUNCTION uint32_t size () const
 
KOKKOS_INLINE_FUNCTION double atol (const uint32_t i) const
 
template<typename Lanes >
KOKKOS_INLINE_FUNCTION bool admissible (const Lanes &lanes, const double *y) const
 
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void rhs (const Lanes &lanes, const double *y, double *f) const
 
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void rhs_jacobian (const Lanes &lanes, const double *y, double *f, double *J) const
 
template<typename Lanes >
KOKKOS_INLINE_FUNCTION double forcing_temperature_derivative (const Lanes &lanes, const double *cp_R) const
 d(sum_k e_k g_k) / dT = sum_k cv_k g_k.
 
template<typename Lanes , typename Powers >
KOKKOS_INLINE_FUNCTION void compact_jacobian (const Lanes &lanes, const double *y, double *J, const double T, const Powers &p, const double cv, const double inv_rho_cv, const double dT_dt, const double *h_RT, const double *cp_R, const double *omega, const double *domega_dT, const ReactionDerivatives &d) const
 f(y) and, if J is not null, the Jacobian df/dy (in the lanes' layout, see dense_index), from d omega / dC and d q / dT by the chain rule (C_k = rho Y_k / W_k).
 
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void evaluate (const Lanes &lanes, const double *y, double *f, double *J) const
 

Static Public Member Functions

static KOKKOS_INLINE_FUNCTION uint32_t scratch_size (const KineticsTable< MemorySpace > &kinetics)
 

Public Attributes

const ThermoTable< MemorySpace > & thermo
 
const KineticsTable< MemorySpace > & kinetics
 
double rho
 
double atol_Y
 
double * scratch
 
double * rank_one
 
const SparseLUPattern< MemorySpace > * sparse = nullptr
 
const double * forcing = nullptr
 
double forcing_time = 0.0
 

Detailed Description

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

Adiabatic, constant-volume reactor at density rho with state y = (Y_1 .. Y_Ns, T): dY_k/dt = W_k omega_k / rho, dT/dt = -sum_k u_k omega_k / (rho cv), with u_k the molar internal energies. The ODE system of integrate().

With a forcing g (n_species + 1 values), the reactor also receives the constant sources rho g_k of its partial densities and rho g_e of its internal energy per volume, rho being the initial density: y_k = rho_k / rho then sums to the current density over rho, and dy_k/dt = W_k omega_k / rho + g_k, dT/dt = (g_e - sum_k e_k g_k - sum_k u_k omega_k / rho) / sum_k y_k cv_k, still autonomous, with the species rows of the Jacobian unchanged. Over a call of length forcing_time, the exact solution can fall below zero by forcing_time max(0, -g_k) at most where the forcing removes a species faster than chemistry restores it, so that much is admissible.

Member Function Documentation

◆ admissible()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes >
KOKKOS_INLINE_FUNCTION bool chemistry::ConstantVolumeReactor< MemorySpace >::admissible ( const Lanes &  lanes,
const double *  y 
) const
inline

◆ atol()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION double chemistry::ConstantVolumeReactor< MemorySpace >::atol ( const uint32_t  i) const
inline

◆ compact_jacobian()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes , typename Powers >
KOKKOS_INLINE_FUNCTION void chemistry::ConstantVolumeReactor< MemorySpace >::compact_jacobian ( const Lanes &  lanes,
const double *  y,
double *  J,
const double  T,
const Powers &  p,
const double  cv,
const double  inv_rho_cv,
const double  dT_dt,
const double *  h_RT,
const double *  cp_R,
const double *  omega,
const double *  domega_dT,
const ReactionDerivatives &  d 
) const
inline

f(y) and, if J is not null, the Jacobian df/dy (in the lanes' layout, see dense_index), from d omega / dC and d q / dT by the chain rule (C_k = rho Y_k / W_k).

The Jacobian in the sparse pattern's compact layout (J_s, with u in rank_one): the species block's entries, the T column and the T row, by the chain rule as in evaluate().

◆ evaluate()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void chemistry::ConstantVolumeReactor< MemorySpace >::evaluate ( const Lanes &  lanes,
const double *  y,
double *  f,
double *  J 
) const
inline

◆ forcing_temperature_derivative()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes >
KOKKOS_INLINE_FUNCTION double chemistry::ConstantVolumeReactor< MemorySpace >::forcing_temperature_derivative ( const Lanes &  lanes,
const double *  cp_R 
) const
inline

d(sum_k e_k g_k) / dT = sum_k cv_k g_k.

◆ rhs()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void chemistry::ConstantVolumeReactor< MemorySpace >::rhs ( const Lanes &  lanes,
const double *  y,
double *  f 
) const
inline

◆ rhs_jacobian()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
template<typename Lanes >
KOKKOS_INLINE_FUNCTION void chemistry::ConstantVolumeReactor< MemorySpace >::rhs_jacobian ( const Lanes &  lanes,
const double *  y,
double *  f,
double *  J 
) const
inline

◆ scratch_size()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
static KOKKOS_INLINE_FUNCTION uint32_t chemistry::ConstantVolumeReactor< MemorySpace >::scratch_size ( const KineticsTable< MemorySpace > &  kinetics)
inlinestatic

◆ size()

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
KOKKOS_INLINE_FUNCTION uint32_t chemistry::ConstantVolumeReactor< MemorySpace >::size ( ) const
inline

Member Data Documentation

◆ atol_Y

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double chemistry::ConstantVolumeReactor< MemorySpace >::atol_Y

◆ forcing

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
const double* chemistry::ConstantVolumeReactor< MemorySpace >::forcing = nullptr

◆ forcing_time

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double chemistry::ConstantVolumeReactor< MemorySpace >::forcing_time = 0.0

◆ kinetics

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
const KineticsTable<MemorySpace>& chemistry::ConstantVolumeReactor< MemorySpace >::kinetics

◆ rank_one

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double* chemistry::ConstantVolumeReactor< MemorySpace >::rank_one

◆ rho

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double chemistry::ConstantVolumeReactor< MemorySpace >::rho

◆ scratch

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
double* chemistry::ConstantVolumeReactor< MemorySpace >::scratch

◆ sparse

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
const SparseLUPattern<MemorySpace>* chemistry::ConstantVolumeReactor< MemorySpace >::sparse = nullptr

◆ thermo

template<typename MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
const ThermoTable<MemorySpace>& chemistry::ConstantVolumeReactor< MemorySpace >::thermo

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