Cantera 2.6.0
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 : ArrheniusBase()
50{
51 m_Ea_str = "Ea-gas";
52 m_E4_str = "Ea-electron";
53}
54
55TwoTempPlasmaRate::TwoTempPlasmaRate(double A, double b, double Ea, double EE)
56 : ArrheniusBase(A, b, Ea)
57{
58 m_Ea_str = "Ea-gas";
59 m_E4_str = "Ea-electron";
60 m_E4_R = EE / GasConstant;
61}
62
64{
65 warn_user("TwoTempPlasmaRate::ddTScaledFromStruct",
66 "Temperature derivative does not consider changes of electron temperature.");
67 return (m_Ea_R - m_E4_R) * shared_data.recipT * shared_data.recipT;
68}
69
71{
72 // TwoTempPlasmaReaction is for a non-equilibrium plasma, and the reverse rate
73 // cannot be calculated from the conventional thermochemistry.
74 // @todo implement the reversible rate for non-equilibrium plasma
75 if (rxn.reversible) {
76 throw InputFileError("TwoTempPlasmaRate::setContext", rxn.input,
77 "TwoTempPlasmaRate does not support reversible reactions");
78 }
79}
80
81}
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).
Base class for Arrhenius-type Parameterizations.
Definition: Arrhenius.h:52
std::string m_Ea_str
The string for activation energy.
Definition: Arrhenius.h:172
std::string m_E4_str
The string for an optional 4th parameter.
Definition: Arrhenius.h:173
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition: Arrhenius.h:167
double m_Ea_R
Activation energy (in temperature units)
Definition: Arrhenius.h:166
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition: AnyMap.h:702
Public interface for kinetics managers.
Definition: Kinetics.h:114
virtual double electronTemperature() const
Electron Temperature (K)
Definition: Phase.h:660
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
bool reversible
True if the current reaction is reversible. False otherwise.
Definition: Reaction.h:150
AnyMap input
Input data used for specific models.
Definition: Reaction.h:163
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
virtual 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.
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Definition: global.h:245
double recipT
inverse of temperature
Definition: ReactionData.h:111
virtual void update(double T)
Update data container based on temperature T
Definition: ReactionData.h:35
double temperature
temperature
Definition: ReactionData.h:109
Data container holding shared data specific to TwoTempPlasmaRate.
virtual 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