change of variable names
This commit is contained in:
parent
0f4c0a3f7c
commit
afd90fb206
8 changed files with 42 additions and 37 deletions
|
|
@ -54,13 +54,13 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* Store the temperature and pressure in the private global variables
|
||||
*/
|
||||
T = T_arg;
|
||||
m_temperature = T_arg;
|
||||
Pres = pres_arg;
|
||||
/*
|
||||
* Evaluate the standard state free energies
|
||||
* at the current temperatures and pressures.
|
||||
*/
|
||||
iconv = vcs_evalSS_TP(ipr, ip1, T, pres_arg);
|
||||
iconv = vcs_evalSS_TP(ipr, ip1, m_temperature, pres_arg);
|
||||
|
||||
/*
|
||||
* Prepare the problem data:
|
||||
|
|
@ -154,7 +154,7 @@ namespace VCSnonideal {
|
|||
|
||||
for (int iph = 0; iph < NPhase; iph++) {
|
||||
vcs_VolPhase* vph = VPhaseList[iph];
|
||||
vph->setState_TP(T, Pres);
|
||||
vph->setState_TP(m_temperature, Pres);
|
||||
vph->sendToVCSGStar(VCS_DATA_PTR(m_SSfeSpecies));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ namespace VCSnonideal {
|
|||
/* ********************************************************** */
|
||||
/* **** ESTIMATE REACTION ADJUSTMENTS *********************** */
|
||||
/* ********************************************************** */
|
||||
vcs_dzero(VCS_DATA_PTR(DelTPhMoles), NPhase);
|
||||
vcs_dzero(VCS_DATA_PTR(m_deltaPhaseMoles), NPhase);
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
xtphMax[iph] = log(m_tPhaseMoles_new[iph] * 1.0E32);
|
||||
xtphMin[iph] = log(m_tPhaseMoles_new[iph] * 1.0E-32);
|
||||
|
|
@ -258,7 +258,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
DelTPhMoles[iph] += DnPhase[irxn][iph] * m_deltaMolNumSpecies[kspec];
|
||||
m_deltaPhaseMoles[iph] += DnPhase[irxn][iph] * m_deltaMolNumSpecies[kspec];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void VCS_SOLVE::vcs_nondim_TP(void) {
|
|||
double tf;
|
||||
if (UnitsState == VCS_DIMENSIONAL_G) {
|
||||
UnitsState = VCS_NONDIMENSIONAL_G;
|
||||
tf = 1.0 / vcs_nondimMult_TP(m_VCS_UnitsFormat, T);
|
||||
tf = 1.0 / vcs_nondimMult_TP(m_VCS_UnitsFormat, m_temperature);
|
||||
for (i = 0; i < m_numSpeciesTot; ++i) {
|
||||
/*
|
||||
* Modify the standard state and total chemical potential data,
|
||||
|
|
@ -109,7 +109,7 @@ void VCS_SOLVE::vcs_nondim_TP(void) {
|
|||
m_feSpecies_old[i] *= tf;
|
||||
}
|
||||
|
||||
Faraday_dim = vcs_nondim_Farad(m_VCS_UnitsFormat, T);
|
||||
Faraday_dim = vcs_nondim_Farad(m_VCS_UnitsFormat, m_temperature);
|
||||
if (m_VCS_UnitsFormat == VCS_UNITS_MKS) {
|
||||
for (i = 0; i < m_numSpeciesTot; ++i) {
|
||||
if (SpeciesUnknownType[i] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
|
||||
|
|
@ -136,7 +136,7 @@ void VCS_SOLVE::vcs_redim_TP(void)
|
|||
double tf;
|
||||
if (UnitsState != VCS_DIMENSIONAL_G) {
|
||||
UnitsState = VCS_DIMENSIONAL_G;
|
||||
tf = vcs_nondimMult_TP(m_VCS_UnitsFormat, T);
|
||||
tf = vcs_nondimMult_TP(m_VCS_UnitsFormat, m_temperature);
|
||||
for (i = 0; i < m_numSpeciesTot; ++i) {
|
||||
/*
|
||||
* Modify the standard state and total chemical potential data,
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ int VCS_SOLVE::vcs_prep_oneTime(int printLvl)
|
|||
modifiedSoln = true;
|
||||
if (Pres <= 0.0) pres = 1.0;
|
||||
else pres = Pres;
|
||||
retn = vcs_evalSS_TP(0, 0, T, pres);
|
||||
retn = vcs_evalSS_TP(0, 0, m_temperature, pres);
|
||||
for (kspec = 0; kspec < m_numSpeciesTot; ++kspec) {
|
||||
if (SpeciesUnknownType[kspec] == VCS_SPECIES_TYPE_MOLNUM) {
|
||||
m_molNumSpecies_old[kspec] = - m_SSfeSpecies[kspec];
|
||||
|
|
@ -289,7 +289,7 @@ int VCS_SOLVE::vcs_prep(void) {
|
|||
vcs_vdzero(m_molNumSpecies_new, m_numSpeciesTot);
|
||||
vcs_dzero(&(DnPhase[0][0]), m_numSpeciesTot*NPhase);
|
||||
vcs_izero(&(PhaseParticipation[0][0]), m_numSpeciesTot*NPhase);
|
||||
vcs_dzero(VCS_DATA_PTR(DelTPhMoles), NPhase);
|
||||
vcs_dzero(VCS_DATA_PTR(m_deltaPhaseMoles), NPhase);
|
||||
vcs_dzero(VCS_DATA_PTR(m_tPhaseMoles_new), NPhase);
|
||||
/*
|
||||
* Calculate the total number of moles in all phases.
|
||||
|
|
|
|||
|
|
@ -105,9 +105,10 @@ int VCS_SOLVE::vcs_report(int iconv)
|
|||
* Calculate some quantities that may need updating
|
||||
*/
|
||||
vcs_tmoles();
|
||||
Vol = vcs_VolTotal(T, Pres, VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
|
||||
Vol = vcs_VolTotal(m_temperature, Pres,
|
||||
VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
|
||||
|
||||
plogf("\t\tTemperature = %15.2g Kelvin\n", T);
|
||||
plogf("\t\tTemperature = %15.2g Kelvin\n", m_temperature);
|
||||
plogf("\t\tPressure = %15.5g Atmos\n", Pres);
|
||||
plogf("\t\tVolume = %15.5g cm**3\n", Vol);
|
||||
|
||||
|
|
@ -301,7 +302,7 @@ int VCS_SOLVE::vcs_report(int iconv)
|
|||
plogf("\n"); print_line("-", 93);
|
||||
plogf("Chemical Potentials of the Species: (dimensionless)\n");
|
||||
|
||||
double rt = vcs_nondimMult_TP(m_VCS_UnitsFormat, T);
|
||||
double rt = vcs_nondimMult_TP(m_VCS_UnitsFormat, m_temperature);
|
||||
plogf("\t\t(RT = %g ", rt);
|
||||
vcs_printChemPotUnits(m_VCS_UnitsFormat);
|
||||
plogf(")\n");
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace VCSnonideal {
|
|||
NPhase(0),
|
||||
iest(0),
|
||||
TMoles(0.0),
|
||||
T(0.0),
|
||||
m_temperature(0.0),
|
||||
Pres(0.0),
|
||||
tolmaj(0.0),
|
||||
tolmin(0.0),
|
||||
|
|
@ -133,7 +133,7 @@ namespace VCSnonideal {
|
|||
|
||||
m_tPhaseMoles_old.resize(nphase0, 0.0);
|
||||
m_tPhaseMoles_new.resize(nphase0, 0.0);
|
||||
DelTPhMoles.resize(nphase0, 0.0);
|
||||
m_deltaPhaseMoles.resize(nphase0, 0.0);
|
||||
TmpPhase.resize(nphase0, 0.0);
|
||||
TmpPhase2.resize(nphase0, 0.0);
|
||||
|
||||
|
|
@ -580,8 +580,8 @@ namespace VCSnonideal {
|
|||
*
|
||||
* T, Pres, copy over here
|
||||
*/
|
||||
if (pub->T > 0.0) T = pub->T;
|
||||
else T = 293.15;
|
||||
if (pub->T > 0.0) m_temperature = pub->T;
|
||||
else m_temperature = 293.15;
|
||||
if (pub->Pres > 0.0) Pres = pub->Pres;
|
||||
else Pres = 1.0;
|
||||
/*
|
||||
|
|
@ -772,7 +772,7 @@ namespace VCSnonideal {
|
|||
int retn = VCS_SUCCESS;
|
||||
bool status_change = false;
|
||||
|
||||
T = pub->T;
|
||||
m_temperature = pub->T;
|
||||
Pres = pub->Pres;
|
||||
m_VCS_UnitsFormat = pub->m_VCS_UnitsFormat;
|
||||
iest = pub->iest;
|
||||
|
|
@ -902,7 +902,8 @@ namespace VCSnonideal {
|
|||
int k1 = 0;
|
||||
|
||||
vcs_tmoles();
|
||||
Vol = vcs_VolTotal(T, Pres, VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
|
||||
Vol = vcs_VolTotal(m_temperature, Pres,
|
||||
VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
|
||||
|
||||
for (i = 0; i < m_numSpeciesTot; ++i) {
|
||||
/*
|
||||
|
|
@ -928,7 +929,7 @@ namespace VCSnonideal {
|
|||
pub->VolPM[i] = VolPM[k1];
|
||||
}
|
||||
|
||||
pub->T = T;
|
||||
pub->T = m_temperature;
|
||||
pub->Pres = Pres;
|
||||
pub->Vol = Vol;
|
||||
int kT = 0;
|
||||
|
|
|
|||
|
|
@ -668,10 +668,10 @@ public:
|
|||
/*!
|
||||
* Length number of phases.
|
||||
*/
|
||||
std::vector<double> DelTPhMoles;
|
||||
std::vector<double> m_deltaPhaseMoles;
|
||||
|
||||
//! Temperature (Kelvin)
|
||||
double T;
|
||||
double m_temperature;
|
||||
|
||||
//! Pressure (units are Pascals)
|
||||
double Pres;
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ namespace VCSnonideal {
|
|||
numSpecliquid,
|
||||
m_numSpeciesTot - (VPhaseList[0])->NVolSpecies - numSpecliquid);
|
||||
plogf(" PRESSURE%22.3f ATM\n TEMPERATURE%19.3f K\n",
|
||||
Pres, T);
|
||||
Pres, m_temperature);
|
||||
Vphase = VPhaseList[0];
|
||||
if (Vphase->NVolSpecies > 0) {
|
||||
plogf(" PHASE1 INERTS%17.3f\n", TPhInertMoles[0]);
|
||||
|
|
@ -250,7 +250,8 @@ namespace VCSnonideal {
|
|||
plogf(" FROM ESTIMATE Type\n\n");
|
||||
for (i = 0; i < m_numElemConstraints; ++i) {
|
||||
print_space(26); plogf("%-2.2s", (ElName[i]).c_str());
|
||||
plogf("%20.12E%20.12E %3d\n", m_elemAbundancesGoal[i], m_elemAbundances[i], m_elType[i]);
|
||||
plogf("%20.12E%20.12E %3d\n", m_elemAbundancesGoal[i], m_elemAbundances[i],
|
||||
m_elType[i]);
|
||||
}
|
||||
if (iest < 0) {
|
||||
plogf("\n MODIFIED LINEAR PROGRAMMING ESTIMATE OF EQUILIBRIUM\n");
|
||||
|
|
@ -279,7 +280,7 @@ namespace VCSnonideal {
|
|||
print_space(14);
|
||||
for (i = 0; i < m_numElemConstraints; ++i) plogf(" %-2.2s", ElName[i].c_str());
|
||||
plogf(" SI(I)\n");
|
||||
RT = vcs_nondimMult_TP(m_VCS_UnitsFormat, T);
|
||||
RT = vcs_nondimMult_TP(m_VCS_UnitsFormat, m_temperature);
|
||||
for (i = 0; i < m_numSpeciesTot; ++i) {
|
||||
plogf(" %-12s", SpName[i].c_str());
|
||||
for (j = 0; j < m_numElemConstraints; ++j) {
|
||||
|
|
@ -499,7 +500,7 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* Zero out the net change in moles of multispecies phases
|
||||
*/
|
||||
vcs_dzero(VCS_DATA_PTR(DelTPhMoles), NPhase);
|
||||
vcs_dzero(VCS_DATA_PTR(m_deltaPhaseMoles), NPhase);
|
||||
/* **************************************************************** */
|
||||
/* ***************** MAIN LOOP IN CALCULATION ******************** */
|
||||
/* **************************************************************** */
|
||||
|
|
@ -975,11 +976,11 @@ namespace VCSnonideal {
|
|||
|
||||
dnPhase_irxn = DnPhase[irxn];
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
DelTPhMoles[iph] += dx * dnPhase_irxn[iph];
|
||||
m_deltaPhaseMoles[iph] += dx * dnPhase_irxn[iph];
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_MODE
|
||||
checkDelta1(VCS_DATA_PTR(m_deltaMolNumSpecies), VCS_DATA_PTR(DelTPhMoles), kspec+1);
|
||||
checkDelta1(VCS_DATA_PTR(m_deltaMolNumSpecies), VCS_DATA_PTR(m_deltaPhaseMoles), kspec+1);
|
||||
#endif
|
||||
/*
|
||||
* Branch point for returning -
|
||||
|
|
@ -1036,7 +1037,7 @@ namespace VCSnonideal {
|
|||
* conservation.
|
||||
*/
|
||||
iph = PhaseID[k];
|
||||
DelTPhMoles[iph] -= m_deltaMolNumSpecies[k];
|
||||
m_deltaPhaseMoles[iph] -= m_deltaMolNumSpecies[k];
|
||||
m_deltaMolNumSpecies[k] = 0.0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1057,13 +1058,14 @@ namespace VCSnonideal {
|
|||
m_deltaMolNumSpecies[i] *= par;
|
||||
}
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
DelTPhMoles[iph] *= par;
|
||||
m_deltaPhaseMoles[iph] *= par;
|
||||
}
|
||||
} else {
|
||||
par = 1.0;
|
||||
}
|
||||
#ifdef DEBUG_MODE
|
||||
checkDelta1(VCS_DATA_PTR(m_deltaMolNumSpecies), VCS_DATA_PTR(DelTPhMoles), m_numSpeciesTot);
|
||||
checkDelta1(VCS_DATA_PTR(m_deltaMolNumSpecies),
|
||||
VCS_DATA_PTR(m_deltaPhaseMoles), m_numSpeciesTot);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -1074,7 +1076,8 @@ namespace VCSnonideal {
|
|||
*/
|
||||
for (kspec = 0; kspec < m_numSpeciesTot; ++kspec) {
|
||||
m_molNumSpecies_new[kspec] = m_molNumSpecies_old[kspec] + m_deltaMolNumSpecies[kspec];
|
||||
if (m_molNumSpecies_new[kspec] < 0.0 && (SpeciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE)) {
|
||||
if (m_molNumSpecies_new[kspec] < 0.0 && (SpeciesUnknownType[kspec]
|
||||
!= VCS_SPECIES_TYPE_INTERFACIALVOLTAGE)) {
|
||||
plogf("vcs_solve_TP: ERROR on step change wt[%d:%s]: %g < 0.0",
|
||||
kspec, SpName[kspec].c_str(), m_molNumSpecies_new[kspec]);
|
||||
plogendl();
|
||||
|
|
@ -1086,7 +1089,7 @@ namespace VCSnonideal {
|
|||
* Calculate the tentative total mole numbers for each phase
|
||||
*/
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
m_tPhaseMoles_new[iph] = m_tPhaseMoles_old[iph] + DelTPhMoles[iph];
|
||||
m_tPhaseMoles_new[iph] = m_tPhaseMoles_old[iph] + m_deltaPhaseMoles[iph];
|
||||
}
|
||||
/*
|
||||
* Calculate the new chemical potentials using the tentative
|
||||
|
|
@ -2421,9 +2424,9 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* Zero out the total moles counters for the phase
|
||||
*/
|
||||
m_tPhaseMoles_old[iph] = 0.0;
|
||||
m_tPhaseMoles_new[iph] = 0.0;
|
||||
DelTPhMoles[iph] = 0.0;
|
||||
m_tPhaseMoles_old[iph] = 0.0;
|
||||
m_tPhaseMoles_new[iph] = 0.0;
|
||||
m_deltaPhaseMoles[iph] = 0.0;
|
||||
|
||||
/*
|
||||
* Loop over all of the active species in the phase.
|
||||
|
|
@ -2750,7 +2753,7 @@ namespace VCSnonideal {
|
|||
m_molNumSpecies_new[kspec] = m_molNumSpecies_old[kspec] + al * m_deltaMolNumSpecies[kspec];
|
||||
}
|
||||
for (iph = 0; iph < NPhase; iph++) {
|
||||
m_tPhaseMoles_new[iph] = m_tPhaseMoles_old[iph] + al * DelTPhMoles[iph];
|
||||
m_tPhaseMoles_new[iph] = m_tPhaseMoles_old[iph] + al * m_deltaPhaseMoles[iph];
|
||||
}
|
||||
vcs_updateVP(1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue