Skip to content
Projects

Batched reduction

The equations of opencr.backends.batched, declared on the code that implements them and checked by the tests.

matrices

functionsource

Return k of shape (B, n_reactions) and M of shape (B, n, n) on xp.

matrix
Mb=N diag(kb ne,bae) S,b=1,…,BM_b = N\,\mathrm{diag}\big(k_b\, n_{e,b}^{a_e}\big)\, S, \qquad b = 1, \dots, B
Assumes
  • NN the net stoichiometry (states ×\times reactions), SS the selector of each reaction's one heavy reactant (reactions ×\times states), aea_e the electrons among the reactants
  • one dense einsum on cunumpy's xp (NumPy or CuPy for the whole process)
  • Maxwellian electrons: the cross-section integrals of all reactions stacked and evaluated 32 temperatures per chunk; a non-Maxwellian EEDF is refused

run

functionsource

Return the reduction at every pair of electron_temperatures and electron_densities.

reduction
Cb=−MQQ,b−1MQP,b,Mbeff=MPP,b+MPQ,b CbC_b = -M_{QQ,b}^{-1} M_{QP,b}, \qquad M^{\mathrm{eff}}_b = M_{PP,b} + M_{PQ,b}\, C_b
pec
PECd,b=kA,b Cud,bne,b\mathrm{PEC}_{d,b} = \frac{k_{A,b}\, C_{ud,b}}{n_{e,b}}
Assumes
  • one heavy reactant per reaction and a given nen_e; the driver densities do not enter (the system is linear)
  • one batched dense xp.linalg.solve for all BB points; the reference is the per-point sparse quasi_static
Built from