From afd90fb20629bdf531f2d7890ae59b1acbe67d64 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 25 Apr 2008 00:28:38 +0000 Subject: [PATCH] change of variable names --- Cantera/src/equil/vcs_TP.cpp | 6 +++--- Cantera/src/equil/vcs_inest.cpp | 4 ++-- Cantera/src/equil/vcs_nondim.cpp | 6 +++--- Cantera/src/equil/vcs_prep.cpp | 4 ++-- Cantera/src/equil/vcs_report.cpp | 7 ++++--- Cantera/src/equil/vcs_solve.cpp | 15 +++++++------- Cantera/src/equil/vcs_solve.h | 4 ++-- Cantera/src/equil/vcs_solve_TP.cpp | 33 ++++++++++++++++-------------- 8 files changed, 42 insertions(+), 37 deletions(-) diff --git a/Cantera/src/equil/vcs_TP.cpp b/Cantera/src/equil/vcs_TP.cpp index b7ca363ba..b2202b8a1 100644 --- a/Cantera/src/equil/vcs_TP.cpp +++ b/Cantera/src/equil/vcs_TP.cpp @@ -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)); } diff --git a/Cantera/src/equil/vcs_inest.cpp b/Cantera/src/equil/vcs_inest.cpp index eeb78dfab..c33e8bd07 100644 --- a/Cantera/src/equil/vcs_inest.cpp +++ b/Cantera/src/equil/vcs_inest.cpp @@ -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]; } } } diff --git a/Cantera/src/equil/vcs_nondim.cpp b/Cantera/src/equil/vcs_nondim.cpp index feff08e42..fca355ce9 100644 --- a/Cantera/src/equil/vcs_nondim.cpp +++ b/Cantera/src/equil/vcs_nondim.cpp @@ -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, diff --git a/Cantera/src/equil/vcs_prep.cpp b/Cantera/src/equil/vcs_prep.cpp index 7c226ce78..34840af98 100644 --- a/Cantera/src/equil/vcs_prep.cpp +++ b/Cantera/src/equil/vcs_prep.cpp @@ -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. diff --git a/Cantera/src/equil/vcs_report.cpp b/Cantera/src/equil/vcs_report.cpp index fe07ebd62..3f865277e 100644 --- a/Cantera/src/equil/vcs_report.cpp +++ b/Cantera/src/equil/vcs_report.cpp @@ -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"); diff --git a/Cantera/src/equil/vcs_solve.cpp b/Cantera/src/equil/vcs_solve.cpp index 4541f7292..47c9842e5 100644 --- a/Cantera/src/equil/vcs_solve.cpp +++ b/Cantera/src/equil/vcs_solve.cpp @@ -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; diff --git a/Cantera/src/equil/vcs_solve.h b/Cantera/src/equil/vcs_solve.h index 3e867b639..d55f10014 100644 --- a/Cantera/src/equil/vcs_solve.h +++ b/Cantera/src/equil/vcs_solve.h @@ -668,10 +668,10 @@ public: /*! * Length number of phases. */ - std::vector DelTPhMoles; + std::vector m_deltaPhaseMoles; //! Temperature (Kelvin) - double T; + double m_temperature; //! Pressure (units are Pascals) double Pres; diff --git a/Cantera/src/equil/vcs_solve_TP.cpp b/Cantera/src/equil/vcs_solve_TP.cpp index 33c5b812e..bf412b4f3 100644 --- a/Cantera/src/equil/vcs_solve_TP.cpp +++ b/Cantera/src/equil/vcs_solve_TP.cpp @@ -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);