141 doublereal
nAtoms(
size_t k,
size_t m)
const {
169 vector_fp& elMolesGoal,
int loglevel = 0);
221 double& f,
vector_fp& elmols,
double xval,
double yval);
228 double xval,
double yval,
int loglevel = 0);
232 double xval,
double yval,
int loglevel = 0);
246 const double& n_t,
const vector_fp& Xmol_i_calc,
248 double pressureConst);
276 doublereal m_temp, m_dens;
292 std::vector<size_t> m_component;
298 std::vector<size_t> m_orderVectorElements;
299 std::vector<size_t> m_orderVectorSpecies;
Class ChemEquil implements a chemical equilibrium solver for single-phase solutions.
double calcEmoles(ThermoPhase &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...
vector_fp m_muSS_RT
Dimensionless values of the Gibbs free energy for the standard state of each species,...
int estimateElementPotentials(ThermoPhase &s, vector_fp &lambda, vector_fp &elMolesGoal, int loglevel=0)
Generate a starting estimate for the element potentials.
void setToEquilState(ThermoPhase &s, const vector_fp &x, doublereal t)
int equilibrate(ThermoPhase &s, const char *XY, int loglevel=0)
size_t m_kk
number of species in the phase
int m_loglevel
Verbosity of printed output.
size_t m_nComponents
This is equal to the rank of the stoichiometric coefficient matrix when it is computed.
ThermoPhase * m_phase
Pointer to the ThermoPhase object used to initialize this object.
void update(const ThermoPhase &s)
Update internally stored state information.
int estimateEP_Brinkley(ThermoPhase &s, vector_fp &lambda, vector_fp &elMoles)
size_t m_eloc
Index of the element id corresponding to the electric charge of each species.
int setInitialMoles(ThermoPhase &s, vector_fp &elMoleGoal, int loglevel=0)
Estimate the initial mole numbers.
int dampStep(ThermoPhase &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.
void initialize(ThermoPhase &s)
EquilOpt options
Options controlling how the calculation is carried out.
vector_fp m_molefractions
Current value of the mole fractions in the single phase. length = m_kk.
vector_fp m_comp
Storage of the element compositions. natom(k,m) = m_comp[k*m_mm+ m];.
vector_fp m_elementmolefracs
Current value of the element mole fractions.
doublereal nAtoms(size_t k, size_t m) const
number of atoms of element m in species k.
double m_elemFracCutoff
element fractional cutoff, below which the element will be zeroed.
doublereal m_elementTotalSum
Current value of the sum of the element abundances given the current element potentials.
size_t m_mm
number of elements in the phase
void equilResidual(ThermoPhase &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.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Chemical equilibrium options.
int iterations
Iteration counter.
doublereal maxStepSize
Maximum step size.
doublereal relTolerance
Relative tolerance.
doublereal absElemTol
Abs Tol in element number.
int maxIterations
Maximum number of iterations.
int propertyPair
Property pair flag.
bool contin
Continuation flag.
Base class for a phase with thermodynamic properties.
This file contains definitions of constants, types and terms that are used in internal routines and a...
Namespace for the Cantera kernel.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
int _equilflag(const char *xy)
map property strings to integers