4 #include "cantera/equil/MultiPhaseEquil.h"
12 int new_equilibrate(
thermo_t& s,
const char* XY,
int solver,
13 doublereal rtol,
int maxsteps,
int maxiter,
int loglevel)
20 if (ixy == TP || ixy == HP || ixy == SP || ixy == TV) {
24 }
else if (solver == 1) {
25 if (ixy == TP || ixy == HP || ixy == SP || ixy == TV) {
28 throw CanteraError(
"equilibrate",
29 std::string(
"MultiPhase equilibrium solver does not support property pair ") + XY);
31 }
else if (solver == 0 || solver == 2) {
34 throw CanteraError(
"equilibrate",
35 "unknown solver:" +
int2str(solver));
40 while (!solvers.empty()) {
42 solver = solvers.back();
47 e.options.maxIterations = maxsteps;
48 e.options.relTolerance = rtol;
50 int retnSub = e.equilibrate(s, XY,
true, loglevel-1);
61 s.setElementPotentials(e.elementPotentials());
62 }
else if (solver == 1) {
68 std::cout <<
"Calling equilibrate(Multiphase)" << std::endl;
69 equilibrate(m, XY, rtol, maxsteps, maxiter, loglevel-1);
74 }
catch (CanteraError& err) {
81 addLogEntry(
"Trying single phase ChemEquil solver.");
96 throw CanteraError(
"equilibrate",
"All available solvers failed");