21 static void print_space(
int num)
23 for (
int j = 0; j < num; j++) {
28 static void print_line(std::string schar,
size_t num)
30 for (
size_t j = 0; j < num; j++) {
31 plogf(
"%s", schar.c_str());
49 bool printActualMoles =
true, inertYes =
false;
50 size_t i, j, l, k, kspec;
57 std::vector<size_t> sortindex(nspecies,0);
58 std::vector<double> xy(nspecies,0.0);
64 for (i = 0; i < nspecies; ++i) {
76 std::swap(xy[k], xy[l]);
77 std::swap(sortindex[k], sortindex[l]);
89 double molScale = 1.0;
90 if (printActualMoles) {
103 plogf(
"\t\t VCS_TP REPORT\n");
107 plogf(
" ERROR: CONVERGENCE CRITERION NOT SATISFIED.\n");
108 }
else if (iconv == 1) {
109 plogf(
" RANGE SPACE ERROR: Equilibrium Found but not all Element Abundances are Satisfied\n");
121 if (!printActualMoles) {
122 plogf(
"\t\tMole Scale = %15.5g kmol (all mole numbers and volumes are scaled by this value)\n",
131 plogf(
" Species Equilibrium kmoles ");
132 plogf(
"Mole Fraction ChemPot/RT SpecUnkType\n");
155 plogf(
"we have a problem\n");
164 plogf(
" Inert Gas Species ");
166 plogf(
" Inert Species in phase %16s ",
173 if (m_numSpeciesRdc != nspecies) {
174 plogf(
"\n SPECIES WITH LESS THAN 1.0E-32 KMOLES:\n\n");
175 for (kspec = m_numSpeciesRdc; kspec < nspecies; ++kspec) {
178 plogf(
" %14.7E %14.7E %12.4E",
199 print_line(
"-", m_numComponents*10 + 45);
200 plogf(
" |ComponentID|");
205 plogf(
" | Components|");
210 plogf(
" NonComponent | Moles |");
214 plogf(
" | DG/RT Rxn |\n");
215 print_line(
"-", m_numComponents*10 + 45);
216 for (
size_t irxn = 0; irxn <
m_numRxnTot; irxn++) {
218 plogf(
" %3d ", kspec);
227 print_line(
"-", m_numComponents*10 + 45);
235 double totalMoles = 0.0;
236 double gibbsPhase = 0.0;
237 double gibbsTotal = 0.0;
241 plogf(
" | ElementID |");
246 plogf(
" | Element |");
251 plogf(
" PhaseName |KMolTarget |");
255 plogf(
" | Gibbs Total |\n");
256 print_line(
"-", m_numElemConstraints*10 + 58);
257 for (
size_t iphase = 0; iphase <
m_numPhases; iphase++) {
258 plogf(
" %3d ", iphase);
265 plogf(
"We have a problem\n");
271 plogf(
" %10.3g", gaPhase[j]);
272 gaTPhase[j] += gaPhase[j];
276 gibbsTotal += gibbsPhase;
277 plogf(
" | %18.11E |\n", gibbsPhase);
279 print_line(
"-", m_numElemConstraints*10 + 58);
280 plogf(
" TOTAL |%10.3e |", totalMoles);
282 plogf(
" %10.3g", gaTPhase[j]);
284 plogf(
" | %18.11E |\n", gibbsTotal);
286 print_line(
"-", m_numElemConstraints*10 + 58);
301 plogf(
"\n\tTotal Dimensionless Gibbs Free Energy = G/RT = %15.7E\n", g);
303 plogf(
"\t\t(Inert species have standard free energy of zero)\n");
306 plogf(
"\nElemental Abundances (kmol): ");
307 plogf(
" Actual Target Type ElActive\n");
321 plogf(
"Chemical Potentials of the Species: (dimensionless)\n");
324 plogf(
"\t\t(RT = %g ", rt);
327 plogf(
" Name TKMoles StandStateChemPot "
328 " ln(AC) ln(X_i) | F z_i phi | ChemPot | (-lnMnaught)");
329 plogf(
"| (MolNum ChemPot)|");
331 print_line(
"-", 147);
332 for (i = 0; i < nspecies; ++i) {
348 lx = log(tmp) - log(tpmoles);
354 plogf(
"%14.7E |", lx);
355 plogf(
"%14.7E | ", eContrib);
359 plogf(
"\n\t\twe have a problem - doesn't add up\n");
372 for (i = 0; i < 125; i++) {
375 plogf(
" %20.9E\n", g);
376 print_line(
"-", 147);
382 plogf(
"\nCounters: Iterations Time (seconds)\n");
384 plogf(
" vcs_basopt: %5d %11.5E\n",
386 plogf(
" vcs_TP: %5d %11.5E\n",
389 plogf(
" vcs_basopt: %5d %11s\n",
391 plogf(
" vcs_TP: %5d %11s\n",
426 plogf(
"\nTCounters: Num_Calls Total_Its Total_Time (seconds)\n");
427 if (timing_print_lvl > 0) {
428 plogf(
" vcs_basopt: %5d %5d %11.5E\n",
431 plogf(
" vcs_TP: %5d %5d %11.5E\n",
434 plogf(
" vcs_inest: %5d %11.5E\n",
436 plogf(
" vcs_TotalTime: %11.5E\n",
439 plogf(
" vcs_basopt: %5d %5d %11s\n",
441 plogf(
" vcs_TP: %5d %5d %11s\n",
443 plogf(
" vcs_inest: %5d %11s\n",
445 plogf(
" vcs_TotalTime: %11s\n",