[Kinetics] move "reaction type" up to Kinetics

This commit is contained in:
Ray Speth 2014-10-22 21:48:15 +00:00
parent d65dbe3da2
commit 584c57d569
8 changed files with 8 additions and 49 deletions

View file

@ -123,10 +123,6 @@ public:
//! @name Reaction Mechanism Informational Query Routines
//! @{
virtual int reactionType(size_t i) const {
return getValue(m_index, i).first;
}
virtual bool isReversible(size_t i) {
if (std::find(m_revindex.begin(), m_revindex.end(), i)
< m_revindex.end()) {
@ -189,8 +185,6 @@ protected:
std::map<size_t, std::vector<grouplist_t> > m_rgroups;
std::map<size_t, std::vector<grouplist_t> > m_pgroups;
std::vector<int> m_rxntype;
std::vector<std::map<size_t, doublereal> > m_rrxn;
std::vector<std::map<size_t, doublereal> > m_prxn;

View file

@ -100,10 +100,6 @@ public:
//! @name Reaction Mechanism Informational Query Routines
//! @{
virtual int reactionType(size_t i) const {
return getValue(m_index, i).first;
}
virtual bool isReversible(size_t i) {
if (std::find(m_revindex.begin(), m_revindex.end(), i)
< m_revindex.end()) {
@ -167,8 +163,6 @@ protected:
size_t m_nirrev;
size_t m_nrev;
std::vector<int> m_rxntype;
std::vector<std::map<size_t, doublereal> > m_rrxn;
std::vector<std::map<size_t, doublereal> > m_prxn;

View file

@ -183,14 +183,6 @@ public:
*/
virtual doublereal productStoichCoeff(size_t kSpecKin, size_t irxn) const;
//! return the reaction type of the reaction irxn
/*!
* @param[in] Reaction index
*
* @return Returns the reaction type of the reaction.
*/
virtual int reactionType(size_t irxn) const;
virtual void getActivityConcentrations(doublereal* const conc);
@ -511,13 +503,6 @@ protected:
*/
std::vector<std::map<size_t, doublereal> > m_prxn;
//! Vector of reactionType for the reactions defined within this object
/*!
* Length = number of reactions, m_ii
* contains the type of reaction.
*/
vector_int reactionType_;
public:
//! Vector of additional information about each reaction
/*!
@ -623,12 +608,6 @@ protected:
//! Pointer to the single surface phase
SurfPhase* m_surf;
//! Vector of reaction types
/*!
* Length = m_ii the number of reactions in the mechanism.
*/
vector_int reactionTypes_;
//! Pointer to the Implicit surface chemistry object
/*!
* Note this object is owned by this InterfaceKinetics object. It may only

View file

@ -681,7 +681,7 @@ public:
* @param i reaction index
*/
virtual int reactionType(size_t i) const {
throw NotImplementedError("Kinetics::reactionType");
return m_rxntype[i];
}
/**
@ -909,6 +909,8 @@ protected:
*/
std::vector<std::vector<size_t> > m_products;
std::vector<int> m_rxntype;
//! m_thermo is a vector of pointers to ThermoPhase objects that are
//! involved with this kinetics operator
/*!

View file

@ -207,7 +207,7 @@ void ElectrodeKinetics::updateROP()
for (size_t iBeta = 0; iBeta < m_beta.size(); iBeta++) {
size_t irxn = m_ctrxn[iBeta];
int reactionType = reactionTypes_[irxn];
int reactionType = m_rxntype[irxn];
if (reactionType == BUTLERVOLMER_RXN) {
//
// Get the beta value
@ -778,7 +778,7 @@ getExchangeCurrentDensityFormulation(size_t irxn,
double mG0 = m_deltaG0[irxn];
int reactionType = reactionTypes_[irxn];
int reactionType = m_rxntype[irxn];
//
// Start with the forward reaction rate

View file

@ -74,7 +74,6 @@ GasKinetics& GasKinetics::operator=(const GasKinetics& right)
m_fwdOrder = right.m_fwdOrder;
m_nirrev = right.m_nirrev;
m_nrev = right.m_nrev;
m_rxntype = right.m_rxntype;
m_rrxn = right.m_rrxn;
m_prxn = right.m_prxn;
m_dn = right.m_dn;
@ -494,7 +493,6 @@ void GasKinetics::addReaction(ReactionData& r)
// operations common to all reaction types
Kinetics::addReaction(r);
m_rxntype.push_back(r.reactionType);
}
void GasKinetics::addFalloffReaction(ReactionData& r)

View file

@ -128,7 +128,6 @@ InterfaceKinetics& InterfaceKinetics::operator=(const InterfaceKinetics& right)
m_nrev = right.m_nrev;
m_rrxn = right.m_rrxn;
m_prxn = right.m_prxn;
reactionType_ = right.reactionType_;
m_conc = right.m_conc;
m_actConc = right.m_actConc;
m_mu0 = right.m_mu0;
@ -636,7 +635,7 @@ void InterfaceKinetics::updateROP()
// Fix up these calculations for cases where the above formalism doesn't hold
double OCV = 0.0;
for (size_t jrxn = 0; jrxn != m_ii; ++jrxn) {
int reactionType = reactionTypes_[jrxn];
int reactionType = m_rxntype[jrxn];
if (reactionType == BUTLERVOLMER_RXN) {
//
// OK, the reaction rate constant contains the current density rate constant calculation
@ -871,8 +870,6 @@ void InterfaceKinetics::addReaction(ReactionData& r)
{
int reactionType = r.reactionType;
reactionType_.push_back(reactionType);
if ((reactionType == BUTLERVOLMER_NOACTIVITYCOEFFS_RXN ) ||
(reactionType == BUTLERVOLMER_RXN ) ||
(reactionType == SURFACEAFFINITY_RXN) ||
@ -924,7 +921,6 @@ void InterfaceKinetics::addElementaryReaction(ReactionData& rdata)
// Find out the reaction type
int reactionType = rdata.reactionType;
reactionTypes_.push_back(reactionType);
/*
* Temporarily change the reaction rate coefficient type to surface arrhenius.
@ -990,7 +986,6 @@ void InterfaceKinetics::addGlobalReaction(ReactionData& rdata)
// Find out the reaction type
int reactionType = rdata.reactionType;
reactionTypes_.push_back(reactionType);
/*
* Temporarily change the reaction rate coefficient type to surface arrhenius.
@ -1330,11 +1325,6 @@ doublereal InterfaceKinetics::productStoichCoeff(size_t kSpecKin, size_t irxn) c
return getValue(m_prxn[kSpecKin], irxn, 0.0);
}
int InterfaceKinetics::reactionType(size_t irxn) const
{
return reactionType_[irxn];
}
void InterfaceKinetics::setPhaseStability(const size_t iphase, const int isStable)
{
if (iphase >= m_thermo.size()) {

View file

@ -65,6 +65,7 @@ Kinetics& Kinetics::operator=(const Kinetics& right)
m_perturb = right.m_perturb;
m_reactants = right.m_reactants;
m_products = right.m_products;
m_rxntype = right.m_rxntype;
m_thermo = right.m_thermo; // DANGER -> shallow pointer copy
@ -299,6 +300,7 @@ void Kinetics::addReaction(ReactionData& r) {
m_rxneqn.push_back(r.equation);
m_reactantStrings.push_back(r.reactantString);
m_productStrings.push_back(r.productString);
m_rxntype.push_back(r.reactionType);
}
void Kinetics::installGroups(size_t irxn, const vector<grouplist_t>& r,