14 #include "cantera/kinetics/RxnMolChange.h"
18 #include "cantera/kinetics.h"
21 #include "cantera/kinetics/ExtraGlobalRxn.h"
26 using namespace Cantera;
35 m_ChargeTransferInRxn(0.0),
39 warn_deprecated(
"class RxnMolChange",
"To be removed after Cantera 2.2.");
47 m_phaseReactantMoles.resize(
m_nPhases, 0.0);
48 m_phaseProductMoles.resize(
m_nPhases, 0.0);
56 for (
int kKin = 0; kKin < m_kk; kKin++) {
62 double nsc = psc - rsc;
64 m_phaseReactantMoles[iph] += rsc;
65 m_phaseProductMoles[iph] += psc;
68 double chg = tpRef.
charge(kLoc);
99 m_ChargeTransferInRxn(0.0),
109 m_phaseReactantMoles.resize(
m_nPhases, 0.0);
110 m_phaseProductMoles.resize(
m_nPhases, 0.0);
118 for (
int kKin = 0; kKin < m_kk; kKin++) {
122 double rsc = egr->reactantStoichCoeff(kKin);
123 double psc = egr->productStoichCoeff(kKin);
124 double nsc = psc - rsc;
126 m_phaseReactantMoles[iph] += rsc;
127 m_phaseProductMoles[iph] += psc;
130 double chg = tpRef.
charge(kLoc);
151 throw CanteraError(
"RxnMolChange",
"unknown condition on charge");
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
Support for thermo property calculation from C++ application programs.
doublereal electrochem_beta(size_t irxn) const
Return the charge transfer rxn Beta parameter for the ith reaction.
thermo_t & thermo(size_t n=0)
This method returns a reference to the nth ThermoPhase object defined in this kinetics mechanism...
Cantera::Kinetics * m_kinBase
Shallow pointer pointing to the kinetics object.
size_t nTotalSpecies() const
The total number of species in all phases participating in the kinetics mechanism.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
double m_ChargeTransferInRxn
Maximum change in charge of any phase due to this reaction.
std::vector< double > m_phaseMassChange
Vector of mass changes for each phase in the Kinetics object due to the current reaction.
std::vector< double > m_phaseChargeChange
Vector of mass changes for each phase in the Kinetics object due to the current reaction.
Base class for a phase with thermodynamic properties.
size_t nPhases() const
The number of phases participating in the reaction mechanism.
A kinetics manager for heterogeneous reaction mechanisms.
Public interface for kinetics managers.
Base class for exceptions thrown by Cantera classes.
RxnMolChange(Cantera::Kinetics *kinPtr, int irxn)
Main constructor for the class.
size_t kineticsSpeciesIndex(size_t k, size_t n) const
The location of species k of phase n in species arrays.
std::vector< int > m_phaseDims
Vector of phase dimensions for the reaction.
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
virtual int eosType() const
Equation of state type flag.
size_t speciesPhaseIndex(size_t k)
This function takes as an argument the kineticsSpecies index (i.e., the list index in the list of spe...
std::vector< double > m_phaseMoleChange
Vector of mole changes for each phase in the Kinetics object due to the current reaction.
std::vector< int > m_phaseTypes
Vector of phase types in the reaction.
size_t nReactions() const
Number of reactions in the reaction mechanism.
virtual double reactantStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a reactant in reaction i.
virtual double productStoichCoeff(size_t k, size_t i) const
Stoichiometric coefficient of species k as a product in reaction i.
int m_nPhases
Number of phases in the kientics object.
double m_beta
Electrochemical beta parameter for the reaction.
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...