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));
39 while (!solvers.empty()) {
41 solver = solvers.back();
46 e.options.maxIterations = maxsteps;
47 e.options.relTolerance = rtol;
49 int retnSub = e.equilibrate(s, XY,
true, loglevel-1);
54 s.setElementPotentials(e.elementPotentials());
55 }
else if (solver == 1) {
61 std::cout <<
"Calling equilibrate(Multiphase)" << std::endl;
62 equilibrate(m, XY, rtol, maxsteps, maxiter, loglevel-1);
64 }
catch (CanteraError& err) {
77 throw CanteraError(
"equilibrate",
"All available solvers failed");
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
This file contains the definition of some high level general equilibration routines.
doublereal equilibrate(MultiPhase &s, const char *XY, doublereal tol, int maxsteps, int maxiter, int loglevel)
Equilibrate a MultiPhase object.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
ThermoPhase thermo_t
typedef for the ThermoPhase class
std::vector< int > vector_int
Vector of ints.
Interface class for the vcsnonlinear solver.
Contains declarations for string manipulation functions within Cantera.
int _equilflag(const char *xy)
map property strings to integers