Cantera  3.1.0a1
Loading...
Searching...
No Matches
TwoTempPlasmaRate.cpp
Go to the documentation of this file.
1//! @file TwoTempPlasmaRate.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
9
10namespace Cantera
11{
12
13bool TwoTempPlasmaData::update(const ThermoPhase& phase, const Kinetics& kin)
14{
15 double T = phase.temperature();
16 double Te = phase.electronTemperature();
17 bool changed = false;
18 if (T != temperature) {
20 changed = true;
21 }
22 if (Te != electronTemp) {
23 updateTe(Te);
24 changed = true;
25 }
26 return changed;
27}
28
30{
31 throw CanteraError("TwoTempPlasmaData::update",
32 "Missing state information: 'TwoTempPlasmaData' requires electron temperature.");
33}
34
35void TwoTempPlasmaData::update(double T, double Te)
36{
38 updateTe(Te);
39}
40
41void TwoTempPlasmaData::updateTe(double Te)
42{
43 electronTemp = Te;
44 logTe = std::log(Te);
45 recipTe = 1./Te;
46}
47
48TwoTempPlasmaRate::TwoTempPlasmaRate()
49{
50 m_Ea_str = "Ea-gas";
51 m_E4_str = "Ea-electron";
52}
53
54TwoTempPlasmaRate::TwoTempPlasmaRate(double A, double b, double Ea, double EE)
55 : ArrheniusBase(A, b, Ea)
56{
57 m_Ea_str = "Ea-gas";
58 m_E4_str = "Ea-electron";
59 m_E4_R = EE / GasConstant;
60}
61
62TwoTempPlasmaRate::TwoTempPlasmaRate(const AnyMap& node, const UnitStack& rate_units)
64{
65 setParameters(node, rate_units);
66}
67
69{
70 warn_user("TwoTempPlasmaRate::ddTScaledFromStruct",
71 "Temperature derivative does not consider changes of electron temperature.");
72 return (m_Ea_R - m_E4_R) * shared_data.recipT * shared_data.recipT;
73}
74
76{
77 // TwoTempPlasmaReaction is for a non-equilibrium plasma, and the reverse rate
78 // cannot be calculated from the conventional thermochemistry.
79 // @todo implement the reversible rate for non-equilibrium plasma
80 if (rxn.reversible) {
81 throw InputFileError("TwoTempPlasmaRate::setContext", rxn.input,
82 "TwoTempPlasmaRate does not support reversible reactions");
83 }
84}
85
86}
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Header for plasma reaction rates parameterized by two temperatures (gas and electron).
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Base class for Arrhenius-type Parameterizations.
Definition Arrhenius.h:44
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
string m_E4_str
The string for an optional 4th parameter.
Definition Arrhenius.h:156
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition Arrhenius.h:150
string m_Ea_str
The string for activation energy.
Definition Arrhenius.h:155
double m_Ea_R
Activation energy (in temperature units)
Definition Arrhenius.h:149
Base class for exceptions thrown by Cantera classes.
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition AnyMap.h:738
Public interface for kinetics managers.
Definition Kinetics.h:125
double temperature() const
Temperature (K).
Definition Phase.h:562
virtual double electronTemperature() const
Electron Temperature (K)
Definition Phase.h:568
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition Reaction.h:25
bool reversible
True if the current reaction is reversible. False otherwise.
Definition Reaction.h:126
AnyMap input
Input data used for specific models.
Definition Reaction.h:139
Base class for a phase with thermodynamic properties.
Two temperature plasma reaction rate type depends on both gas temperature and electron temperature.
void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
double ddTScaledFromStruct(const TwoTempPlasmaData &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
void warn_user(const string &method, const string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition global.h:267
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
double recipT
inverse of temperature
virtual void update(double T)
Update data container based on temperature T
double temperature
temperature
Data container holding shared data specific to TwoTempPlasmaRate.
bool update(const ThermoPhase &phase, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
double electronTemp
electron temperature
double logTe
logarithm of electron temperature
double recipTe
inverse of electron temperature
Unit aggregation utility.
Definition Units.h:105