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
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 : 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
63 double TwoTempPlasmaRate::ddTScaledFromStruct(const TwoTempPlasmaData& shared_data) const
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
70 void TwoTempPlasmaRate::setContext(const Reaction& rxn, const Kinetics& kin)
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}
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::ArrheniusBase
Base class for Arrhenius-type Parameterizations.
Definition: Arrhenius.h:52
Cantera::ArrheniusBase::m_Ea_str
std::string m_Ea_str
The string for activation energy.
Definition: Arrhenius.h:172
Cantera::ArrheniusBase::m_E4_str
std::string m_E4_str
The string for an optional 4th parameter.
Definition: Arrhenius.h:173
Cantera::ArrheniusBase::m_E4_R
double m_E4_R
Optional 4th energy parameter (in temperature units)
Definition: Arrhenius.h:167
Cantera::ArrheniusBase::m_Ea_R
double m_Ea_R
Activation energy (in temperature units)
Definition: Arrhenius.h:166
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
Cantera::InputFileError
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition: AnyMap.h:702
Cantera::Kinetics
Public interface for kinetics managers.
Definition: Kinetics.h:114
Cantera::Phase::electronTemperature
virtual double electronTemperature() const
Electron Temperature (K)
Definition: Phase.h:660
Cantera::Phase::temperature
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Cantera::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33
Cantera::Reaction::reversible
bool reversible
True if the current reaction is reversible. False otherwise.
Definition: Reaction.h:150
Cantera::Reaction::input
AnyMap input
Input data used for specific models.
Definition: Reaction.h:163
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
Cantera::TwoTempPlasmaRate::setContext
virtual void setContext(const Reaction &rxn, const Kinetics &kin) override
Set context of reaction rate evaluation.
Definition: TwoTempPlasmaRate.cpp:70
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:63
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557
Cantera::warn_user
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
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition: ct_defs.h:113
Cantera::ReactionData::recipT
double recipT
inverse of temperature
Definition: ReactionData.h:111
Cantera::ReactionData::update
virtual void update(double T)
Update data container based on temperature T
Definition: ReactionData.h:35
Cantera::ReactionData::temperature
double temperature
temperature
Definition: ReactionData.h:109
Cantera::TwoTempPlasmaData
Data container holding shared data specific to TwoTempPlasmaRate.
Definition: TwoTempPlasmaRate.h:21
Cantera::TwoTempPlasmaData::update
virtual 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