9#ifndef CT_PLASMAPHASE_H
10#define CT_PLASMAPHASE_H
14#include "cantera/numerics/eigen_sparse.h"
20class ElectronCollisionPlasmaRate;
140 explicit PlasmaPhase(
const string& inputFile=
"",
const string&
id=
"");
152 bool addSpecies(shared_ptr<Species> spec)
override;
153 virtual void setSolution(std::weak_ptr<Solution> soln)
override;
192 span<const double> distrb);
209 return m_isotropicShapeFactor;
280 const shared_ptr<ElectronCollisionPlasmaRate>
collisionRate(
size_t i)
const {
852 double m_isotropicShapeFactor = 1.0;
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.
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state.
An error indicating that an unimplemented function has been called.
virtual double molarDensity() const
Molar density (kmol/m^3).
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual double concentration(const size_t k) const
Concentration of species k.
string speciesName(size_t k) const
Name of the species with index k.
virtual void setDensity(const double density_)
Set the internally stored density (kg/m^3) of the phase.
Base class for handling plasma properties, specifically focusing on the electron energy distribution.
void checkElectronEnergyDistribution() const
Check the electron energy distribution.
void getStandardChemPotentials(span< double > muStar) const override
Return the standard chemical potentials of the species. Units: J/kmol.
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.
void getGibbs_ref(span< double > g) const override
Return the reference chemical potentials of the species. Units: J/kmol.
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.
void setState(const AnyMap &state) override
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
int levelNumber() const
Return the electron energy level number m_levelNum.
void getActivities(span< double > a) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
double thermalExpansionCoeff() const override
Raise NotImplementedError, as there is an ambiguity on the temperature to use.
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 normalizeElectronEnergyDistribution()
Electron energy distribution norm.
void updateThermo() const override
Update the species reference state thermodynamic functions.
void getPartialMolarEnthalpies(span< double > hbar) const override
Return the partial molar enthalpies of the species in the solution. Units: J/kmol.
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 soundSpeed() const override
Raise NotImplementedError, as there is an ambiguity on the temperature to use.
double pressure() const override
Return the pressure of the plasma phase. Units: Pa.
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 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.
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 getActivityCoefficients(span< double > ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
double meanTemperature() const
Return the mean temperature of the plasma phase. Units: K.
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 ...
void getElectronEnergyDistribution(span< double > distrb) const
Get electron energy distribution.
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.
void setPressure(double p) override
Set the pressure at constant temperature and composition. Units: Pa.
string m_distributionType
Electron energy distribution type. Can be "isotropic", "discretized" or "Boltzmann-two-term".
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.
void setDiscretizedElectronEnergyDist(span< const double > levels, span< const double > distrb)
Set discretized electron energy distribution.
double m_electronTemp
Electron temperature [K].
double RTe() const
Return the Gas Constant multiplied by the current electron temperature [J/kmol].
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 getElectronEnergyLevels(span< double > levels) const
Get electron energy levels.
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.
string electronSpeciesName() const
Electron species name.
void setIsotropicElectronEnergyDistribution()
Set isotropic electron energy distribution.
void getPartialMolarVolumes(span< double > vbar) const override
Return the partial molar volumes of the species in the solution. Units: m³/kmol.
Eigen::ArrayXd m_electronEnergyDistDiff
ionization degree for the electron-electron collisions (tmp is the previous one)
void getStandardVolumes(span< double > vol) const override
Return the standard molar volumes of the species. Units: m³/kmol.
double isotropicShapeFactor() const
The shape factor of isotropic electron energy distribution.
void getPartialMolarEntropies(span< double > sbar) const override
Return the partial molar entropies of the species in the solution. Units: J/kmol/K.
double gibbs_mole() const override
Return the molar Gibbs free energy. Units: J/kmol.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
std::vector< double > m_work
Work array.
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.
void getChemPotentials(span< double > mu) const override
Return the chemical potentials of the species in the solution. Units: J/kmol.
void setElectronEnergyLevels(span< const double > levels)
Set electron energy levels.
size_t targetIndex(size_t i) const
Return the 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].
void getStandardVolumes_ref(span< double > vol) const override
Return the molar volumes of the species reference states. Units: m³/kmol.
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.
virtual double electronPressure() const
Return the electron pressure. Units: Pa.
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.
void getPartialMolarIntEnergies(span< double > ubar) const override
Return the partial molar internal energies of the species in the solution. Units: J/kmol.
int m_distNum
Electron energy distribution change variable.
const double Boltzmann
Boltzmann constant [J/K].
const double Avogadro
Avogadro's Number [number/kmol].
const double GasConstant
Universal Gas Constant [J/kmol/K].
const double ElectronCharge
Elementary charge [C].
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"