8 #ifndef CT_CHEM_EQUIL_H
9 #define CT_CHEM_EQUIL_H
119 bool useThermoPhaseElementPotentials =
false,
int loglevel = 0);
141 bool useThermoPhaseElementPotentials =
false,
int loglevel = 0);
142 const vector_fp& elementPotentials()
const {
166 doublereal
nAtoms(
size_t k,
size_t m)
const {
167 return m_comp[k*
m_mm + m];
194 vector_fp& elMolesGoal,
int loglevel = 0);
246 double& f,
vector_fp& elmols,
double xval,
double yval);
253 double xval,
double yval,
int loglevel = 0);
257 double xval,
double yval,
int loglevel = 0);
271 const double& n_t,
const vector_fp& Xmol_i_calc,
273 double pressureConst);
285 std::auto_ptr<PropertyCalculator<thermo_t> > m_p1, m_p2;
302 doublereal m_elementTotalSum;
317 doublereal m_temp, m_dens;
337 std::vector<size_t> m_component;
343 std::vector<size_t> m_orderVectorElements;
344 std::vector<size_t> m_orderVectorSpecies;
347 extern int ChemEquil_print_lvl;
Class ChemEquil implements a chemical equilibrium solver for single-phase solutions.
EquilOpt options
Options controlling how the calculation is carried out.
vector_fp m_muSS_RT
Dimensionless values of the gibbs free energy for the standard state of each species, at the temperature and pressure of the solution (the star standard state).
thermo_t * m_phase
Pointer to the ThermoPhase object used to initialize this object.
doublereal relTolerance
Relative tolerance.
int setInitialMoles(thermo_t &s, vector_fp &elMoleGoal, int loglevel=0)
Estimate the initial mole numbers.
size_t m_kk
number of species in the phase
Classes used by ChemEquil.
doublereal maxStepSize
Maximum step size.
int equilibrate(thermo_t &s, const char *XY, bool useThermoPhaseElementPotentials=false, int loglevel=0)
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
int propertyPair
Property pair flag.
void initialize(thermo_t &s)
size_t m_nComponents
This is equal to the rank of the stoichiometric coefficient matrix when it is computed.
void equilResidual(thermo_t &s, const vector_fp &x, const vector_fp &elmtotal, vector_fp &resid, double xval, double yval, int loglevel=0)
Evaluates the residual vector F, of length m_mm.
void update(const thermo_t &s)
Update internally stored state information.
int iterations
Iteration counter.
Base class for a phase with thermodynamic properties.
void setToEquilState(thermo_t &s, const vector_fp &x, doublereal t)
Chemical equilibrium options.
size_t m_eloc
Index of the element id corresponding to the electric charge of each species.
doublereal absElemTol
Abs Tol in element number.
double m_elemFracCutoff
element fractional cutoff, below which the element will be zeroed.
int estimateEP_Brinkley(thermo_t &s, vector_fp &lambda, vector_fp &elMoles)
bool contin
Continuation flag.
int estimateElementPotentials(thermo_t &s, vector_fp &lambda, vector_fp &elMolesGoal, int loglevel=0)
Generate a starting estimate for the element potentials.
size_t m_mm
number of elements in the phase
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Templates for operations on vector-like objects.
vector_fp m_lambda
Current value of the dimensional element potentials -> length = m_mm.
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
doublereal nAtoms(size_t k, size_t m) const
number of atoms of element m in species k.
vector_fp m_molefractions
Current value of the mole fractions in the single phase.
double calcEmoles(thermo_t &s, vector_fp &x, const double &n_t, const vector_fp &Xmol_i_calc, vector_fp &eMolesCalc, vector_fp &n_i_calc, double pressureConst)
Given a vector of dimensionless element abundances, this routine calculates the moles of the elements...
int maxIterations
Maximum number of iterations.
int _equilflag(const char *xy)
map property strings to integers
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
int dampStep(thermo_t &s, vector_fp &oldx, double oldf, vector_fp &grad, vector_fp &step, vector_fp &x, double &f, vector_fp &elmols, double xval, double yval)
Find an acceptable step size and take it.