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