| Cantera 3.0.0

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
6#include "cantera/kinetics/TwoTempPlasmaRate.h"
7#include "cantera/kinetics/Reaction.h"
8#include "cantera/thermo/ThermoPhase.h"
9
10 namespace Cantera
11{
12
13 bool 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) {
19 ReactionData::update(T);
20 changed = true;
21 }
22 if (Te != electronTemp) {
23 updateTe(Te);
24 changed = true;
25 }
26 return changed;
27}
28
29 void TwoTempPlasmaData::update(double T)
30{
31 throw CanteraError("TwoTempPlasmaData::update",
32 "Missing state information: 'TwoTempPlasmaData' requires electron temperature.");
33}
34
35 void TwoTempPlasmaData::update(double T, double Te)
36{
37 ReactionData::update(T);
38 updateTe(Te);
39}
40
41 void 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)
63 : TwoTempPlasmaRate()
64{
65 setParameters(node, rate_units);
66}
67
68 double TwoTempPlasmaRate::ddTScaledFromStruct(const TwoTempPlasmaData& shared_data) const
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
75 void TwoTempPlasmaRate::setContext(const Reaction& rxn, const Kinetics& kin)
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}
Reaction.h
ThermoPhase.h
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
TwoTempPlasmaRate.h
Header for plasma reaction rates parameterized by two temperatures (gas and electron).
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::ArrheniusBase
Base class for Arrhenius-type Parameterizations.
Definition Arrhenius.h:44
Cantera::ArrheniusBase::setParameters
void setParameters(const AnyMap &node, const UnitStack &rate_units) override
Set parameters.
Definition Arrhenius.cpp:100
Cantera::ArrheniusBase::m_E4_str
string m_E4_str
The string for an optional 4th parameter.
Definition Arrhenius.h:156
Cantera::ArrheniusBase::m_E4_R
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition Arrhenius.h:150
Cantera::ArrheniusBase::m_Ea_str
string m_Ea_str
The string for activation energy.
Definition Arrhenius.h:155
Cantera::ArrheniusBase::m_Ea_R
double m_Ea_R
Activation energy (in temperature units)
Definition Arrhenius.h:149
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Cantera::InputFileError
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition AnyMap.h:738
Cantera::Kinetics
Public interface for kinetics managers.
Definition Kinetics.h:126
Cantera::Phase::temperature
double temperature() const
Temperature (K).
Definition Phase.h:662
Cantera::Phase::electronTemperature
virtual double electronTemperature() const
Electron Temperature (K)
Definition Phase.h:668
Cantera::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition Reaction.h:27
Cantera::Reaction::reversible
bool reversible
True if the current reaction is reversible. False otherwise.
Definition Reaction.h:147
Cantera::Reaction::input
AnyMap input
Input data used for specific models.
Definition Reaction.h:160
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
Cantera::TwoTempPlasmaRate
Two temperature plasma reaction rate type depends on both gas temperature and electron temperature.
Definition TwoTempPlasmaRate.h:61
Cantera::TwoTempPlasmaRate::setContext
void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
Definition TwoTempPlasmaRate.cpp:75
Cantera::TwoTempPlasmaRate::ddTScaledFromStruct
double ddTScaledFromStruct(const TwoTempPlasmaData &shared_data) const
Evaluate derivative of reaction rate with respect to temperature divided by reaction rate.
Definition TwoTempPlasmaRate.cpp:68
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Cantera::warn_user
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
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::ReactionData::recipT
double recipT
inverse of temperature
Definition ReactionData.h:112
Cantera::ReactionData::update
virtual void update(double T)
Update data container based on temperature T
Definition ReactionData.h:36
Cantera::ReactionData::temperature
double temperature
temperature
Definition ReactionData.h:110
Cantera::TwoTempPlasmaData
Data container holding shared data specific to TwoTempPlasmaRate.
Definition TwoTempPlasmaRate.h:21
Cantera::TwoTempPlasmaData::update
bool update(const ThermoPhase &phase, const Kinetics &kin) override
Update data container based on thermodynamic phase state.
Definition TwoTempPlasmaRate.cpp:13
Cantera::TwoTempPlasmaData::electronTemp
double electronTemp
electron temperature
Definition TwoTempPlasmaRate.h:36
Cantera::TwoTempPlasmaData::logTe
double logTe
logarithm of electron temperature
Definition TwoTempPlasmaRate.h:37
Cantera::TwoTempPlasmaData::recipTe
double recipTe
inverse of electron temperature
Definition TwoTempPlasmaRate.h:38
Cantera::UnitStack
Unit aggregation utility.
Definition Units.h:105