8 #ifndef CT_CHEM_EQUIL_H
9 #define CT_CHEM_EQUIL_H
143 doublereal
nAtoms(
size_t k,
size_t m)
const {
171 vector_fp& elMolesGoal,
int loglevel = 0);
223 double& f,
vector_fp& elmols,
double xval,
double yval);
230 double xval,
double yval,
int loglevel = 0);
234 double xval,
double yval,
int loglevel = 0);
248 const double& n_t,
const vector_fp& Xmol_i_calc,
250 double pressureConst);
278 doublereal m_temp, m_dens;
294 std::vector<size_t> m_component;
300 std::vector<size_t> m_orderVectorElements;
301 std::vector<size_t> m_orderVectorSpecies;
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Class ChemEquil implements a chemical equilibrium solver for single-phase solutions.
int equilibrate(thermo_t &s, const char *XY, int loglevel=0)
vector_fp m_muSS_RT
Dimensionless values of the Gibbs free energy for the standard state of each species,...
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.
thermo_t * m_phase
Pointer to the ThermoPhase object used to initialize this object.
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.
size_t m_eloc
Index of the element id corresponding to the electric charge of each species.
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.
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.
int setInitialMoles(thermo_t &s, vector_fp &elMoleGoal, int loglevel=0)
Estimate the initial mole numbers.
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...
vector_fp m_comp
Storage of the element compositions. natom(k,m) = m_comp[k*m_mm+ m];.
void setToEquilState(thermo_t &s, const vector_fp &x, doublereal t)
vector_fp m_elementmolefracs
Current value of the element mole fractions.
int estimateEP_Brinkley(thermo_t &s, vector_fp &lambda, vector_fp &elMoles)
doublereal nAtoms(size_t k, size_t m) const
number of atoms of element m in species k.
int estimateElementPotentials(thermo_t &s, vector_fp &lambda, vector_fp &elMolesGoal, int loglevel=0)
Generate a starting estimate for the element potentials.
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.
void initialize(thermo_t &s)
size_t m_mm
number of elements in the phase
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 terms that are used in internal routines and are unlikely to need m...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Namespace for the Cantera kernel.
int _equilflag(const char *xy)
map property strings to integers