1 #ifndef CT_MULTIPHASE_EQUIL
2 #define CT_MULTIPHASE_EQUIL
36 typedef size_t index_t;
42 size_t constituent(index_t m) {
50 void getStoichVector(index_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 #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(index_t n) {
85 return m_species[m_order[n]];
88 void reportCSV(
const std::string& reportFile);
90 double phaseMoles(index_t iph)
const;
100 void step(doublereal omega,
vector_fp& deltaN,
int loglevel = 0);
102 void updateMixMoles();
106 double moles(
size_t ns)
const {
107 return m_moles[m_order[ns]];
109 double& moles(
size_t ns) {
110 return m_moles[m_order[ns]];
112 int solutionSpecies(
size_t n)
const {
113 return m_dsoln[m_order[n]];
115 bool isStoichPhase(
size_t n)
const {
116 return (m_dsoln[m_order[n]] == 0);
118 doublereal mu(
size_t n)
const {
119 return m_mu[m_species[m_order[n]]];
121 std::string speciesName(
size_t n)
const {
128 return (m_nsp > m_nel) ? m_nsp - m_nel : 0;
131 index_t m_nel_mix, m_nsp_mix, m_np;
132 index_t m_nel, m_nsp;
136 doublereal m_press, m_temp;
137 std::vector<size_t> m_order;
142 std::vector<bool> m_majorsp;
143 std::vector<size_t> m_sortindex;
151 std::vector<size_t> m_species;
152 std::vector<size_t> m_element;
153 std::vector<bool> m_solnrxn;