20vcs_VolPhase::vcs_VolPhase(VCS_SOLVE* owningSolverObject) :
21 m_owningSolverObject(0),
23 m_singleSpecies(true),
25 m_eqnState(VCS_EOS_CONSTANT),
26 ChargeNeutralityElement(
npos),
27 p_activityConvention(0),
28 m_numElemConstraints(0),
31 m_totalMolesInert(0.0),
44 m_UpToDate_VolStar(false),
45 m_UpToDate_VolPM(false),
46 m_UpToDate_GStar(false),
51 m_owningSolverObject = owningSolverObject;
54vcs_VolPhase::~vcs_VolPhase()
56 for (
size_t k = 0; k < m_numSpecies; k++) {
57 delete ListSpeciesPtr[k];
61void vcs_VolPhase::resize(
const size_t phaseNum,
const size_t nspecies,
62 const size_t numElem,
const char*
const phaseName,
63 const double molesInert)
65 AssertThrowMsg(nspecies > 0,
"vcs_VolPhase::resize",
"nspecies Error");
66 setTotalMolesInert(molesInert);
70 if (phaseNum == VP_ID_) {
71 if (strcmp(PhaseName.c_str(), phaseName)) {
73 "Strings are different: " + PhaseName +
" " +
74 phaseName +
" :unknown situation");
79 PhaseName = fmt::format(
"Phase_{}", VP_ID_);
81 PhaseName = phaseName;
85 m_singleSpecies =
false;
87 m_singleSpecies =
true;
90 if (m_numSpecies == nspecies && numElem == m_numElemConstraints) {
94 m_numSpecies = nspecies;
96 m_singleSpecies =
false;
99 IndSpecies.resize(nspecies,
npos);
101 if (ListSpeciesPtr.size() >= m_numSpecies) {
102 for (
size_t i = 0; i < m_numSpecies; i++) {
103 if (ListSpeciesPtr[i]) {
104 delete ListSpeciesPtr[i];
105 ListSpeciesPtr[i] = 0;
109 ListSpeciesPtr.resize(nspecies, 0);
110 for (
size_t i = 0; i < nspecies; i++) {
114 Xmol_.resize(nspecies, 0.0);
115 creationMoleNumbers_.resize(nspecies, 0.0);
116 creationGlobalRxnNumbers_.resize(nspecies,
npos);
117 for (
size_t i = 0; i < nspecies; i++) {
118 Xmol_[i] = 1.0/nspecies;
119 creationMoleNumbers_[i] = 1.0/nspecies;
120 if (IndSpecies[i] >= m_numElemConstraints) {
121 creationGlobalRxnNumbers_[i] = IndSpecies[i] - m_numElemConstraints;
123 creationGlobalRxnNumbers_[i] =
npos;
127 SS0ChemicalPotential.resize(nspecies, -1.0);
128 StarChemicalPotential.resize(nspecies, -1.0);
129 StarMolarVol.resize(nspecies, -1.0);
130 PartialMolarVol.resize(nspecies, -1.0);
131 ActCoeff.resize(nspecies, 1.0);
132 np_dLnActCoeffdMolNumber.resize(nspecies, nspecies, 0.0);
137 m_UpToDate_AC =
false;
138 m_UpToDate_VolStar =
false;
139 m_UpToDate_VolPM =
false;
140 m_UpToDate_GStar =
false;
141 m_UpToDate_G0 =
false;
146void vcs_VolPhase::elemResize(
const size_t numElemConstraints)
148 m_elementNames.resize(numElemConstraints);
149 m_elementActive.resize(numElemConstraints+1, 1);
151 m_formulaMatrix.resize(m_numSpecies, numElemConstraints, 0.0);
152 m_elementNames.resize(numElemConstraints,
"");
153 m_elemGlobalIndex.resize(numElemConstraints,
npos);
154 m_numElemConstraints = numElemConstraints;
157void vcs_VolPhase::_updateActCoeff()
const
160 m_UpToDate_AC =
true;
163 TP_ptr->getActivityCoefficients(&ActCoeff[0]);
164 m_UpToDate_AC =
true;
167void vcs_VolPhase::_updateG0()
const
169 TP_ptr->getGibbs_ref(&SS0ChemicalPotential[0]);
170 m_UpToDate_G0 =
true;
173double vcs_VolPhase::G0_calc_one(
size_t kspec)
const
175 if (!m_UpToDate_G0) {
178 return SS0ChemicalPotential[kspec];
181void vcs_VolPhase::_updateGStar()
const
183 TP_ptr->getStandardChemPotentials(&StarChemicalPotential[0]);
184 m_UpToDate_GStar =
true;
187double vcs_VolPhase::GStar_calc_one(
size_t kspec)
const
189 if (!m_UpToDate_GStar) {
192 return StarChemicalPotential[kspec];
195void vcs_VolPhase::setMoleFractions(
const double*
const xmol)
198 for (
size_t k = 0; k < m_numSpecies; k++) {
202 if (std::fabs(sum) > 1.0E-13) {
203 for (
size_t k = 0; k < m_numSpecies; k++) {
207 _updateMoleFractionDependencies();
212void vcs_VolPhase::_updateMoleFractionDependencies()
215 TP_ptr->setState_PX(Pres_, &Xmol_[m_MFStartIndex]);
217 if (!m_isIdealSoln) {
218 m_UpToDate_AC =
false;
219 m_UpToDate_VolPM =
false;
228double vcs_VolPhase::moleFraction(
size_t k)
const
233void vcs_VolPhase::setMoleFractionsState(
const double totalMoles,
234 const double*
const moleFractions,
235 const int vcsStateStatus)
237 if (totalMoles != 0.0) {
241 throw CanteraError(
"vcs_VolPhase::setMolesFractionsState",
242 "inappropriate usage");
247 throw CanteraError(
"vcs_VolPhase::setMolesFractionsState",
248 "inappropriate usage");
253 m_vcsStateStatus = vcsStateStatus;
256 double fractotal = 1.0;
257 v_totalMoles = totalMoles;
258 if (m_totalMolesInert > 0.0) {
259 if (m_totalMolesInert > v_totalMoles) {
260 throw CanteraError(
"vcs_VolPhase::setMolesFractionsState",
261 "inerts greater than total: {} {}",
262 v_totalMoles, m_totalMolesInert);
264 fractotal = 1.0 - m_totalMolesInert/v_totalMoles;
267 for (
size_t k = 0; k < m_numSpecies; k++) {
268 Xmol_[k] = moleFractions[k];
269 sum += moleFractions[k];
272 throw CanteraError(
"vcs_VolPhase::setMolesFractionsState",
273 "inappropriate usage");
275 if (sum != fractotal) {
276 for (
size_t k = 0; k < m_numSpecies; k++) {
277 Xmol_[k] *= (fractotal /sum);
280 _updateMoleFractionDependencies();
283void vcs_VolPhase::setMolesFromVCS(
const int stateCalc,
284 const double* molesSpeciesVCS)
286 v_totalMoles = m_totalMolesInert;
288 if (molesSpeciesVCS == 0) {
289 AssertThrowMsg(m_owningSolverObject,
"vcs_VolPhase::setMolesFromVCS",
290 "shouldn't be here");
292 molesSpeciesVCS = &m_owningSolverObject->m_molNumSpecies_old[0];
294 molesSpeciesVCS = &m_owningSolverObject->m_molNumSpecies_new[0];
296 throw CanteraError(
"vcs_VolPhase::setMolesFromVCS",
"shouldn't be here");
298 }
else if (m_owningSolverObject) {
310 for (
size_t k = 0; k < m_numSpecies; k++) {
312 size_t kglob = IndSpecies[k];
313 v_totalMoles += std::max(0.0, molesSpeciesVCS[kglob]);
316 if (v_totalMoles > 0.0) {
317 for (
size_t k = 0; k < m_numSpecies; k++) {
319 size_t kglob = IndSpecies[k];
320 double tmp = std::max(0.0, molesSpeciesVCS[kglob]);
321 Xmol_[k] = tmp / v_totalMoles;
334 if (m_phiVarIndex !=
npos) {
335 size_t kglob = IndSpecies[m_phiVarIndex];
336 if (m_numSpecies == 1) {
337 Xmol_[m_phiVarIndex] = 1.0;
339 Xmol_[m_phiVarIndex] = 0.0;
341 double phi = molesSpeciesVCS[kglob];
342 setElectricPotential(phi);
343 if (m_numSpecies == 1) {
347 _updateMoleFractionDependencies();
348 if (m_totalMolesInert > 0.0) {
356 creationMoleNumbers_ = Xmol_;
361 m_vcsStateStatus = stateCalc;
364void vcs_VolPhase::setMolesFromVCSCheck(
const int vcsStateStatus,
365 const double* molesSpeciesVCS,
366 const double*
const TPhMoles)
368 setMolesFromVCS(vcsStateStatus, molesSpeciesVCS);
371 double Tcheck = TPhMoles[VP_ID_];
372 if (Tcheck != v_totalMoles) {
374 Tcheck = v_totalMoles;
376 throw CanteraError(
"vcs_VolPhase::setMolesFromVCSCheck",
377 "We have a consistency problem: {} {}", Tcheck, v_totalMoles);
382void vcs_VolPhase::updateFromVCS_MoleNumbers(
const int vcsStateStatus)
384 if ((!m_UpToDate || vcsStateStatus != m_vcsStateStatus) && m_owningSolverObject &&
386 setMolesFromVCS(vcsStateStatus);
390void vcs_VolPhase::sendToVCS_ActCoeff(
const int vcsStateStatus,
393 updateFromVCS_MoleNumbers(vcsStateStatus);
394 if (!m_UpToDate_AC) {
397 for (
size_t k = 0; k < m_numSpecies; k++) {
398 size_t kglob = IndSpecies[k];
399 AC[kglob] = ActCoeff[k];
403double vcs_VolPhase::sendToVCS_VolPM(
double*
const VolPM)
const
405 if (!m_UpToDate_VolPM) {
408 for (
size_t k = 0; k < m_numSpecies; k++) {
409 size_t kglob = IndSpecies[k];
410 VolPM[kglob] = PartialMolarVol[k];
415void vcs_VolPhase::sendToVCS_GStar(
double*
const gstar)
const
417 if (!m_UpToDate_GStar) {
420 for (
size_t k = 0; k < m_numSpecies; k++) {
421 size_t kglob = IndSpecies[k];
422 gstar[kglob] = StarChemicalPotential[k];
426void vcs_VolPhase::setElectricPotential(
const double phi)
429 TP_ptr->setElectricPotential(m_phi);
431 m_UpToDate_AC =
false;
432 m_UpToDate_VolStar =
false;
433 m_UpToDate_VolPM =
false;
434 m_UpToDate_GStar =
false;
437double vcs_VolPhase::electricPotential()
const
442void vcs_VolPhase::setState_TP(
const double temp,
const double pres)
444 if (Temp_ == temp && Pres_ == pres) {
447 TP_ptr->setElectricPotential(m_phi);
448 TP_ptr->setState_TP(temp, pres);
451 m_UpToDate_AC =
false;
452 m_UpToDate_VolStar =
false;
453 m_UpToDate_VolPM =
false;
454 m_UpToDate_GStar =
false;
455 m_UpToDate_G0 =
false;
458void vcs_VolPhase::setState_T(
const double temp)
460 setState_TP(temp, Pres_);
463void vcs_VolPhase::_updateVolStar()
const
465 TP_ptr->getStandardVolumes(&StarMolarVol[0]);
466 m_UpToDate_VolStar =
true;
469double vcs_VolPhase::VolStar_calc_one(
size_t kspec)
const
471 if (!m_UpToDate_VolStar) {
474 return StarMolarVol[kspec];
477double vcs_VolPhase::_updateVolPM()
const
479 TP_ptr->getPartialMolarVolumes(&PartialMolarVol[0]);
481 for (
size_t k = 0; k < m_numSpecies; k++) {
482 m_totalVol += PartialMolarVol[k] * Xmol_[k];
484 m_totalVol *= v_totalMoles;
486 if (m_totalMolesInert > 0.0) {
488 double volI = m_totalMolesInert *
GasConstant * Temp_ / Pres_;
491 throw CanteraError(
"vcs_VolPhase::_updateVolPM",
"unknown situation");
494 m_UpToDate_VolPM =
true;
498void vcs_VolPhase::_updateLnActCoeffJac()
500 double phaseTotalMoles = v_totalMoles;
501 if (phaseTotalMoles < 1.0E-14) {
502 phaseTotalMoles = 1.0;
506 if (!m_UpToDate_AC) {
512 TP_ptr->getdlnActCoeffdlnN(m_numSpecies, &np_dLnActCoeffdMolNumber(0,0));
513 for (
size_t j = 0; j < m_numSpecies; j++) {
514 double moles_j_base = phaseTotalMoles * Xmol_[j];
515 double*
const np_lnActCoeffCol = np_dLnActCoeffdMolNumber.ptrColumn(j);
516 if (moles_j_base < 1.0E-200) {
517 moles_j_base = 1.0E-7 * moles_j_base + 1.0E-13 * phaseTotalMoles + 1.0E-150;
519 for (
size_t k = 0; k < m_numSpecies; k++) {
520 np_lnActCoeffCol[k] = np_lnActCoeffCol[k] * phaseTotalMoles / moles_j_base;
524 double deltaMoles_j = 0.0;
528 double TMoles_base = phaseTotalMoles;
531 for (
size_t j = 0; j < m_numSpecies; j++) {
534 double moles_j_base = phaseTotalMoles * Xmol_Base[j];
535 deltaMoles_j = 1.0E-7 * moles_j_base + 1.0E-13 * phaseTotalMoles + 1.0E-150;
539 phaseTotalMoles = TMoles_base + deltaMoles_j;
540 for (
size_t k = 0; k < m_numSpecies; k++) {
541 Xmol_[k] = Xmol_Base[k] * TMoles_base / phaseTotalMoles;
543 Xmol_[j] = (moles_j_base + deltaMoles_j) / phaseTotalMoles;
547 _updateMoleFractionDependencies();
551 v_totalMoles = TMoles_base;
558 setMoleFractions(&Xmol_Base[0]);
559 _updateMoleFractionDependencies();
563void vcs_VolPhase::sendToVCS_LnActCoeffJac(
Array2D& np_LnACJac_VCS)
567 _updateLnActCoeffJac();
570 for (
size_t j = 0; j < m_numSpecies; j++) {
571 size_t jglob = IndSpecies[j];
572 for (
size_t k = 0; k < m_numSpecies; k++) {
573 size_t kglob = IndSpecies[k];
574 np_LnACJac_VCS(kglob,jglob) = np_dLnActCoeffdMolNumber(k,j);
583 Pres_ = TP_ptr->pressure();
584 setState_TP(Temp_, Pres_);
585 m_phi = TP_ptr->electricPotential();
586 size_t nsp = TP_ptr->nSpecies();
587 size_t nelem = TP_ptr->nElements();
588 if (nsp != m_numSpecies) {
589 if (m_numSpecies != 0) {
590 warn_user(
"vcs_VolPhase::setPtrThermoPhase",
591 "Nsp != NVolSpeces: {} {}", nsp, m_numSpecies);
593 resize(VP_ID_, nsp, nelem, PhaseName.c_str());
595 TP_ptr->getMoleFractions(&Xmol_[0]);
596 creationMoleNumbers_ = Xmol_;
597 _updateMoleFractionDependencies();
601 m_isIdealSoln =
true;
603 std::string eos = TP_ptr->type();
604 if (eos ==
"IdealGas" || eos ==
"ConstDensity" || eos ==
"Surf"
605 || eos ==
"Metal" || eos ==
"StoichSubstance"
606 || eos ==
"LatticeSolid"
607 || eos ==
"Lattice" || eos ==
"Edge" || eos ==
"IdealSolidSoln") {
608 m_isIdealSoln =
true;
610 m_isIdealSoln =
false;
620double vcs_VolPhase::totalMoles()
const
625double vcs_VolPhase::molefraction(
size_t k)
const
630void vcs_VolPhase::setCreationMoleNumbers(
const double*
const n_k,
631 const std::vector<size_t> &creationGlobalRxnNumbers)
633 creationMoleNumbers_.assign(n_k, n_k+m_numSpecies);
634 for (
size_t k = 0; k < m_numSpecies; k++) {
635 creationGlobalRxnNumbers_[k] = creationGlobalRxnNumbers[k];
639const vector_fp& vcs_VolPhase::creationMoleNumbers(std::vector<size_t> &creationGlobalRxnNumbers)
const
641 creationGlobalRxnNumbers = creationGlobalRxnNumbers_;
642 return creationMoleNumbers_;
645void vcs_VolPhase::setTotalMoles(
const double totalMols)
647 v_totalMoles = totalMols;
648 if (m_totalMolesInert > 0.0) {
651 "vcs_VolPhase::setTotalMoles",
652 "totalMoles less than inert moles: {} {}",
653 totalMols, m_totalMolesInert);
655 if (m_singleSpecies && (m_phiVarIndex == 0)) {
658 if (totalMols > 0.0) {
667void vcs_VolPhase::setMolesOutOfDate(
int stateCalc)
670 if (stateCalc != -1) {
671 m_vcsStateStatus = stateCalc;
675void vcs_VolPhase::setMolesCurrent(
int stateCalc)
678 m_vcsStateStatus = stateCalc;
681bool vcs_VolPhase::isIdealSoln()
const
683 return m_isIdealSoln;
686size_t vcs_VolPhase::phiVarIndex()
const
688 return m_phiVarIndex;
691void vcs_VolPhase::setPhiVarIndex(
size_t phiVarIndex)
693 m_phiVarIndex = phiVarIndex;
695 if (m_singleSpecies && m_phiVarIndex == 0) {
702 return ListSpeciesPtr[kindex];
705int vcs_VolPhase::exists()
const
710void vcs_VolPhase::setExistence(
const int existence)
713 if (v_totalMoles != 0.0) {
715 "setting false existence for phase with moles");
717 }
else if (m_totalMolesInert == 0.0) {
718 if (v_totalMoles == 0.0 && (!m_singleSpecies || m_phiVarIndex != 0)) {
720 "setting true existence for phase with no moles");
725 "Trying to set existence of an electron phase to false");
727 m_existence = existence;
730size_t vcs_VolPhase::spGlobalIndexVCS(
const size_t spIndex)
const
732 return IndSpecies[spIndex];
735void vcs_VolPhase::setSpGlobalIndexVCS(
const size_t spIndex,
736 const size_t spGlobalIndex)
738 IndSpecies[spIndex] = spGlobalIndex;
739 if (spGlobalIndex >= m_numElemConstraints) {
740 creationGlobalRxnNumbers_[spIndex] = spGlobalIndex - m_numElemConstraints;
744void vcs_VolPhase::setTotalMolesInert(
const double tMolesInert)
746 if (m_totalMolesInert != tMolesInert) {
748 m_UpToDate_AC =
false;
749 m_UpToDate_VolStar =
false;
750 m_UpToDate_VolPM =
false;
751 m_UpToDate_GStar =
false;
752 m_UpToDate_G0 =
false;
753 v_totalMoles += (tMolesInert - m_totalMolesInert);
754 m_totalMolesInert = tMolesInert;
756 if (m_totalMolesInert > 0.0) {
758 }
else if (m_singleSpecies && (m_phiVarIndex == 0)) {
761 if (v_totalMoles > 0.0) {
769double vcs_VolPhase::totalMolesInert()
const
771 return m_totalMolesInert;
774size_t vcs_VolPhase::elemGlobalIndex(
const size_t e)
const
776 AssertThrow(e < m_numElemConstraints,
" vcs_VolPhase::elemGlobalIndex");
777 return m_elemGlobalIndex[e];
780void vcs_VolPhase::setElemGlobalIndex(
const size_t eLocal,
const size_t eGlobal)
783 "vcs_VolPhase::setElemGlobalIndex");
784 m_elemGlobalIndex[eLocal] = eGlobal;
787size_t vcs_VolPhase::nElemConstraints()
const
789 return m_numElemConstraints;
792std::string vcs_VolPhase::elementName(
const size_t e)
const
794 return m_elementNames[e];
800 for (
size_t k = 0; k < tPhase->
nSpecies(); k++) {
801 if (tPhase->
charge(k) != 0.0) {
821size_t vcs_VolPhase::transferElementsFM(
const ThermoPhase*
const tPhase)
831 ChargeNeutralityElement = ne;
838 if (ChargeNeutralityElement !=
npos) {
842 size_t eFound =
npos;
851 for (
size_t eT = 0; eT < nebase; eT++) {
854 m_elementActive[eT] = 0;
859 for (
size_t eT = 0; eT < nebase; eT++) {
866 if (eFound ==
npos) {
869 m_elementActive[ne] = 0;
870 std::string ename =
"E";
871 m_elementNames[ne] = ename;
877 m_formulaMatrix.resize(ns, ne, 0.0);
882 for (
size_t eT = 0; eT < nebase; eT++) {
889 std::string pname = tPhase->
name();
891 pname = fmt::format(
"phase{}", VP_ID_);
893 e = ChargeNeutralityElement;
894 m_elementNames[e] =
"cn_" + pname;
897 for (
size_t k = 0; k < ns; k++) {
899 for (
size_t eT = 0; eT < nebase; eT++) {
900 m_formulaMatrix(k,e) = tPhase->
nAtoms(k, eT);
903 if (eFound !=
npos) {
904 m_formulaMatrix(k,eFound) = - tPhase->
charge(k);
909 for (
size_t k = 0; k < ns; k++) {
910 m_formulaMatrix(k,ChargeNeutralityElement) = tPhase->
charge(k);
917 if (ns == 1 && tPhase->
charge(0) != 0.0) {
925int vcs_VolPhase::elementType(
const size_t e)
const
927 return m_elementType[e];
930const Array2D& vcs_VolPhase::getFormulaMatrix()
const
932 return m_formulaMatrix;
935int vcs_VolPhase::speciesUnknownType(
const size_t k)
const
937 return m_speciesUnknownType[k];
940int vcs_VolPhase::elementActive(
const size_t e)
const
942 return m_elementActive[e];
945size_t vcs_VolPhase::nSpecies()
const
950std::string vcs_VolPhase::eos_name()
const
952 switch (m_eqnState) {
953 case VCS_EOS_CONSTANT:
955 case VCS_EOS_IDEAL_GAS:
957 case VCS_EOS_STOICH_SUB:
959 case VCS_EOS_IDEAL_SOLN:
961 case VCS_EOS_DEBEYE_HUCKEL:
962 return "Debeye Huckel";
963 case VCS_EOS_REDLICH_KWONG:
964 return "Redlich_Kwong";
965 case VCS_EOS_REGULAR_SOLN:
966 return "Regular Soln";
968 return fmt::format(
"UnkType: {:7d}", m_eqnState);
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Base class for exceptions thrown by Cantera classes.
std::string name() const
Return the name of the phase.
size_t nSpecies() const
Returns the number of species in the phase.
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
int elementType(size_t m) const
Return the element constraint type Possible types include:
doublereal nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
doublereal temperature() const
Temperature (K).
size_t nElements() const
Number of elements.
std::string elementName(size_t m) const
Name of the element with index m.
Base class for a phase with thermodynamic properties.
bool chargeNeutralityNecessary() const
Returns the chargeNeutralityNecessity boolean.
Properties of a single species.
#define AssertThrow(expr, procedure)
Assertion must be true or an error is thrown.
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
Namespace for the Cantera kernel.
const size_t npos
index returned by functions to indicate "no position"
static bool hasChargedSpecies(const ThermoPhase *const tPhase)
This function decides whether a phase has charged species or not.
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double GasConstant
Universal Gas Constant [J/kmol/K].
static bool chargeNeutralityElement(const ThermoPhase *const tPhase)
This utility routine decides whether a Cantera ThermoPhase needs a constraint equation representing t...
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Print a user warning raised from method as CanteraWarning.
Contains declarations for string manipulation functions within Cantera.
Header for the object representing each phase within vcs.
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE
Unknown refers to the voltage level of a phase.
#define VCS_STATECALC_OLD
State Calculation based on the old or base mole numbers.
#define VCS_STATECALC_TMP
State Calculation based on a temporary set of mole numbers.
#define VCS_PHASE_EXIST_NO
Phase doesn't currently exist in the mixture.
#define VCS_PHASE_EXIST_ALWAYS
#define VCS_ELEM_TYPE_ABSPOS
Normal element constraint consisting of positive coefficients for the formula matrix.
#define VCS_STATECALC_NEW
State Calculation based on the new or tentative mole numbers.
#define VCS_SPECIES_TYPE_MOLNUM
Unknown refers to mole number of a single species.
#define VCS_ELEM_TYPE_ELECTRONCHARGE
This refers to conservation of electrons.
#define VCS_ELEM_TYPE_CHARGENEUTRALITY
This refers to a charge neutrality of a single phase.
#define VCS_PHASE_EXIST_YES
Phase is a normal phase that currently exists.
#define VCS_PHASE_EXIST_ZEROEDPHASE
Phase currently is zeroed due to a programmatic issue.
Header file for the internal object that holds the vcs equilibrium problem (see Class VCS_SOLVE and C...