|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
Reactions of a mechanism as flat device tables (compressed rows per reaction), in MemorySpace. All quantities SI with kmol, in double precision in every build. Concentrations C_k = rho Y_k / W_k. More...
#include <kinetics.h>
Public Types | |
| template<typename T > | |
| using | View1 = Kokkos::View< T *, MemorySpace > |
Public Member Functions | |
| KOKKOS_INLINE_FUNCTION void | plog_level (const uint32_t l, const double log_T, const double inv_T, double &k, double &dlnk_dT) const |
| Sum of the PLOG rates at pressure level l and its d ln k / dT. | |
| KOKKOS_INLINE_FUNCTION void | pressure_rate (const uint32_t i, const double log_T, const double inv_T, const double ln_p, double &k, double &dlnk_dT, double &dlnk_dlnp) const |
| Rate constant of a PLOG or Chebyshev reaction at T and ln p, with d ln k / dT at fixed p and d ln k / d ln p. | |
| KOKKOS_INLINE_FUNCTION double | third_body (const uint32_t i, const double *C, const double C_total) const |
| Third-body concentration of reaction i. | |
| KOKKOS_INLINE_FUNCTION void | falloff_function (const uint32_t i, const double T, const double Pr, double &F, double &dlnF_dlnPr, double &dlnF_dT) const |
| Falloff blending F(Pr, T) and its logarithmic derivatives d ln F / d ln Pr and d ln F / dT at fixed Pr. | |
| KOKKOS_INLINE_FUNCTION uint32_t | derivatives_size () const |
| Doubles of ReactionDerivatives storage. | |
| template<typename Lanes > | |
| KOKKOS_INLINE_FUNCTION void | rates_of_progress (const Lanes &lanes, const double T, const double *C, const double C_total, const double *g_RT, const double *h_RT, double *q, const ReactionDerivatives *d) const |
| Rates of progress q_i [kmol/(m^3 s)] of every reaction (one per lane) and, with derivatives, what the Jacobian needs. | |
| KOKKOS_INLINE_FUNCTION void | rates_of_progress (const double T, const double *C, const double *g_RT, double *q) const |
| Rates of progress of one thread, without derivatives. | |
| template<typename Lanes > | |
| KOKKOS_INLINE_FUNCTION void | production_rates (const Lanes &lanes, const double *q, double *omega, double *partial=nullptr) const |
| Net production rates omega_k = sum_i nu_ki q_i [kmol/(m^3 s)], one species per lane, summed by reaction index (or the same sums of any per-reaction quantity, e.g. dq_dT). | |
| KOKKOS_INLINE_FUNCTION void | production_rates (const double *q, double *omega) const |
| template<typename Lanes > | |
| KOKKOS_INLINE_FUNCTION void | production_jacobian_entries (const Lanes &lanes, const ReactionDerivatives &d, double *values, double *all_columns) const |
| The structural entries of the Jacobian of the production rates (d omega_k / d C_j at fixed T, without the part shared by all columns), values[e] for entry e = (entry_row(e), entry_column(e)), one entry per lane; and that shared part of each row in all_columns. | |
| template<typename Lanes > | |
| KOKKOS_INLINE_FUNCTION void | production_jacobian (const Lanes &lanes, const ReactionDerivatives &d, double *J, const uint32_t stride, double *all_columns=nullptr) const |
| Jacobian of the production rates with respect to the concentrations at fixed T, one row per lane: J[dense_index(stride, k, j)] = d omega_k / d C_j for j < n_species (by rows, or by columns for lanes with Lanes::column_major). | |
Static Public Member Functions | |
| static KOKKOS_INLINE_FUNCTION double | plain_power (const double C, const double order) |
| C^order: repeated products for integer orders, pow of max(C, 0) otherwise. | |
| static KOKKOS_INLINE_FUNCTION double | power (const double C, const double order, const double C_reg=C_REG) |
| Mass-action factor C^order, regularized below C_reg for 0 < order < 1. | |
| static KOKKOS_INLINE_FUNCTION double | power_derivative (const double C, const double order, const double C_reg=C_REG) |
| d power(C, order) / dC. | |
| static KOKKOS_INLINE_FUNCTION double | arrhenius (const double A, const double b, const double Ea_R, const double log_T, const double inv_T) |
Static Public Attributes | |
| static constexpr double | C_REG = 1e-12 |
| Concentration [kmol/m^3] below which orders 0 < n < 1 follow C_reg^n x ((2 - n) + (n - 1) x), x = C / C_reg (linear in C for x < 0): C^1 at C_reg, with a bounded slope at C = 0 where n C^(n - 1) diverges. | |
| static constexpr uint32_t | MAX_KEPT = 4 |
| Factors C^order of a reaction's products that the derivatives reuse. | |
Reactions of a mechanism as flat device tables (compressed rows per reaction), in MemorySpace. All quantities SI with kmol, in double precision in every build. Concentrations C_k = rho Y_k / W_k.
Rates follow Cantera: k = A T^b exp(-Ea / RT); three-body reactions multiply both directions by [M] = sum_k eff_k C_k; falloff reactions use k = k_inf Pr / (1 + Pr) F with Pr = k_0 [M] / k_inf and F = 1 (Lindemann), Troe or SRI; PLOG reactions interpolate ln k linearly in ln p between the bracketing pressures (constant outside them), summing the rates given at one pressure; Chebyshev reactions take log10 k as a series in reduced 1/T and log10 p, with p = C_total R T; reversible reactions take k_r = k_f / K_c with K_c = exp(-sum_k nu_k g_k / RT) (p_atm / RT)^(sum_k nu_k).
| using chemistry::KineticsTable< MemorySpace >::View1 = Kokkos::View<T *, MemorySpace> |
|
inlinestatic |
|
inline |
Doubles of ReactionDerivatives storage.
|
inline |
Falloff blending F(Pr, T) and its logarithmic derivatives d ln F / d ln Pr and d ln F / dT at fixed Pr.
|
inlinestatic |
C^order: repeated products for integer orders, pow of max(C, 0) otherwise.
|
inline |
Sum of the PLOG rates at pressure level l and its d ln k / dT.
|
inlinestatic |
Mass-action factor C^order, regularized below C_reg for 0 < order < 1.
|
inlinestatic |
d power(C, order) / dC.
|
inline |
Rate constant of a PLOG or Chebyshev reaction at T and ln p, with d ln k / dT at fixed p and d ln k / d ln p.
|
inline |
Jacobian of the production rates with respect to the concentrations at fixed T, one row per lane: J[dense_index(stride, k, j)] = d omega_k / d C_j for j < n_species (by rows, or by columns for lanes with Lanes::column_major).
| d | Derivatives from rates_of_progress at the same state. |
| all_columns | If not null, the part of row k that is the same in every column (third bodies at their default efficiency, PLOG and Chebyshev pressures) goes to all_columns[k] instead of J. |
|
inline |
The structural entries of the Jacobian of the production rates (d omega_k / d C_j at fixed T, without the part shared by all columns), values[e] for entry e = (entry_row(e), entry_column(e)), one entry per lane; and that shared part of each row in all_columns.
|
inline |
|
inline |
Net production rates omega_k = sum_i nu_ki q_i [kmol/(m^3 s)], one species per lane, summed by reaction index (or the same sums of any per-reaction quantity, e.g. dq_dT).
|
inline |
Rates of progress of one thread, without derivatives.
|
inline |
Rates of progress q_i [kmol/(m^3 s)] of every reaction (one per lane) and, with derivatives, what the Jacobian needs.
| C | Concentrations (n_species), C_total their sum. |
| g_RT,h_RT | Species g / RT and h / RT at T (h_RT only with derivatives). |
| q | Rates of progress (n_reactions). |
| d | Null, or the derivatives (laid out by ReactionDerivatives::at). |
|
inline |
Third-body concentration of reaction i.
|
staticconstexpr |
Concentration [kmol/m^3] below which orders 0 < n < 1 follow C_reg^n x ((2 - n) + (n - 1) x), x = C / C_reg (linear in C for x < 0): C^1 at C_reg, with a bounded slope at C = 0 where n C^(n - 1) diverges.
| double chemistry::KineticsTable< MemorySpace >::C_reg = C_REG |
| View1<double> chemistry::KineticsTable< MemorySpace >::chebyshev |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::chebyshev_n_p |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::chebyshev_offset |
| Kokkos::View<double *[4], Kokkos::LayoutRight, MemorySpace> chemistry::KineticsTable< MemorySpace >::chebyshev_range |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::chunk_end |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::chunk_offset |
| View1<double> chemistry::KineticsTable< MemorySpace >::default_efficiency |
| View1<double> chemistry::KineticsTable< MemorySpace >::delta_nu |
| View1<double> chemistry::KineticsTable< MemorySpace >::efficiency_extra |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::efficiency_offset |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::efficiency_species |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::entry_column |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::entry_offset |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::entry_row |
| View1<uint8_t> chemistry::KineticsTable< MemorySpace >::falloff |
| Kokkos::View<double *[5], Kokkos::LayoutRight, MemorySpace> chemistry::KineticsTable< MemorySpace >::falloff_params |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::forward_offset |
| View1<double> chemistry::KineticsTable< MemorySpace >::forward_order |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::forward_species |
| Kokkos::View<double *[3], Kokkos::LayoutRight, MemorySpace> chemistry::KineticsTable< MemorySpace >::low |
|
staticconstexpr |
Factors C^order of a reaction's products that the derivatives reuse.
| uint32_t chemistry::KineticsTable< MemorySpace >::n_reactions = 0 |
| uint32_t chemistry::KineticsTable< MemorySpace >::n_species = 0 |
| View1<double> chemistry::KineticsTable< MemorySpace >::net_nu |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::net_offset |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::net_species |
| View1<double> chemistry::KineticsTable< MemorySpace >::plog_ln_p |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::plog_offset |
| Kokkos::View<double *[3], Kokkos::LayoutRight, MemorySpace> chemistry::KineticsTable< MemorySpace >::plog_rate |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::plog_rate_offset |
| Kokkos::View<double *[3], Kokkos::LayoutRight, MemorySpace> chemistry::KineticsTable< MemorySpace >::rate |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::reverse_offset |
| View1<double> chemistry::KineticsTable< MemorySpace >::reverse_order |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::reverse_species |
| View1<uint8_t> chemistry::KineticsTable< MemorySpace >::reversible |
| View1<double> chemistry::KineticsTable< MemorySpace >::species_nu |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::species_offset |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::species_reaction |
| View1<double> chemistry::KineticsTable< MemorySpace >::term_coefficient |
| View1<uint32_t> chemistry::KineticsTable< MemorySpace >::term_source |
| View1<uint8_t> chemistry::KineticsTable< MemorySpace >::type |