rizer.cantera_ext
C++ Cantera 1-D plasma extension (custom Domain1D models and solvers)
Loading...
Searching...
No Matches
rizer::ReactorRHS Class Reference

Shared single-cell two-temperature reacting-plasma RHS (one physics source). More...

#include <ReactorRHS.h>

Classes

struct  Diagnostics
 Optional power / Maxwellian-condition breakdown filled by rates() when a non-null pointer is passed. More...
struct  Config

Public Member Functions

 ReactorRHS (std::shared_ptr< Cantera::Solution > sol, Config cfg)
 Construct a ReactorRHS for a given plasma Solution and configuration.
std::size_t nSpecies () const
std::size_t electronIndex () const
const std::vector< double > & molecularWeights () const
std::string speciesName (std::size_t k) const
 Name of species k in the mechanism.
const std::shared_ptr< Cantera::Solution > & solution () const
const std::vector< double > & speciesCp () const
 Mass-basis species heat capacity at constant pressure c_p,k [J/kg/K], length nSpecies(), valid as of the most recent rates() call for this state (rates() must be called first for the same (Tg,Te,Y,rho); this reads back that call's already-evaluated Cantera thermo state rather than re-evaluating it).
void rates (double Tg, double Te, const double *Y, double rho, double E, double &dTg, double &dTe, double *dY, double &lhs_Tg, double &lhs_Te, Diagnostics *diag=nullptr) const
 Single-cell RHS (no transport, no volume work).
double conductivity (double Tg, double Te, const double *Y, double rho) const
 Electrical conductivity [S/m] at a node state.
double electronDensity (double Tg, double Te, const double *Y, double rho) const
 Electron number density [1/m^3], \(n_e = X_e P / (k_B T_{mean})\).

Detailed Description

Shared single-cell two-temperature reacting-plasma RHS (one physics source).

The two-temperature (Te != Tg) energy/chemistry/Joule physics of a single plasma cell, factored out of PlasmaChannel1D so the standalone 0D reactor (Plasma0DReactor) and the 1D channel share ONE implementation. Per call it sets the Cantera state, evaluates finite-rate chemistry, the Joule source \(\sigma E^2\), the elastic/inelastic electron-heavy exchange, and the two energy-equation capacitances.

Conductivity sigma and the elastic energy-exchange frequency nu_E come from a composition-resolved CollisionModel when one is supplied (preferred: tracks the evolving composition); otherwise from the legacy nu_m(Te)/sigma(Te) tables / scalar nu_m + scalar nu_E (the path the monolithic 1D channel has used).

Definition at line 33 of file ReactorRHS.h.

Constructor & Destructor Documentation

◆ ReactorRHS()

rizer::ReactorRHS::ReactorRHS ( std::shared_ptr< Cantera::Solution > sol,
Config cfg )

Construct a ReactorRHS for a given plasma Solution and configuration.

Parameters
solCantera plasma Solution (thermo + kinetics) this RHS evaluates against
cfgClosure selection and legacy fallback tables/scalars (see Config above)

Definition at line 49 of file ReactorRHS.cpp.

Member Function Documentation

◆ conductivity()

double rizer::ReactorRHS::conductivity ( double Tg,
double Te,
const double * Y,
double rho ) const

Electrical conductivity [S/m] at a node state.

Parameters
TgGas temperature [K]
TeElectron temperature [K]
YMass fractions, length nSpecies [-]
rhoMass density [kg/m^3]

Definition at line 264 of file ReactorRHS.cpp.

◆ electronDensity()

double rizer::ReactorRHS::electronDensity ( double Tg,
double Te,
const double * Y,
double rho ) const

Electron number density [1/m^3], \(n_e = X_e P / (k_B T_{mean})\).

Parameters
TgGas temperature [K]
TeElectron temperature [K]
YMass fractions, length nSpecies [-]
rhoMass density [kg/m^3]

Definition at line 273 of file ReactorRHS.cpp.

◆ electronIndex()

std::size_t rizer::ReactorRHS::electronIndex ( ) const
inline

Definition at line 93 of file ReactorRHS.h.

◆ molecularWeights()

const std::vector< double > & rizer::ReactorRHS::molecularWeights ( ) const
inline

Definition at line 94 of file ReactorRHS.h.

◆ nSpecies()

std::size_t rizer::ReactorRHS::nSpecies ( ) const
inline

Definition at line 92 of file ReactorRHS.h.

◆ rates()

void rizer::ReactorRHS::rates ( double Tg,
double Te,
const double * Y,
double rho,
double E,
double & dTg,
double & dTe,
double * dY,
double & lhs_Tg,
double & lhs_Te,
Diagnostics * diag = nullptr ) const

Single-cell RHS (no transport, no volume work).

rho [kg/m^3], E [V/m]. Outputs dTg,dTe [K/s], dY [1/s] (length nSpecies), and the energy-equation capacitances lhs_Tg,lhs_Te [J/m^3/K].

Parameters
TgGas (heavy-species) temperature [K]
TeElectron temperature [K]
YMass fractions, length nSpecies [-]
rhoMass density [kg/m^3]
EElectric field magnitude [V/m]
[out]dTgGas temperature time derivative [K/s]
[out]dTeElectron temperature time derivative [K/s]
[out]dYMass fraction time derivatives, length nSpecies [1/s]
[out]lhs_TgGas-energy-equation capacitance (heavy-species \(\rho c_v\)) [J/m^3/K]
[out]lhs_TeElectron-energy-equation capacitance ( \(Y_e \rho c_{v,e}\)) [J/m^3/K]
[out]diagIf non-null, filled with the power / Maxwellian- condition breakdown for this evaluation (see Diagnostics).

Definition at line 153 of file ReactorRHS.cpp.

◆ solution()

const std::shared_ptr< Cantera::Solution > & rizer::ReactorRHS::solution ( ) const
inline

Definition at line 98 of file ReactorRHS.h.

◆ speciesCp()

const std::vector< double > & rizer::ReactorRHS::speciesCp ( ) const
inline

Mass-basis species heat capacity at constant pressure c_p,k [J/kg/K], length nSpecies(), valid as of the most recent rates() call for this state (rates() must be called first for the same (Tg,Te,Y,rho); this reads back that call's already-evaluated Cantera thermo state rather than re-evaluating it).

For a heavy species k, \(c_{p,k} = (C_{p,k}/R)\,R/W_k\), i.e. Cantera's dimensionless molar \(C_p/R\) (from getCp_R(), evaluated at Tg) converted to a mass-specific quantity by the molecular weight W_k [kg/kmol]. The electron entry (index electronIndex()) instead holds the analytic monatomic-ideal-gas value \(c_{p,e} = c_{v,e} + R/W_e = 2.5\,R/W_e\) – consistent with the cv_e already used internally by rates() for lhs_Te, rather than Cantera's own (thermo-fit) electron Cp. Used by PlasmaChannel1D's species-diffusion enthalpy-transport (energy- equation "enthalpy diffusion") term.

Definition at line 114 of file ReactorRHS.h.

◆ speciesName()

std::string rizer::ReactorRHS::speciesName ( std::size_t k) const

Name of species k in the mechanism.

Parameters
kSpecies index into the mechanism, 0..nSpecies()-1 [-]

Definition at line 93 of file ReactorRHS.cpp.


The documentation for this class was generated from the following files:
  • /home/runner/work/rizer/rizer/rizer/cantera_ext/src/ReactorRHS.h
  • /home/runner/work/rizer/rizer/rizer/cantera_ext/src/ReactorRHS.cpp