vcs_VolPhase: made more member data private, and eliminated some unused

member data
This commit is contained in:
Harry Moffat 2008-06-25 16:40:55 +00:00
parent 2a07341974
commit 85a55c7c44
4 changed files with 26 additions and 35 deletions

View file

@ -1056,7 +1056,7 @@ namespace VCSnonideal {
if (ns == 1) {
if (tPhase->charge(0) != 0.0) {
VolPhase->m_speciesUnknownType[0] = VCS_SPECIES_TYPE_INTERFACIALVOLTAGE;
VolPhase->m_phiVarIndex = 0;
VolPhase->setPhiVarIndex(0);
}
}
@ -1506,8 +1506,8 @@ namespace VCSnonideal {
kT++;
}
if (volPhase->m_phiVarIndex >= 0) {
int kglob = volPhase->IndSpecies[volPhase->m_phiVarIndex];
if (volPhase->phiVarIndex() >= 0) {
int kglob = volPhase->IndSpecies[volPhase->phiVarIndex()];
vprob->w[kglob] = tPhase->electricPotential();
}
volPhase->setMolesFromVCS(VCS_STATECALC_OLD, VCS_DATA_PTR(vprob->w));

View file

@ -46,10 +46,9 @@ namespace VCSnonideal {
m_isIdealSoln(false),
Existence(0),
m_MFStartIndex(0),
IndexSpecialSpecies(-1),
Activity_Coeff_Model(VCS_AC_CONSTANT),
IndSpecies(0),
IndSpeciesContig(true),
//IndSpeciesContig(true),
m_VCS_UnitsFormat(VCS_UNITS_MKS),
m_useCanteraCalls(false),
TP_ptr(0),
@ -109,9 +108,8 @@ namespace VCSnonideal {
m_isIdealSoln(b.m_isIdealSoln),
Existence(b.Existence),
m_MFStartIndex(b.m_MFStartIndex),
IndexSpecialSpecies(b.IndexSpecialSpecies),
Activity_Coeff_Model(b.Activity_Coeff_Model),
IndSpeciesContig(b.IndSpeciesContig),
//IndSpeciesContig(b.IndSpeciesContig),
m_VCS_UnitsFormat(b.m_VCS_UnitsFormat),
m_useCanteraCalls(b.m_useCanteraCalls),
TP_ptr(b.TP_ptr),
@ -187,14 +185,13 @@ namespace VCSnonideal {
m_isIdealSoln = b.m_isIdealSoln;
Existence = b.Existence;
m_MFStartIndex = b.m_MFStartIndex;
IndexSpecialSpecies = b.IndexSpecialSpecies;
Activity_Coeff_Model = b.Activity_Coeff_Model;
/*
* Do a shallow copy because we haven' figured this out.
*/
IndSpecies = b.IndSpecies;
IndSpeciesContig = b.IndSpeciesContig;
//IndSpeciesContig = b.IndSpeciesContig;
for (k = 0; k < old_num; k++) {
if ( ListSpeciesPtr[k]) {
@ -1171,5 +1168,16 @@ namespace VCSnonideal {
}
/**********************************************************************/
int vcs_VolPhase::phiVarIndex() const {
return m_phiVarIndex;
}
/**********************************************************************/
void vcs_VolPhase::setPhiVarIndex(int phiVarIndex) {
m_phiVarIndex = phiVarIndex;
}
/**********************************************************************/
}

View file

@ -247,8 +247,6 @@ namespace VCSnonideal {
*/
double GStar_calc_one(int kspec) const;
//! Gibbs free energy calculation at a temperature for the reference state
//! of a species, return a value for one species
/*!
@ -404,6 +402,10 @@ namespace VCSnonideal {
//! Returns whether the object is using cantera calls.
bool usingCanteraCalls() const;
int phiVarIndex() const;
void setPhiVarIndex(int phiVarIndex);
private:
//! Evaluate the activity coefficients at the current conditions
@ -538,7 +540,7 @@ namespace VCSnonideal {
*/
std::vector<std::string> ElName;
//! boolean indicating whether element constraint is active
//! boolean indicating whether an element constraint is active
//! for the current problem
std::vector<int> ElActive;
@ -629,22 +631,12 @@ namespace VCSnonideal {
int m_MFStartIndex;
public:
//! Index of the species which is special in
//! with respect to the thermo treatment.
/*!
* For water models this index will point to
* the index for water.
* defaults to 0
*/
int IndexSpecialSpecies;
//! Integer representing the activity coefficient model
/*!
* The known models are listed at the top of this page
*/
int Activity_Coeff_Model;
//! Index into the species vectors
/*!
* Maps the phase species number into the global species number.
@ -652,9 +644,6 @@ namespace VCSnonideal {
* vector is changed during the algorithm
*/
std::vector<int> IndSpecies;
//! Boolean indicating whether IndSpecies is contiguous
bool IndSpeciesContig;
//! Vector of Species structures for the species belonging to this phase
/*!
@ -704,8 +693,6 @@ namespace VCSnonideal {
//! Vector of the current mole fractions for species
//! in the phase
std::vector<double> Xmol;
public:
//! If the potential is a solution variable in VCS, it acts as a species.
//! This is the species index in the phase for the potential
@ -717,7 +704,6 @@ namespace VCSnonideal {
*/
mutable double m_totalVol;
private:
//! Vector of calculated SS0 chemical potentials for the
//! current Temperature.
/*!
@ -741,7 +727,6 @@ namespace VCSnonideal {
*/
mutable std::vector<double> StarChemicalPotential;
public:
//! Vector of the Star molar Volumes of the species.
/*!
* units m3 / kmol
@ -761,7 +746,6 @@ namespace VCSnonideal {
*/
mutable std::vector<double> ActCoeff;
private:
//! Vector of the derivatives of the ln activity coefficient wrt to the
//! current mole number
/*!
@ -832,7 +816,6 @@ namespace VCSnonideal {
//! Current value of the pressure for this object, and underlying objects
double Pres;
public:
//! Reference pressure for the phase
double RefPres;

View file

@ -971,11 +971,11 @@ namespace VCSnonideal {
for (int k = 0; k < pubPhase->NVolSpecies; k++) {
kT = pubPhase->IndSpecies[k];
//pubPhase->SS0ChemicalPotential[k] = vPhase->SS0ChemicalPotential[k];
pubPhase->StarMolarVol[k] = vPhase->StarMolarVol[k];
pubPhase->PartialMolarVol[k] = vPhase->PartialMolarVol[k];
pubPhase->ActCoeff[k] = vPhase->ActCoeff[k];
//pubPhase->StarMolarVol[k] = vPhase->StarMolarVol[k];
//pubPhase->PartialMolarVol[k] = vPhase->PartialMolarVol[k];
//pubPhase->ActCoeff[k] = vPhase->ActCoeff[k];
if (pubPhase->m_phiVarIndex == k) {
if (pubPhase->phiVarIndex() == k) {
k1 = vPhase->IndSpecies[k];
double tmp = m_molNumSpecies_old[k1];
if (! vcs_doubleEqual( pubPhase->electricPotential() , tmp)) {