2 #ifndef CT_MULTIPHASE_EQUIL
3 #define CT_MULTIPHASE_EQUIL
42 size_t constituent(
size_t m) {
50 void getStoichVector(
size_t rxn,
vector_fp& nu) {
52 nu.resize(m_nsp, 0.0);
56 for (k = 0; k < m_nsp; k++) {
57 nu[m_order[k]] = m_N(k, rxn);
65 doublereal equilibrate(
int XY, doublereal err = 1.0e-9,
66 int maxsteps = 1000,
int loglevel=-99);
69 std::string reactionString(
size_t j) {
70 return std::string(
"");
72 void setInitialMixMoles(
int loglevel = 0) {
77 size_t componentIndex(
size_t n) {
78 return m_species[m_order[n]];
81 void reportCSV(
const std::string& reportFile);
83 double phaseMoles(
size_t iph)
const;
126 void step(doublereal omega,
vector_fp& deltaN,
int loglevel = 0);
131 void updateMixMoles();
139 double moles(
size_t ns)
const {
140 return m_moles[m_order[ns]];
142 double& moles(
size_t ns) {
143 return m_moles[m_order[ns]];
145 int solutionSpecies(
size_t n)
const {
146 return m_dsoln[m_order[n]];
148 bool isStoichPhase(
size_t n)
const {
149 return (m_dsoln[m_order[n]] == 0);
151 doublereal mu(
size_t n)
const {
152 return m_mu[m_species[m_order[n]]];
154 std::string speciesName(
size_t n)
const {
161 return (m_nsp > m_nel) ? m_nsp - m_nel : 0;
164 size_t m_nel_mix, m_nsp_mix, m_np;
169 doublereal m_press, m_temp;
170 std::vector<size_t> m_order;
175 std::vector<bool> m_majorsp;
176 std::vector<size_t> m_sortindex;
183 std::vector<size_t> m_species;
184 std::vector<size_t> m_element;
185 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...
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::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...