15 doublereal tol,
int maxsteps,
int maxiter,
31 if (ixy == TP || ixy == HP || ixy == SP || ixy == TV) {
33 double err = s.
equilibrate(ixy, tol, maxsteps, maxiter, loglevel);
50 addLogEntry(
"multiphase equilibrium can be done only for TP, HP, SP, or TV");
60 doublereal rtol,
int maxsteps,
int maxiter,
int loglevel)
85 int estimateEquil = 0;
92 rtol, maxsteps, maxiter, loglevel-1);
105 addLogEntry(
"Trying single phase ChemEquil solver.");
115 }
else if (solver == 1) {
121 equilibrate(m, XY, rtol, maxsteps, maxiter, loglevel-1);
134 addLogEntry(
"Trying single phase ChemEquil solver.");
153 bool useThermoPhaseElementPotentials =
true;
154 retnSub = e.
equilibrate(s, XY, useThermoPhaseElementPotentials,
167 "Both equilibrium solvers failed");
Class ChemEquil implements a chemical equilibrium solver for single-phase solutions.
EquilOpt options
Options controlling how the calculation is carried out.
doublereal equilibrate(int XY, doublereal err=1.0e-9, int maxsteps=1000, int maxiter=200, int loglevel=-99)
Set the mixture to a state of chemical equilibrium.
doublereal relTolerance
Relative tolerance.
void beginLogGroup(const std::string &title, int loglevel)
Create a new group for log messages.
string lastErrorMessage()
Retrieve the last error message in a string.
This file contains the definition of some high level general equilibration routines.
void addPhase(ThermoPhase *p, doublereal moles)
Add a phase to the mixture.
int equilibrate(thermo_t &s, const char *XY, bool useThermoPhaseElementPotentials=false, int loglevel=0)
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).
Base class for a phase with thermodynamic properties.
A class for multiphase mixtures.
std::string id() const
Return the string id for the phase.
Base class for exceptions thrown by Cantera classes.
void setElementPotentials(const vector_fp &lambda)
Stores the element potentials in the ThermoPhase object.
void endLogGroup(const std::string &title)
Close the current group of log messages.
Interface class for the vcsnonlinear solver.
void addLogEntry(const std::string &tag, const std::string &value)
Add an entry to an HTML log file.
void init()
Process phases and build atomic composition array.
int maxIterations
Maximum number of iterations.
int _equilflag(const char *xy)
map property strings to integers
int vcs_equilibrate(thermo_t &s, const char *XY, int estimateEquil, int printLvl, int solver, doublereal rtol, int maxsteps, int maxiter, int loglevel)
Set a single-phase chemical solution to chemical equilibrium.
void save()
Function to put this error onto Cantera's error stack.