6 #ifndef CT_MULTIPHASE_EQUIL 7 #define CT_MULTIPHASE_EQUIL 46 size_t constituent(
size_t m) {
54 void getStoichVector(
size_t rxn,
vector_fp& nu) {
55 nu.resize(m_nsp, 0.0);
59 for (
size_t k = 0; k < m_nsp; k++) {
60 nu[m_order[k]] = m_N(k, rxn);
68 doublereal equilibrate(
int XY, doublereal err = 1.0e-9,
69 int maxsteps = 1000,
int loglevel=-99);
72 std::string reactionString(
size_t j) {
75 void setInitialMixMoles(
int loglevel = 0) {
80 size_t componentIndex(
size_t n) {
81 return m_species[m_order[n]];
84 void reportCSV(
const std::string& reportFile);
86 double phaseMoles(
size_t iph)
const;
129 void step(doublereal omega,
vector_fp& deltaN,
int loglevel = 0);
134 void updateMixMoles();
142 double moles(
size_t ns)
const {
143 return m_moles[m_order[ns]];
145 double& moles(
size_t ns) {
146 return m_moles[m_order[ns]];
148 int solutionSpecies(
size_t n)
const {
149 return m_dsoln[m_order[n]];
151 bool isStoichPhase(
size_t n)
const {
152 return (m_dsoln[m_order[n]] == 0);
154 doublereal mu(
size_t n)
const {
155 return m_mu[m_species[m_order[n]]];
157 std::string speciesName(
size_t n)
const {
164 return (m_nsp > m_nel) ? m_nsp - m_nel : 0;
167 size_t m_nel_mix, m_nsp_mix;
172 doublereal m_press, m_temp;
173 std::vector<size_t> m_order;
178 std::vector<bool> m_majorsp;
179 std::vector<size_t> m_sortindex;
186 std::vector<size_t> m_species;
187 std::vector<size_t> m_element;
188 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"
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 Equilfu...
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.
size_t nFree() const
Number of degrees of freedom.
Namespace for the Cantera kernel.
void finish()
Clean up the composition.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
std::string speciesName(const size_t kGlob) const
Name of species with global index kGlob.