[Kinetics] Eliminate unnecessary m_rrxn and m_prxn variables
This information can be extracted from the Reaction objects as-needed.
This commit is contained in:
parent
ca90c671ac
commit
f623e44d32
5 changed files with 8 additions and 34 deletions
|
|
@ -938,26 +938,6 @@ protected:
|
|||
//! Vector of Reaction objects represented by this Kinetics manager
|
||||
std::vector<shared_ptr<Reaction> > m_reactions;
|
||||
|
||||
//! m_rrxn is a vector of maps, containing the reactant
|
||||
//! stoichiometric coefficient information
|
||||
/*!
|
||||
* m_rrxn has a length equal to the total number of species in the
|
||||
* kinetics object. For each species, there exists a map, with the
|
||||
* reaction number being the key, and the reactant stoichiometric
|
||||
* coefficient for the species being the value.
|
||||
*/
|
||||
std::vector<std::map<size_t, doublereal> > m_rrxn;
|
||||
|
||||
//! m_prxn is a vector of maps, containing the reactant
|
||||
//! stoichiometric coefficient information
|
||||
/**
|
||||
* m_prxn is a vector of maps. m_prxn has a length equal to the total
|
||||
* number of species in the kinetics object. For each species, there
|
||||
* exists a map, with the reaction number being the key, and the product
|
||||
* stoichiometric coefficient for the species being the value.
|
||||
*/
|
||||
std::vector<std::map<size_t, doublereal> > m_prxn;
|
||||
|
||||
std::vector<int> m_rxntype;
|
||||
|
||||
//! m_thermo is a vector of pointers to ThermoPhase objects that are
|
||||
|
|
|
|||
|
|
@ -115,10 +115,10 @@ public:
|
|||
* - `t[4] = log(t)`
|
||||
* - `t[5] = 1.0/t;
|
||||
*
|
||||
* @param tt Vector of temperature polynomials
|
||||
* @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
|
||||
* @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
|
||||
* @param s_R Vector of Dimensionless entropies. (length m_kk).
|
||||
* @param[in] tt Array of evaluated temperature functions
|
||||
* @param[out] cp_R Dimensionless heat capacity
|
||||
* @param[out] h_RT Dimensionless enthalpy
|
||||
* @param[out] s_R Dimensionless entropy
|
||||
*/
|
||||
virtual void updateProperties(const doublereal* tt,
|
||||
doublereal* cp_R, doublereal* h_RT,
|
||||
|
|
|
|||
|
|
@ -156,8 +156,6 @@ void BulkKinetics::modifyElementaryReaction(size_t i, ElementaryReaction& rNew)
|
|||
void BulkKinetics::init()
|
||||
{
|
||||
m_kk = thermo().nSpecies();
|
||||
m_rrxn.resize(m_kk);
|
||||
m_prxn.resize(m_kk);
|
||||
m_conc.resize(m_kk);
|
||||
m_grt.resize(m_kk);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -952,8 +952,6 @@ void InterfaceKinetics::init()
|
|||
for (size_t n = 0; n < nPhases(); n++) {
|
||||
m_kk += thermo(n).nSpecies();
|
||||
}
|
||||
m_rrxn.resize(m_kk);
|
||||
m_prxn.resize(m_kk);
|
||||
m_actConc.resize(m_kk);
|
||||
m_conc.resize(m_kk);
|
||||
m_mu0.resize(m_kk);
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ Kinetics& Kinetics::operator=(const Kinetics& right)
|
|||
m_kk = right.m_kk;
|
||||
m_perturb = right.m_perturb;
|
||||
m_reactions = right.m_reactions;
|
||||
m_rrxn = right.m_rrxn;
|
||||
m_prxn = right.m_prxn;
|
||||
m_rxntype = right.m_rxntype;
|
||||
|
||||
m_thermo = right.m_thermo; // DANGER -> shallow pointer copy
|
||||
|
|
@ -422,12 +420,14 @@ size_t Kinetics::speciesPhaseIndex(size_t k)
|
|||
|
||||
double Kinetics::reactantStoichCoeff(size_t kSpec, size_t irxn) const
|
||||
{
|
||||
return getValue(m_rrxn[kSpec], irxn, 0.0);
|
||||
return getValue(m_reactions[irxn]->reactants, kineticsSpeciesName(kSpec),
|
||||
0.0);
|
||||
}
|
||||
|
||||
double Kinetics::productStoichCoeff(size_t kSpec, size_t irxn) const
|
||||
{
|
||||
return getValue(m_prxn[kSpec], irxn, 0.0);
|
||||
return getValue(m_reactions[irxn]->products, kineticsSpeciesName(kSpec),
|
||||
0.0);
|
||||
}
|
||||
|
||||
void Kinetics::getFwdRatesOfProgress(doublereal* fwdROP)
|
||||
|
|
@ -607,7 +607,6 @@ bool Kinetics::addReaction(shared_ptr<Reaction> r)
|
|||
size_t k = kineticsSpeciesIndex(iter->first);
|
||||
rk.push_back(k);
|
||||
rstoich.push_back(iter->second);
|
||||
m_rrxn[k][irxn] = iter->second;
|
||||
}
|
||||
|
||||
for (Composition::const_iterator iter = r->products.begin();
|
||||
|
|
@ -616,7 +615,6 @@ bool Kinetics::addReaction(shared_ptr<Reaction> r)
|
|||
size_t k = kineticsSpeciesIndex(iter->first);
|
||||
pk.push_back(k);
|
||||
pstoich.push_back(iter->second);
|
||||
m_prxn[k][irxn] = iter->second;
|
||||
}
|
||||
|
||||
// The default order for each reactant is its stoichiometric coefficient,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue