|
Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website |
Work memory and kernels that advance the cells of a state as adiabatic constant-volume reactors at fixed (rho, e). More...
#include <cell_chemistry.h>
Classes | |
| struct | Statistics |
Public Member Functions | |
| void | init (const Mixture &gas, const chemistry::Mechanism &mechanism, const chemistry::KineticsTable<> &kinetics, const CellChemistryOptions &options, uint32_t n_cells) |
| void | balance_across_ranks (double threshold) |
| Balances the integration across ranks from now on (collective: every rank of the run, every call): see ChemistryBalance. | |
| Statistics | advance (const StateView &U, const SpeciesView &rhoY, const Kokkos::View< rtype * > &T_seed, const Kokkos::View< rtype * > &chem_h, const Kokkos::View< rtype * > &chem_cost, uint32_t n, double dt, const Kokkos::View< rtype * > &time_scale={}, const ChemistryForcing *forcing=nullptr) |
| Advance cells [0, n) over dt. Partial densities change; rho, rho u, rho E and the temperature seed do not. | |
| void | heat_release (const StateView &U, const SpeciesView &rhoY, const Kokkos::View< rtype * > &T_seed, const Kokkos::View< rtype * > &hrr, const Kokkos::View< rtype **, Kokkos::LayoutRight > &production, uint32_t n) |
| Heat release rate and mass production rates W_k omega_k of cells [0, n). | |
| uint32_t | lanes () const |
| Vector lanes per cell thread (1: one thread per cell). | |
| uint32_t | threads () const |
| Threads of a cell's team. | |
| uint32_t | wide_threads () const |
| Threads of the teams of the cells whose last call was expensive (GPUs), 0 if the same. | |
| bool | binned () const |
| Whether cells integrated one per thread are ordered by their last cost (GPUs). | |
| size_t | shared_bytes () const |
| Bytes of team scratch memory per cell holding its work memory, 0 if global memory. | |
| uint32_t | sparse_entries () const |
| Entries of L + U of the sparse LU, 0 for the dense one. | |
Work memory and kernels that advance the cells of a state as adiabatic constant-volume reactors at fixed (rho, e).
A kernel flags the cells that need chemistry (T >= T_frozen and a mass fraction that would change by more than 1e-2 atol over dt at the current rates), a scan compacts them into a queue, and the queued cells are integrated in batches that bound the work memory, after the ranks have balanced the queues if asked to (ChemistryBalance). Each cell's result depends only on its own state, so neither the order of the queue, the batches nor the rank that integrates it changes it: per mechanism and build, every cell takes the same code path (one thread per cell, or a fixed number of lanes).
| CellChemistry::Statistics CellChemistry::advance | ( | const StateView & | U, |
| const SpeciesView & | rhoY, | ||
| const Kokkos::View< rtype * > & | T_seed, | ||
| const Kokkos::View< rtype * > & | chem_h, | ||
| const Kokkos::View< rtype * > & | chem_cost, | ||
| uint32_t | n, | ||
| double | dt, | ||
| const Kokkos::View< rtype * > & | time_scale = {}, |
||
| const ChemistryForcing * | forcing = nullptr |
||
| ) |
Advance cells [0, n) over dt. Partial densities change; rho, rho u, rho E and the temperature seed do not.
| chem_h | Last sub-step of each cell, in and out. |
| chem_cost | Sub-steps of each cell, incremented. |
| time_scale | Optional per-cell multiplier of dt: the rates of an autonomous constant-volume reactor scaled by s give exactly its state after s dt (combustion models, docs/design/les.md 6.4). |
| forcing | Optional (options.forced): integrate dU/dt = s R(U) + forcing->rate instead, so that rho, rho u and rho E change by dt times their rates and every cell moves, reacting or not. A cell reacts if its chemistry is active at U or at U + dt rate; its internal energy per volume is taken linear in time between the two. |
Balances the integration across ranks from now on (collective: every rank of the run, every call): see ChemistryBalance.
|
inline |
Whether cells integrated one per thread are ordered by their last cost (GPUs).
| void CellChemistry::heat_release | ( | const StateView & | U, |
| const SpeciesView & | rhoY, | ||
| const Kokkos::View< rtype * > & | T_seed, | ||
| const Kokkos::View< rtype * > & | hrr, | ||
| const Kokkos::View< rtype **, Kokkos::LayoutRight > & | production, | ||
| uint32_t | n | ||
| ) |
Heat release rate and mass production rates W_k omega_k of cells [0, n).
| void CellChemistry::init | ( | const Mixture & | gas, |
| const chemistry::Mechanism & | mechanism, | ||
| const chemistry::KineticsTable<> & | kinetics, | ||
| const CellChemistryOptions & | options, | ||
| uint32_t | n_cells | ||
| ) |
| n_cells | Most cells advanced in one call (sizes the chunks). |
|
inline |
Vector lanes per cell thread (1: one thread per cell).
|
inline |
Bytes of team scratch memory per cell holding its work memory, 0 if global memory.
|
inline |
Entries of L + U of the sparse LU, 0 for the dense one.
|
inline |
Threads of a cell's team.
|
inline |
Threads of the teams of the cells whose last call was expensive (GPUs), 0 if the same.