Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
CellChemistry Class Reference

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.
 

Detailed Description

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).

Member Function Documentation

◆ advance()

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.

Parameters
chem_hLast sub-step of each cell, in and out.
chem_costSub-steps of each cell, incremented.
time_scaleOptional 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).
forcingOptional (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.

◆ balance_across_ranks()

void CellChemistry::balance_across_ranks ( double  threshold)

Balances the integration across ranks from now on (collective: every rank of the run, every call): see ChemistryBalance.

◆ binned()

bool CellChemistry::binned ( ) const
inline

Whether cells integrated one per thread are ordered by their last cost (GPUs).

◆ heat_release()

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).

◆ init()

void CellChemistry::init ( const Mixture &  gas,
const chemistry::Mechanism &  mechanism,
const chemistry::KineticsTable<> &  kinetics,
const CellChemistryOptions &  options,
uint32_t  n_cells 
)
Parameters
n_cellsMost cells advanced in one call (sizes the chunks).

◆ lanes()

uint32_t CellChemistry::lanes ( ) const
inline

Vector lanes per cell thread (1: one thread per cell).

◆ shared_bytes()

size_t CellChemistry::shared_bytes ( ) const
inline

Bytes of team scratch memory per cell holding its work memory, 0 if global memory.

◆ sparse_entries()

uint32_t CellChemistry::sparse_entries ( ) const
inline

Entries of L + U of the sparse LU, 0 for the dense one.

◆ threads()

uint32_t CellChemistry::threads ( ) const
inline

Threads of a cell's team.

◆ wide_threads()

uint32_t CellChemistry::wide_threads ( ) const
inline

Threads of the teams of the cells whose last call was expensive (GPUs), 0 if the same.


The documentation for this class was generated from the following files: