14ElectronCollisionPlasmaData::ElectronCollisionPlasmaData()
52 if (!node.
hasKey(
"energy-levels") && !node.
hasKey(
"cross-sections")) {
55 if (node.
hasKey(
"energy-levels")) {
58 if (node.
hasKey(
"cross-sections")) {
62 throw CanteraError(
"ElectronCollisionPlasmaRate::setParameters",
63 "Energy levels and cross section must have the same length.");
68 node[
"type"] =
type();
78 if (shared_data.levelChanged) {
87 auto cs_array = Eigen::Map<const Eigen::ArrayXd>(
92 auto eps = Eigen::Map<const Eigen::ArrayXd>(
97 auto distribution = Eigen::Map<const Eigen::ArrayXd>(
103 simpson(distribution.cwiseProduct(cs_array), eps.pow(2.0));
113 "ElectronCollisionPlasmaRate does not support reversible reactions");
119 electronName =
dynamic_cast<const PlasmaPhase&
>(kin.
thermo()).electronSpeciesName();
121 throw CanteraError(
"ElectronCollisionPlasmaRate::setContext",
122 "ElectronCollisionPlasmaRate requires plasma phase");
128 "ElectronCollisionPlasmaRate requires exactly two reactants");
133 if (rxn.
reactants.at(electronName) != 1) {
135 "ElectronCollisionPlasmaRate requires one and only one electron");
Header for plasma reaction rates parameterized by electron collision cross section and electron energ...
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
A map of string keys to values whose type can vary at runtime.
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
vector< double > m_crossSectionsInterpolated
collision cross sections [m2] after interpolation
virtual void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
vector< double > m_crossSections
collision cross sections [m2] at m_energyLevels
virtual void getParameters(AnyMap &node) const override
Get parameters.
vector< double > m_energyLevels
electron energy levels [eV]
virtual void setParameters(const AnyMap &node, const UnitStack &units) override
Set parameters.
virtual const std::string type() const override
String identifying reaction rate specialization.
double evalFromStruct(const ElectronCollisionPlasmaData &shared_data)
Evaluate reaction rate.
Public interface for kinetics managers.
ThermoPhase & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism.
Base class for a phase with plasma properties.
int distributionNumber() const
Return the distribution Number m_distNum.
int levelNumber() const
Return the electron energy level Number m_levelNum.
size_t nElectronEnergyLevels() const
Number of electron levels.
void getElectronEnergyDistribution(double *distrb) const
Get electron energy distribution.
void getElectronEnergyLevels(double *levels) const
Get electron energy levels.
virtual void setParameters(const AnyMap &node, const UnitStack &units)
Set parameters.
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
bool reversible
True if the current reaction is reversible. False otherwise.
Composition reactants
Reactant species and stoichiometric coefficients.
AnyMap input
Input data used for specific models.
Base class for a phase with thermodynamic properties.
string type() const override
String indicating the thermodynamic model implemented.
Header for a file containing miscellaneous numerical functions.
double linearInterp(double x, const vector< double > &xpts, const vector< double > &fpts)
Linearly interpolate a function defined on a discrete grid.
double simpson(const Eigen::ArrayXd &f, const Eigen::ArrayXd &x)
Numerical integration of a function using Simpson's rule with flexibility of taking odd and even numb...
const double Avogadro
Avogadro's Number [number/kmol].
const double ElectronCharge
Elementary charge [C].
const double ElectronMass
Electron Mass [kg].
Namespace for the Cantera kernel.
Data container holding shared data specific to ElectronCollisionPlasmaRate.
vector< double > energyLevels
electron energy levels
virtual bool update(const ThermoPhase &phase, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
vector< double > distribution
electron energy distribution
int m_level_number
integer that is incremented when electron energy level changes
int m_dist_number
integer that is incremented when electron energy distribution changes
Unit aggregation utility.