From 1f8618f090bf2f486a4da4751781d1581fa43662 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 18 Apr 2008 20:56:59 +0000 Subject: [PATCH] Changed a variable name --- Cantera/src/equil/vcs_nondim.cpp | 4 ++-- Cantera/src/equil/vcs_prep.cpp | 2 +- Cantera/src/equil/vcs_rxnadj.cpp | 3 ++- Cantera/src/equil/vcs_solve.cpp | 2 +- Cantera/src/equil/vcs_solve.h | 7 ++++--- Cantera/src/equil/vcs_solve_TP.cpp | 20 ++++++++++---------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Cantera/src/equil/vcs_nondim.cpp b/Cantera/src/equil/vcs_nondim.cpp index d5ab86b4f..83863942f 100644 --- a/Cantera/src/equil/vcs_nondim.cpp +++ b/Cantera/src/equil/vcs_nondim.cpp @@ -106,7 +106,7 @@ void VCS_SOLVE::vcs_nondim_TP(void) { m_gibbsSpecies[i] *= tf; dg[i] *= tf; dgl[i] *= tf; - fel[i] *= tf; + m_feSpecies_old[i] *= tf; } Faraday_dim = vcs_nondim_Farad(m_VCS_UnitsFormat, T); @@ -146,7 +146,7 @@ void VCS_SOLVE::vcs_redim_TP(void) m_gibbsSpecies[i] *= tf; dg[i] *= tf; dgl[i] *= tf; - fel[i] *= tf; + m_feSpecies_old[i] *= tf; } Faraday_dim *= tf; } diff --git a/Cantera/src/equil/vcs_prep.cpp b/Cantera/src/equil/vcs_prep.cpp index d339f3202..b3f8e47c4 100644 --- a/Cantera/src/equil/vcs_prep.cpp +++ b/Cantera/src/equil/vcs_prep.cpp @@ -285,7 +285,7 @@ int VCS_SOLVE::vcs_prep(void) { * Initialize various arrays in the data to zero */ vcs_dzero(VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesTot); - vcs_vdzero(fel, m_numSpeciesTot); + vcs_vdzero(m_feSpecies_old, m_numSpeciesTot); vcs_vdzero(wt, m_numSpeciesTot); vcs_dzero(&(DnPhase[0][0]), m_numSpeciesTot*NPhase); vcs_izero(&(PhaseParticipation[0][0]), m_numSpeciesTot*NPhase); diff --git a/Cantera/src/equil/vcs_rxnadj.cpp b/Cantera/src/equil/vcs_rxnadj.cpp index 3038eccf9..ce769ea6c 100644 --- a/Cantera/src/equil/vcs_rxnadj.cpp +++ b/Cantera/src/equil/vcs_rxnadj.cpp @@ -418,7 +418,8 @@ double VCS_SOLVE::vcs_line_search(int irxn, double dx_orig) /* * Calculate the deltaG value at the dx = 0.0 point */ - double deltaGOrig = deltaG_Recalc_Rxn(irxn, molNumBase, acBase, VCS_DATA_PTR(fel)); + double deltaGOrig = deltaG_Recalc_Rxn(irxn, molNumBase, acBase, + VCS_DATA_PTR(m_feSpecies_old)); double forig = fabs(deltaGOrig) + 1.0E-15; if (deltaGOrig > 0.0) { if (dx_orig > 0.0) { diff --git a/Cantera/src/equil/vcs_solve.cpp b/Cantera/src/equil/vcs_solve.cpp index 7160c5e5a..afd6f09c2 100644 --- a/Cantera/src/equil/vcs_solve.cpp +++ b/Cantera/src/equil/vcs_solve.cpp @@ -127,7 +127,7 @@ namespace VCSnonideal { m_deltaGRxn_tmp.resize(nspecies0, 0.0); ds.resize(nspecies0, 0.0); - fel.resize(nspecies0, 0.0); + m_feSpecies_old.resize(nspecies0, 0.0); ga.resize(nelements, 0.0); gai.resize(nelements, 0.0); diff --git a/Cantera/src/equil/vcs_solve.h b/Cantera/src/equil/vcs_solve.h index de235b842..41e60329b 100644 --- a/Cantera/src/equil/vcs_solve.h +++ b/Cantera/src/equil/vcs_solve.h @@ -433,11 +433,12 @@ public: */ std::vector m_gibbsSpecies; - //! Old free energy vector from the previous iteration + //! Free energy vector from the start of the current iteration /*! - * fe[] is copied into fel[] + * The free energies are saved at the start of the current iteration. + * Length = number of species */ - std::vector fel; + std::vector m_feSpecies_old; //! Dimensionless trial free energy for all the species in the mechanism //! at the current T, P, and mole numbers. diff --git a/Cantera/src/equil/vcs_solve_TP.cpp b/Cantera/src/equil/vcs_solve_TP.cpp index 6a5e925a5..33e062fe3 100644 --- a/Cantera/src/equil/vcs_solve_TP.cpp +++ b/Cantera/src/equil/vcs_solve_TP.cpp @@ -442,7 +442,7 @@ namespace VCSnonideal { } } - vcs_dcopy(VCS_DATA_PTR(fel), VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesRdc); + vcs_dcopy(VCS_DATA_PTR(m_feSpecies_old), VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesRdc); vcs_dcopy(VCS_DATA_PTR(feTrial), VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesRdc); vcs_dcopy(VCS_DATA_PTR(ActCoeff0), VCS_DATA_PTR(ActCoeff), m_numSpeciesRdc); vcs_dcopy(VCS_DATA_PTR(dgl), VCS_DATA_PTR(dg), m_numRxnRdc); @@ -903,7 +903,7 @@ namespace VCSnonideal { * which have yet to be processed in the main loop */ for (ll = kspec+1; ll < m_numSpeciesRdc; ++ll) { - fel[ll] = m_gibbsSpecies[ll]; + m_feSpecies_old[ll] = m_gibbsSpecies[ll]; } for (ll = irxn+1; ll < m_numRxnRdc; ++ll) { dgl[ll] = dg[ll]; @@ -1117,7 +1117,7 @@ namespace VCSnonideal { /* *************************************************************** */ if (printDetails) { plogf(" --- Total Old Dimensionless Gibbs Free Energy = %20.13E\n", - vcs_Total_Gibbs(VCS_DATA_PTR(soln), VCS_DATA_PTR(fel), + vcs_Total_Gibbs(VCS_DATA_PTR(soln), VCS_DATA_PTR(m_feSpecies_old), VCS_DATA_PTR(TPhMoles))); plogf(" --- Total tentative Dimensionless Gibbs Free Energy = %20.13E", vcs_Total_Gibbs(VCS_DATA_PTR(wt), VCS_DATA_PTR(m_gibbsSpecies), @@ -1181,14 +1181,14 @@ namespace VCSnonideal { for (i = 0; i < m_numComponents; ++i) { plogf(" --- %-12.12s", SpName[i].c_str()); plogf(" "); plogf("%14.6E%14.6E%14.6E%14.6E\n", soln[i], - wt[i], fel[i], m_gibbsSpecies[i]); + wt[i], m_feSpecies_old[i], m_gibbsSpecies[i]); } for (i = m_numComponents; i < m_numSpeciesRdc; ++i) { l1 = i - m_numComponents; plogf(" --- %-12.12s", SpName[i].c_str()); plogf(" %2d %14.6E%14.6E%14.6E%14.6E%14.6E%14.6E\n", spStatus[l1], soln[i], - wt[i], fel[i], m_gibbsSpecies[i], + wt[i], m_feSpecies_old[i], m_gibbsSpecies[i], dgl[l1], dg[l1]); } for (kspec = m_numSpeciesRdc; kspec < m_numSpeciesTot; ++kspec) { @@ -1196,7 +1196,7 @@ namespace VCSnonideal { plogf(" --- %-12.12s", SpName[kspec].c_str()); plogf(" %2d %14.6E%14.6E%14.6E%14.6E%14.6E%14.6E\n", spStatus[l1], soln[kspec], - wt[kspec], fel[kspec], m_gibbsSpecies[kspec], + wt[kspec], m_feSpecies_old[kspec], m_gibbsSpecies[kspec], dgl[l1], dg[l1]); } plogf(" ---"); print_space(56); @@ -1213,7 +1213,7 @@ namespace VCSnonideal { } plogf(" "); vcs_print_line("-", 103); plogf(" --- Total Old Dimensionless Gibbs Free Energy = %20.13E\n", - vcs_Total_Gibbs(VCS_DATA_PTR(soln), VCS_DATA_PTR(fel), + vcs_Total_Gibbs(VCS_DATA_PTR(soln), VCS_DATA_PTR(m_feSpecies_old), VCS_DATA_PTR(TPhMoles))); plogf(" --- Total New Dimensionless Gibbs Free Energy = %20.13E", vcs_Total_Gibbs(VCS_DATA_PTR(wt), VCS_DATA_PTR(m_gibbsSpecies), @@ -1244,7 +1244,7 @@ namespace VCSnonideal { vcs_dcopy(VCS_DATA_PTR(TPhMoles), VCS_DATA_PTR(TPhMoles1), NPhase); vcs_dcopy(VCS_DATA_PTR(soln), VCS_DATA_PTR(wt), m_numSpeciesRdc); vcs_dcopy(VCS_DATA_PTR(dgl), VCS_DATA_PTR(dg), m_numRxnRdc); - vcs_dcopy(VCS_DATA_PTR(fel), VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesRdc); + vcs_dcopy(VCS_DATA_PTR(m_feSpecies_old), VCS_DATA_PTR(m_gibbsSpecies), m_numSpeciesRdc); vcs_updateVP(0); /* @@ -2261,7 +2261,7 @@ namespace VCSnonideal { dg[irxn] = 0.0; dgl[irxn] = 0.0; m_gibbsSpecies[kspec] = 0.0; - fel[kspec] = 0.0; + m_feSpecies_old[kspec] = 0.0; wt[kspec] = 0.0; /* * Rearrange the data if the current species isn't the last active @@ -4676,7 +4676,7 @@ namespace VCSnonideal { SWAP(m_spSize[k1], m_spSize[k2], t1); SWAP(m_gibbsSpecies[k1], m_gibbsSpecies[k2], t1); SWAP(ds[k1], ds[k2], t1); - SWAP(fel[k1], fel[k2], t1); + SWAP(m_feSpecies_old[k1], m_feSpecies_old[k2], t1); SWAP(feTrial[k1], feTrial[k2], t1); SWAP(SSPhase[k1], SSPhase[k2], j); SWAP(PhaseID[k1], PhaseID[k2], j);