Added comments and a def.

This commit is contained in:
Harry Moffat 2009-01-26 15:59:10 +00:00
parent 4e2aea52c6
commit 9b12761506
2 changed files with 18 additions and 6 deletions

View file

@ -84,7 +84,6 @@ namespace VCSnonideal {
//! Cutoff relative mole fraction value,
//! below which species are deleted from the equilibrium problem.
#ifndef VCS_RELDELETE_SPECIES_CUTOFF
#define VCS_RELDELETE_SPECIES_CUTOFF 1.0e-64
#endif
@ -105,6 +104,13 @@ namespace VCSnonideal {
//! from the equilibrium problem.
#ifndef VCS_DELETE_PHASE_CUTOFF
#define VCS_DELETE_PHASE_CUTOFF 1.0e-12
#endif
//! Cutoff moles below which a phase or species which
//! comprises the bulk of an element's total concentration
//! is deleted.
#ifndef VCS_DELETE_ELEMENTABS_CUTOFF
#define VCS_DELETE_ELEMENTABS_CUTOFF 1.0e-280
#endif
//@}

View file

@ -27,6 +27,10 @@ namespace VCSnonideal {
// Utility function that evaluates whether a phase can be popped
// into existence
/*
* A phase can be popped iff the stoichiometric coefficients for the
* component species, whose concentrations will be lowered during the
* process, are positive by at least a small degree.
*
* @param iphasePop id of the phase, which is currently zeroed,
*
* @return Returns true if the phase can come into existence
@ -40,12 +44,12 @@ namespace VCSnonideal {
int existence = Vphase->exists();
if (existence > 0) {
printf("ERROR vcs_popPhasePossible called for a phase that exists!");
exit(-1);
std::exit(-1);
}
#endif
/*
* section to do damping of the m_deltaMolNumSpecies[]
* Loop through all of the species in the phase
*/
for (int k = 0; k < Vphase->nSpecies(); k++) {
int kspec = Vphase->spGlobalIndexVCS(k);
@ -58,12 +62,14 @@ namespace VCSnonideal {
double negChangeComp = - stoicC * 1.0;
if (negChangeComp > 0.0) {
// TODO: We may have to come up with a tolerance here
if (m_molNumSpecies_old[j] <= 1.0E-300) {
if (m_molNumSpecies_old[j] <= VCS_DELETE_ELEMENTABS_CUTOFF*0.1) {
#ifdef DEBUG_MODE
if (m_debug_print_lvl >= 3) {
plogf(" --- vcs_popPhasePosssible() Phase %d (%s) can't be popped\n", iphasePop,
plogf(" --- vcs_popPhasePosssible() Phase %d (%s) can't be popped\n",
iphasePop,
Vphase->PhaseName.c_str());
plogf(" --- Component %d (%s)will go negative\n", j, m_speciesName[j].c_str());
plogf(" --- Component %d (%s)will go negative\n",
j, m_speciesName[j].c_str());
}
#endif
return false;