24void printProgress(
const vector<string>& spName,
const vector<double>& soln,
25 const vector<double>& ff)
28 plogf(
" --- Summary of current progress:\n");
29 plogf(
" --- Name Moles - SSGibbs \n");
30 plogf(
" -------------------------------------------------------------------------------------\n");
31 for (
size_t k = 0; k < soln.size(); k++) {
32 plogf(
" --- %20s %12.4g - %12.4g\n", spName[k], soln[k], ff[k]);
33 sum += soln[k] * ff[k];
35 plogf(
" --- Total sum to be minimized = %g\n", sum);
43 m_nsp(mphase->nSpecies()),
44 m_numSpeciesRdc(mphase->nSpecies()),
45 m_numPhases(mphase->nPhases()),
46 m_temperature(mphase->temperature()),
47 m_pressurePA(mphase->pressure()),
50 string ser =
"VCS_SOLVE: ERROR:\n\t";
52 plogf(
"%s Number of species is nonpositive\n", ser);
54 " Number of species is nonpositive\n");
57 plogf(
"%s Number of phases is nonpositive\n", ser);
59 " Number of phases is nonpositive\n");
130 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
135 if (tPhase->
nDim() != 3) {
137 "Surface/edge phase not handled yet.");
141 make_unique<vcs_VolPhase>(
this, tPhase, iphase));
146 size_t nSpPhase = tPhase->
nSpecies();
147 for (
size_t k = 0; k < nSpPhase; k++) {
191 for (
size_t j = 0; j <
m_nelem; j++) {
192 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
201 writeline(
'=', 80,
true,
true);
202 writeline(
'=', 16,
false);
203 plogf(
" Cantera_to_vprob: START OF PROBLEM STATEMENT ");
206 plogf(
" Phase IDs of species\n");
207 plogf(
" species phaseID phaseName ");
208 plogf(
" Initial_Estimated_kMols\n");
209 for (
size_t i = 0; i <
m_nsp; i++) {
223 writeline(
'-', 80,
true,
true);
224 plogf(
" Information about phases\n");
225 plogf(
" PhaseName PhaseNum SingSpec EqnState NumSpec "
228 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
236 writeline(
'=', 80,
true,
true);
237 writeline(
'=', 16,
false);
238 plogf(
" Cantera_to_vprob: END OF PROBLEM STATEMENT ");
246 for (
size_t i = 0; i <
m_nsp; i++) {
251 for (
size_t i = 0; i <
m_nelem; i++) {
258 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
262 "Species to Phase Mapping, PhaseID, has a bad value\n"
263 "\tm_phaseID[{}] = {}\n"
264 "Allowed values: 0 to {}", kspec, iph,
m_numPhases - 1);
272 if (numPhSp[iph] != Vphase->
nSpecies()) {
274 "Number of species in phase {}, {}, doesn't match ({} != {}) [vphase = {}]",
279 for (
size_t i = 0; i <
m_nelem; i++) {
284 "Charge neutrality condition {} is signicantly "
285 "nonzero, {}. Giving up",
289 plogf(
"Charge neutrality condition %s not zero, %g. Setting it zero\n",
299 for (
size_t i = 0; i <
m_nsp; i++) {
316 for (
size_t k = 1; k < Vphase->
nSpecies(); k++) {
326VCS_SOLVE::~VCS_SOLVE()
335 "called for a phase that exists!");
341 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
344 "VCS_SOLVE::vcs_popPhasePossible",
345 "we shouldn't be here {}: {} > 0.0", kspec,
349 bool iPopPossible =
true;
359 double negChangeComp = - stoicC;
360 if (negChangeComp > 0.0) {
364 iPopPossible =
false;
379 for (
size_t jrxn = 0; jrxn <
m_numRxnRdc; jrxn++) {
380 bool foundJrxn =
false;
422 size_t iphasePop =
npos;
423 double FephaseMax = -1.0E30;
424 double Fephase = -1.0E30;
428 plogf(
" --- vcs_popPhaseID() called\n");
429 plogf(
" --- Phase Status F_e MoleNum\n");
430 plogf(
" --------------------------------------------------------------------------\n");
434 int existence = Vphase->
exists();
438 plogf(
" --- %18s %5d NA %11.3e\n",
448 "Index out of bounds due to logic error.");
451 Fephase = exp(-deltaGRxn) - 1.0;
453 note =
"(ready to be birthed)";
454 if (Fephase > FephaseMax) {
456 FephaseMax = Fephase;
457 note =
"(chosen to be birthed)";
461 note =
"(not stable)";
463 "VCS_SOLVE::vcs_popPhaseID",
"shouldn't be here");
467 plogf(
" --- %18s %5d %10.3g %10.3g %s\n",
475 if (Fephase > FephaseMax) {
477 FephaseMax = Fephase;
480 FephaseMax = std::max(FephaseMax, Fephase);
483 plogf(
" --- %18s %5d %11.3g %11.3g\n",
488 plogf(
" --- %18s %5d blocked %11.3g\n",
494 phasePopPhaseIDs.resize(0);
495 if (iphasePop !=
npos) {
496 phasePopPhaseIDs.push_back(iphasePop);
502 plogf(
" ---------------------------------------------------------------------\n");
514 vector<size_t> creationGlobalRxnNumbers;
522 "called for a phase that exists!");
524 plogf(
" --- vcs_popPhaseRxnStepSizes() called to pop phase %s %d into existence\n",
570 vector<double> fracDelta(Vphase->
nSpecies());
571 vector<double> X_est(Vphase->
nSpecies());
574 double sumFrac = 0.0;
575 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
576 sumFrac += fracDelta[k];
578 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
579 X_est[k] = fracDelta[k] / sumFrac;
582 double deltaMolNumPhase = tPhaseMoles;
587 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
589 double delmol = deltaMolNumPhase * X_est[k];
593 throw CanteraError(
"VCS_SOLVE::vcs_popPhaseRxnStepSizes",
594 "Index out of bounds due to logic error.");
599 molNumSpecies_tmp[j] += stoicC * delmol;
605 double ratioComp = 0.0;
608 if (molNumSpecies_tmp[j] < 0.0) {
612 damp = std::min(damp, delta0 / deltaJ * 0.9);
617 if ((jph != iphasePop) && (!
m_SSPhase[j])) {
618 double fdeltaJ = fabs(deltaJ);
631 if (ratioComp > 1.0E-30 && ratioComp < 0.001) {
632 damp = 0.001 / ratioComp;
634 if (damp <= 1.0E-6) {
638 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
654 size_t iphDel =
npos;
658 for (
int j = 0; j < 82; j++) {
662 plogf(
" --- Subroutine vcs_RxnStepSizes called - Details:\n");
664 for (
int j = 0; j < 82; j++) {
668 plogf(
" --- Species KMoles Rxn_Adjustment DeltaG\n");
678 for (
size_t irxn = 0; irxn <
m_numRxnRdc; ++irxn) {
706 if (Vphase->
exists() > 0 && trphmoles > 0.0) {
722 plogf(
" %12.4E %12.4E %12.4E\n",
734 plogf(
" %12.4E %12.4E %12.4E\n",
826 if ((k == kspec) && (
m_SSPhase[kspec] != 1)) {
836 plogf(
" %12.4E %12.4E %12.4E\n",
844 for (
size_t j = 0; j <
m_nsp; j++) {
860 plogf(
" %12.4E %12.4E %12.4E\n",
863 plogf(
" --- vcs_RxnStepSizes Special section to set up to delete %s\n",
867 forceComponentCalc = 1;
880 plogf(
" %12.4E %12.4E %12.4E\n",
897 const size_t nsp = Vphase->
nSpecies();
898 int minNumberIterations = 3;
900 minNumberIterations = 1;
904 bool doSuccessiveSubstitution =
true;
905 double funcPhaseStability;
906 vector<double> X_est(nsp, 0.0);
907 vector<double> delFrac(nsp, 0.0);
908 vector<double> E_phi(nsp, 0.0);
909 vector<double> fracDelta_old(nsp, 0.0);
910 vector<double> fracDelta_raw(nsp, 0.0);
911 vector<size_t> creationGlobalRxnNumbers(nsp,
npos);
922 vector<size_t> componentList;
923 for (
size_t k = 0; k < nsp; k++) {
926 componentList.push_back(k);
930 double normUpdate = 0.1 *
vcs_l2norm(fracDelta_new);
931 double damp = 1.0E-2;
933 if (doSuccessiveSubstitution) {
936 plogf(
" --- vcs_phaseStabilityTest() called\n");
937 plogf(
" --- Its X_old[%2d] FracDel_old[%2d] deltaF[%2d] FracDel_new[%2d]"
938 " normUpdate damp FuncPhaseStability\n", KP, KP, KP, KP);
939 plogf(
" --------------------------------------------------------------"
940 "--------------------------------------------------------\n");
942 plogf(
" --- vcs_phaseStabilityTest() called for phase %d\n", iph);
945 for (
size_t k = 0; k < nsp; k++) {
946 if (fracDelta_new[k] < 1.0E-13) {
947 fracDelta_new[k] =1.0E-13;
950 bool converged =
false;
951 double dirProd = 0.0;
952 for (
int its = 0; its < 200 && (!converged); its++) {
953 double dampOld = damp;
954 double normUpdateOld = normUpdate;
955 fracDelta_old = fracDelta_new;
956 double dirProdOld = dirProd;
960 for (
size_t i = 0; i < componentList.size(); i++) {
961 size_t kc = componentList[i];
963 fracDelta_old[kc] = 0.0;
964 for (
size_t k = 0; k < nsp; k++) {
974 double sumFrac = 0.0;
975 for (
size_t k = 0; k < nsp; k++) {
976 sumFrac += fracDelta_old[k];
980 if (sumFrac <= 0.0) {
983 double sum_Xcomp = 0.0;
984 for (
size_t k = 0; k < nsp; k++) {
985 X_est[k] = fracDelta_old[k] / sumFrac;
987 sum_Xcomp += X_est[k];
1000 for (
size_t i = 0; i < componentList.size(); i++) {
1001 size_t kc = componentList[i];
1008 for (
size_t i = 0; i < componentList.size(); i++) {
1010 for (
size_t k = 0; k < Vphase->
nSpecies(); k++) {
1027 funcPhaseStability = sum_Xcomp - 1.0;
1028 for (
size_t k = 0; k < nsp; k++) {
1035 funcPhaseStability += E_phi[k];
1042 for (
size_t k = 0; k < nsp; k++) {
1044 double b = E_phi[k] / sum * (1.0 - sum_Xcomp);
1046 fracDelta_raw[k] = b;
1052 for (
size_t i = 0; i < componentList.size(); i++) {
1053 size_t kc = componentList[i];
1055 fracDelta_raw[kc] = 0.0;
1056 for (
size_t k = 0; k < nsp; k++) {
1066 for (
size_t k = 0; k < nsp; k++) {
1067 delFrac[k] = fracDelta_raw[k] - fracDelta_old[k];
1072 for (
size_t k = 0; k < nsp; k++) {
1073 dirProd += fracDelta_old[k] * delFrac[k];
1075 bool crossedSign =
false;
1076 if (dirProd * dirProdOld < 0.0) {
1081 if (dampOld < 0.25) {
1082 damp = 2.0 * dampOld;
1085 if (normUpdate *1.5 > normUpdateOld) {
1086 damp = 0.5 * dampOld;
1087 }
else if (normUpdate *2.0 > normUpdateOld) {
1088 damp = 0.8 * dampOld;
1091 if (normUpdate > normUpdateOld * 2.0) {
1092 damp = 0.6 * dampOld;
1093 }
else if (normUpdate > normUpdateOld * 1.2) {
1094 damp = 0.9 * dampOld;
1098 for (
size_t k = 0; k < nsp; k++) {
1099 if (fabs(damp * delFrac[k]) > 0.3*fabs(fracDelta_old[k])) {
1100 damp = std::max(0.3*fabs(fracDelta_old[k]) / fabs(delFrac[k]),
1101 1.0E-8/fabs(delFrac[k]));
1103 if (delFrac[k] < 0.0 && 2.0 * damp * (-delFrac[k]) > fracDelta_old[k]) {
1104 damp = fracDelta_old[k] / (2.0 * -delFrac[k]);
1106 if (delFrac[k] > 0.0 && 2.0 * damp * delFrac[k] > fracDelta_old[k]) {
1107 damp = fracDelta_old[k] / (2.0 * delFrac[k]);
1110 damp = std::max(damp, 0.000001);
1111 for (
size_t k = 0; k < nsp; k++) {
1112 fracDelta_new[k] = fracDelta_old[k] + damp * delFrac[k];
1116 plogf(
" --- %3d %12g %12g %12g %12g %12g %12g %12g\n", its, X_est[KP], fracDelta_old[KP],
1117 delFrac[KP], fracDelta_new[KP], normUpdate, damp, funcPhaseStability);
1120 if (normUpdate < 1.0E-5 * damp) {
1122 if (its < minNumberIterations) {
1137 throw CanteraError(
"VCS_SOLVE::vcs_phaseStabilityTest",
"not done yet");
1140 plogf(
" ------------------------------------------------------------"
1141 "-------------------------------------------------------------\n");
1143 if (funcPhaseStability > 0.0) {
1144 plogf(
" --- phase %d with func = %g is to be born\n", iph, funcPhaseStability);
1146 plogf(
" --- phase %d with func = %g stays dead\n", iph, funcPhaseStability);
1149 return funcPhaseStability;
1159 for (
size_t k = 0; k <
m_nsp; k++) {
1183 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
1185 for (
size_t e = 0; e <
m_nelem; e++) {
1188 m_spSize[kspec] = (sz > 0.0) ? sz : 1.0;
1205 double test = -1.0e-10;
1206 bool modifiedSoln =
false;
1209 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
1214 if (fabs(sum) < 1.0E-6) {
1215 modifiedSoln =
true;
1218 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
1248 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
1267 for (
size_t e = 0; e < m_mix->
nElements(); e++) {
1270 if (sum < 1.0E-20) {
1271 throw CanteraError(
"VCS_SOLVE::vcs_prep",
"The problem is not well posed"
1272 " because the total number of element moles is zero.");
1286 plogf(
" --- Subroutine elem_rearrange() called to ");
1287 plogf(
"check stoich. coefficient matrix\n");
1288 plogf(
" --- and to rearrange the element ordering once\n");
1294 double test = -1.0E10;
1297 for (
size_t i = 0; i <
m_nelem; ++i) {
1300 if (test == aw[i]) {
1309 while (jr < ncomponents) {
1318 for (
size_t ielem = jr; ielem <
m_nelem; ielem++) {
1326 "Shouldn't be here. Algorithm misfired.");
1343 for (
size_t j = 0; j < ncomponents; ++j) {
1350 for (
size_t j = 0; j < jl; ++j) {
1352 for (
size_t i = 0; i < ncomponents; ++i) {
1353 ss[j] += sm[i + jr*ncomponents] * sm[i + j*ncomponents];
1360 for (
size_t j = 0; j < jl; ++j) {
1361 for (
size_t i = 0; i < ncomponents; ++i) {
1362 sm[i + jr*ncomponents] -= ss[j] * sm[i + j*ncomponents];
1370 for (
size_t ml = 0; ml < ncomponents; ++ml) {
1371 sa[jr] += pow(sm[ml + jr*ncomponents], 2);
1374 if (sa[jr] > 1.0e-6) {
1381 plogf(
" --- %-2.2s(%9.2g) replaces %-2.2s(%9.2g) as element %3d\n",
1386 std::swap(aw[jr], aw[k]);
1400 "vcs_switch_elem_pos",
1401 "inappropriate args: {} {}", ipos, jpos);
1421 for (
size_t j = 0; j <
m_nsp; ++j) {
1429 double diag = hessianDiag_Ideal;
1431 if (hessianDiag_Ideal <= 0.0) {
1433 "We shouldn't be here");
1435 if (hessActCoef >= 0.0) {
1436 diag += hessActCoef;
1437 }
else if (fabs(hessActCoef) < 0.6666 * hessianDiag_Ideal) {
1438 diag += hessActCoef;
1440 diag -= 0.6666 * hessianDiag_Ideal;
1479 if (!Vphase->m_singleSpecies && !Vphase->isIdealSoln()) {
1493 vector<pair<double, size_t>> x_order;
1494 for (
size_t i = 0; i <
m_nsp; i++) {
1507 plogf(
"\t\t VCS_TP REPORT\n");
1511 plogf(
" ERROR: CONVERGENCE CRITERION NOT SATISFIED.\n");
1512 }
else if (iconv == 1) {
1513 plogf(
" RANGE SPACE ERROR: Equilibrium Found but not all Element Abundances are Satisfied\n");
1518 double totalVolume = 0.0;
1519 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
1524 totalVolume += Volp;
1529 plogf(
"\t\ttotal Volume = %15.5g m**3\n", totalVolume);
1534 plogf(
" Species Equilibrium kmoles ");
1535 plogf(
"Mole Fraction ChemPot/RT SpecUnkType\n");
1539 writeline(
' ', 13,
false);
1546 size_t j = x_order[i].second;
1548 writeline(
' ', 13,
false);
1558 throw CanteraError(
"VCS_SOLVE::vcs_report",
"we have a problem");
1563 plogf(
"\n SPECIES WITH LESS THAN 1.0E-32 KMOLES:\n\n");
1567 plogf(
" %14.7E %14.7E %12.4E",
1585 plogf(
" |ComponentID|");
1590 plogf(
" | Components|");
1595 plogf(
" NonComponent | Moles |");
1599 plogf(
" | DG/RT Rxn |\n");
1601 for (
size_t irxn = 0; irxn <
m_numRxnTot; irxn++) {
1603 plogf(
" %3d ", kspec);
1616 vector<double> gaTPhase(
m_nelem, 0.0);
1617 double totalMoles = 0.0;
1618 double gibbsPhase = 0.0;
1619 double gibbsTotal = 0.0;
1622 writeline(
'-',
m_nelem*10 + 58);
1623 plogf(
" | ElementID |");
1624 for (
size_t j = 0; j <
m_nelem; j++) {
1628 plogf(
" | Element |");
1629 for (
size_t j = 0; j <
m_nelem; j++) {
1633 plogf(
" PhaseName |KMolTarget |");
1634 for (
size_t j = 0; j <
m_nelem; j++) {
1637 plogf(
" | Gibbs Total |\n");
1638 writeline(
'-',
m_nelem*10 + 58);
1639 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
1640 plogf(
" %3d ", iphase);
1647 throw CanteraError(
"VCS_SOLVE::vcs_report",
"we have a problem");
1650 for (
size_t j = 0; j <
m_nelem; ++j) {
1651 double abundance_j = 0.0;
1652 for (
size_t i = 0; i <
m_nsp; ++i) {
1659 plogf(
" %10.3g", abundance_j);
1660 gaTPhase[j] += abundance_j;
1668 gibbsTotal += gibbsPhase;
1669 plogf(
" | %18.11E |\n", gibbsPhase);
1671 writeline(
'-',
m_nelem*10 + 58);
1672 plogf(
" TOTAL |%10.3e |", totalMoles);
1673 for (
size_t j = 0; j <
m_nelem; j++) {
1674 plogf(
" %10.3g", gaTPhase[j]);
1676 plogf(
" | %18.11E |\n", gibbsTotal);
1678 writeline(
'-',
m_nelem*10 + 58);
1686 plogf(
"\n\tTotal Dimensionless Gibbs Free Energy = G/RT = %15.7E\n", g);
1687 plogf(
"\nElemental Abundances (kmol): ");
1688 plogf(
" Actual Target Type ElActive\n");
1689 for (
size_t i = 0; i <
m_nelem; ++i) {
1690 writeline(
' ', 26,
false);
1698 writeline(
'-', 93,
true,
true);
1699 plogf(
"Chemical Potentials of the Species: (dimensionless)\n");
1702 plogf(
" Name TKMoles StandStateChemPot "
1703 " ln(AC) ln(X_i) | F z_i phi | ChemPot | (-lnMnaught)");
1704 plogf(
"| (MolNum ChemPot)|");
1705 writeline(
'-', 147,
true,
true);
1706 for (
size_t i = 0; i <
m_nsp; ++i) {
1707 size_t j = x_order[i].second;
1722 lx = log(tmp) - log(tpmoles);
1728 plogf(
"%14.7E |", lx);
1729 plogf(
"%14.7E | ", eContrib);
1734 "we have a problem - doesn't add up");
1746 for (
size_t i = 0; i < 125; i++) {
1749 plogf(
" %20.9E\n", g);
1750 writeline(
'-', 147);
1754 plogf(
"\nCounters: Iterations\n");
1763 for (
size_t j = 0; j <
m_nelem; ++j) {
1765 for (
size_t i = 0; i <
m_nsp; ++i) {
1776 for (
size_t i = 0; i < top; ++i) {
1783 "Problem with charge neutrality condition");
1792 bool multisign =
false;
1793 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
1825 plogf(
" --- vcsc_elcorr: Element abundances correction routine");
1827 plogf(
" (m_numComponents != m_nelem)");
1832 for (
size_t i = 0; i <
m_nelem; ++i) {
1835 double l2before = 0.0;
1836 for (
size_t i = 0; i <
m_nelem; ++i) {
1837 l2before += x[i] * x[i];
1839 l2before = sqrt(l2before/
m_nelem);
1844 bool changed =
false;
1845 for (
size_t i = 0; i <
m_nelem; ++i) {
1847 bool multisign =
false;
1848 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
1860 if (numNonZero < 2) {
1861 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
1871 int numCompNonZero = 0;
1872 size_t compID =
npos;
1882 if (numCompNonZero == 1) {
1908 for (
size_t i = 0; i <
m_nelem; ++i) {
1911 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
1914 if (atomComp > 0.0) {
1918 plogf(
" --- vcs_elcorr: Reduced species %s from %g to %g "
1919 "due to %s max bounds constraint\n",
1933 plogf(
" --- vcs_elcorr: Zeroed species %s and changed "
1934 "status to %d due to max bounds constraint\n",
1955 if (fabs(x[i]) > 1.0E-13) {
1972 par = std::min(par, 100.0);
1974 if (par < 1.0 && par > 0.0) {
1998 auto finalize = [&]() {
2000 double l2after = 0.0;
2001 for (
size_t i = 0; i <
m_nelem; ++i) {
2004 l2after = sqrt(l2after/
m_nelem);
2006 plogf(
" --- Elem_Abund: Correct Initial "
2008 for (
size_t i = 0; i <
m_nelem; ++i) {
2013 plogf(
" --- Diff_Norm: %20.12E %20.12E\n",
2021 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
2025 double saveDir = 0.0;
2026 bool goodSpec =
true;
2029 if (fabs(dir) > 1.0E-10) {
2031 if (saveDir < 0.0) {
2035 }
else if (saveDir > 0.0) {
2078 for (
size_t i = 0; i <
m_nelem; ++i) {
2104 for (
size_t i = 0; i <
m_nelem; ++i) {
2107 bool useZeroed =
true;
2148 double test = -1.0E-10;
2151 plogf(
" --- call setInitialMoles\n");
2155 bool abundancesOK =
true;
2157 vector<double> ss(
m_nelem, 0.0);
2158 vector<double> sa(
m_nelem, 0.0);
2159 vector<double> wx(
m_nelem, 0.0);
2160 vector<double> aw(
m_nsp, 0.0);
2162 for (
size_t ik = 0; ik <
m_nsp; ik++) {
2176 plogf(
" --- seMolesLinProg Mole numbers failing element abundances\n");
2177 plogf(
" --- seMolesLinProg Call vcs_elcorr to attempt fix\n");
2180 abundancesOK = (retn < 2);
2182 abundancesOK =
true;
2191 plogf(
"iteration %d\n", iter);
2200 for (
size_t irxn = 0; irxn <
m_numRxnTot; irxn++) {
2204 double dxi_min = 1.0e10;
2206 for (
size_t jcomp = 0; jcomp <
m_nelem; jcomp++) {
2212 int idir = (dg_rt < 0.0 ? 1 : -1);
2218 double nu = sc_irxn[jcomp];
2231 dxi_min = std::min(dxi_min, delta_xi);
2238 double dsLocal = idir*dxi_min;
2261 plogf(
" --- setInitialMoles end\n");
2263 if (!abundancesOK) {
2265 }
else if (iter > 15) {
2278 g += molesSp[kspec] * chemPot[kspec];
2293 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
2300 if ((nSpPhase == 1) && (volPhase->
phiVarIndex() == 0)) {
2311 writeline(
'=', 80,
true,
true);
2312 writeline(
'=', 20,
false);
2313 plogf(
" Cantera_to_vprob: START OF PROBLEM STATEMENT ");
2317 plogf(
" Phase IDs of species\n");
2318 plogf(
" species phaseID phaseName ");
2319 plogf(
" Initial_Estimated_kMols\n");
2320 for (
size_t i = 0; i <
m_nsp; i++) {
2333 writeline(
'-', 80,
true,
true);
2334 plogf(
" Information about phases\n");
2335 plogf(
" PhaseName PhaseNum SingSpec EqnState NumSpec "
2338 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
2346 writeline(
'=', 80,
true,
true);
2347 writeline(
'=', 20,
false);
2348 plogf(
" Cantera_to_vprob: END OF PROBLEM STATEMENT ");
2364 const char* pprefix =
" --- vcs_inest: ";
2370 plogf(
"%s Initial guess passed element abundances on input\n", pprefix);
2371 plogf(
"%s m_doEstimateEquil = 1 so will use the input mole "
2372 "numbers as estimates\n", pprefix);
2376 plogf(
"%s Initial guess failed element abundances on input\n", pprefix);
2377 plogf(
"%s m_doEstimateEquil = 1 so will discard input "
2378 "mole numbers and find our own estimate\n", pprefix);
2384 vector<double> ss(
m_nelem, 0.0);
2385 vector<double> sa(
m_nelem, 0.0);
2390 plogf(
"%sGo find an initial estimate for the equilibrium problem\n",
2393 double test = -1.0E20;
2401 plogf(
"%s Mole Numbers returned from linear programming (vcs_inest initial guess):\n",
2403 plogf(
"%s SPECIES MOLE_NUMBER -SS_ChemPotential\n", pprefix);
2404 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2405 plogf(
"%s ", pprefix);
2409 plogf(
"%s Element Abundance Agreement returned from linear "
2410 "programming (vcs_inest initial guess):\n", pprefix);
2411 plogf(
"%s Element Goal Actual\n", pprefix);
2412 for (
size_t j = 0; j <
m_nelem; j++) {
2415 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2418 plogf(
"%s ", pprefix);
2429 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2457 double TMolesMultiphase = 0.0;
2483 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2484 plogf(
"%s", pprefix);
2490 plogf(
"fe* = %15.5g ff = %15.5g dg* = %15.5g\n",
2504 for (
size_t irxn = 0; irxn < nrxn; ++irxn) {
2538 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2540 plogf(
"%sdirection (", pprefix);
2547 plogf(
" (ssPhase doesn't exist -> stability not checked)");
2564 if (par <= 1.0 && par > 0.0) {
2600 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2606 if (s < 0.0 && ikl == 0) {
2619 double xl = (1.0 - s / (s1 - s)) * 0.5;
2629 par = par * 2.0 * xl;
2636 plogf(
"%s Final Mole Numbers produced by inest:\n",
2638 plogf(
"%s SPECIES MOLE_NUMBER\n", pprefix);
2639 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2640 plogf(
"%s %-12.12s %g\n",
2658 plogf(
"%sInitial guess failed element abundances\n", pprefix);
2659 plogf(
"%sCall vcs_elcorr to attempt fix\n", pprefix);
2665 "Initial guess still fails element abundance equations\n"
2666 "Inability to ever satisfy element abundance constraints is probable");
2670 plogf(
"%sInitial guess now satisfies element abundances\n", pprefix);
2672 plogf(
"%sElement Abundances RANGE ERROR\n", pprefix);
2673 plogf(
"%s - Initial guess satisfies NC=%d element abundances, "
2674 "BUT not NE=%d element abundances\n", pprefix,
2682 plogf(
"%sInitial guess satisfies element abundances\n", pprefix);
2684 plogf(
"%sElement Abundances RANGE ERROR\n", pprefix);
2685 plogf(
"%s - Initial guess satisfies NC=%d element abundances, "
2686 "BUT not NE=%d element abundances\n", pprefix,
2693 plogf(
"%sTotal Dimensionless Gibbs Free Energy = %15.7E\n", pprefix,
2704 for (
size_t kspec = 0; kspec <
m_nsp; ++kspec) {
2718 for (
size_t kspec = 0; kspec <
m_nsp; kspec++) {
2737 plogf(
"\nTCounters: Num_Calls Total_Its\n");
2738 plogf(
" vcs_basopt: %5d %5d\n",
2740 plogf(
" vcs_TP: %5d %5d\n",
2751 writeline(
'=', 80,
true,
true);
2752 writeline(
'=', 20,
false);
2753 plogf(
" VCS_PROB: PROBLEM STATEMENT ");
2757 plogf(
"\tSolve a constant T, P problem:\n");
2761 plogf(
"\t\tPres = %g atm\n", pres_atm);
2763 plogf(
" Phase IDs of species\n");
2764 plogf(
" species phaseID phaseName ");
2765 plogf(
" Initial_Estimated_Moles Species_Type\n");
2766 for (
size_t i = 0; i <
m_nsp; i++) {
2786 writeline(
'-', 80,
true,
true);
2787 plogf(
" Information about phases\n");
2788 plogf(
" PhaseName PhaseNum SingSpec EqnState NumSpec "
2791 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
2804 plogf(
"\nElemental Abundances: ");
2805 plogf(
" Target_kmol ElemType ElActive\n");
2806 for (
size_t i = 0; i <
m_nelem; ++i) {
2807 writeline(
' ', 26,
false);
2813 plogf(
"\nChemical Potentials: (J/kmol)\n");
2814 plogf(
" Species (phase) "
2815 " SS0ChemPot StarChemPot\n");
2816 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
2819 for (
size_t kindex = 0; kindex < Vphase->
nSpecies(); kindex++) {
2832 writeline(
'=', 80,
true,
true);
2833 writeline(
'=', 20,
false);
2834 plogf(
" VCS_PROB: END OF PROBLEM STATEMENT ");
2845 throw CanteraError(
"VCS_SOLVE::addOnePhaseSpecies",
"Shouldn't be here");
2851 "element not found");
2865 "error: element must have a name");
2883 for (
size_t e = 0; e <
m_nelem; e++) {
Headers for the MultiPhase object that is used to set up multiphase equilibrium problems (see Chemica...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
void zero()
Set all of the entries to zero.
size_t nColumns() const
Number of columns.
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Base class for exceptions thrown by Cantera classes.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
A class for multiphase mixtures.
double speciesMoles(size_t kGlob) const
Returns the moles of global species k. units = kmol.
double pressure() const
Pressure [Pa].
double temperature() const
Temperature [K].
string speciesName(size_t kGlob) const
Name of species with global index kGlob.
size_t nElements() const
Number of elements.
ThermoPhase & phase(size_t n)
Return a reference to phase n.
double elementMoles(size_t m) const
Total moles of global element m, summed over all phases.
size_t nSpecies() const
Returns the number of species in the phase.
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
double molecularWeight(size_t k) const
Molecular weight of species k.
double charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Base class for a phase with thermodynamic properties.
double electricPotential() const
Returns the electric potential of this phase (V).
Class to keep track of time and iterations.
int Its
Current number of iterations in the main loop of vcs_TP() to solve for thermo equilibrium.
int T_Calls_Inest
Current number of times the initial thermo equilibrium estimator has been called.
int T_Basis_Opts
Total number of optimizations of the components basis set done.
int Basis_Opts
number of optimizations of the components basis set done
int T_Its
Total number of iterations in the main loop of vcs_TP() to solve for thermo equilibrium.
int T_Calls_vcs_TP
Current number of calls to vcs_TP.
size_t vcs_popPhaseID(vector< size_t > &phasePopPhaseIDs)
Decision as to whether a phase pops back into existence.
vector< double > m_deltaPhaseMoles
Change in the total moles in each phase.
size_t m_numPhases
Number of Phases in the problem.
int m_doEstimateEquil
Setting for whether to do an initial estimate.
vector< double > m_deltaMolNumSpecies
Reaction Adjustments for each species during the current step.
VCS_SOLVE(MultiPhase *mphase, int printLvl=0)
Initialize the sizes within the VCS_SOLVE object.
vector< double > m_spSize
total size of the species
vector< double > m_scSize
Absolute size of the stoichiometric coefficients.
int vcs_evalSS_TP(int ipr, int ip1, double Temp, double pres)
Evaluate the standard state free energies at the current temperature and pressure.
vector< double > m_sm
QR matrix work space used in vcs_basopt()
vector< double > m_wtSpecies
Molecular weight of each species.
vector< size_t > m_indexRxnToSpecies
Mapping between the species index for noncomponent species and the full species index.
void vcs_prep(int printLvl)
This routine is mostly concerned with changing the private data to be consistent with what's needed f...
vector< double > m_sa
Gram-Schmidt work space used in vcs_basopt()
vector< size_t > m_phaseID
Mapping from the species number to the phase number.
vector< string > m_speciesName
Species string name for the kth species.
void vcs_deltag(const int L, const bool doDeleted, const int vcsState, const bool alterZeroedPhases=true)
This subroutine calculates reaction free energy changes for all noncomponent formation reactions.
double m_tolmaj2
Below this, major species aren't refined any more.
vector< double > m_deltaGRxn_new
Delta G(irxn) for the noncomponent species in the mechanism.
Array2D m_np_dLnActCoeffdMolNum
Change in the log of the activity coefficient with respect to the mole number multiplied by the phase...
void vcs_report(int iconv)
Print out a report on the state of the equilibrium problem to standard output.
size_t m_nelem
Number of element constraints in the problem.
vector< double > m_PMVolumeSpecies
Partial molar volumes of the species.
vector< int > m_elementActive
Specifies whether an element constraint is active.
int m_useActCoeffJac
Choice of Hessians.
vector< size_t > m_speciesLocalPhaseIndex
Index that keeps track of the index of the species within the local phase.
void vcs_basopt(const bool doJustComponents, double test)
Choose the optimum species basis for the calculations.
vector< string > m_elementName
Vector of strings containing the element names.
vector< int > m_speciesUnknownType
Specifies the species unknown type.
int vcs_elcorr(double aa[], double x[])
This subroutine corrects for element abundances.
vector< double > m_TmpPhase
Temporary vector of length NPhase.
vector< size_t > m_speciesMapIndex
Index vector that keeps track of the species vector rearrangement.
Array2D m_phaseParticipation
This is 1 if the phase, iphase, participates in the formation reaction irxn, and zero otherwise.
vector< int > m_actConventionSpecies
specifies the activity convention of the phase containing the species
double vcs_phaseStabilityTest(const size_t iph)
Main program to test whether a deleted phase should be brought back into existence.
void vcs_inest()
Create an initial estimate of the solution to the equilibrium problem.
vector< double > m_elemAbundances
Element abundances vector.
vector< double > m_tPhaseMoles_new
total kmols of species in each phase in the tentative soln vector
vector< double > m_actCoeffSpecies_old
Molar-based Activity Coefficients for Species based on old mole numbers.
vector< double > m_SSfeSpecies
Standard state chemical potentials for species K at the current temperature and pressure.
bool vcs_popPhasePossible(const size_t iphasePop) const
Utility function that evaluates whether a phase can be popped into existence.
vector< double > m_lnMnaughtSpecies
specifies the ln(Mnaught) used to calculate the chemical potentials
vector< int > m_elType
Type of the element constraint.
void vcs_elab()
Computes the current elemental abundances vector.
void prob_report(int print_lvl)
Print out the problem specification in all generality as it currently exists in the VCS_SOLVE object.
int vcs_setMolesLinProg()
Estimate the initial mole numbers by constrained linear programming.
vector< double > m_molNumSpecies_old
Total moles of the species.
double vcs_Total_Gibbs(double *w, double *fe, double *tPhMoles)
Calculate the total dimensionless Gibbs free energy.
void vcs_CalcLnActCoeffJac(const double *const moleSpeciesVCS)
Recalculate all of the activity coefficients in all of the phases based on input mole numbers.
vector< size_t > m_elementMapIndex
Index vector that keeps track of the rearrangement of the elements.
vector< double > m_aw
work array of mole fractions used in vcs_basopt()
size_t m_numSpeciesRdc
Current number of species in the problems.
vector< double > m_feSpecies_old
Free energy vector from the start of the current iteration.
int m_debug_print_lvl
Debug printing lvl.
void vcs_counters_init(int ifunc)
Initialize the internal counters.
void vcs_reinsert_deleted(size_t kspec)
We make decisions on the initial mole number, and major-minor status here.
vector< double > m_ss
Gram-Schmidt work space used in vcs_basopt()
vector< double > m_chargeSpecies
Charge of each species. Length = number of species.
Array2D m_formulaMatrix
Formula matrix for the problem.
size_t addOnePhaseSpecies(vcs_VolPhase *volPhase, size_t k, size_t kT)
Add elements to the local element list This routines adds entries for the formula matrix for one spec...
Array2D m_stoichCoeffRxnMatrix
Stoichiometric coefficient matrix for the reaction mechanism expressed in Reduced Canonical Form.
size_t m_numRxnRdc
Current number of non-component species in the problem.
VCS_COUNTERS * m_VCount
Timing and iteration counters for the vcs object.
vector< double > m_deltaGRxn_Deficient
Last deltag[irxn] from the previous step with additions for possible births of zeroed phases.
vector< unique_ptr< vcs_VolPhase > > m_VolPhaseList
Array of Phase Structures. Length = number of phases.
double vcs_Hessian_diag_adj(size_t irxn, double hessianDiag_Ideal)
Calculates the diagonal contribution to the Hessian due to the dependence of the activity coefficient...
size_t m_numComponents
Number of components calculated for the problem.
void vcs_prob_specifyFully()
Fully specify the problem to be solved.
double m_pressurePA
Pressure.
void vcs_SSPhase()
Calculate the status of single species phases.
vector< double > m_feSpecies_new
Dimensionless new free energy for all the species in the mechanism at the new tentative T,...
double m_Faraday_dim
dimensionless value of Faraday's constant, F / RT (1/volt)
void vcs_elem_rearrange()
Rearrange the constraint equations represented by the Formula Matrix so that the operational ones are...
size_t m_nsp
Total number of species in the problems.
vector< double > m_actCoeffSpecies_new
Molar-based Activity Coefficients for Species.
bool vcs_elabcheck(int ibound)
Checks to see if the element abundances are in compliance.
vector< char > m_SSPhase
Boolean indicating whether a species belongs to a single-species phase.
vector< double > m_phasePhi
electric potential of the iph phase
double vcs_Hessian_actCoeff_diag(size_t irxn)
Calculates the diagonal contribution to the Hessian due to the dependence of the activity coefficient...
vector< double > m_elemAbundancesGoal
Element abundances vector Goals.
size_t vcs_RxnStepSizes(int &forceComponentCalc, size_t &kSpecial)
Calculates formation reaction step sizes.
Array2D m_deltaMolNumPhase
Change in the number of moles of phase, iphase, due to the noncomponent formation reaction,...
vector< int > m_phaseActConvention
specifies the activity convention of the phase.
vector< int > m_speciesStatus
Major -Minor status vector for the species in the problem.
vector< double > m_deltaGRxn_tmp
Temporary vector of Rxn DeltaG's.
vector< double > m_TmpPhase2
Temporary vector of length NPhase.
void vcs_switch_elem_pos(size_t ipos, size_t jpos)
Swaps the indices for all of the global data for two elements, ipos and jpos.
double vcs_tmoles()
Calculates the total number of moles of species in all phases.
size_t elementIndex(const string &elementName) const
Return the index of an element by name, or npos if not found.
int m_printLvl
Print level for print routines.
void vcs_dfe(const int stateCalc, const int ll, const size_t lbot, const size_t ltop)
Calculate the dimensionless chemical potentials of all species or of certain groups of species,...
vector< double > m_tPhaseMoles_old
Total kmols of species in each phase.
int vcs_popPhaseRxnStepSizes(const size_t iphasePop)
Calculates the deltas of the reactions due to phases popping into existence.
size_t m_numRxnTot
Total number of non-component species in the problem.
vector< double > m_molNumSpecies_new
Tentative value of the mole number vector.
double m_temperature
Temperature (Kelvin)
vector< double > m_deltaGRxn_old
Last deltag[irxn] from the previous step.
void vcs_TCounters_report()
Create a report on the plog file containing iteration counters.
size_t addElement(const char *elNameNew, int elType, int elactive)
This routine resizes the number of elements in the VCS_SOLVE object by adding a new element to the en...
double m_totalMolNum
Total number of kmoles in all phases.
Phase information and Phase calculations for vcs.
void setCreationMoleNumbers(const double *const n_k, const vector< size_t > &creationGlobalRxnNumbers)
Sets the creationMoleNum's within the phase object.
int speciesUnknownType(const size_t k) const
Returns the type of the species unknown.
size_t elemGlobalIndex(const size_t e) const
Returns the global index of the local element index for the phase.
size_t nSpecies() const
Return the number of species in the phase.
string PhaseName
String name for the phase.
void setMoleFractionsState(const double molNum, const double *const moleFracVec, const int vcsStateStatus)
Set the moles and/or mole fractions within the phase.
size_t VP_ID_
Original ID of the phase in the problem.
const Array2D & getFormulaMatrix() const
Get a constant form of the Species Formula Matrix.
size_t phiVarIndex() const
Return the index of the species that represents the the voltage of the phase.
bool m_singleSpecies
If true, this phase consists of a single species.
void setMolesFromVCS(const int stateCalc, const double *molesSpeciesVCS=0)
Set the moles within the phase.
void setElemGlobalIndex(const size_t eLocal, const size_t eGlobal)
sets a local phase element to a global index value
int exists() const
Retrieve the kth Species structure for the species belonging to this phase.
size_t nElemConstraints() const
Returns the number of element constraints.
size_t spGlobalIndexVCS(const size_t spIndex) const
Return the Global VCS index of the kth species in the phase.
double GStar_calc_one(size_t kspec) const
Gibbs free energy calculation for standard state of one species.
int p_activityConvention
Convention for the activity formulation.
void sendToVCS_GStar(double *const gstar) const
Fill in the standard state Gibbs free energy vector for VCS.
void sendToVCS_ActCoeff(const int stateCalc, double *const AC)
Fill in an activity coefficients vector within a VCS_SOLVE object.
double sendToVCS_VolPM(double *const VolPM) const
Fill in the partial molar volume vector for VCS.
double G0_calc_one(size_t kspec) const
Gibbs free energy calculation at a temperature for the reference state of a species,...
void setState_TP(const double temperature_Kelvin, const double pressure_PA)
Sets the temperature and pressure in this object and underlying ThermoPhase objects.
string eos_name() const
Return the name corresponding to the equation of state.
void setSpGlobalIndexVCS(const size_t spIndex, const size_t spGlobalIndex)
set the Global VCS index of the kth species in the phase
void setExistence(const int existence)
Set the existence flag in the object.
const vector< double > & creationMoleNumbers(vector< size_t > &creationGlobalRxnNumbers) const
Return a const reference to the creationMoleNumbers stored in the object.
double totalMoles() const
Return the total moles in the phase.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
void debuglog(const string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
void writelogendl()
Write an end of line character to the screen and flush output.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
T clip(const T &value, const T &lower, const T &upper)
Clip value such that lower <= value <= upper.
const double Faraday
Faraday constant [C/kmol].
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
void solve(DenseMatrix &A, double *b, size_t nrhs, size_t ldb)
Solve Ax = b. Array b is overwritten on exit with x.
double vcs_l2norm(const vector< double > &vec)
determine the l2 norm of a vector of doubles
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
Contains declarations for string manipulation functions within Cantera.
Header for the object representing each phase within vcs.
#define VCS_SPECIES_INTERFACIALVOLTAGE
Species refers to an electron in the metal.
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE
Unknown refers to the voltage level of a phase.
#define VCS_STATECALC_OLD
State Calculation based on the old or base mole numbers.
#define VCS_DELETE_MINORSPECIES_CUTOFF
Cutoff relative mole number value, below which species are deleted from the equilibrium problem.
#define VCS_SPECIES_COMPONENT
These defines are valid values for spStatus()
#define VCS_SPECIES_MAJOR
Species is a major species.
#define VCS_PHASE_EXIST_NO
Phase doesn't currently exist in the mixture.
#define VCS_PHASE_EXIST_ALWAYS
These defines are valid values for the phase existence flag.
#define VCS_SPECIES_STOICHZERO
Species lies in a multicomponent phase that is active, but species concentration is zero due to stoic...
#define VCS_ELEM_TYPE_ABSPOS
Normal element constraint consisting of positive coefficients for the formula matrix.
#define VCS_STATECALC_NEW
State Calculation based on the new or tentative mole numbers.
#define VCS_SPECIES_TYPE_MOLNUM
Unknown refers to mole number of a single species.
#define VCS_SPECIES_ZEROEDPHASE
Species lies in a multicomponent phase that is zeroed atm.
#define VCS_SPECIES_ACTIVEBUTZERO
Species lies in a multicomponent phase that is active, but species concentration is zero.
#define VCS_ELEM_TYPE_ELECTRONCHARGE
This refers to conservation of electrons.
#define VCS_SPECIES_ZEROEDSS
Species is a SS phase, that is currently zeroed out.
#define VCS_DELETE_PHASE_CUTOFF
Cutoff relative moles below which a phase is deleted from the equilibrium problem.
#define VCS_SMALL_MULTIPHASE_SPECIES
Relative value of multiphase species mole number for a multiphase species which is small.
#define VCS_ELEM_TYPE_CHARGENEUTRALITY
This refers to a charge neutrality of a single phase.
#define VCS_SPECIES_MINOR
Species is a major species.
#define VCS_DELETE_ELEMENTABS_CUTOFF
Cutoff moles below which a phase or species which comprises the bulk of an element's total concentrat...
#define VCS_PHASE_EXIST_YES
Phase is a normal phase that currently exists.
#define VCS_SUCCESS
ERROR CODES.
#define VCS_STATECALC_PHASESTABILITY
State Calculation based on tentative mole numbers for a phase which is currently zeroed,...
#define plogf
define this Cantera function to replace printf
Header file for the internal object that holds the vcs equilibrium problem (see Class VCS_SOLVE and C...