vcs_VolPhase update: Made more members private
This commit is contained in:
parent
4e051200f8
commit
62133ce1b4
7 changed files with 168 additions and 94 deletions
|
|
@ -1283,7 +1283,7 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* Fill in the vcs_SpeciesProperty structure
|
||||
*/
|
||||
vcs_SpeciesProperties *sProp = VolPhase->ListSpeciesPtr[k];
|
||||
vcs_SpeciesProperties *sProp = VolPhase->speciesProperty(k);
|
||||
sProp->NumElements = vprob->ne;
|
||||
sProp->SpName = vprob->SpName[kT];
|
||||
sProp->SpeciesThermo = ts_ptr;
|
||||
|
|
@ -1392,7 +1392,7 @@ namespace VCSnonideal {
|
|||
*/
|
||||
double R = vcsUtil_gasConstant(vprob->m_VCS_UnitsFormat);
|
||||
for (k = 0; k < nSpPhase; k++) {
|
||||
vcs_SpeciesProperties *sProp = VolPhase->ListSpeciesPtr[k];
|
||||
vcs_SpeciesProperties *sProp = VolPhase->speciesProperty(k);
|
||||
ts_ptr = sProp->SpeciesThermo;
|
||||
ts_ptr->SS0_feSave = VolPhase->G0_calc_one(k)/ R;
|
||||
ts_ptr->SS0_TSave = vprob->T;
|
||||
|
|
@ -1512,9 +1512,9 @@ namespace VCSnonideal {
|
|||
}
|
||||
volPhase->setMolesFromVCS(VCS_STATECALC_OLD, VCS_DATA_PTR(vprob->w));
|
||||
if (volPhase->TotalMoles() > 0.0) {
|
||||
volPhase->Existence = 1;
|
||||
volPhase->setExistence(1);
|
||||
} else {
|
||||
volPhase->Existence = 0;
|
||||
volPhase->setExistence(0);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace VCSnonideal {
|
|||
m_molarVolInert(1000.),
|
||||
m_activityConvention(0),
|
||||
m_isIdealSoln(false),
|
||||
Existence(0),
|
||||
m_existence(0),
|
||||
m_MFStartIndex(0),
|
||||
Activity_Coeff_Model(VCS_AC_CONSTANT),
|
||||
IndSpecies(0),
|
||||
|
|
@ -68,7 +68,7 @@ namespace VCSnonideal {
|
|||
{
|
||||
m_owningSolverObject = owningSolverObject;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
@ -106,7 +106,7 @@ namespace VCSnonideal {
|
|||
TMolesInert(b.TMolesInert),
|
||||
m_activityConvention(b.m_activityConvention),
|
||||
m_isIdealSoln(b.m_isIdealSoln),
|
||||
Existence(b.Existence),
|
||||
m_existence(b.m_existence),
|
||||
m_MFStartIndex(b.m_MFStartIndex),
|
||||
Activity_Coeff_Model(b.Activity_Coeff_Model),
|
||||
//IndSpeciesContig(b.IndSpeciesContig),
|
||||
|
|
@ -133,7 +133,7 @@ namespace VCSnonideal {
|
|||
*/
|
||||
*this = b;
|
||||
}
|
||||
/***********************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
* Assignment operator()
|
||||
|
|
@ -183,7 +183,7 @@ namespace VCSnonideal {
|
|||
TMolesInert = b.TMolesInert;
|
||||
m_activityConvention = b.m_activityConvention;
|
||||
m_isIdealSoln = b.m_isIdealSoln;
|
||||
Existence = b.Existence;
|
||||
m_existence = b.m_existence;
|
||||
m_MFStartIndex = b.m_MFStartIndex;
|
||||
Activity_Coeff_Model = b.Activity_Coeff_Model;
|
||||
|
||||
|
|
@ -245,7 +245,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return *this;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
void vcs_VolPhase::resize(int phaseNum, int nspecies, const char *phaseName,
|
||||
double molesInert) {
|
||||
|
|
@ -260,7 +260,7 @@ namespace VCSnonideal {
|
|||
|
||||
TMolesInert = molesInert;
|
||||
if (TMolesInert > 0.0) {
|
||||
Existence = 2;
|
||||
m_existence = 2;
|
||||
}
|
||||
|
||||
m_phi = 0.0;
|
||||
|
|
@ -334,7 +334,7 @@ namespace VCSnonideal {
|
|||
m_UpToDate_GStar = false;
|
||||
m_UpToDate_G0 = false;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
//! Evaluate activity coefficients
|
||||
/*!
|
||||
|
|
@ -365,7 +365,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
m_UpToDate_AC = true;
|
||||
}
|
||||
/***********************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
@ -380,7 +380,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return(ActCoeff[kspec]);
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Gibbs free energy calculation at a temperature for the reference state
|
||||
// of each species
|
||||
|
|
@ -401,7 +401,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
m_UpToDate_G0 = true;
|
||||
}
|
||||
/*******************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Gibbs free energy calculation at a temperature for the reference state
|
||||
// of a species, return a value for one species
|
||||
|
|
@ -417,7 +417,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return SS0ChemicalPotential[kspec];
|
||||
}
|
||||
/*******************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Gibbs free energy calculation for standard states
|
||||
/*
|
||||
|
|
@ -442,7 +442,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
m_UpToDate_GStar = true;
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Gibbs free energy calculation for standard state of one species
|
||||
/*
|
||||
|
|
@ -462,7 +462,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return StarChemicalPotential[kspec];
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Set the mole fractions from a conventional mole fraction vector
|
||||
/*
|
||||
|
|
@ -485,7 +485,7 @@ namespace VCSnonideal {
|
|||
m_UpToDate = false;
|
||||
m_vcsStateStatus = VCS_STATECALC_TMP;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Updates the mole fractions in subobjects
|
||||
/*
|
||||
|
|
@ -503,13 +503,13 @@ namespace VCSnonideal {
|
|||
m_UpToDate_VolPM = false;
|
||||
}
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Return a const reference to the mole fraction vector in the phase
|
||||
const std::vector<double> & vcs_VolPhase::moleFractions() const {
|
||||
return Xmol;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Set the moles within the phase
|
||||
/*
|
||||
|
|
@ -581,7 +581,7 @@ namespace VCSnonideal {
|
|||
Xmol[k] = tmp / v_totalMoles;
|
||||
}
|
||||
}
|
||||
Existence = 1;
|
||||
m_existence = 1;
|
||||
} else {
|
||||
// This is where we will start to store a better approximation
|
||||
// for the mole fractions, when the phase doesn't exist.
|
||||
|
|
@ -589,7 +589,7 @@ namespace VCSnonideal {
|
|||
for (int k = 0; k < NVolSpecies; k++) {
|
||||
Xmol[k] = 1.0 / NVolSpecies;
|
||||
}
|
||||
Existence = 0;
|
||||
m_existence = 0;
|
||||
}
|
||||
/*
|
||||
* Update the electric potential if it is a solution variable
|
||||
|
|
@ -605,12 +605,12 @@ namespace VCSnonideal {
|
|||
double phi = molesSpeciesVCS[kglob];
|
||||
setElectricPotential(phi);
|
||||
if (NVolSpecies == 1) {
|
||||
Existence = 1;
|
||||
m_existence = 1;
|
||||
}
|
||||
}
|
||||
_updateMoleFractionDependencies();
|
||||
if (TMolesInert > 0.0) {
|
||||
Existence = 2;
|
||||
m_existence = 2;
|
||||
}
|
||||
/*
|
||||
* Set flags indicating we are up to date with the VCS state vector.
|
||||
|
|
@ -619,7 +619,7 @@ namespace VCSnonideal {
|
|||
m_vcsStateStatus = stateCalc;
|
||||
|
||||
}
|
||||
/******************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Set the moles within the phase
|
||||
/*
|
||||
|
|
@ -628,7 +628,8 @@ namespace VCSnonideal {
|
|||
* a gather routine.
|
||||
*
|
||||
*
|
||||
* @param molesSpeciesVCS array of mole numbers. Note, the indecises for species in
|
||||
* @param molesSpeciesVCS array of mole numbers. Note,
|
||||
* the indecises for species in
|
||||
* this array may not be contiguous. IndSpecies[] is needed
|
||||
* to gather the species into the local contiguous vector
|
||||
* format.
|
||||
|
|
@ -652,7 +653,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
}
|
||||
}
|
||||
/******************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Update the moles within the phase, if necessary
|
||||
/*
|
||||
|
|
@ -699,7 +700,7 @@ namespace VCSnonideal {
|
|||
AC[kglob] = ActCoeff[k];
|
||||
}
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Fill in the partial molar volume vector for VCS
|
||||
/*
|
||||
|
|
@ -722,7 +723,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return m_totalVol;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Fill in the partial molar volume vector for VCS
|
||||
/*
|
||||
|
|
@ -744,7 +745,7 @@ namespace VCSnonideal {
|
|||
gstar[kglob] = StarChemicalPotential[k];
|
||||
}
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
void vcs_VolPhase::setElectricPotential(const double phi) {
|
||||
|
|
@ -758,12 +759,12 @@ namespace VCSnonideal {
|
|||
m_UpToDate_VolPM = false;
|
||||
m_UpToDate_GStar = false;
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
double vcs_VolPhase::electricPotential() const {
|
||||
return m_phi;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Sets the temperature and pressure in this object and
|
||||
// underlying objects
|
||||
|
|
@ -794,7 +795,7 @@ namespace VCSnonideal {
|
|||
m_UpToDate_GStar = false;
|
||||
m_UpToDate_G0 = false;
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Sets the temperature in this object and
|
||||
// underlying objects
|
||||
|
|
@ -808,7 +809,7 @@ namespace VCSnonideal {
|
|||
void vcs_VolPhase::setState_T(const double temp) {
|
||||
setState_TP(temp, Pres);
|
||||
}
|
||||
/**************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Molar volume calculation for standard states
|
||||
/*
|
||||
|
|
@ -833,7 +834,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
m_UpToDate_VolStar = true;
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Molar volume calculation for standard state of one species
|
||||
/*
|
||||
|
|
@ -854,7 +855,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
return StarMolarVol[kspec];
|
||||
}
|
||||
/****************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Calculate the partial molar volumes of all species and return the
|
||||
// total volume
|
||||
|
|
@ -898,7 +899,7 @@ namespace VCSnonideal {
|
|||
m_UpToDate_VolPM = true;
|
||||
return m_totalVol;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
/*
|
||||
* _updateLnActCoeffJac():
|
||||
|
|
@ -971,7 +972,7 @@ namespace VCSnonideal {
|
|||
_updateMoleFractionDependencies();
|
||||
_updateActCoeff();
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Downloads the ln ActCoeff jacobian into the VCS version of the
|
||||
// ln ActCoeff jacobian.
|
||||
|
|
@ -985,7 +986,8 @@ namespace VCSnonideal {
|
|||
* j = id of the species mole number
|
||||
* k = id of the species activity coefficient
|
||||
*/
|
||||
void vcs_VolPhase::sendToVCS_LnActCoeffJac(double * const * const LnACJac_VCS) {
|
||||
void
|
||||
vcs_VolPhase::sendToVCS_LnActCoeffJac(double * const * const LnACJac_VCS) {
|
||||
/*
|
||||
* update the Ln Act Coeff jacobian entries with respect to the
|
||||
* mole number of species in the phase -> we always assume that
|
||||
|
|
@ -1007,7 +1009,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
}
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Set the pointer for Cantera's ThermoPhase parameter
|
||||
/*
|
||||
|
|
@ -1064,7 +1066,7 @@ namespace VCSnonideal {
|
|||
m_useCanteraCalls = false;
|
||||
}
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Return a const ThermoPhase pointer corresponding to this phase
|
||||
/*
|
||||
|
|
@ -1073,22 +1075,38 @@ namespace VCSnonideal {
|
|||
const Cantera::ThermoPhase *vcs_VolPhase::ptrThermoPhase() const {
|
||||
return TP_ptr;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
double vcs_VolPhase::TotalMoles() const {
|
||||
return v_totalMoles;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
double vcs_VolPhase::molefraction(int k) const {
|
||||
return Xmol[k];
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
void vcs_VolPhase::setTotalMoles(double tmols) {
|
||||
v_totalMoles = tmols;
|
||||
// Sets the total moles in the phase
|
||||
/*
|
||||
* We don't have to flag the internal state as changing here
|
||||
* because we have just changed the total moles.
|
||||
*
|
||||
* @param totalMols Total moles in the phase (kmol)
|
||||
*/
|
||||
void vcs_VolPhase::setTotalMoles(const double totalMols) {
|
||||
v_totalMoles = totalMols;
|
||||
if (TMolesInert > 0.0) {
|
||||
m_existence = 2;
|
||||
} else {
|
||||
if (totalMols > 0.0) {
|
||||
m_existence = 1;
|
||||
} else {
|
||||
m_existence = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Sets the mole flag within the object to out of date
|
||||
/*
|
||||
|
|
@ -1101,7 +1119,7 @@ namespace VCSnonideal {
|
|||
m_vcsStateStatus = stateCalc;
|
||||
}
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Sets the mole flag within the object to be current
|
||||
/*
|
||||
|
|
@ -1111,7 +1129,7 @@ namespace VCSnonideal {
|
|||
m_UpToDate = true;
|
||||
m_vcsStateStatus = stateCalc;
|
||||
}
|
||||
/************************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
// Return a string representing the equation of state
|
||||
|
|
@ -1154,30 +1172,73 @@ namespace VCSnonideal {
|
|||
std::string sss=st;
|
||||
return sss;
|
||||
}
|
||||
/**********************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Returns whether the phase is an ideal solution phase
|
||||
bool vcs_VolPhase::isIdealSoln() const {
|
||||
return m_isIdealSoln;
|
||||
}
|
||||
/**********************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
// Returns whether the phase uses Cantera calls
|
||||
bool vcs_VolPhase::usingCanteraCalls() const {
|
||||
return m_useCanteraCalls;
|
||||
}
|
||||
/**********************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
int vcs_VolPhase::phiVarIndex() const {
|
||||
return m_phiVarIndex;
|
||||
}
|
||||
/**********************************************************************/
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
void vcs_VolPhase::setPhiVarIndex(int phiVarIndex) {
|
||||
m_phiVarIndex = phiVarIndex;
|
||||
}
|
||||
/***************************************************************************/
|
||||
|
||||
// Retrieve the kth Species structure for the species belonging to this phase
|
||||
/*
|
||||
* The index into this vector is the species index within the phase.
|
||||
*
|
||||
* @param kindex kth species index.
|
||||
*/
|
||||
vcs_SpeciesProperties * vcs_VolPhase::speciesProperty(const int kindex) {
|
||||
return ListSpeciesPtr[kindex];
|
||||
}
|
||||
/***************************************************************************/
|
||||
|
||||
// Boolean indicating whether the phase exists or not
|
||||
int vcs_VolPhase::exists() const {
|
||||
return m_existence;
|
||||
}
|
||||
/**********************************************************************/
|
||||
|
||||
// Set the existence flag in the object
|
||||
void vcs_VolPhase::setExistence(const int existence) {
|
||||
if (existence == 0) {
|
||||
if (v_totalMoles != 0.0) {
|
||||
#ifdef DEBUG_MODE
|
||||
plogf("vcs_VolPhase::setExistence setting false existence for phase with moles");
|
||||
plogendl();
|
||||
exit(-1);
|
||||
#endif
|
||||
v_totalMoles = 0.0;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_MODE
|
||||
else {
|
||||
if (TMolesInert == 0.0) {
|
||||
if (v_totalMoles == 0.0) {
|
||||
plogf("vcs_VolPhase::setExistence setting true existence for phase with no moles");
|
||||
plogendl();
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
m_existence = existence;
|
||||
}
|
||||
/**********************************************************************/
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -368,9 +368,12 @@ namespace VCSnonideal {
|
|||
|
||||
//! Sets the total moles in the phase
|
||||
/*!
|
||||
* We don't have to flag the internal state as changing here
|
||||
* because we have just changed the total moles.
|
||||
*
|
||||
* @param totalMols Total moles in the phase (kmol)
|
||||
*/
|
||||
void setTotalMoles(double totalMols);
|
||||
void setTotalMoles(const double totalMols);
|
||||
|
||||
//! Sets the mole flag within the object to out of date
|
||||
/*!
|
||||
|
|
@ -406,6 +409,28 @@ namespace VCSnonideal {
|
|||
|
||||
void setPhiVarIndex(int phiVarIndex);
|
||||
|
||||
//! Retrieve the kth Species structure for the species belonging to this phase
|
||||
/*!
|
||||
* The index into this vector is the species index within the phase.
|
||||
*
|
||||
* @param kindex kth species index.
|
||||
*/
|
||||
vcs_SpeciesProperties * speciesProperty(int kindex);
|
||||
|
||||
//! int indicating whether the phase exists or not
|
||||
int exists() const;
|
||||
|
||||
//! Set the existence flag in the object
|
||||
/*!
|
||||
* Note the total moles of the phase must have been set appropriately
|
||||
* before calling this routine.
|
||||
*
|
||||
* @param existence Phase existence flag
|
||||
*
|
||||
* @note try to eliminate this routine
|
||||
*/
|
||||
void setExistence(const int existence);
|
||||
|
||||
private:
|
||||
|
||||
//! Evaluate the activity coefficients at the current conditions
|
||||
|
|
@ -609,6 +634,7 @@ namespace VCSnonideal {
|
|||
//! uniformly equal to one.
|
||||
bool m_isIdealSoln;
|
||||
|
||||
private:
|
||||
//! Current state of existence:
|
||||
/*!
|
||||
* 0 : Doesn't exist currently
|
||||
|
|
@ -617,9 +643,9 @@ namespace VCSnonideal {
|
|||
* inerts which can't exist in any other
|
||||
* phase
|
||||
*/
|
||||
int Existence;
|
||||
int m_existence;
|
||||
|
||||
|
||||
private:
|
||||
// Index of the first MF species in the list of unknowns for this phase
|
||||
/*!
|
||||
* This is always equal to zero.
|
||||
|
|
@ -645,12 +671,14 @@ namespace VCSnonideal {
|
|||
*/
|
||||
std::vector<int> IndSpecies;
|
||||
|
||||
private:
|
||||
//! Vector of Species structures for the species belonging to this phase
|
||||
/*!
|
||||
* The index into this vector is the species index within the phase.
|
||||
*/
|
||||
std::vector<vcs_SpeciesProperties *> ListSpeciesPtr;
|
||||
|
||||
public:
|
||||
//! Units for the chemical potential data, pressure data, volume,
|
||||
//! and species amounts
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -148,13 +148,6 @@ namespace VCSnonideal {
|
|||
} else {
|
||||
m_molNumSpecies_old[kspec] = 0.0;
|
||||
}
|
||||
if (m_molNumSpecies_old[kspec] > 0.0) {
|
||||
if (Vphase->Existence == 0) {
|
||||
Vphase->Existence = 1;
|
||||
}
|
||||
} else if (m_SSPhase[kspec]) {
|
||||
Vphase->Existence = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -164,7 +157,7 @@ namespace VCSnonideal {
|
|||
(void) vcs_basopt(FALSE, aw, sa, sm, ss, test, &conv);
|
||||
|
||||
/* ***************************************************************** */
|
||||
/* **** CALCULATE TOTAL GASEOUS AND LIQUID MOLES, ****************** */
|
||||
/* **** CALCULATE TOTAL MOLES, ****************** */
|
||||
/* **** CHEMICAL POTENTIALS OF BASIS ****************** */
|
||||
/* ***************************************************************** */
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
namespace VCSnonideal {
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void VCS_SOLVE::vcs_SSPhase(void)
|
||||
/**************************************************************************
|
||||
|
|
@ -54,7 +51,7 @@ namespace VCSnonideal {
|
|||
Vphase = m_VolPhaseList[iph];
|
||||
Vphase->SingleSpecies = false;
|
||||
if (TPhInertMoles[iph] > 0.0) {
|
||||
Vphase->Existence = 2;
|
||||
Vphase->setExistence(2);
|
||||
}
|
||||
if (numPhSpecies[iph] <= 1) {
|
||||
if (TPhInertMoles[iph] == 0.0) {
|
||||
|
|
@ -77,7 +74,6 @@ namespace VCSnonideal {
|
|||
else m_SSPhase[kspec] = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
// This routine is mostly concerned with changing the private data
|
||||
|
|
@ -143,7 +139,7 @@ namespace VCSnonideal {
|
|||
int pID = m_phaseID[kspec];
|
||||
int spPhIndex = m_speciesLocalPhaseIndex[kspec];
|
||||
vcs_VolPhase *vPhase = m_VolPhaseList[pID];
|
||||
vcs_SpeciesProperties *spProp = vPhase->ListSpeciesPtr[spPhIndex];
|
||||
vcs_SpeciesProperties *spProp = vPhase->speciesProperty(spPhIndex);
|
||||
double sz = 0.0;
|
||||
int eSize = spProp->FormulaMatrixCol.size();
|
||||
for (int e = 0; e < eSize; e++) {
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ namespace VCSnonideal {
|
|||
*/
|
||||
Vphase = m_VolPhaseList[iph];
|
||||
for (int k = 0; k < Vphase->NVolSpecies; k++) {
|
||||
vcs_SpeciesProperties *sProp = Vphase->ListSpeciesPtr[k];
|
||||
vcs_SpeciesProperties *sProp = Vphase->speciesProperty(k);
|
||||
int kT = Vphase->IndSpecies[k];
|
||||
sProp->SpeciesThermo = m_speciesThermoList[kT];
|
||||
}
|
||||
|
|
@ -891,7 +891,7 @@ namespace VCSnonideal {
|
|||
TPhInertMoles[iph] = pub_phase_ptr->TMolesInert;
|
||||
vPhase->TMolesInert = pub_phase_ptr->TMolesInert;
|
||||
if (TPhInertMoles[iph] > 0.0) {
|
||||
vPhase->Existence = 2;
|
||||
vPhase->setExistence(2);
|
||||
vPhase->SingleSpecies = FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -959,7 +959,7 @@ namespace VCSnonideal {
|
|||
for (int iph = 0; iph < pub->NPhase; iph++) {
|
||||
vcs_VolPhase *pubPhase = pub->VPhaseList[iph];
|
||||
vcs_VolPhase *vPhase = m_VolPhaseList[iph];
|
||||
pubPhase->Existence = vPhase->Existence;
|
||||
//pubPhase->setExistence(vPhase->exists());
|
||||
// Note pubPhase is not the same as vPhase, since they contain
|
||||
// different indexing into the solution vector.
|
||||
// pubPhase->TMoles = vPhase->TMoles;
|
||||
|
|
|
|||
|
|
@ -599,8 +599,8 @@ namespace VCSnonideal {
|
|||
*/
|
||||
if (resurrect) {
|
||||
bool phaseResurrected = false;
|
||||
if (Vphase->Existence == 0) {
|
||||
Vphase->Existence = 1;
|
||||
if (Vphase->exists() == 0) {
|
||||
//Vphase->setExistence(1);
|
||||
phaseResurrected = true;
|
||||
}
|
||||
--m_numRxnMinorZeroed;
|
||||
|
|
@ -843,7 +843,7 @@ namespace VCSnonideal {
|
|||
*/
|
||||
iph = m_phaseID[kspec];
|
||||
Vphase = m_VolPhaseList[iph];
|
||||
Vphase->Existence = 0;
|
||||
//Vphase->setExistence(0);
|
||||
#ifdef DEBUG_MODE
|
||||
sprintf(ANOTE, "zeroing out SS phase: ");
|
||||
#endif
|
||||
|
|
@ -2286,19 +2286,19 @@ namespace VCSnonideal {
|
|||
* If it is extinct, call the delete_multiphase() function.
|
||||
*/
|
||||
if (! m_SSPhase[klast]) {
|
||||
if (Vphase->Existence != 2) {
|
||||
Vphase->Existence = 0;
|
||||
if (Vphase->exists() != 2) {
|
||||
bool stillExists = false;
|
||||
for (int k = 0; k < m_numSpeciesRdc; k++) {
|
||||
if (m_speciesUnknownType[k] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
|
||||
if (m_phaseID[k] == iph) {
|
||||
if (m_molNumSpecies_old[k] > 0.0) {
|
||||
Vphase->Existence = 1;
|
||||
stillExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Vphase->Existence == 0) {
|
||||
if (!stillExists) {
|
||||
vcs_delete_multiphase(iph);
|
||||
}
|
||||
}
|
||||
|
|
@ -2365,8 +2365,8 @@ namespace VCSnonideal {
|
|||
* for those other species.
|
||||
*/
|
||||
if (! m_SSPhase[kspec]) {
|
||||
if (Vphase->Existence == 0) {
|
||||
Vphase->Existence = 1;
|
||||
if (Vphase->exists() == 0) {
|
||||
Vphase->setExistence(1);
|
||||
for (k = 0; k < m_numSpeciesTot; k++) {
|
||||
if (m_phaseID[k] == iph) {
|
||||
i = k - m_numComponents;
|
||||
|
|
@ -2376,7 +2376,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
Vphase->Existence = 1;
|
||||
Vphase->setExistence(1);
|
||||
}
|
||||
|
||||
++(m_numRxnRdc);
|
||||
|
|
@ -2413,7 +2413,7 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* set the phase existence flag to dead
|
||||
*/
|
||||
Vphase->Existence = 0;
|
||||
Vphase->setTotalMoles(0.0);
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 2) {
|
||||
plogf(" --- delete_multiphase %d, %s\n", iph, Vphase->PhaseName.c_str());
|
||||
|
|
@ -2653,7 +2653,7 @@ namespace VCSnonideal {
|
|||
|
||||
// Check first to see if the phase is in fact deleted
|
||||
const vcs_VolPhase *Vphase = m_VolPhaseList[iphase];
|
||||
if (Vphase->Existence != 0) {
|
||||
if (Vphase->exists() != 0) {
|
||||
return false;
|
||||
}
|
||||
int irxn, kspec;
|
||||
|
|
@ -3221,9 +3221,9 @@ namespace VCSnonideal {
|
|||
}
|
||||
m_molNumSpecies_old[k] = 0.0;
|
||||
iph = m_phaseID[k];
|
||||
Vphase = m_VolPhaseList[iph];
|
||||
Vphase->Existence = 0;
|
||||
m_tPhaseMoles_old[iph] = 0.0;
|
||||
Vphase = m_VolPhaseList[iph];
|
||||
Vphase->setTotalMoles(0.0);
|
||||
if (k == kspec) {
|
||||
m_rxnStatus[irxn] = VCS_SPECIES_ZEROEDSS;
|
||||
if (m_SSPhase[kspec] != 1) {
|
||||
|
|
@ -4906,13 +4906,9 @@ namespace VCSnonideal {
|
|||
// Took out because we aren't updating mole fractions in Vphase
|
||||
// Vphase->TMoles = m_tPhaseMoles_old[i];
|
||||
if (m_tPhaseMoles_old[i] == 0.0) {
|
||||
Vphase->Existence = 0;
|
||||
Vphase->setTotalMoles(0.0);
|
||||
} else {
|
||||
if (TPhInertMoles[i] > 0.0) {
|
||||
Vphase->Existence = 2;
|
||||
} else {
|
||||
Vphase->Existence = 1;
|
||||
}
|
||||
Vphase->setTotalMoles(m_tPhaseMoles_old[i]);
|
||||
}
|
||||
}
|
||||
m_totalMolNum = sum;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue