From 431eb16260f2f4ce337f3a60e70b7eb795e2ce75 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 16 May 2008 22:00:16 +0000 Subject: [PATCH] Variable name changing only --- Cantera/src/equil/vcs_Gibbs.cpp | 4 +- Cantera/src/equil/vcs_MultiPhaseEquil.cpp | 4 +- Cantera/src/equil/vcs_TP.cpp | 2 +- Cantera/src/equil/vcs_elem_rearrange.cpp | 4 +- Cantera/src/equil/vcs_inest.cpp | 4 +- Cantera/src/equil/vcs_prep.cpp | 8 +-- Cantera/src/equil/vcs_rearrange.cpp | 2 +- Cantera/src/equil/vcs_report.cpp | 4 +- Cantera/src/equil/vcs_rxnadj.cpp | 4 +- Cantera/src/equil/vcs_solve.cpp | 40 +++++++-------- Cantera/src/equil/vcs_solve.h | 35 +++++++++---- Cantera/src/equil/vcs_solve_TP.cpp | 62 +++++++++++------------ Cantera/src/equil/vcs_species_thermo.cpp | 2 +- 13 files changed, 94 insertions(+), 81 deletions(-) diff --git a/Cantera/src/equil/vcs_Gibbs.cpp b/Cantera/src/equil/vcs_Gibbs.cpp index 27b514e62..74695ae25 100644 --- a/Cantera/src/equil/vcs_Gibbs.cpp +++ b/Cantera/src/equil/vcs_Gibbs.cpp @@ -40,7 +40,7 @@ namespace VCSnonideal { double g = 0.0; for (int iph = 0; iph < m_numPhases; iph++) { - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; if ((TPhInertMoles[iph] > 0.0) && (tPhMoles[iph] > 0.0)) { g += TPhInertMoles[iph] * log(TPhInertMoles[iph] / tPhMoles[iph]); @@ -80,7 +80,7 @@ namespace VCSnonideal { if (TPhInertMoles[iphase] > 0.0) { phaseMols += TPhInertMoles[iphase]; g += TPhInertMoles[iphase] * log(TPhInertMoles[iphase] / phaseMols); - vcs_VolPhase *Vphase = VPhaseList[iphase]; + vcs_VolPhase *Vphase = m_VolPhaseList[iphase]; if (Vphase->GasPhase == iphase) { g += TPhInertMoles[iphase] * log(m_pressurePA/1.01325E5); } diff --git a/Cantera/src/equil/vcs_MultiPhaseEquil.cpp b/Cantera/src/equil/vcs_MultiPhaseEquil.cpp index 57702ff64..e910afcc0 100644 --- a/Cantera/src/equil/vcs_MultiPhaseEquil.cpp +++ b/Cantera/src/equil/vcs_MultiPhaseEquil.cpp @@ -1586,7 +1586,7 @@ namespace VCSnonideal { int nc = numComponents(); // scMatrix [nrxn][ncomp] const DoubleStarStar &scMatrix = m_vsolvePtr->m_stoichCoeffRxnMatrix; - const std::vector indSpecies = m_vsolvePtr->m_speciesIndexVector; + const std::vector indSpecies = m_vsolvePtr->m_speciesMapIndex; if ((int) rxn > nsp - nc) return; int j = indSpecies[rxn + nc]; nu[j] = 1.0; @@ -1616,7 +1616,7 @@ namespace VCSnonideal { int vcs_MultiPhaseEquil::component(int m) const { int nc = numComponents(); - if (m < nc) return m_vsolvePtr->m_speciesIndexVector[m]; + if (m < nc) return m_vsolvePtr->m_speciesMapIndex[m]; else return -1; } diff --git a/Cantera/src/equil/vcs_TP.cpp b/Cantera/src/equil/vcs_TP.cpp index 5162d37d1..8c7af97a9 100644 --- a/Cantera/src/equil/vcs_TP.cpp +++ b/Cantera/src/equil/vcs_TP.cpp @@ -153,7 +153,7 @@ namespace VCSnonideal { //} for (int iph = 0; iph < m_numPhases; iph++) { - vcs_VolPhase* vph = VPhaseList[iph]; + vcs_VolPhase* vph = m_VolPhaseList[iph]; vph->setState_TP(m_temperature, m_pressurePA); vph->sendToVCSGStar(VCS_DATA_PTR(m_SSfeSpecies)); } diff --git a/Cantera/src/equil/vcs_elem_rearrange.cpp b/Cantera/src/equil/vcs_elem_rearrange.cpp index 38c8c67e9..d51d415c5 100644 --- a/Cantera/src/equil/vcs_elem_rearrange.cpp +++ b/Cantera/src/equil/vcs_elem_rearrange.cpp @@ -236,7 +236,7 @@ namespace VCSnonideal { * to reflect the switch in the element positions. */ for (int iph = 0; iph < m_numPhases; iph++) { - volPhase = VPhaseList[iph]; + volPhase = m_VolPhaseList[iph]; for (int e = 0; e < volPhase->nElemConstraints; e++) { if (volPhase->ElGlobalIndex[e] == ipos) { volPhase->ElGlobalIndex[e] = jpos; @@ -248,7 +248,7 @@ namespace VCSnonideal { } vcsUtil_dsw(VCS_DATA_PTR(m_elemAbundancesGoal), ipos, jpos); vcsUtil_dsw(VCS_DATA_PTR(m_elemAbundances), ipos, jpos); - vcsUtil_isw(VCS_DATA_PTR(IndEl), ipos, jpos); + vcsUtil_isw(VCS_DATA_PTR(m_elementMapIndex), ipos, jpos); vcsUtil_isw(VCS_DATA_PTR(m_elType), ipos, jpos); vcsUtil_isw(VCS_DATA_PTR(m_elementActive), ipos, jpos); for (j = 0; j < m_numSpeciesTot; ++j) { diff --git a/Cantera/src/equil/vcs_inest.cpp b/Cantera/src/equil/vcs_inest.cpp index 87141ac96..3baf70ecd 100644 --- a/Cantera/src/equil/vcs_inest.cpp +++ b/Cantera/src/equil/vcs_inest.cpp @@ -135,7 +135,7 @@ namespace VCSnonideal { vcs_dzero(VCS_DATA_PTR(m_deltaMolNumSpecies), nspecies); for (kspec = 0; kspec < nspecies; ++kspec) { iph = m_phaseID[kspec]; - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { if (molNum[kspec] <= 0.0) { /* @@ -184,7 +184,7 @@ namespace VCSnonideal { } TMolesMultiphase = 0.0; for (iph = 0; iph < m_numPhases; iph++) { - if (! VPhaseList[iph]->SingleSpecies) { + if (! m_VolPhaseList[iph]->SingleSpecies) { TMolesMultiphase += m_tPhaseMoles_new[iph]; } } diff --git a/Cantera/src/equil/vcs_prep.cpp b/Cantera/src/equil/vcs_prep.cpp index e5eaae50f..5b637a5dc 100644 --- a/Cantera/src/equil/vcs_prep.cpp +++ b/Cantera/src/equil/vcs_prep.cpp @@ -51,7 +51,7 @@ namespace VCSnonideal { * Treat that species as a single-species phase */ for (iph = 0; iph < m_numPhases; iph++) { - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; Vphase->SingleSpecies = false; if (TPhInertMoles[iph] > 0.0) { Vphase->Existence = 2; @@ -72,7 +72,7 @@ namespace VCSnonideal { */ for (kspec = 0; kspec < m_numSpeciesTot; kspec++) { iph = m_phaseID[kspec]; - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; if (Vphase->SingleSpecies) m_SSPhase[kspec] = TRUE; else m_SSPhase[kspec] = FALSE; } @@ -142,8 +142,8 @@ namespace VCSnonideal { for (kspec = 0; kspec < m_numSpeciesTot; ++kspec) { int pID = m_phaseID[kspec]; - int spPhIndex = indPhSp[kspec]; - vcs_VolPhase *vPhase = VPhaseList[pID]; + int spPhIndex = m_speciesLocalPhaseIndex[kspec]; + vcs_VolPhase *vPhase = m_VolPhaseList[pID]; vcs_SpeciesProperties *spProp = vPhase->ListSpeciesPtr[spPhIndex]; double sz = 0.0; int eSize = spProp->FormulaMatrixCol.size(); diff --git a/Cantera/src/equil/vcs_rearrange.cpp b/Cantera/src/equil/vcs_rearrange.cpp index e78575532..c49a4a85a 100644 --- a/Cantera/src/equil/vcs_rearrange.cpp +++ b/Cantera/src/equil/vcs_rearrange.cpp @@ -36,7 +36,7 @@ namespace VCSnonideal { * Call it k1 and continue. */ for (j = 0; j < m_numSpeciesTot; ++j) { - l = m_speciesIndexVector[j]; + l = m_speciesMapIndex[j]; k1 = j; if (l == i) break; } diff --git a/Cantera/src/equil/vcs_report.cpp b/Cantera/src/equil/vcs_report.cpp index ba592dace..189e1acfe 100644 --- a/Cantera/src/equil/vcs_report.cpp +++ b/Cantera/src/equil/vcs_report.cpp @@ -152,7 +152,7 @@ namespace VCSnonideal { plogf(" Inert Gas Species "); } else { plogf(" Inert Species in phase %16s ", - (VPhaseList[i])->PhaseName.c_str()); + (m_VolPhaseList[i])->PhaseName.c_str()); } plogf("%14.7E %14.7E %12.4E\n", TPhInertMoles[i], TPhInertMoles[i] / m_tPhaseMoles_old[i], 0.0); @@ -244,7 +244,7 @@ namespace VCSnonideal { print_line("-", m_numElemConstraints*10 + 58); for (int iphase = 0; iphase < m_numPhases; iphase++) { plogf(" %3d ", iphase); - vcs_VolPhase *VPhase = VPhaseList[iphase]; + vcs_VolPhase *VPhase = m_VolPhaseList[iphase]; plogf("%-12.12s |",VPhase->PhaseName.c_str()); plogf("%10.3e |", m_tPhaseMoles_old[iphase]); totalMoles += m_tPhaseMoles_old[iphase]; diff --git a/Cantera/src/equil/vcs_rxnadj.cpp b/Cantera/src/equil/vcs_rxnadj.cpp index 1f1c51ead..43247dfe5 100644 --- a/Cantera/src/equil/vcs_rxnadj.cpp +++ b/Cantera/src/equil/vcs_rxnadj.cpp @@ -139,7 +139,7 @@ namespace VCSnonideal { } } for (j = 0; j < m_numPhases; j++) { - if (! (VPhaseList[j])->SingleSpecies) { + if (! (m_VolPhaseList[j])->SingleSpecies) { if (m_tPhaseMoles_old[j] > 0.0) s -= SQUARE(dnPhase_irxn[j]) / m_tPhaseMoles_old[j]; } @@ -319,7 +319,7 @@ namespace VCSnonideal { * Loop over all of the phases in the problem */ for (int iphase = 0; iphase < m_numPhases; iphase++) { - vcs_VolPhase *Vphase = VPhaseList[iphase]; + vcs_VolPhase *Vphase = m_VolPhaseList[iphase]; /* * We don't need to call single species phases; */ diff --git a/Cantera/src/equil/vcs_solve.cpp b/Cantera/src/equil/vcs_solve.cpp index da617939b..2cd89e624 100644 --- a/Cantera/src/equil/vcs_solve.cpp +++ b/Cantera/src/equil/vcs_solve.cpp @@ -145,13 +145,13 @@ namespace VCSnonideal { * ind[] is an index variable that keep track of solution vector * rotations. */ - m_speciesIndexVector.resize(nspecies0, 0); - indPhSp.resize(nspecies0, 0); + m_speciesMapIndex.resize(nspecies0, 0); + m_speciesLocalPhaseIndex.resize(nspecies0, 0); /* * IndEl[] is an index variable that keep track of element vector * rotations. */ - IndEl.resize(nelements, 0); + m_elementMapIndex.resize(nelements, 0); /* * ir[] is an index vector that keeps track of the irxn to species @@ -191,9 +191,9 @@ namespace VCSnonideal { /* * Malloc Phase Info */ - VPhaseList.resize(nphase0, 0); + m_VolPhaseList.resize(nphase0, 0); for (iph = 0; iph < nphase0; iph++) { - VPhaseList[iph] = new vcs_VolPhase(); + m_VolPhaseList[iph] = new vcs_VolPhase(); } /* @@ -236,8 +236,8 @@ namespace VCSnonideal { int nspecies = m_numSpeciesTot; for (j = 0; j < m_numPhases; j++) { - delete VPhaseList[j]; - VPhaseList[j] = 0; + delete m_VolPhaseList[j]; + m_VolPhaseList[j] = 0; } for (j = 0; j < nspecies; j++) { @@ -610,14 +610,14 @@ namespace VCSnonideal { * of solution vector rotations. */ for (i = 0; i < nspecies; i++) { - m_speciesIndexVector[i] = i; + m_speciesMapIndex[i] = i; } /* * IndEl[] is an index variable that keep track of element vector * rotations. */ - for (i = 0; i < nelements; i++) IndEl[i] = i; + for (i = 0; i < nelements; i++) m_elementMapIndex[i] = i; /* * ir[] -> will be done below once nc is defined. * ic[] -> Define all species to be major species, initially. @@ -639,7 +639,7 @@ namespace VCSnonideal { return VCS_PUB_BAD; } m_phaseID[kspec] = pub->PhaseID[kspec]; - indPhSp[kspec] = numPhSp[iph]; + m_speciesLocalPhaseIndex[kspec] = numPhSp[iph]; numPhSp[iph]++; } for (iph = 0; iph < nph; iph++) { @@ -654,7 +654,7 @@ namespace VCSnonideal { if (m_numPhases == 1) { for (kspec = 0; kspec < nspecies; kspec++) { m_phaseID[kspec] = 0; - indPhSp[kspec] = kspec; + m_speciesLocalPhaseIndex[kspec] = kspec; } } else { plogf("%sSpecies to Phase Mapping, PhaseID, is not defined\n", ser); @@ -695,13 +695,13 @@ namespace VCSnonideal { * Use the object's assignment operator */ for (iph = 0; iph < nph; iph++) { - *(VPhaseList[iph]) = *(pub->VPhaseList[iph]); + *(m_VolPhaseList[iph]) = *(pub->VPhaseList[iph]); /* * Fix up the species thermo pointer in the vcs_SpeciesThermo object * It should point to the species thermo pointer in the private * data space. */ - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; for (int k = 0; k < Vphase->NVolSpecies; k++) { vcs_SpeciesProperties *sProp = Vphase->ListSpeciesPtr[k]; int kT = Vphase->IndSpecies[k]; @@ -713,7 +713,7 @@ namespace VCSnonideal { * Specify the Activity Convention information */ for (iph = 0; iph < nph; iph++) { - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; PhaseActConvention[iph] = Vphase->ActivityConvention; if (Vphase->ActivityConvention != 0) { /* @@ -789,7 +789,7 @@ namespace VCSnonideal { m_tolmin2 = 0.01 * m_tolmin; for (kspec = 0; kspec < m_numSpeciesTot; ++kspec) { - k = m_speciesIndexVector[kspec]; + k = m_speciesMapIndex[kspec]; m_molNumSpecies_old[kspec] = pub->w[k]; m_molNumSpecies_new[kspec] = pub->mf[k]; m_feSpecies_curr[kspec] = pub->m_gibbsSpecies[k]; @@ -799,7 +799,7 @@ namespace VCSnonideal { * Transfer the element abundance goals to the solve object */ for (i = 0; i < m_numElemConstraints; i++) { - j = IndEl[i]; + j = m_elementMapIndex[i]; m_elemAbundancesGoal[i] = pub->gai[j]; } @@ -823,7 +823,7 @@ namespace VCSnonideal { */ for (iph = 0; iph < m_numPhases; iph++) { - vcs_VolPhase *vPhase = VPhaseList[iph]; + vcs_VolPhase *vPhase = m_VolPhaseList[iph]; vcs_VolPhase *pub_phase_ptr = pub->VPhaseList[iph]; if (vPhase->VP_ID != pub_phase_ptr->VP_ID) { @@ -915,7 +915,7 @@ namespace VCSnonideal { * Call it K1 and continue. */ for (j = 0; j < m_numSpeciesTot; ++j) { - l = m_speciesIndexVector[j]; + l = m_speciesMapIndex[j]; k1 = j; if (l == i) break; } @@ -939,7 +939,7 @@ namespace VCSnonideal { int kT = 0; for (int iph = 0; iph < pub->NPhase; iph++) { vcs_VolPhase *pubPhase = pub->VPhaseList[iph]; - vcs_VolPhase *vPhase = VPhaseList[iph]; + vcs_VolPhase *vPhase = m_VolPhaseList[iph]; pubPhase->Existence = vPhase->Existence; // Note pubPhase is not the same as vPhase, since they contain // different indexing into the solution vector. @@ -1045,7 +1045,7 @@ double VCS_SOLVE::vcs_VolTotal(double tkelvin, double pres, double w[], { double volTot = 0.0; for (int iphase = 0; iphase < m_numPhases; iphase++) { - vcs_VolPhase *Vphase = VPhaseList[iphase]; + vcs_VolPhase *Vphase = m_VolPhaseList[iphase]; Vphase->setState_TP(tkelvin, pres); Vphase->setMolesFromVCS(w); double volp = Vphase->VolPM_calc(); diff --git a/Cantera/src/equil/vcs_solve.h b/Cantera/src/equil/vcs_solve.h index b98013494..66c60f1ec 100644 --- a/Cantera/src/equil/vcs_solve.h +++ b/Cantera/src/equil/vcs_solve.h @@ -1127,32 +1127,45 @@ public: //! Index vector that keeps track of the species vector rearrangement /*! - * At the end of each run, the species vector and associated data gets put back + * At the end of each run, the species vector and associated data gets put back * in the original order. * * Example * - * k = m_speciesIndexVector[kspec] + * k = m_speciesMapIndex[kspec] * * kspec = current order in the vcs_solve object * k = original order in the vcs_prob object and in the MultiPhase object */ - std::vector m_speciesIndexVector; + std::vector m_speciesMapIndex; - //! Index that keeps track of the index of the species according - //! to the phase + //! Index that keeps track of the index of the species within the local + //! phase /*! - * indPhSp[k] = Index that keeps track of the index of the species according - * to the phase + * This returns the local index of the species within the phase. It's argument + * is the global species index within the VCS problem. + * + * k = m_speciesLocalPhaseIndex[kspec] + * + * k varies between 0 and the nSpecies in the phase + * * Length = number of species */ - std::vector indPhSp; + std::vector m_speciesLocalPhaseIndex; //! Index vector that keeps track of the rearrangement of the elements /*! - * IndEl[j] + * At the end of each run, the element vector and associated data gets put back + * in the original order. + * + * Example + * + * e = m_elementMapIndex[eNum] + * + * eNum = current order in the vcs_solve object + * e = original order in the vcs_prob object and in the MultiPhase object */ - std::vector IndEl; + std::vector m_elementMapIndex; //! Mapping between the species index for noncomponent species and the //! full species index. @@ -1237,7 +1250,7 @@ public: /*! * Length = number of phases */ - std::vector VPhaseList; + std::vector m_VolPhaseList; //! String containing the title of the run std::string m_title; diff --git a/Cantera/src/equil/vcs_solve_TP.cpp b/Cantera/src/equil/vcs_solve_TP.cpp index da4b79a4b..35e1d4a9f 100644 --- a/Cantera/src/equil/vcs_solve_TP.cpp +++ b/Cantera/src/equil/vcs_solve_TP.cpp @@ -170,9 +170,9 @@ namespace VCSnonideal { /* **** Printout the initial conditions for problem ****** */ /* ******************************************************* */ if (m_numPhases > 1) { - if (! VPhaseList[1]->SingleSpecies) { + if (! m_VolPhaseList[1]->SingleSpecies) { liqphase = TRUE; - numSpecliquid = VPhaseList[1]->NVolSpecies; + numSpecliquid = m_VolPhaseList[1]->NVolSpecies; } } if (print_lvl != 0) { @@ -180,17 +180,17 @@ namespace VCSnonideal { plogf("%s\n", m_title.c_str()); plogf("\n\n%5d SPECIES%8d ELEMENTS", m_numSpeciesTot, m_numElemConstraints); plogf("%16d COMPONENTS\n%5d PHASE1 SPECIES", m_numComponents, - ((VPhaseList[0])->NVolSpecies)); + ((m_VolPhaseList[0])->NVolSpecies)); plogf("%10d PHASE2 SPECIES%8d SINGLE SPECIES PHASES\n\n", numSpecliquid, - m_numSpeciesTot - (VPhaseList[0])->NVolSpecies - numSpecliquid); + m_numSpeciesTot - (m_VolPhaseList[0])->NVolSpecies - numSpecliquid); //string punits = "atm"; //if (m_VCS_UnitsFormat == 3) { // punits = "Pa "; //} plogf(" PRESSURE%22.8g %3s\n", m_pressurePA, "Pa "); plogf(" TEMPERATURE%19.3f K\n", m_temperature); - Vphase = VPhaseList[0]; + Vphase = m_VolPhaseList[0]; if (Vphase->NVolSpecies > 0) { plogf(" PHASE1 INERTS%17.3f\n", TPhInertMoles[0]); } @@ -503,7 +503,7 @@ namespace VCSnonideal { kspec = m_indexRxnToSpecies[irxn]; sc_irxn = m_stoichCoeffRxnMatrix[irxn]; iph = m_phaseID[kspec]; - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; #ifdef DEBUG_MODE ANOTE[0] = '\0'; #endif @@ -833,7 +833,7 @@ namespace VCSnonideal { * Set the existence flag */ iph = m_phaseID[kspec]; - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; Vphase->Existence = 0; #ifdef DEBUG_MODE sprintf(ANOTE, "zero SS phase: moles went neg"); @@ -1128,7 +1128,7 @@ namespace VCSnonideal { l2normdg(VCS_DATA_PTR(m_deltaGRxn_old)), l2normdg(VCS_DATA_PTR(m_deltaGRxn_new))); plogf(" Total kmoles of gas = %15.7E\n", m_tPhaseMoles_old[0]); - if ((m_numPhases > 1) && (! (VPhaseList[1])->SingleSpecies)) { + if ((m_numPhases > 1) && (! (m_VolPhaseList[1])->SingleSpecies)) { plogf(" Total kmoles of liquid = %15.7E\n", m_tPhaseMoles_old[1]); } else { plogf(" Total kmoles of liquid = %15.7E\n", 0.0); @@ -1184,7 +1184,7 @@ namespace VCSnonideal { plogf(" --- Phase_Name KMoles(after update)\n"); plogf(" --- "); vcs_print_line("-", 50); for (iph = 0; iph < m_numPhases; iph++) { - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; plogf(" --- %18s = %15.7E\n", Vphase->PhaseName.c_str(), m_tPhaseMoles_new[iph]); } plogf(" "); vcs_print_line("-", 103); @@ -1247,7 +1247,7 @@ namespace VCSnonideal { */ justDeletedMultiPhase = FALSE; for (iph = 0; iph < m_numPhases; iph++) { - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; if (!(Vphase->SingleSpecies)) { if (m_tPhaseMoles_old[iph] != 0.0 && m_tPhaseMoles_old[iph]/m_totalMolNum <= VCS_DELETE_PHASE_CUTOFF) { @@ -1905,8 +1905,8 @@ namespace VCSnonideal { * This contains the mole fraction that would be true if * the phase just pops into existence. */ - i = indPhSp[kspec]; - Vphase = VPhaseList[iph]; + i = m_speciesLocalPhaseIndex[kspec]; + Vphase = m_VolPhaseList[iph]; m_molNumSpecies_new[kspec] = Vphase->molefraction(i); } } @@ -1992,7 +1992,7 @@ namespace VCSnonideal { double *ds_kspec = VCS_DATA_PTR(m_deltaMolNumSpecies) + kspec; double dg_irxn = m_deltaGRxn_new[irxn]; int iphase = m_phaseID[kspec]; - vcs_VolPhase *Vphase = VPhaseList[iphase]; + vcs_VolPhase *Vphase = m_VolPhaseList[iphase]; *do_delete = FALSE; if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) { if (w_kspec <= 0.0) { @@ -2217,7 +2217,7 @@ namespace VCSnonideal { { int klast = m_numSpeciesRdc - 1; int iph = m_phaseID[kspec]; - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; int irxn = kspec - m_numComponents; /* This is the noncomponent rxn index */ /* * Zero the concentration of the species. @@ -2326,7 +2326,7 @@ namespace VCSnonideal { --(m_numRxnMinorZeroed); } int iph = m_phaseID[kspec]; - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; Vphase->setMolesFromVCSCheck(VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(m_tPhaseMoles_old)); /* * We may have popped a multispecies phase back @@ -2382,7 +2382,7 @@ namespace VCSnonideal { void VCS_SOLVE::delete_multiphase(int iph) { int kspec, j, irxn; double dx; - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; /* * set the phase existence flag to dead */ @@ -2853,7 +2853,7 @@ namespace VCSnonideal { sprintf(ANOTE, "MultSpec: phase come alive DG = %11.3E", m_deltaGRxn_new[irxn]); #endif - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; int numSpPhase = Vphase->NVolSpecies; m_deltaMolNumSpecies[kspec] = m_totalMolNum * 10.0 * VCS_DELETE_PHASE_CUTOFF / numSpPhase; } @@ -2918,7 +2918,7 @@ namespace VCSnonideal { } } for (j = 0; j < m_numPhases; j++) { - Vphase = VPhaseList[j]; + Vphase = m_VolPhaseList[j]; if (! Vphase->SingleSpecies) { if (m_tPhaseMoles_old[j] > 0.0) s -= SQUARE(dnPhase_irxn[j]) / m_tPhaseMoles_old[j]; @@ -3034,7 +3034,7 @@ namespace VCSnonideal { } m_molNumSpecies_old[k] = 0.0; iph = m_phaseID[k]; - Vphase = VPhaseList[iph]; + Vphase = m_VolPhaseList[iph]; Vphase->Existence = 0; m_tPhaseMoles_old[iph] = 0.0; #ifdef DEBUG_MODE @@ -3229,7 +3229,7 @@ namespace VCSnonideal { int k; for (iph = 0; iph < m_numPhases; iph++) { lneed = FALSE; - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; if (! Vphase->SingleSpecies) { double sum = 0.0; for (k = 0; k < Vphase->NVolSpecies; k++) { @@ -4037,7 +4037,7 @@ namespace VCSnonideal { * *************************************************************************/ { - vcs_VolPhase *Vphase = VPhaseList[iph]; + vcs_VolPhase *Vphase = m_VolPhaseList[iph]; int nkk = Vphase->NVolSpecies; int k, kspec; @@ -4316,7 +4316,7 @@ namespace VCSnonideal { */ for (iphase = 0; iphase < m_numPhases; iphase++) { if (!CurrPhAC[iphase]) { - Vphase = VPhaseList[iphase]; + Vphase = m_VolPhaseList[iphase]; if (!Vphase->SingleSpecies) { Vphase->setMolesFromVCS(z); Vphase->sendToVCSActCoeff(VCS_DATA_PTR(actCoeff_ptr)); @@ -4546,7 +4546,7 @@ namespace VCSnonideal { sum = 0.0; for (i = 0; i < m_numPhases; i++) { sum += m_tPhaseMoles_old[i]; - Vphase = VPhaseList[i]; + Vphase = m_VolPhaseList[i]; // Took out because we aren't updating mole fractions in Vphase // Vphase->TMoles = m_tPhaseMoles_old[i]; if (m_tPhaseMoles_old[i] == 0.0) { @@ -4574,7 +4574,7 @@ namespace VCSnonideal { void VCS_SOLVE::vcs_updateVP(const int vcsState) { vcs_VolPhase *Vphase; for (int i = 0; i < m_numPhases; i++) { - Vphase = VPhaseList[i]; + Vphase = m_VolPhaseList[i]; if (vcsState == VCS_STATECALC_OLD) { Vphase->setMolesFromVCSCheck(VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(m_tPhaseMoles_old), i); @@ -4646,11 +4646,11 @@ namespace VCSnonideal { /* * Handle the index pointer in the phase structures first */ - pv1 = VPhaseList[m_phaseID[k1]]; - pv2 = VPhaseList[m_phaseID[k2]]; + pv1 = m_VolPhaseList[m_phaseID[k1]]; + pv2 = m_VolPhaseList[m_phaseID[k2]]; - kp1 = indPhSp[k1]; - kp2 = indPhSp[k2]; + kp1 = m_speciesLocalPhaseIndex[k1]; + kp2 = m_speciesLocalPhaseIndex[k2]; #ifdef DEBUG_MODE if (pv1->IndSpecies[kp1] != k1) { plogf("Indexing error in program\n"); @@ -4676,8 +4676,8 @@ namespace VCSnonideal { SWAP(m_feSpecies_new[k1], m_feSpecies_new[k2], t1); SWAP(m_SSPhase[k1], m_SSPhase[k2], j); SWAP(m_phaseID[k1], m_phaseID[k2], j); - SWAP(m_speciesIndexVector[k1], m_speciesIndexVector[k2], j); - SWAP(indPhSp[k1], indPhSp[k2], j); + SWAP(m_speciesMapIndex[k1], m_speciesMapIndex[k2], j); + SWAP(m_speciesLocalPhaseIndex[k1], m_speciesLocalPhaseIndex[k2], j); SWAP(SpecActConvention[k1], SpecActConvention[k2], j); SWAP(SpecLnMnaught[k1], SpecLnMnaught[k2], t1); SWAP(m_actCoeffSpecies_new[k1], m_actCoeffSpecies_new[k2], t1); @@ -4757,7 +4757,7 @@ namespace VCSnonideal { double *dtmp_ptr; int irxnl = m_numRxnRdc; if (doDeleted) irxnl = m_numRxnTot; - vcs_VolPhase *vPhase = VPhaseList[iphase]; + vcs_VolPhase *vPhase = m_VolPhaseList[iphase]; #ifdef DEBUG_MODE if (vcs_debug_print_lvl >= 2) { diff --git a/Cantera/src/equil/vcs_species_thermo.cpp b/Cantera/src/equil/vcs_species_thermo.cpp index b88751a8c..653df81f7 100644 --- a/Cantera/src/equil/vcs_species_thermo.cpp +++ b/Cantera/src/equil/vcs_species_thermo.cpp @@ -427,7 +427,7 @@ double VCS_SOLVE::vcs_Gxs_calc(int iphase) int kspec; double Gxs = 0.0, ac; double totmol = m_tPhaseMoles_old[iphase]; - vcs_VolPhase *Vphase = VPhaseList[iphase]; + vcs_VolPhase *Vphase = m_VolPhaseList[iphase]; VCS_SPECIES_THERMO *ts_ptr; if (totmol != 0.0 && Vphase->Activity_Coeff_Model != VCS_AC_CONSTANT) {