Cantera  3.2.0a2
Loading...
Searching...
No Matches
ElectronCollisionPlasmaRate.h
Go to the documentation of this file.
1//! @file ElectronCollisionPlasmaRate.h Header for plasma reaction rates parameterized
2//! by electron collision cross section and electron energy distribution.
3
4// This file is part of Cantera. See License.txt in the top-level directory or
5// at https://cantera.org/license.txt for license and copyright information.
6
7#ifndef CT_ELECTRONCOLLISIONPLASMARATE_H
8#define CT_ELECTRONCOLLISIONPLASMARATE_H
9
11#include "ReactionRate.h"
12#include "MultiRate.h"
13#include "cantera/numerics/eigen_dense.h"
14
15namespace Cantera
16{
17
18//! Data container holding shared data specific to ElectronCollisionPlasmaRate
19/**
20 * The data container `ElectronCollisionPlasmaData` holds precalculated data common to
21 * all `ElectronCollisionPlasmaRate` objects.
22 */
24{
26
27 virtual bool update(const ThermoPhase& phase, const Kinetics& kin) override;
29
30 virtual void invalidateCache() override {
32 energyLevels.resize(0);
33 distribution.resize(0);
34 m_dist_number = -1;
35 }
36
37 vector<double> energyLevels; //!< electron energy levels
38 vector<double> distribution; //!< electron energy distribution
39
40 //! integer that is incremented when electron energy levels change
41 int levelNumber = -1;
42
43protected:
44 //! integer that is incremented when electron energy distribution changes
45 int m_dist_number = -1;
46};
47
48
49//! Electron collision plasma reaction rate type
50/*!
51 * The electron collision plasma reaction rate uses the electron collision
52 * data and the electron energy distribution to calculate the reaction rate.
53 * Hagelaar and Pitchford @cite hagelaar2005 define the reaction rate
54 * coefficient (Eqn. 63) as,
55 *
56 * @f[
57 * k = \gamma \int_0^{\infty} \epsilon \sigma F_0 d\epsilon,
58 * @f]
59 *
60 * where @f$ \gamma = \sqrt{2/m_e} @f$ (Eqn.4 in @cite hagelaar2015),
61 * @f$ m_e @f$ [kg] is the electron mass, @f$ \epsilon @f$ [J] is the electron
62 * energy, @f$ \sigma @f$ [m²] is the reaction collision cross section,
63 * @f$ F_0 @f$ [@f$ \mbox{J}^{-3/2} @f$] is the normalized electron energy
64 * distribution function, and @f$ k @f$ has the unit of [m³/s]. The collision
65 * process is treated as a bimolecular reaction and should have units of [m³/kmol/s].
66 * Therefore the forward reaction coefficient becomes,
67 *
68 * @f[
69 * k_f = \gamma N_A \int_0^{\infty} \epsilon \sigma F_0 d\epsilon,
70 * @f]
71 *
72 * where @f$ N_A @f$ [1/kmol] is the Avogadro's number. Since the unit of the
73 * electron energy downloaded from LXCat is in [eV], the elementary charge, e,
74 * can be taken out of the integral and combine with @f$ \gamma @f$ to get,
75 *
76 * @f[
77 * k_f = \sqrt{\frac{2e}{m_e}} N_A \int_0^{\infty} \epsilon_V \sigma F_{0,V} d\epsilon_V.
78 * @f]
79 *
80 * In addition to the forward reaction coefficient, the reverse (super-elastic) reaction
81 * coefficient can be written as,
82 *
83 * @f[
84 * k_r = \sqrt{\frac{2e}{m_e}} N_A \int_0^{\infty} \epsilon_V \sigma_{super}
85 * F_{0,V} d\epsilon_V,
86 * @f]
87 *
88 * where @f$ \sigma_{super} @f$ is the super-elastic cross section, defined by the principle
89 * of detailed balancing as:
90 *
91 * @f[
92 * \sigma_{super}(\epsilon) = \frac{\epsilon + U}{\epsilon} \sigma(\epsilon + U),
93 * @f]
94 *
95 * where @f$ U @f$ is the threshold energy [eV], equal to the first energy level of the cross
96 * section (#m_energyLevels).
97 *
98 * @ingroup otherRateGroup
99 * @since New in %Cantera 3.1.
100 */
102{
103public:
104 ElectronCollisionPlasmaRate() = default;
105 //! Constructor from YAML input for ElectronCollisionPlasmaRate.
106 /*!
107 * This constructor is used to initialize an electron collision plasma rate
108 * from an input YAML file. It extracts the energy levels, cross-sections,
109 * and reaction metadata used in the rate coefficient calculation.
110 *
111 * @param node The AnyMap node containing rate fields from YAML
112 * @param rate_units Units used for interpreting the rate fields
113 */
115 const UnitStack& rate_units={})
116 {
117 setParameters(node, rate_units);
118 }
119
120 virtual void setParameters(const AnyMap& node, const UnitStack& units) override;
121
122 virtual void getParameters(AnyMap& node) const override;
123
124 unique_ptr<MultiRateBase> newMultiRate() const override {
125 return unique_ptr<MultiRateBase>(
127 }
128
129 virtual const std::string type() const override {
130 return "electron-collision-plasma";
131 }
132
133 virtual void setContext(const Reaction& rxn, const Kinetics& kin) override;
134
135 //! Evaluate reaction rate
136 /*!
137 * @param shared_data data shared by all reactions of a given type
138 */
139 double evalFromStruct(const ElectronCollisionPlasmaData& shared_data);
140
141 //! Calculate the reverse rate coefficient for super-elastic collisions
142 //! @param shared_data Data structure with energy levels and EEDF
143 //! @param kf Forward rate coefficient (input, unused)
144 //! @param kr Reverse rate coefficient (output, modified)
145 void modifyRateConstants(const ElectronCollisionPlasmaData& shared_data,
146 double& kf, double& kr);
147
148 //! Evaluate derivative of reaction rate with respect to temperature
149 //! divided by reaction rate
150 //! @param shared_data data shared by all reactions of a given type
151 double ddTScaledFromStruct(const ElectronCollisionPlasmaData& shared_data) const {
152 throw NotImplementedError("ElectronCollisionPlasmaRate::ddTScaledFromStruct");
153 }
154
155 //! The kind of the process which will be one of the following:
156 //! - `"effective"`: A generic effective collision
157 //! - `"excitation"`: Electronic or vibrational excitation
158 //! - `"ionization"`: Electron-impact ionization
159 //! - `"attachment"`: Electron attachment
160 //! @since New in Cantera 3.2.
161 const string& kind() const {
162 return m_kind;
163 }
164
165 //! Get the target species of the electron collision process.
166 //! This is the name of the neutral or ionic species that the electron interacts with
167 //! @since New in Cantera 3.2.
168 const string& target() const {
169 return m_target;
170 }
171
172 //! Get the product of the electron collision process.
173 //! This is the name of the species or excited state of
174 //! some species resulting from the process.
175 //! @note this may not necessarily be represented by
176 //! a distinct species in the mixture.
177 //! @since New in Cantera 3.2.
178 const string& product() const {
179 return m_product;
180 }
181
182 //! Get the energy threshold of electron collision [eV]
183 //!
184 //! By default, the threshold is set to the first non-zero energy value
185 //! listed in the tabulated cross section data.
186 //!
187 //! @note This behavior may be subject to change. A more robust approach
188 //! may use the energy corresponding to the first non-zero cross section
189 //! value, rather than the first non-zero energy point in the data table.
190 //!
191 //! @since New in Cantera 3.2.
192 double threshold() const {
193 return m_threshold;
194 }
195
196 //! The value of #m_energyLevels [eV]
197 const vector<double>& energyLevels() const {
198 return m_energyLevels;
199 }
200
201 //! The value of #m_crossSections [m2]
202 const vector<double>& crossSections() const {
203 return m_crossSections;
204 }
205
206 //! The value of #m_crossSectionsInterpolated [m2]
207 const vector<double>& crossSectionInterpolated() const {
209 }
210
211 //! Update the value of #m_crossSectionsInterpolated [m2]
212 void updateInterpolatedCrossSection(const vector<double>&);
213
214private:
215 //! The name of the kind of electron collision
216 string m_kind;
217
218 //! The name of the target of electron collision
219 string m_target;
220
221 //! The product of electron collision
222 string m_product;
223
224 //! The energy threshold of electron collision
226
227 //! electron energy levels [eV]
228 vector<double> m_energyLevels;
229
230 //! Counter used to indicate when #m_energyLevels needs to be synced with the phase
232
233 //! Counter used to indicate when #m_crossSectionsOffset needs to be synced with the
234 //! phase
236
237 //! collision cross sections [m2] at #m_energyLevels
238 vector<double> m_crossSections;
239
240 //! collision cross sections [m2] after interpolation
242
243 //! collision cross section [m2] interpolated on #m_energyLevels offset by the
244 //! threshold energy (the first energy level).
245 //! This is used for the calculation of the super-elastic collision reaction
246 //! rate coefficient.
247 Eigen::ArrayXd m_crossSectionsOffset;
248};
249
250}
251
252#endif
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
Electron collision plasma reaction rate type.
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.
int m_levelNumberSuperelastic
Counter used to indicate when m_crossSectionsOffset needs to be synced with the phase.
double ddTScaledFromStruct(const ElectronCollisionPlasmaData &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
unique_ptr< MultiRateBase > newMultiRate() const override
Create a rate evaluator for reactions of a particular derived type.
string m_product
The product of electron collision.
int m_levelNumber
Counter used to indicate when m_energyLevels needs to be synced with the phase.
string m_target
The name of the target of electron collision.
vector< double > m_crossSections
collision cross sections [m2] at m_energyLevels
const string & kind() const
The kind of the process which will be one of the following:
double m_threshold
The energy threshold of electron collision.
const vector< double > & crossSections() const
The value of m_crossSections [m2].
double threshold() const
Get the energy threshold of electron collision [eV].
string m_kind
The name of the kind of electron collision.
const string & product() const
Get the product of the electron collision process.
const vector< double > & crossSectionInterpolated() const
The value of m_crossSectionsInterpolated [m2].
virtual void getParameters(AnyMap &node) const override
Get parameters.
void modifyRateConstants(const ElectronCollisionPlasmaData &shared_data, double &kf, double &kr)
Calculate the reverse rate coefficient for super-elastic collisions.
Eigen::ArrayXd m_crossSectionsOffset
collision cross section [m2] interpolated on m_energyLevels offset by the threshold energy (the first...
void updateInterpolatedCrossSection(const vector< double > &)
Update the value of m_crossSectionsInterpolated [m2].
const string & target() const
Get the target species of the electron collision process.
vector< double > m_energyLevels
electron energy levels [eV]
virtual void setParameters(const AnyMap &node, const UnitStack &units) override
Set parameters.
ElectronCollisionPlasmaRate(const AnyMap &node, const UnitStack &rate_units={})
Constructor from YAML input for ElectronCollisionPlasmaRate.
virtual const std::string type() const override
String identifying reaction rate specialization.
const vector< double > & energyLevels() const
The value of m_energyLevels [eV].
double evalFromStruct(const ElectronCollisionPlasmaData &shared_data)
Evaluate reaction rate.
Public interface for kinetics managers.
Definition Kinetics.h:126
A class template handling ReactionRate specializations.
Definition MultiRate.h:22
An error indicating that an unimplemented function has been called.
Abstract base class for reaction rate definitions; this base class is used by user-facing APIs to acc...
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition Reaction.h:25
Base class for a phase with thermodynamic properties.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
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.
int levelNumber
integer that is incremented when electron energy levels change
virtual void invalidateCache() override
Force shared data and reaction rates to be updated next time.
vector< double > distribution
electron energy distribution
int m_dist_number
integer that is incremented when electron energy distribution changes
Data container holding shared data used for ReactionRate calculation.
virtual void update(double T)
Update data container based on temperature T
virtual void invalidateCache()
Force shared data and reaction rates to be updated next time.
Unit aggregation utility.
Definition Units.h:105