Cantera  3.2.0a1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PlasmaPhase.cpp
Go to the documentation of this file.
1//! @file PlasmaPhase.cpp
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
7#include <boost/math/special_functions/gamma.hpp>
14
15namespace Cantera {
16
17namespace {
18 const double gamma = sqrt(2 * ElectronCharge / ElectronMass);
19}
20
21PlasmaPhase::PlasmaPhase(const string& inputFile, const string& id_)
22{
23 initThermoFile(inputFile, id_);
24
25 // initial grid
26 m_electronEnergyLevels = Eigen::ArrayXd::LinSpaced(m_nPoints, 0.0, 1.0);
27
28 // initial electron temperature
30
31 // resize vectors
32 m_interp_cs.resize(m_nPoints);
33}
34
35PlasmaPhase::~PlasmaPhase()
36{
37 if (shared_ptr<Solution> soln = m_soln.lock()) {
38 soln->removeChangedCallback(this);
39 soln->kinetics()->removeReactionAddedCallback(this);
40 }
41 for (size_t k = 0; k < nCollisions(); k++) {
42 // remove callback
43 m_collisions[k]->removeSetRateCallback(this);
44 }
45}
46
48{
49 if (m_distributionType == "discretized") {
50 throw CanteraError("PlasmaPhase::updateElectronEnergyDistribution",
51 "Invalid for discretized electron energy distribution.");
52 } else if (m_distributionType == "isotropic") {
54 }
57}
58
60 Eigen::ArrayXd eps32 = m_electronEnergyLevels.pow(3./2.);
61 double norm = 2./3. * numericalQuadrature(m_quadratureMethod,
63 if (norm < 0.0) {
64 throw CanteraError("PlasmaPhase::normalizeElectronEnergyDistribution",
65 "The norm is negative. This might be caused by bad "
66 "electron energy distribution");
67 }
69}
70
72{
73 if (type == "discretized" ||
74 type == "isotropic") {
76 } else {
77 throw CanteraError("PlasmaPhase::setElectronEnergyDistributionType",
78 "Unknown type for electron energy distribution.");
79 }
80}
81
83{
85 double x = m_isotropicShapeFactor;
86 double gamma1 = boost::math::tgamma(3.0 / 2.0 * x);
87 double gamma2 = boost::math::tgamma(5.0 / 2.0 * x);
88 double c1 = x * std::pow(gamma2, 1.5) / std::pow(gamma1, 2.5);
89 double c2 = x * std::pow(gamma2 / gamma1, x);
91 c1 / std::pow(meanElectronEnergy(), 1.5) *
93 meanElectronEnergy()).pow(x)).exp();
95}
96
98 m_electronTemp = Te;
100}
101
103 m_electronTemp = 2.0 / 3.0 * energy * ElectronCharge / Boltzmann;
105}
106
107void PlasmaPhase::setElectronEnergyLevels(const double* levels, size_t length,
108 bool updateEnergyDist)
109{
110 m_nPoints = length;
111 m_electronEnergyLevels = Eigen::Map<const Eigen::ArrayXd>(levels, length);
114 if (updateEnergyDist) updateElectronEnergyDistribution();
115 m_interp_cs.resize(m_nPoints);
116 // The cross sections are interpolated on the energy levels
117 if (nCollisions() > 0) {
118 for (size_t i = 0; i < m_collisions.size(); i++) {
119 m_interp_cs_ready[i] = false;
121 }
122 }
123}
124
126{
127 m_distNum++;
128}
129
131{
132 m_levelNum++;
133}
134
136{
137 Eigen::ArrayXd h = m_electronEnergyLevels.tail(m_nPoints - 1) -
139 if (m_electronEnergyLevels[0] < 0.0 || (h <= 0.0).any()) {
140 throw CanteraError("PlasmaPhase::checkElectronEnergyLevels",
141 "Values of electron energy levels need to be positive and "
142 "monotonically increasing.");
143 }
144}
145
147{
148 Eigen::ArrayXd h = m_electronEnergyLevels.tail(m_nPoints - 1) -
150 if ((m_electronEnergyDist < 0.0).any()) {
151 throw CanteraError("PlasmaPhase::checkElectronEnergyDistribution",
152 "Values of electron energy distribution cannot be negative.");
153 }
154 if (m_electronEnergyDist[m_nPoints - 1] > 0.01) {
155 warn_user("PlasmaPhase::checkElectronEnergyDistribution",
156 "The value of the last element of electron energy distribution exceed 0.01. "
157 "This indicates that the value of electron energy level is not high enough "
158 "to contain the isotropic distribution at mean electron energy of "
159 "{} eV", meanElectronEnergy());
160 }
161}
162
164 const double* dist,
165 size_t length)
166{
167 m_distributionType = "discretized";
168 setElectronEnergyLevels(levels, length, false);
170 Eigen::Map<const Eigen::ArrayXd>(dist, length);
174 }
180}
181
183{
184 // calculate mean electron energy and electron temperature
185 Eigen::ArrayXd eps52 = m_electronEnergyLevels.pow(5./2.);
186 double epsilon_m = 2.0 / 5.0 * numericalQuadrature(m_quadratureMethod,
187 m_electronEnergyDist, eps52);
188 if (epsilon_m < 0.0 && m_quadratureMethod == "simpson") {
189 // try trapezoidal method
190 epsilon_m = 2.0 / 5.0 * numericalQuadrature(
191 "trapezoidal", m_electronEnergyDist, eps52);
192 }
193
194 if (epsilon_m < 0.0) {
195 throw CanteraError("PlasmaPhase::updateElectronTemperatureFromEnergyDist",
196 "The electron energy distribution produces negative electron temperature.");
197 }
198
199 m_electronTemp = 2.0 / 3.0 * epsilon_m * ElectronCharge / Boltzmann;
200}
201
203 m_isotropicShapeFactor = x;
205}
206
207void PlasmaPhase::getParameters(AnyMap& phaseNode) const
208{
210 AnyMap eedf;
211 eedf["type"] = m_distributionType;
212 vector<double> levels(m_nPoints);
213 Eigen::Map<Eigen::ArrayXd>(levels.data(), m_nPoints) = m_electronEnergyLevels;
214 eedf["energy-levels"] = levels;
215 if (m_distributionType == "isotropic") {
216 eedf["shape-factor"] = m_isotropicShapeFactor;
217 eedf["mean-electron-energy"].setQuantity(meanElectronEnergy(), "eV");
218 } else if (m_distributionType == "discretized") {
219 vector<double> dist(m_nPoints);
220 Eigen::Map<Eigen::ArrayXd>(dist.data(), m_nPoints) = m_electronEnergyDist;
221 eedf["distribution"] = dist;
222 eedf["normalize"] = m_do_normalizeElectronEnergyDist;
223 }
224 phaseNode["electron-energy-distribution"] = std::move(eedf);
225}
226
227void PlasmaPhase::setParameters(const AnyMap& phaseNode, const AnyMap& rootNode)
228{
229 IdealGasPhase::setParameters(phaseNode, rootNode);
230 m_root = rootNode;
231 if (phaseNode.hasKey("electron-energy-distribution")) {
232 const AnyMap eedf = phaseNode["electron-energy-distribution"].as<AnyMap>();
233 m_distributionType = eedf["type"].asString();
234 if (m_distributionType == "isotropic") {
235 if (eedf.hasKey("shape-factor")) {
236 m_isotropicShapeFactor = eedf["shape-factor"].asDouble();
237 } else {
238 throw CanteraError("PlasmaPhase::setParameters",
239 "isotropic type requires shape-factor key.");
240 }
241 if (eedf.hasKey("energy-levels")) {
242 setElectronEnergyLevels(eedf["energy-levels"].asVector<double>().data(),
243 eedf["energy-levels"].asVector<double>().size(),
244 false);
245 }
246 if (eedf.hasKey("mean-electron-energy")) {
247 double energy = eedf.convert("mean-electron-energy", "eV");
248 // setMeanElectronEnergy() calls updateElectronEnergyDistribution()
249 setMeanElectronEnergy(energy);
250 } else {
251 throw CanteraError("PlasmaPhase::setParameters",
252 "isotropic type requires electron-temperature key.");
253 }
254 } else if (m_distributionType == "discretized") {
255 if (!eedf.hasKey("energy-levels")) {
256 throw CanteraError("PlasmaPhase::setParameters",
257 "Cannot find key energy-levels.");
258 }
259 if (!eedf.hasKey("distribution")) {
260 throw CanteraError("PlasmaPhase::setParameters",
261 "Cannot find key distribution.");
262 }
263 if (eedf.hasKey("normalize")) {
264 enableNormalizeElectronEnergyDist(eedf["normalize"].asBool());
265 }
266 setDiscretizedElectronEnergyDist(eedf["energy-levels"].asVector<double>().data(),
267 eedf["distribution"].asVector<double>().data(),
268 eedf["energy-levels"].asVector<double>().size());
269 }
270 }
271}
272
273bool PlasmaPhase::addSpecies(shared_ptr<Species> spec)
274{
275 bool added = IdealGasPhase::addSpecies(spec);
276 size_t k = m_kk - 1;
277
278 if (spec->composition.find("E") != spec->composition.end() &&
279 spec->composition.size() == 1 &&
280 spec->composition["E"] == 1) {
283 } else {
284 throw CanteraError("PlasmaPhase::addSpecies",
285 "Cannot add species, {}. "
286 "Only one electron species is allowed.", spec->name);
287 }
288 }
289 return added;
290}
291
293{
295 // check electron species
297 throw CanteraError("PlasmaPhase::initThermo",
298 "No electron species found.");
299 }
300}
301
302void PlasmaPhase::setSolution(std::weak_ptr<Solution> soln) {
304 // register callback function to be executed
305 // when the thermo or kinetics object changed
306 if (shared_ptr<Solution> soln = m_soln.lock()) {
307 soln->registerChangedCallback(this, [&]() {
309 });
310 }
311}
312
314{
315 m_collisions.clear();
316 m_collisionRates.clear();
318
319 if (shared_ptr<Solution> soln = m_soln.lock()) {
320 shared_ptr<Kinetics> kin = soln->kinetics();
321 if (!kin) {
322 return;
323 }
324
325 // add collision from the initial list of reactions
326 for (size_t i = 0; i < kin->nReactions(); i++) {
327 std::shared_ptr<Reaction> R = kin->reaction(i);
328 if (R->rate()->type() != "electron-collision-plasma") {
329 continue;
330 }
331 addCollision(R);
332 }
333
334 // register callback when reaction is added later
335 // Modifying collision reactions is not supported
336 kin->registerReactionAddedCallback(this, [this, kin]() {
337 size_t i = kin->nReactions() - 1;
338 if (kin->reaction(i)->type() == "electron-collision-plasma") {
339 addCollision(kin->reaction(i));
340 }
341 });
342 }
343}
344
345void PlasmaPhase::addCollision(std::shared_ptr<Reaction> collision)
346{
347 size_t i = nCollisions();
348
349 // setup callback to signal updating the cross-section-related
350 // parameters
351 collision->registerSetRateCallback(this, [this, i, collision]() {
352 m_interp_cs_ready[i] = false;
354 std::dynamic_pointer_cast<ElectronCollisionPlasmaRate>(collision->rate());
355 });
356
357 // Identify target species for electron-collision reactions
358 for (const auto& [name, _] : collision->reactants) {
359 // Reactants are expected to be electrons and the target species
360 if (name != electronSpeciesName()) {
362 break;
363 }
364 }
365
366 m_collisions.emplace_back(collision);
367 m_collisionRates.emplace_back(
368 std::dynamic_pointer_cast<ElectronCollisionPlasmaRate>(collision->rate()));
369 m_interp_cs_ready.emplace_back(false);
370
371 // resize parameters
373}
374
376{
377 if (m_interp_cs_ready[i]) {
378 return false;
379 }
380 vector<double> levels(m_nPoints);
381 Eigen::Map<Eigen::ArrayXd>(levels.data(), m_nPoints) = m_electronEnergyLevels;
382 m_collisionRates[i]->updateInterpolatedCrossSection(levels);
383 m_interp_cs_ready[i] = true;
384 return true;
385}
386
388{
390 // Forward difference for the first point
394
395 // Central difference for the middle points
396 for (size_t i = 1; i < m_nPoints - 1; i++) {
400 (h1 * h1 - h0 * h0) * m_electronEnergyDist[i] -
401 h1 * h1 * m_electronEnergyDist[i-1]) /
402 (h1 * h0) / (h1 + h0);
403 }
404
405 // Backward difference for the last point
411}
412
414{
415 // cache of cross section plus distribution plus energy-level number
416 static const int cacheId = m_cache.getId();
417 CachedScalar last_stateNum = m_cache.getScalar(cacheId);
418
419 // combine the distribution and energy level number
420 int stateNum = m_distNum + m_levelNum;
421
422 vector<bool> interpChanged(m_collisions.size());
423 for (size_t i = 0; i < m_collisions.size(); i++) {
424 interpChanged[i] = updateInterpolatedCrossSection(i);
425 }
426
427 if (last_stateNum.validate(temperature(), stateNum)) {
428 // check each cross section, and only update coefficients that
429 // the interpolated cross sections change
430 for (size_t i = 0; i < m_collisions.size(); i++) {
431 if (interpChanged[i]) {
433 }
434 }
435 } else {
436 // update every coefficient if distribution, temperature,
437 // or energy levels change.
438 for (size_t i = 0; i < m_collisions.size(); i++) {
440 }
441 }
442}
443
445{
446 // @todo exclude attachment collisions
447 size_t k = m_targetSpeciesIndices[i];
448
449 // Map cross sections to Eigen::ArrayXd
450 auto cs_array = Eigen::Map<const Eigen::ArrayXd>(
451 m_collisionRates[i]->crossSectionInterpolated().data(),
452 m_collisionRates[i]->crossSectionInterpolated().size()
453 );
454
455 // Mass ratio calculation
456 double mass_ratio = ElectronMass / molecularWeight(k) * Avogadro;
457
458 // Calculate the rate using Simpson's rule or trapezoidal rule
459 Eigen::ArrayXd f0_plus = m_electronEnergyDist + Boltzmann * temperature() /
461 m_elasticElectronEnergyLossCoefficients[i] = 2.0 * mass_ratio * gamma *
463 m_quadratureMethod, 1.0 / 3.0 * f0_plus.cwiseProduct(cs_array),
464 m_electronEnergyLevels.pow(3.0));
465}
466
468{
470 // The elastic power loss includes the contributions from inelastic
471 // collisions (inelastic recoil effects).
472 double rate = 0.0;
473 for (size_t i = 0; i < nCollisions(); i++) {
476 }
477
478 return Avogadro * Avogadro * ElectronCharge *
480}
481
483{
485 static const int cacheId = m_cache.getId();
486 CachedScalar cached = m_cache.getScalar(cacheId);
487 double tempNow = temperature();
488 double electronTempNow = electronTemperature();
489 size_t k = m_electronSpeciesIndex;
490 // If the electron temperature has changed since the last time these
491 // properties were computed, recompute them.
492 if (cached.state1 != tempNow || cached.state2 != electronTempNow) {
494 &m_cp0_R[k], &m_h0_RT[k], &m_s0_R[k]);
495 cached.state1 = tempNow;
496 cached.state2 = electronTempNow;
497 }
498 // update the species Gibbs functions
499 m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k];
500}
501
503 double value = IdealGasPhase::enthalpy_mole();
504 value += GasConstant * (electronTemperature() - temperature()) *
507 return value;
508}
509
510void PlasmaPhase::getGibbs_ref(double* g) const
511{
514}
515
517{
520}
521
523{
526}
527
529{
531 double logp = log(pressure());
532 double logpe = log(electronPressure());
533 sbar[m_electronSpeciesIndex] += GasConstant * (logp - logpe);
534}
535
537{
538 const vector<double>& _h = enthalpy_RT_ref();
539 for (size_t k = 0; k < m_kk; k++) {
540 ubar[k] = RT() * (_h[k] - 1.0);
541 }
542 size_t k = m_electronSpeciesIndex;
543 ubar[k] = RTe() * (_h[k] - 1.0);
544}
545
546void PlasmaPhase::getChemPotentials(double* mu) const
547{
549 size_t k = m_electronSpeciesIndex;
550 double xx = std::max(SmallNumber, moleFraction(k));
551 mu[k] += (RTe() - RT()) * log(xx);
552}
553
555{
557 size_t k = m_electronSpeciesIndex;
558 muStar[k] -= log(pressure() / refPressure()) * RT();
559 muStar[k] += log(electronPressure() / refPressure()) * RTe();
560}
561
562void PlasmaPhase::getEntropy_R(double* sr) const
563{
564 const vector<double>& _s = entropy_R_ref();
565 copy(_s.begin(), _s.end(), sr);
566 double tmp = log(pressure() / refPressure());
567 for (size_t k = 0; k < m_kk; k++) {
568 if (k != m_electronSpeciesIndex) {
569 sr[k] -= tmp;
570 } else {
571 sr[k] -= log(electronPressure() / refPressure());
572 }
573 }
574}
575
576void PlasmaPhase::getGibbs_RT(double* grt) const
577{
578 const vector<double>& gibbsrt = gibbs_RT_ref();
579 copy(gibbsrt.begin(), gibbsrt.end(), grt);
580 double tmp = log(pressure() / refPressure());
581 for (size_t k = 0; k < m_kk; k++) {
582 if (k != m_electronSpeciesIndex) {
583 grt[k] += tmp;
584 } else {
585 grt[k] += log(electronPressure() / refPressure());
586 }
587 }
588}
589
590}
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...
Header file for class PlasmaPhase.
Declaration for class Cantera::Species.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:432
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1477
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Definition AnyMap.cpp:1595
Base class for exceptions thrown by Cantera classes.
const vector< double > & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
double enthalpy_mole() const override
Return the Molar enthalpy. Units: J/kmol.
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.
double pressure() const override
Pressure.
vector< double > m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
vector< double > m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
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...
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
const vector< double > & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
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.
virtual void updateThermo() const
Update the species reference state thermodynamic functions.
vector< double > m_s0_R
Temporary storage for dimensionless reference state entropies.
vector< double > m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
const vector< double > & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
virtual void update_single(size_t k, double T, double *cp_R, double *h_RT, double *s_R) const
Get reference-state properties for a single species.
ValueCache m_cache
Cached for saved calculations within each ThermoPhase.
Definition Phase.h:835
size_t m_kk
Number of species in the phase.
Definition Phase.h:855
double temperature() const
Temperature (K).
Definition Phase.h:563
virtual double concentration(const size_t k) const
Concentration of species k.
Definition Phase.cpp:476
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:129
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:439
double molecularWeight(size_t k) const
Molecular weight of species k.
Definition Phase.cpp:383
string name() const
Return the name of the phase.
Definition Phase.cpp:20
void addCollision(std::shared_ptr< Reaction > collision)
Add a collision and record the target species.
void checkElectronEnergyDistribution() const
Check the electron energy distribution.
void setCollisions()
Set collisions.
double meanElectronEnergy() const
Mean electron energy [eV].
double enthalpy_mole() const override
Return the Molar enthalpy. Units: J/kmol.
size_t m_nPoints
Number of points of electron energy levels.
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 ...
void setElectronEnergyLevels(const double *levels, size_t length, bool updateEnergyDist=true)
Set electron energy levels.
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.
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...
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 collisions.
Eigen::ArrayXd m_electronEnergyDist
Normalized electron energy distribution vector [-] Length: m_nPoints.
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.
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.
vector< double > m_interp_cs
Interpolated cross sections.
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.
void updateElectronEnergyDistribution()
Update 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.
PlasmaPhase(const string &inputFile="", const string &id="")
Construct and initialize a PlasmaPhase object directly from an input file.
double m_electronTemp
Electron temperature [K].
double RTe() const
Return the Gas Constant multiplied by the current electron temperature.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
bool m_do_normalizeElectronEnergyDist
Flag of normalizing electron energy distribution.
AnyMap m_root
Data for initiate reaction.
void updateElectronEnergyDistDifference()
Update electron energy distribution difference.
void updateElasticElectronEnergyLossCoefficient(size_t i)
Updates the elastic electron energy loss coefficient for collision index i.
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
Electron energy distribution Difference dF/dε (V^-5/2)
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
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.
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.
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 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.
virtual void setParameters(const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap())
Set equation of state parameters from an AnyMap phase description.
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
double RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void setSolution(std::weak_ptr< Solution > soln)
Set the link to the Solution object that owns this ThermoPhase.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
std::weak_ptr< Solution > m_soln
reference to Solution
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual double refPressure() const
Returns the reference pressure in Pa.
CachedScalar getScalar(int id)
Get a reference to a CachedValue object representing a scalar (double) with the given id.
Definition ValueCache.h:161
int getId()
Get a unique id for a cached value.
Header for a file containing miscellaneous numerical functions.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
double numericalQuadrature(const string &method, const Eigen::ArrayXd &f, const Eigen::ArrayXd &x)
Numerical integration of a function.
Definition funcs.cpp:112
const double Boltzmann
Boltzmann constant [J/K].
Definition ct_defs.h:84
const double Avogadro
Avogadro's Number [number/kmol].
Definition ct_defs.h:81
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
const double ElectronCharge
Elementary charge [C].
Definition ct_defs.h:90
const double ElectronMass
Electron Mass [kg].
Definition ct_defs.h:111
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition global.h:263
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:180
const double SmallNumber
smallest number to compare to zero.
Definition ct_defs.h:158
A cached property value and the state at which it was evaluated.
Definition ValueCache.h:33
double state2
Value of the second state variable for the state at which value was evaluated, for example density or...
Definition ValueCache.h:106
bool validate(double state1New)
Check whether the currently cached value is valid based on a single state variable.
Definition ValueCache.h:39
double state1
Value of the first state variable for the state at which value was evaluated, for example temperature...
Definition ValueCache.h:102