Cantera  4.0.0a1
Loading...
Searching...
No Matches
PlasmaPhase.h
Go to the documentation of this file.
1/**
2 * @file PlasmaPhase.h
3 * Header file for class PlasmaPhase.
4 */
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
9#ifndef CT_PLASMAPHASE_H
10#define CT_PLASMAPHASE_H
11
14#include "cantera/numerics/eigen_sparse.h"
15
16namespace Cantera
17{
18
19class Reaction;
20class ElectronCollisionPlasmaRate;
21
22//! Base class for handling plasma properties, specifically focusing on the
23//! electron energy distribution.
24/*!
25 * This class provides functionality to manage the the electron energy distribution
26 * using two primary methods for defining the electron distribution and electron
27 * temperature.
28 *
29 * The first method utilizes setElectronTemperature(), which sets the electron
30 * temperature and calculates the electron energy distribution assuming an
31 * isotropic-velocity model. Note that all units in PlasmaPhase are in SI, except
32 * for electron energy, which is measured in volts.
33 *
34 * The generalized electron energy distribution for an isotropic-velocity
35 * distribution (as described by Gudmundsson @cite gudmundsson2001 and Khalilpour
36 * and Foroutan @cite khalilpour2020)
37 * is given by:
38 * @f[
39 * f(\epsilon) = c_1 \frac{\sqrt{\epsilon}}{\epsilon_m^{3/2}}
40 * \exp \left(-c_2 \left(\frac{\epsilon}{\epsilon_m}\right)^x \right),
41 * @f]
42 * where @f$ x = 1 @f$ corresponds to a Maxwellian distribution and
43 * @f$ x = 2 @f$ corresponds to a Druyvesteyn distribution.
44 * Here, @f$ \epsilon_m = \frac{3}{2} T_e @f$ [V] represents the
45 * mean electron energy.
46 *
47 * The total probability distribution integrates to one:
48 * @f[
49 * \int_0^{\infty} f(\epsilon) d\epsilon = 1.
50 * @f]
51 * According to Hagelaar and Pitchford @cite hagelaar2005, the electron energy
52 * probability function can be defined as
53 * @f$ F(\epsilon) = \frac{f(\epsilon)}{\sqrt{\epsilon}} @f$ with units of
54 * [V@f$^{-3/2}@f$]. The generalized form of the electron energy probability
55 * function for isotropic-velocity distributions is:
56 * @f[
57 * F(\epsilon) = c_1 \frac{1}{\epsilon_m^{3/2}}
58 * \exp\left(-c_2 \left(\frac{\epsilon}{\epsilon_m}\right)^x\right),
59 * @f]
60 * and this form is used to model the isotropic electron energy distribution
61 * in PlasmaPhase.
62 *
63 * The second method allows for manual definition of the electron energy
64 * distribution using setDiscretizedElectronEnergyDist(). In this approach,
65 * the electron temperature is derived from the mean electron energy,
66 * @f$ \epsilon_m @f$, which can be calculated as follows @cite hagelaar2005 :
67 * @f[
68 * \epsilon_m = \int_0^{\infty} \epsilon^{3/2} F(\epsilon) d\epsilon.
69 * @f]
70 * This integral can be approximated using the trapezoidal rule,
71 * @f[
72 * \epsilon_m = \sum_i \left(\epsilon_{i+1}^{5/2} - \epsilon_i^{5/2}\right)
73 * \frac{F(\epsilon_{i+1}) + F(\epsilon_i)}{2},
74 * @f]
75 * where @f$ i @f$ is the index of discrete energy levels, or Simpson's rule.
76 *
77 * @warning This class is an experimental part of %Cantera and may be
78 * changed or removed without notice.
79 * @todo Implement electron Boltzmann equation solver to solve EEDF.
80 * https://github.com/Cantera/enhancements/issues/127
81 * @ingroup thermoprops
82 */
84{
85public:
86 //! Construct and initialize a PlasmaPhase object
87 //! directly from an input file. The constructor initializes the electron
88 //! energy distribution to be Druyvesteyn distribution (m_x = 2.0). The initial
89 //! electron energy grid is set to a linear space which starts at 0.01 eV and ends
90 //! at 1 eV with 1000 points.
91 /*!
92 * @param inputFile Name of the input file containing the phase definition
93 * to set up the object. If blank, an empty phase will be
94 * created.
95 * @param id ID of the phase in the input file. Defaults to the
96 * empty string.
97 */
98 explicit PlasmaPhase(const string& inputFile="", const string& id="");
99
100 ~PlasmaPhase();
101
102 string type() const override {
103 return "plasma";
104 }
105
106 void initThermo() override;
107
108 //! Set electron energy levels.
109 //! @param levels The vector of electron energy levels (eV).
110 //! Length: #m_nPoints.
111 //! @param length The length of the @c levels.
112 void setElectronEnergyLevels(const double* levels, size_t length);
113
114 //! Get electron energy levels.
115 //! @param levels The vector of electron energy levels (eV). Length: #m_nPoints
116 void getElectronEnergyLevels(double* levels) const {
117 Eigen::Map<Eigen::ArrayXd>(levels, m_nPoints) = m_electronEnergyLevels;
118 }
119
120 //! Set discretized electron energy distribution.
121 //! @param levels The vector of electron energy levels (eV).
122 //! Length: #m_nPoints.
123 //! @param distrb The vector of electron energy distribution.
124 //! Length: #m_nPoints.
125 //! @param length The length of the vectors, which equals #m_nPoints.
126 void setDiscretizedElectronEnergyDist(const double* levels,
127 const double* distrb,
128 size_t length);
129
130 //! Get electron energy distribution.
131 //! @param distrb The vector of electron energy distribution.
132 //! Length: #m_nPoints.
133 void getElectronEnergyDistribution(double* distrb) const {
134 Eigen::Map<Eigen::ArrayXd>(distrb, m_nPoints) = m_electronEnergyDist;
135 }
136
137 //! Set the shape factor of isotropic electron energy distribution.
138 //! Note that @f$ x = 1 @f$ and @f$ x = 2 @f$ correspond to the
139 //! Maxwellian and Druyvesteyn distribution, respectively.
140 //! @param x The shape factor
141 void setIsotropicShapeFactor(double x);
142
143 //! The shape factor of isotropic electron energy distribution
144 double isotropicShapeFactor() const {
145 return m_isotropicShapeFactor;
146 }
147
148 //! Set the internally stored electron temperature of the phase (K).
149 //! @param Te Electron temperature in Kelvin
150 void setElectronTemperature(double Te) override;
151
152 //! Set mean electron energy [eV]. This method also sets electron temperature
153 //! accordingly.
154 void setMeanElectronEnergy(double energy);
155
156 //! Get electron energy distribution type
158 return m_distributionType;
159 }
160
161 //! Set electron energy distribution type
162 void setElectronEnergyDistributionType(const string& type);
163
164 //! Numerical quadrature method. Method: #m_quadratureMethod
165 string quadratureMethod() const {
166 return m_quadratureMethod;
167 }
168
169 //! Set numerical quadrature method for integrating electron
170 //! energy distribution function. Method: #m_quadratureMethod
171 void setQuadratureMethod(const string& method) {
172 m_quadratureMethod = method;
173 }
174
175 //! Mean electron energy [eV]
176 double meanElectronEnergy() const {
177 return 3.0 / 2.0 * electronTemperature() * Boltzmann / ElectronCharge;
178 }
179
180 //! Set flag of automatically normalize electron energy distribution
181 //! Flag: #m_do_normalizeElectronEnergyDist
184 }
185
186 //! Flag of automatically normalize electron energy distribution.
187 //! Flag: #m_do_normalizeElectronEnergyDist
190 }
191
192 bool addSpecies(shared_ptr<Species> spec) override;
193
194 //! Electron Temperature (K)
195 //! @return The electron temperature of the phase
196 double electronTemperature() const override {
197 return m_electronTemp;
198 }
199
200 //! Return the Gas Constant multiplied by the current electron temperature
201 /*!
202 * The units are Joules kmol-1
203 */
204 double RTe() const {
206 }
207
208 /**
209 * Electron pressure. Units: Pa.
210 * @f[P = n_{k_e} R T_e @f]
211 */
212 virtual double electronPressure() const {
215 }
216
217 //! Number of electron levels
218 size_t nElectronEnergyLevels() const {
219 return m_nPoints;
220 }
221
222 //! Number of electron collision cross sections
223 size_t nCollisions() const {
224 return m_collisions.size();
225 }
226
227 //! Get the Reaction object associated with electron collision *i*.
228 //! @since New in %Cantera 3.2.
229 const shared_ptr<Reaction> collision(size_t i) const {
230 return m_collisions[i];
231 }
232
233 //! Get the ElectronCollisionPlasmaRate object associated with electron collision
234 //! *i*.
235 //! @since New in %Cantera 3.2.
236 const shared_ptr<ElectronCollisionPlasmaRate> collisionRate(size_t i) const {
237 return m_collisionRates[i];
238 }
239
240 //! Electron Species Index
241 size_t electronSpeciesIndex() const {
243 }
244
245 //! Return the Molar enthalpy. Units: J/kmol.
246 /*!
247 * For an ideal gas mixture with additional electron,
248 * @f[
249 * \hat h(T) = \sum_{k \neq k_e} X_k \hat h^0_k(T) + X_{k_e} \hat h^0_{k_e}(T_e),
250 * @f]
251 * and is a function only of temperature. The standard-state pure-species
252 * enthalpies @f$ \hat h^0_k(T) @f$ are computed by the species
253 * thermodynamic property manager.
254 *
255 * @see MultiSpeciesThermo
256 */
257 double enthalpy_mole() const override;
258
259 //! Return the molar entropy. Units: J/kmol/K.
260 /*!
261 * For an ideal gas mixture with an additional electron species,
262 * @f[
263 * \hat s(T,T_e,p,X)
264 * = \sum_{k\neq k_e} X_k\left[\hat s_k^0(T) - R\ln\left(\frac{X_k p}{p^0}\right)\right]
265 * + X_{k_e}\left[\hat s_{k_e}^0(T_e) - R\ln\left(\frac{X_{k_e} p_e}{p^0}\right)\right],
266 * @f]
267 * where heavy-species properties are evaluated at @f$T@f$, electron properties at
268 * @f$T_e@f$, and the electron mixing term uses the electron pressure
269 * @f$p_e = n_{k_e} R T_e@f$.
270 *
271 * @see MultiSpeciesThermo
272 */
273 double entropy_mole() const override;
274
275 //! Return the molar Gibbs free energy. Units: J/kmol.
276 /*!
277 * For an ideal gas mixture with an additional electron species,
278 * @f[
279 * \hat g(T, T_e, p, X) = \sum_k X_k \mu_k(T_k, p_k, X),
280 * @f]
281 * where heavy species use the gas temperature @f$T@f$ and bulk pressure,
282 * while the electron chemical potential uses @f$T_e@f$ and
283 * @f$p_e = n_{k_e} R T_e@f$.
284 *
285 * @see MultiSpeciesThermo
286 */
287 double gibbs_mole() const override;
288
289 //! Return the molar internal energy. Units: J/kmol.
290 /*!
291 * For an ideal gas mixture with an additional electron species,
292 * @f[
293 * \hat u(T,T_e) = \sum_{k \neq k_e} X_k \hat u^0_k(T) + X_{k_e} \hat u^0_{k_e}(T_e),
294 * @f]
295 * where @f$\hat u^0_k(T) = \hat h^0_k(T) - R T@f$ for heavy species and
296 * @f$\hat u^0_{k_e}(T_e) = \hat h^0_{k_e}(T_e) - R T_e@f$ for electrons.
297 *
298 * @see MultiSpeciesThermo
299 */
300 double intEnergy_mole() const override;
301
302 void getEntropy_R(double* sr) const override;
303
304 void getGibbs_RT(double* grt) const override;
305
306 void getGibbs_ref(double* g) const override;
307
308 void getStandardVolumes_ref(double* vol) const override;
309
310 void getChemPotentials(double* mu) const override;
311
312 void getStandardChemPotentials(double* muStar) const override;
313
314 void getPartialMolarEnthalpies(double* hbar) const override;
315
316 void getPartialMolarEntropies(double* sbar) const override;
317
318 void getPartialMolarIntEnergies(double* ubar) const override;
319
320 void getParameters(AnyMap& phaseNode) const override;
321
322 void setParameters(const AnyMap& phaseNode,
323 const AnyMap& rootNode=AnyMap()) override;
324
325 //! Update the electron energy distribution.
327
328 //! Electron species name
329 string electronSpeciesName() const {
331 }
332
333 //! Return the distribution Number #m_distNum
334 int distributionNumber() const {
335 return m_distNum;
336 }
337
338 //! Return the electron energy level Number #m_levelNum
339 int levelNumber() const {
340 return m_levelNum;
341 }
342
343 //! Get the indicies for inelastic electron collisions
344 //! @since New in %Cantera 3.2.
345 const vector<size_t>& kInelastic() const {
346 return m_kInelastic;
347 }
348
349 //! Get the indices for elastic electron collisions
350 //! @since New in %Cantera 3.2.
351 const vector<size_t>& kElastic() const {
352 return m_kElastic;
353 }
354
355 //! target of a specific process
356 //! @since New in %Cantera 3.2.
357 size_t targetIndex(size_t i) const {
358 return m_targetSpeciesIndices[i];
359 }
360
361 //! Get the frequency of the applied electric field [Hz]
362 //! @since New in %Cantera 3.2.
363 double electricFieldFrequency() const {
365 }
366
367 //! Get the applied electric field strength [V/m]
368 double electricField() const {
369 return m_electricField;
370 }
371
372 //! Set the absolute electric field strength [V/m]
373 void setElectricField(double E) {
374 m_electricField = E;
375 }
376
377 //! Calculate the degree of ionization
378 //double ionDegree() const {
379 // double ne = concentration(m_electronSpeciesIndex); // [kmol/m³]
380 // double n_total = molarDensity(); // [kmol/m³]
381 // return ne / n_total;
382 //}
383
384 //! Get the reduced electric field strength [V·m²]
385 double reducedElectricField() const {
387 }
388
389 //! Set reduced electric field given in [V·m²]
390 void setReducedElectricField(double EN) {
391 m_electricField = EN * molarDensity() * Avogadro; // [V/m]
392 }
393
394 virtual void setSolution(std::weak_ptr<Solution> soln) override;
395
396 /**
397 * The elastic power loss (J/s/m³)
398 * @f[
399 * P_k = N_A N_A C_e e \sum_k C_k K_k,
400 * @f]
401 * where @f$ C_k @f$ and @f$ C_e @f$ are the concentration (kmol/m³) of the
402 * target species and electrons, respectively. @f$ K_k @f$ is the elastic
403 * electron energy loss coefficient (eV-m³/s).
404 */
405 double elasticPowerLoss();
406
407 /**
408 * The electron mobility (m²/V/s)
409 * @f[
410 * \mu = \nu_d / E,
411 * @f]
412 * where @f$ \nu_d @f$ is the drift velocity (m²/s), and @f$ E @f$ is the electric
413 * field strength (V/m).
414 */
415 double electronMobility() const;
416
417 /**
418 * The joule heating power (W/m³)
419 * @f[
420 * q_J = \sigma * E^2,
421 * @f]
422 * where @f$ \sigma @f$ is the conductivity (S/m), defined by:
423 * @f[
424 * \sigma = e * n_e * \mu_e
425 * @f]
426 * and @f$ E @f$ is the electric field strength (V/m).
427 */
428 double jouleHeatingPower() const;
429
430 void beginEquilibrate() override;
431
432 void endEquilibrate() override;
433
434 double intrinsicHeating() override;
435
436protected:
437 void updateThermo() const override;
438
439 //! When electron energy distribution changed, plasma properties such as
440 //! electron-collision reaction rates need to be re-evaluated.
442
443 //! When electron energy level changed, plasma properties such as
444 //! electron-collision reaction rates need to be re-evaluate.
445 //! In addition, the cross-sections need to be interpolated at
446 //! the new level.
448
449 //! Check the electron energy levels
450 /*!
451 * The values of electron energy levels need to be positive and
452 * monotonically increasing.
453 */
454 void checkElectronEnergyLevels() const;
455
456 //! Check the electron energy distribution
457 /*!
458 * This method check the electron energy distribution for the criteria
459 * below.
460 *
461 * 1. The values of electron energy distribution cannot be negative.
462 *
463 * 2. If the last value of electron energy distribution is larger
464 * than 0.01, it will raise a warning to suggest using a higher electron
465 * energy levels.
466 */
468
469 //! Set isotropic electron energy distribution
471
472 //! Update electron temperature (K) From energy distribution.
473 //! #m_electronTemp
475
476 //! Electron energy distribution norm
478
479 //! Update interpolated cross section of a collision
480 bool updateInterpolatedCrossSection(size_t k);
481
482 //! Update electron energy distribution difference
484
485 // Electron energy order in the exponential term
486 double m_isotropicShapeFactor = 1.0;
487
488 //! Number of points of electron energy levels
489 size_t m_nPoints = 1001;
490
491 //! electron energy levels [ev]. Length: #m_nPoints
493
494 //! Normalized electron energy distribution vector [-]
495 //! Length: #m_nPoints
496 Eigen::ArrayXd m_electronEnergyDist;
497
498 //! Index of electron species
500
501 //! Electron temperature [K]
503
504 //! Electron energy distribution type
505 string m_distributionType = "isotropic";
506
507 //! Numerical quadrature method for electron energy distribution
508 string m_quadratureMethod = "simpson";
509
510 //! Flag of normalizing electron energy distribution
512
513 //! Indices of inelastic collisions in m_crossSections
514 vector<size_t> m_kInelastic;
515
516 //! Indices of elastic collisions in m_crossSections
517 vector<size_t> m_kElastic;
518
519 //! electric field [V/m]
520 double m_electricField = 0.0;
521
522 //! electric field freq [Hz]
524
525 //! Cross section data. m_crossSections[i][j], where i is the specific process,
526 //! j is the index of vector. Unit: [m^2]
527 vector<vector<double>> m_crossSections;
528
529 //! Electron energy levels corresponding to the cross section data. m_energyLevels[i][j],
530 //! where i is the specific process, j is the index of vector. Unit: [eV]
531 vector<vector<double>> m_energyLevels;
532
533 //! ionization degree for the electron-electron collisions (tmp is the previous one)
534 //double m_ionDegree = 0.0;
535
536 //! Electron energy distribution Difference dF/dε (V^-5/2)
538
539 //! Elastic electron energy loss coefficients (eV m3/s)
540 /*! The elastic electron energy loss coefficient for species k is,
541 * @f[
542 * K_k = \frac{2 m_e}{m_k} \sqrt{\frac{2 e}{m_e}} \int_0^{\infty} \sigma_k
543 * \epsilon^2 \left( F_0 + \frac{k_B T}{e}
544 * \frac{\partial F_0}{\partial \epsilon} \right) d \epsilon,
545 * @f]
546 * where @f$ m_e @f$ [kg] is the electron mass, @f$ \epsilon @f$ [V] is the
547 * electron energy, @f$ \sigma_k @f$ [m2] is the reaction collision cross section,
548 * @f$ F_0 @f$ [V^(-3/2)] is the normalized electron energy distribution function.
549 */
551
552 //! Updates the elastic electron energy loss coefficient for collision index i
553 /*! Calculates the elastic energy loss coefficient using the current electron
554 energy distribution and cross sections.
555 */
557
558 //! Update elastic electron energy loss coefficients
559 /*! Used by elasticPowerLoss() and other plasma property calculations that
560 depends on #m_elasticElectronEnergyLossCoefficients. This function calls
561 updateInterpolatedCrossSection() before calling
562 updateElasticElectronEnergyLossCoefficient()
563 */
565
566private:
567
568 //! Solver used to calculate the EEDF based on electron collision rates
569 unique_ptr<EEDFTwoTermApproximation> m_eedfSolver = nullptr;
570
571 //! Electron energy distribution change variable. Whenever
572 //! #m_electronEnergyDist changes, this int is incremented.
573 int m_distNum = -1;
574
575 //! Electron energy level change variable. Whenever
576 //! #m_electronEnergyLevels changes, this int is incremented.
577 int m_levelNum = -1;
578
579 //! The list of shared pointers of plasma collision reactions
580 vector<shared_ptr<Reaction>> m_collisions;
581
582 //! The list of shared pointers of collision rates
583 vector<shared_ptr<ElectronCollisionPlasmaRate>> m_collisionRates;
584
585 //! The collision-target species indices of #m_collisions
587
588 //! The list of whether the interpolated cross sections is ready
589 vector<bool> m_interp_cs_ready;
590
591 //! Set collisions. This function sets the list of collisions and
592 //! the list of target species using #addCollision.
593 void setCollisions();
594
595 //! Add a collision and record the target species
596 void addCollision(shared_ptr<Reaction> collision);
597
598 //! Saved electron temperature during an equilibrium solve
600
601 //! Lock flag (default off)
602 bool m_inEquilibrate = false;
603
604 //! Work array
605 mutable std::vector<double> m_work;
606};
607
608}
609
610#endif
EEDF Two-Term approximation solver.
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:431
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state.
virtual double molarDensity() const
Molar density (kmol/m^3).
Definition Phase.cpp:599
virtual double concentration(const size_t k) const
Concentration of species k.
Definition Phase.cpp:501
string speciesName(size_t k) const
Name of the species with index k.
Definition Phase.cpp:143
Base class for handling plasma properties, specifically focusing on the electron energy distribution.
Definition PlasmaPhase.h:84
void checkElectronEnergyDistribution() const
Check the electron energy distribution.
vector< vector< double > > m_energyLevels
Electron energy levels corresponding to the cross section data.
void setCollisions()
Set collisions.
double meanElectronEnergy() const
Mean electron energy [eV].
int distributionNumber() const
Return the distribution Number m_distNum.
double m_electronTempEquil
Saved electron temperature during an equilibrium solve.
double enthalpy_mole() const override
Return the Molar enthalpy. Units: J/kmol.
void setQuadratureMethod(const string &method)
Set numerical quadrature method for integrating electron energy distribution function.
size_t m_nPoints
Number of points of electron energy levels.
int levelNumber() const
Return the electron energy level Number m_levelNum.
void addCollision(shared_ptr< Reaction > collision)
Add a collision and record the target species.
virtual void setSolution(std::weak_ptr< Solution > soln) override
Set the link to the Solution object that owns this ThermoPhase.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
void normalizeElectronEnergyDistribution()
Electron energy distribution norm.
void getStandardChemPotentials(double *muStar) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void updateThermo() const override
Update the species reference state thermodynamic functions.
vector< size_t > m_targetSpeciesIndices
The collision-target species indices of m_collisions.
void setElectronTemperature(double Te) override
Set the internally stored electron temperature of the phase (K).
void electronEnergyLevelChanged()
When electron energy level changed, plasma properties such as electron-collision reaction rates need ...
double m_electricFieldFrequency
electric field freq [Hz]
string electronEnergyDistributionType() const
Get electron energy distribution type.
double elasticPowerLoss()
The elastic power loss (J/s/m³)
int m_levelNum
Electron energy level change variable.
bool updateInterpolatedCrossSection(size_t k)
Update interpolated cross section of a collision.
bool m_inEquilibrate
Lock flag (default off)
void electronEnergyDistributionChanged()
When electron energy distribution changed, plasma properties such as electron-collision reaction rate...
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
void setElectricField(double E)
Set the absolute electric field strength [V/m].
string quadratureMethod() const
Numerical quadrature method. Method: m_quadratureMethod.
double electricFieldFrequency() const
Get the frequency of the applied electric field [Hz].
size_t nElectronEnergyLevels() const
Number of electron levels.
void getGibbs_ref(double *g) const override
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
size_t nCollisions() const
Number of electron collision cross sections.
void endEquilibrate() override
Hook called at the end of an equilibrium calculation on this phase.
Eigen::ArrayXd m_electronEnergyDist
Normalized electron energy distribution vector [-] Length: m_nPoints.
double electricField() const
Get the applied electric field strength [V/m].
Eigen::ArrayXd m_electronEnergyLevels
electron energy levels [ev]. Length: m_nPoints
void setDiscretizedElectronEnergyDist(const double *levels, const double *distrb, size_t length)
Set discretized electron energy distribution.
double intrinsicHeating() override
Intrinsic volumetric heating rate [W/m³].
double electronMobility() const
The electron mobility (m²/V/s)
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
string type() const override
String indicating the thermodynamic model implemented.
void checkElectronEnergyLevels() const
Check the electron energy levels.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void updateElasticElectronEnergyLossCoefficients()
Update elastic electron energy loss coefficients.
void updateElectronTemperatureFromEnergyDist()
Update electron temperature (K) From energy distribution.
string m_distributionType
Electron energy distribution type.
void getStandardVolumes_ref(double *vol) const override
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
const vector< size_t > & kElastic() const
Get the indices for elastic electron collisions.
const shared_ptr< ElectronCollisionPlasmaRate > collisionRate(size_t i) const
Get the ElectronCollisionPlasmaRate object associated with electron collision i.
void updateElectronEnergyDistribution()
Update the electron energy distribution.
vector< double > m_elasticElectronEnergyLossCoefficients
Elastic electron energy loss coefficients (eV m3/s)
string m_quadratureMethod
Numerical quadrature method for electron energy distribution.
double m_electricField
electric field [V/m]
void beginEquilibrate() override
Hook called at the beginning of an equilibrium calculation on this phase.
size_t electronSpeciesIndex() const
Electron Species Index.
double m_electronTemp
Electron temperature [K].
void getElectronEnergyDistribution(double *distrb) const
Get electron energy distribution.
double RTe() const
Return the Gas Constant multiplied by the current electron temperature.
void setElectronEnergyLevels(const double *levels, size_t length)
Set electron energy levels.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
double intEnergy_mole() const override
Return the molar internal energy. Units: J/kmol.
double entropy_mole() const override
Return the molar entropy. Units: J/kmol/K.
bool m_do_normalizeElectronEnergyDist
Flag of normalizing electron energy distribution.
void updateElectronEnergyDistDifference()
Update electron energy distribution difference.
bool normalizeElectronEnergyDistEnabled() const
Flag of automatically normalize electron energy distribution.
void updateElasticElectronEnergyLossCoefficient(size_t i)
Updates the elastic electron energy loss coefficient for collision index i.
vector< size_t > m_kElastic
Indices of elastic collisions in m_crossSections.
void setReducedElectricField(double EN)
Set reduced electric field given in [V·m²].
unique_ptr< EEDFTwoTermApproximation > m_eedfSolver
Solver used to calculate the EEDF based on electron collision rates.
void getPartialMolarIntEnergies(double *ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
string electronSpeciesName() const
Electron species name.
void setIsotropicElectronEnergyDistribution()
Set isotropic electron energy distribution.
Eigen::ArrayXd m_electronEnergyDistDiff
ionization degree for the electron-electron collisions (tmp is the previous one)
double isotropicShapeFactor() const
The shape factor of isotropic electron energy distribution.
double gibbs_mole() const override
Return the molar Gibbs free energy. Units: J/kmol.
std::vector< double > m_work
Work array.
void getElectronEnergyLevels(double *levels) const
Get electron energy levels.
double reducedElectricField() const
Calculate the degree of ionization.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
const shared_ptr< Reaction > collision(size_t i) const
Get the Reaction object associated with electron collision i.
vector< bool > m_interp_cs_ready
The list of whether the interpolated cross sections is ready.
vector< shared_ptr< ElectronCollisionPlasmaRate > > m_collisionRates
The list of shared pointers of collision rates.
size_t targetIndex(size_t i) const
target of a specific process
vector< shared_ptr< Reaction > > m_collisions
The list of shared pointers of plasma collision reactions.
void setParameters(const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap()) override
Set equation of state parameters from an AnyMap phase description.
void setMeanElectronEnergy(double energy)
Set mean electron energy [eV].
size_t m_electronSpeciesIndex
Index of electron species.
const vector< size_t > & kInelastic() const
Get the indicies for inelastic electron collisions.
vector< vector< double > > m_crossSections
Cross section data.
void setElectronEnergyDistributionType(const string &type)
Set electron energy distribution type.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
virtual double electronPressure() const
Electron pressure.
double jouleHeatingPower() const
The joule heating power (W/m³)
vector< size_t > m_kInelastic
Indices of inelastic collisions in m_crossSections.
double electronTemperature() const override
Electron Temperature (K)
void setIsotropicShapeFactor(double x)
Set the shape factor of isotropic electron energy distribution.
void enableNormalizeElectronEnergyDist(bool enable)
Set flag of automatically normalize electron energy distribution Flag: m_do_normalizeElectronEnergyDi...
int m_distNum
Electron energy distribution change variable.
const double Boltzmann
Boltzmann constant [J/K].
Definition ct_defs.h:86
const double Avogadro
Avogadro's Number [number/kmol].
Definition ct_defs.h:83
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:122
const double ElectronCharge
Elementary charge [C].
Definition ct_defs.h:92
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
const size_t npos
index returned by functions to indicate "no position"
Definition ct_defs.h:182