2 #ifndef CT_MULTIPHASE_EQUIL
3 #define CT_MULTIPHASE_EQUIL
41 size_t constituent(
size_t m) {
49 void getStoichVector(
size_t rxn,
vector_fp& nu) {
51 nu.resize(m_nsp, 0.0);
55 for (k = 0; k < m_nsp; k++) {
56 nu[m_order[k]] = m_N(k, rxn);
64 doublereal equilibrate(
int XY, doublereal err = 1.0e-9,
65 int maxsteps = 1000,
int loglevel=-99);
68 #if defined(WITH_HTML_LOGS)
71 void printInfo(
int loglevel);
74 return std::string(
"");
76 inline void printInfo(
int loglevel) {}
79 void setInitialMixMoles(
int loglevel = 0) {
84 size_t componentIndex(
size_t n) {
85 return m_species[m_order[n]];
88 void reportCSV(
const std::string& reportFile);
90 double phaseMoles(
size_t iph)
const;
133 void step(doublereal omega,
vector_fp& deltaN,
int loglevel = 0);
138 void updateMixMoles();
146 double moles(
size_t ns)
const {
147 return m_moles[m_order[ns]];
149 double& moles(
size_t ns) {
150 return m_moles[m_order[ns]];
152 int solutionSpecies(
size_t n)
const {
153 return m_dsoln[m_order[n]];
155 bool isStoichPhase(
size_t n)
const {
156 return (m_dsoln[m_order[n]] == 0);
158 doublereal mu(
size_t n)
const {
159 return m_mu[m_species[m_order[n]]];
161 std::string speciesName(
size_t n)
const {
168 return (m_nsp > m_nel) ? m_nsp - m_nel : 0;
171 size_t m_nel_mix, m_nsp_mix, m_np;
176 doublereal m_press, m_temp;
177 std::vector<size_t> m_order;
182 std::vector<bool> m_majorsp;
183 std::vector<size_t> m_sortindex;
190 std::vector<size_t> m_species;
191 std::vector<size_t> m_element;
192 std::vector<bool> m_solnrxn;
doublereal computeReactionSteps(vector_fp &dxi)
Compute the change in extent of reaction for each reaction.
const size_t npos
index returned by functions to indicate "no position"
std::string speciesName(const size_t kGlob) const
Name of species with global index kGlob.
size_t nFree() const
Number of degrees of freedom.
void getComponents(const std::vector< size_t > &order)
This method finds a set of component species and a complete set of formation reactions for the non-co...
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
MultiPhaseEquil(MultiPhase *mix, bool start=true, int loglevel=0)
Construct a multiphase equilibrium manager for a multiphase mixture.
Headers for the MultiPhase object that is used to set up multiphase equilibrium problems (see Equilib...
int setInitialMoles(int loglevel=0)
Estimate the initial mole numbers.
std::vector< int > vector_int
Vector of ints.
A class for multiphase mixtures.
doublereal stepComposition(int loglevel=0)
Take one step in composition, given the gradient of G at the starting point, and a vector of reaction...
void unsort(vector_fp &x)
Re-arrange a vector of species properties in sorted form (components first) into unsorted, sequential form.
std::string reactionString(size_t j)
Return a string specifying the jth reaction.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void finish()
Clean up the composition.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...