20 vcs_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;
54 vcs_VolPhase::~vcs_VolPhase()
56 for (
size_t k = 0; k < m_numSpecies; k++) {
57 delete ListSpeciesPtr[k];
61 void 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;
146 void 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;
157 void vcs_VolPhase::_updateActCoeff()
const 160 m_UpToDate_AC =
true;
163 TP_ptr->getActivityCoefficients(&ActCoeff[0]);
164 m_UpToDate_AC =
true;
167 void vcs_VolPhase::_updateG0()
const 169 TP_ptr->getGibbs_ref(&SS0ChemicalPotential[0]);
170 m_UpToDate_G0 =
true;
173 double vcs_VolPhase::G0_calc_one(
size_t kspec)
const 175 if (!m_UpToDate_G0) {
178 return SS0ChemicalPotential[kspec];
181 void vcs_VolPhase::_updateGStar()
const 183 TP_ptr->getStandardChemPotentials(&StarChemicalPotential[0]);
184 m_UpToDate_GStar =
true;
187 double vcs_VolPhase::GStar_calc_one(
size_t kspec)
const 189 if (!m_UpToDate_GStar) {
192 return StarChemicalPotential[kspec];
195 void 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();
212 void 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;
228 double vcs_VolPhase::moleFraction(
size_t k)
const 233 void 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();
283 void 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;
364 void 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);
382 void vcs_VolPhase::updateFromVCS_MoleNumbers(
const int vcsStateStatus)
384 if ((!m_UpToDate || vcsStateStatus != m_vcsStateStatus) && m_owningSolverObject &&
386 setMolesFromVCS(vcsStateStatus);
390 void 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];
403 double 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];
415 void 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];
426 void 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;
437 double vcs_VolPhase::electricPotential()
const 442 void 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;
458 void vcs_VolPhase::setState_T(
const double temp)
460 setState_TP(temp, Pres_);
463 void vcs_VolPhase::_updateVolStar()
const 465 TP_ptr->getStandardVolumes(&StarMolarVol[0]);
466 m_UpToDate_VolStar =
true;
469 double vcs_VolPhase::VolStar_calc_one(
size_t kspec)
const 471 if (!m_UpToDate_VolStar) {
474 return StarMolarVol[kspec];
477 double 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;
498 void 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();
563 void 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 plogf(
"Warning Nsp != NVolSpeces: %d %d \n", nsp, m_numSpecies);
592 resize(VP_ID_, nsp, nelem, PhaseName.c_str());
594 TP_ptr->getMoleFractions(&Xmol_[0]);
595 creationMoleNumbers_ = Xmol_;
596 _updateMoleFractionDependencies();
600 m_isIdealSoln =
true;
602 std::string eos = TP_ptr->type();
603 if (eos ==
"IdealGas" || eos ==
"ConstDensity" || eos ==
"Surf" 604 || eos ==
"Metal" || eos ==
"StoichSubstance" 605 || eos ==
"Semiconductor" || eos ==
"LatticeSolid" 606 || eos ==
"Lattice" || eos ==
"Edge" || eos ==
"IdealSolidSoln") {
607 m_isIdealSoln =
true;
609 m_isIdealSoln =
false;
619 double vcs_VolPhase::totalMoles()
const 624 double vcs_VolPhase::molefraction(
size_t k)
const 629 void vcs_VolPhase::setCreationMoleNumbers(
const double*
const n_k,
630 const std::vector<size_t> &creationGlobalRxnNumbers)
632 creationMoleNumbers_.assign(n_k, n_k+m_numSpecies);
633 for (
size_t k = 0; k < m_numSpecies; k++) {
634 creationGlobalRxnNumbers_[k] = creationGlobalRxnNumbers[k];
638 const vector_fp& vcs_VolPhase::creationMoleNumbers(std::vector<size_t> &creationGlobalRxnNumbers)
const 640 creationGlobalRxnNumbers = creationGlobalRxnNumbers_;
641 return creationMoleNumbers_;
644 void vcs_VolPhase::setTotalMoles(
const double totalMols)
646 v_totalMoles = totalMols;
647 if (m_totalMolesInert > 0.0) {
650 "vcs_VolPhase::setTotalMoles",
651 "totalMoles less than inert moles: {} {}",
652 totalMols, m_totalMolesInert);
654 if (m_singleSpecies && (m_phiVarIndex == 0)) {
657 if (totalMols > 0.0) {
666 void vcs_VolPhase::setMolesOutOfDate(
int stateCalc)
669 if (stateCalc != -1) {
670 m_vcsStateStatus = stateCalc;
674 void vcs_VolPhase::setMolesCurrent(
int stateCalc)
677 m_vcsStateStatus = stateCalc;
680 bool vcs_VolPhase::isIdealSoln()
const 682 return m_isIdealSoln;
685 size_t vcs_VolPhase::phiVarIndex()
const 687 return m_phiVarIndex;
690 void vcs_VolPhase::setPhiVarIndex(
size_t phiVarIndex)
692 m_phiVarIndex = phiVarIndex;
694 if (m_singleSpecies && m_phiVarIndex == 0) {
701 return ListSpeciesPtr[kindex];
704 int vcs_VolPhase::exists()
const 709 void vcs_VolPhase::setExistence(
const int existence)
712 if (v_totalMoles != 0.0) {
714 "setting false existence for phase with moles");
716 }
else if (m_totalMolesInert == 0.0) {
717 if (v_totalMoles == 0.0 && (!m_singleSpecies || m_phiVarIndex != 0)) {
719 "setting true existence for phase with no moles");
724 "Trying to set existence of an electron phase to false");
726 m_existence = existence;
729 size_t vcs_VolPhase::spGlobalIndexVCS(
const size_t spIndex)
const 731 return IndSpecies[spIndex];
734 void vcs_VolPhase::setSpGlobalIndexVCS(
const size_t spIndex,
735 const size_t spGlobalIndex)
737 IndSpecies[spIndex] = spGlobalIndex;
738 if (spGlobalIndex >= m_numElemConstraints) {
739 creationGlobalRxnNumbers_[spIndex] = spGlobalIndex - m_numElemConstraints;
743 void vcs_VolPhase::setTotalMolesInert(
const double tMolesInert)
745 if (m_totalMolesInert != tMolesInert) {
747 m_UpToDate_AC =
false;
748 m_UpToDate_VolStar =
false;
749 m_UpToDate_VolPM =
false;
750 m_UpToDate_GStar =
false;
751 m_UpToDate_G0 =
false;
752 v_totalMoles += (tMolesInert - m_totalMolesInert);
753 m_totalMolesInert = tMolesInert;
755 if (m_totalMolesInert > 0.0) {
757 }
else if (m_singleSpecies && (m_phiVarIndex == 0)) {
760 if (v_totalMoles > 0.0) {
768 double vcs_VolPhase::totalMolesInert()
const 770 return m_totalMolesInert;
773 size_t vcs_VolPhase::elemGlobalIndex(
const size_t e)
const 775 AssertThrow(e < m_numElemConstraints,
" vcs_VolPhase::elemGlobalIndex");
776 return m_elemGlobalIndex[e];
779 void vcs_VolPhase::setElemGlobalIndex(
const size_t eLocal,
const size_t eGlobal)
782 "vcs_VolPhase::setElemGlobalIndex");
783 m_elemGlobalIndex[eLocal] = eGlobal;
786 size_t vcs_VolPhase::nElemConstraints()
const 788 return m_numElemConstraints;
791 std::string vcs_VolPhase::elementName(
const size_t e)
const 793 return m_elementNames[e];
799 for (
size_t k = 0; k < tPhase->
nSpecies(); k++) {
800 if (tPhase->
charge(k) != 0.0) {
820 size_t vcs_VolPhase::transferElementsFM(
const ThermoPhase*
const tPhase)
830 ChargeNeutralityElement = ne;
837 if (ChargeNeutralityElement !=
npos) {
841 size_t eFound =
npos;
850 for (
size_t eT = 0; eT < nebase; eT++) {
853 m_elementActive[eT] = 0;
858 for (
size_t eT = 0; eT < nebase; eT++) {
865 if (eFound ==
npos) {
868 m_elementActive[ne] = 0;
869 std::string ename =
"E";
870 m_elementNames[ne] = ename;
876 m_formulaMatrix.resize(ns, ne, 0.0);
881 for (
size_t eT = 0; eT < nebase; eT++) {
888 std::string pname = tPhase->
id();
890 pname = fmt::format(
"phase{}", VP_ID_);
892 e = ChargeNeutralityElement;
893 m_elementNames[e] =
"cn_" + pname;
896 for (
size_t k = 0; k < ns; k++) {
898 for (
size_t eT = 0; eT < nebase; eT++) {
899 m_formulaMatrix(k,e) = tPhase->
nAtoms(k, eT);
902 if (eFound !=
npos) {
903 m_formulaMatrix(k,eFound) = - tPhase->
charge(k);
908 for (
size_t k = 0; k < ns; k++) {
909 m_formulaMatrix(k,ChargeNeutralityElement) = tPhase->
charge(k);
916 if (ns == 1 && tPhase->
charge(0) != 0.0) {
924 int vcs_VolPhase::elementType(
const size_t e)
const 926 return m_elementType[e];
929 const Array2D& vcs_VolPhase::getFormulaMatrix()
const 931 return m_formulaMatrix;
934 int vcs_VolPhase::speciesUnknownType(
const size_t k)
const 936 return m_speciesUnknownType[k];
939 int vcs_VolPhase::elementActive(
const size_t e)
const 941 return m_elementActive[e];
944 size_t vcs_VolPhase::nSpecies()
const 949 std::string vcs_VolPhase::eos_name()
const 951 switch (m_eqnState) {
952 case VCS_EOS_CONSTANT:
954 case VCS_EOS_IDEAL_GAS:
956 case VCS_EOS_STOICH_SUB:
958 case VCS_EOS_IDEAL_SOLN:
960 case VCS_EOS_DEBEYE_HUCKEL:
961 return "Debeye Huckel";
962 case VCS_EOS_REDLICH_KWONG:
963 return "Redlich_Kwong";
964 case VCS_EOS_REGULAR_SOLN:
965 return "Regular Soln";
967 return fmt::format(
"UnkType: {:7d}", m_eqnState);
#define VCS_ELEM_TYPE_ELECTRONCHARGE
This refers to conservation of electrons.
#define VCS_PHASE_EXIST_NO
Phase doesn't currently exist in the mixture.
bool vcs_doubleEqual(double d1, double d2)
Simple routine to check whether two doubles are equal up to roundoff error.
size_t nElements() const
Number of elements.
doublereal temperature() const
Temperature (K).
#define VCS_PHASE_EXIST_ALWAYS
Always exists because it contains inerts which can't exist in any other phase.
#define VCS_PHASE_EXIST_ZEROEDPHASE
Phase currently is zeroed due to a programmatic issue.
const size_t npos
index returned by functions to indicate "no position"
size_t nSpecies() const
Returns the number of species in the phase.
static bool hasChargedSpecies(const ThermoPhase *const tPhase)
This function decides whether a phase has charged species or not.
static bool chargeNeutralityElement(const ThermoPhase *const tPhase)
This utility routine decides whether a Cantera ThermoPhase needs a constraint equation representing t...
#define VCS_PHASE_EXIST_YES
Phase is a normal phase that currently exists.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Base class for a phase with thermodynamic properties.
Header file for the internal object that holds the vcs equilibrium problem (see Class VCS_SOLVE and E...
Header for the object representing each phase within vcs.
#define VCS_SPECIES_TYPE_MOLNUM
Unknown refers to mole number of a single species.
#define VCS_ELEM_TYPE_ABSPOS
Normal element constraint consisting of positive coefficients for the formula matrix.
Properties of a single species.
#define VCS_ELEM_TYPE_CHARGENEUTRALITY
This refers to a charge neutrality of a single phase.
#define AssertThrow(expr, procedure)
Assertion must be true or an error is thrown.
#define VCS_STATECALC_NEW
State Calculation based on the new or tentative mole numbers.
Base class for exceptions thrown by Cantera classes.
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
#define VCS_STATECALC_OLD
State Calculation based on the old or base mole numbers.
std::string id() const
Return the string id for the phase.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
int elementType(size_t m) const
Return the element constraint type Possible types include:
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
#define plogf
define this Cantera function to replace printf
bool chargeNeutralityNecessary() const
Returns the chargeNeutralityNecessity boolean.
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE
Unknown refers to the voltage level of a phase.
#define VCS_STATECALC_TMP
State Calculation based on a temporary set of mole numbers.
Namespace for the Cantera kernel.
doublereal nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
std::string elementName(size_t m) const
Name of the element with index m.