20 #include "vcs_species_thermo.h"
31 int VCS_SOLVE::vcs_PS(VCS_PROB* vprob,
int iphase,
int printLvl,
double& feStable)
44 size_t nspecies0 = vprob->nspecies + 10;
45 size_t nelements0 = vprob->ne;
46 size_t nphase0 = vprob->NPhase;
48 vcs_initSizes(nspecies0, nelements0, nphase0);
51 if (ifunc < 0 || ifunc > 2) {
52 plogf(
"vcs: Unrecognized value of ifunc, %d: bailing!\n",
62 int retn = vcs_prob_specifyFully(vprob);
64 plogf(
"vcs_pub_to_priv returned a bad status, %d: bailing!\n",
73 retn = vcs_prep_oneTime(printLvl);
75 plogf(
"vcs_prep_oneTime returned a bad status, %d: bailing!\n",
85 retn = vcs_prob_specify(vprob);
87 plogf(
"vcs_prob_specify returned a bad status, %d: bailing!\n",
99 plogf(
"vcs_prep returned a bad status, %d: bailing!\n", retn);
105 if (!vcs_wellPosed(vprob)) {
106 plogf(
"vcs has determined the problem is not well posed: Bailing\n");
113 m_temperature = vprob->T;
114 m_pressurePA = vprob->PresPA;
119 vcs_evalSS_TP(printLvl, printLvl, m_temperature, m_pressurePA);
137 iStab = vcs_solve_phaseStability(iphase, ifunc, feStable, printLvl);
161 vcs_prob_update(vprob);
198 int VCS_SOLVE::vcs_solve_phaseStability(
const int iph,
const int ifunc,
202 double test = -1.0E-10;
203 bool usedZeroedSpecies;
204 std::vector<size_t> phasePopPhaseIDs(0);
207 std::vector<double> sm(m_numElemConstraints*m_numElemConstraints, 0.0);
208 std::vector<double> ss(m_numElemConstraints, 0.0);
209 std::vector<double> sa(m_numElemConstraints, 0.0);
211 std::vector<double> aw(m_numSpeciesTot, 0.0);
212 std::vector<double> wx(m_numElemConstraints, 0.0);
217 test, &usedZeroedSpecies);
218 vcs_evaluate_speciesType();
230 phasePopPhaseIDs.clear();
231 vcs_popPhaseID(phasePopPhaseIDs);
232 funcVal = vcs_phaseStabilityTest(iph);