24 static char pprefix[20] =
" --- vcs_inest: ";
40 double*
const ss,
double test)
42 size_t lt, ikl, kspec, iph, irxn;
51 double TMolesMultiphase;
66 vcs_setMolesLinProg();
70 std::vector<double> cc(nspecies, 0.0);
81 for (kspec = 0; kspec < nspecies; ++kspec) {
97 plogf(
"%s Mole Numbers returned from linear programming (vcs_inest initial guess):\n",
99 plogf(
"%s SPECIES MOLE_NUMBER -SS_ChemPotential\n", pprefix);
100 for (kspec = 0; kspec < nspecies; ++kspec) {
101 plogf(
"%s ", pprefix);
105 plogf(
"%s Element Abundance Agreement returned from linear "
106 "programming (vcs_inest initial guess):",
109 plogf(
"%s Element Goal Actual\n", pprefix);
114 for (kspec = 0; kspec < nspecies; ++kspec) {
117 plogf(
"%s ", pprefix);
133 for (kspec = 0; kspec < nspecies; ++kspec) {
153 (void)
vcs_basopt(
false, aw, sa, sm, ss, test, &conv);
174 TMolesMultiphase = 0.0;
202 for (kspec = 0; kspec < nspecies; ++kspec) {
203 plogf(
"%s", pprefix);
205 if (kspec < m_numComponents)
209 plogf(
"fe* = %15.5g ff = %15.5g dg* = %15.5g\n",
222 for (irxn = 0; irxn < nrxn; ++irxn) {
261 for (kspec = 0; kspec < nspecies; ++kspec) {
263 plogf(
"%sdirection (", pprefix);
270 plogf(
" (ssPhase doesn't exist -> stability not checked)");
290 if (par <= 1.0 && par > 0.0) {
307 for (kspec = m_numComponents; kspec < nspecies; ++kspec) {
327 for (kspec = 0, s = 0.0; kspec < nspecies; ++kspec) {
352 xl = (1.0 - s / (s1 - s)) * 0.5;
368 par = par * 2.0 * xl;
377 plogf(
"%s Final Mole Numbers produced by inest:\n",
379 plogf(
"%s SPECIES MOLE_NUMBER\n", pprefix);
380 for (kspec = 0; kspec < nspecies; ++kspec) {
381 plogf(
"%s ", pprefix);
411 if (vcs_elabcheck(0)) {
414 plogf(
"%s Initial guess passed element abundances on input\n", pprefix);
415 plogf(
"%s m_doEstimateEquil = 1 so will use the input mole "
416 "numbers as estimates", pprefix);
424 plogf(
"%s Initial guess failed element abundances on input\n", pprefix);
425 plogf(
"%s m_doEstimateEquil = 1 so will discard input "
426 "mole numbers and find our own estimate", pprefix);
442 std::vector<double> ss(m_numElemConstraints, 0.0);
443 std::vector<double> sa(m_numElemConstraints, 0.0);
450 plogf(
"%sGo find an initial estimate for the equilibrium problem",
472 bool rangeCheck = vcs_elabcheck(1);
473 if (!vcs_elabcheck(0)) {
475 plogf(
"%sInitial guess failed element abundances\n", pprefix);
476 plogf(
"%sCall vcs_elcorr to attempt fix", pprefix);
480 rangeCheck = vcs_elabcheck(1);
481 if (!vcs_elabcheck(0)) {
482 plogf(
"%sInitial guess still fails element abundance equations\n",
484 plogf(
"%s - Inability to ever satisfy element abundance "
485 "constraints is probable", pprefix);
491 plogf(
"%sInitial guess now satisfies element abundances", pprefix);
494 plogf(
"%sElement Abundances RANGE ERROR\n", pprefix);
495 plogf(
"%s - Initial guess satisfies NC=%d element abundances, "
496 "BUT not NE=%d element abundances", pprefix,
505 plogf(
"%sInitial guess satisfies element abundances", pprefix);
508 plogf(
"%sElement Abundances RANGE ERROR\n", pprefix);
509 plogf(
"%s - Initial guess satisfies NC=%d element abundances, "
510 "BUT not NE=%d element abundances", pprefix,
519 plogf(
"%sTotal Dimensionless Gibbs Free Energy = %15.7E", pprefix,