27 ThermoPhase::ThermoPhase() :
30 m_hasElementPotentials(false),
31 m_chargeNeutralityNecessary(false),
37 ThermoPhase::~ThermoPhase()
48 for (
size_t k = 0; k <
nSpecies(); k++) {
73 for (
size_t k = 0; k <
nSpecies(); k++) {
81 for (
size_t k = 0; k <
m_kk; k++) {
82 lnac[k] = std::log(lnac[k]);
90 for (
size_t k = 0; k <
m_kk; k++) {
204 double rtol,
bool doUV)
214 "Input specific volume is too small or negative. v = {}", v);
220 "Input pressure is too small or negative. p = {}", p);
233 }
else if (Tnew < Tmin) {
247 bool ignoreBounds =
false;
250 bool unstablePhase =
false;
253 double Tunstable = -1.0;
254 bool unstablePhaseNew =
false;
257 for (
int n = 0; n < 500; n++) {
262 unstablePhase =
true;
266 dt =
clip((Htarget - Hold)/cpd, -100.0, 100.0);
273 if ((dt > 0.0 && unstablePhase) || (dt <= 0.0 && !unstablePhase)) {
274 if (Hbot < Htarget && Tnew < (0.75 * Tbot + 0.25 * Told)) {
275 dt = 0.75 * (Tbot - Told);
278 }
else if (Htop > Htarget && Tnew > (0.75 * Ttop + 0.25 * Told)) {
279 dt = 0.75 * (Ttop - Told);
284 if (Tnew > Tmax && !ignoreBounds) {
287 if (Hmax >= Htarget) {
288 if (Htop < Htarget) {
297 if (Tnew < Tmin && !ignoreBounds) {
300 if (Hmin <= Htarget) {
301 if (Hbot > Htarget) {
314 for (
int its = 0; its < 10; its++) {
316 if (Tnew < Told / 3.0) {
318 dt = -2.0 * Told / 3.0;
329 unstablePhaseNew =
true;
332 unstablePhaseNew =
false;
335 if (unstablePhase ==
false && unstablePhaseNew ==
true) {
340 if (Hnew == Htarget) {
342 }
else if (Hnew > Htarget && (Htop < Htarget || Hnew < Htop)) {
345 }
else if (Hnew < Htarget && (Hbot > Htarget || Hnew > Hbot)) {
350 double Herr = Htarget - Hnew;
351 double acpd = std::max(fabs(cpd), 1.0E-5);
352 double denom = std::max(fabs(Htarget), acpd * Tnew);
353 double HConvErr = fabs((Herr)/denom);
354 if (HConvErr < rtol || fabs(dt/Tnew) < rtol) {
362 string ErrString =
"No convergence in 500 iterations\n";
364 ErrString += fmt::format(
365 "\tTarget Internal Energy = {}\n" 366 "\tCurrent Specific Volume = {}\n" 367 "\tStarting Temperature = {}\n" 368 "\tCurrent Temperature = {}\n" 369 "\tCurrent Internal Energy = {}\n" 370 "\tCurrent Delta T = {}\n",
371 Htarget, v, Tinit, Tnew, Hnew, dt);
373 ErrString += fmt::format(
374 "\tTarget Enthalpy = {}\n" 375 "\tCurrent Pressure = {}\n" 376 "\tStarting Temperature = {}\n" 377 "\tCurrent Temperature = {}\n" 378 "\tCurrent Enthalpy = {}\n" 379 "\tCurrent Delta T = {}\n",
380 Htarget, p, Tinit, Tnew, Hnew, dt);
383 ErrString += fmt::format(
384 "\t - The phase became unstable (Cp < 0) T_unstable_last = {}\n",
405 double rtol,
bool doSV)
413 "Input specific volume is too small or negative. v = {}", v);
419 "Input pressure is too small or negative. p = {}", p);
432 }
else if (Tnew < Tmin) {
446 bool ignoreBounds =
false;
449 bool unstablePhase =
false;
450 double Tunstable = -1.0;
451 bool unstablePhaseNew =
false;
454 for (
int n = 0; n < 500; n++) {
459 unstablePhase =
true;
463 dt =
clip((Starget - Sold)*Told/cpd, -100.0, 100.0);
467 if ((dt > 0.0 && unstablePhase) || (dt <= 0.0 && !unstablePhase)) {
468 if (Sbot < Starget && Tnew < Tbot) {
469 dt = 0.75 * (Tbot - Told);
472 }
else if (Stop > Starget && Tnew > Ttop) {
473 dt = 0.75 * (Ttop - Told);
478 if (Tnew > Tmax && !ignoreBounds) {
481 if (Smax >= Starget) {
482 if (Stop < Starget) {
490 }
else if (Tnew < Tmin && !ignoreBounds) {
493 if (Smin <= Starget) {
494 if (Sbot > Starget) {
507 for (
int its = 0; its < 10; its++) {
513 unstablePhaseNew =
true;
516 unstablePhaseNew =
false;
519 if (unstablePhase ==
false && unstablePhaseNew ==
true) {
524 if (Snew == Starget) {
526 }
else if (Snew > Starget && (Stop < Starget || Snew < Stop)) {
529 }
else if (Snew < Starget && (Sbot > Starget || Snew > Sbot)) {
534 double Serr = Starget - Snew;
535 double acpd = std::max(fabs(cpd), 1.0E-5);
536 double denom = std::max(fabs(Starget), acpd * Tnew);
537 double SConvErr = fabs((Serr * Tnew)/denom);
538 if (SConvErr < rtol || fabs(dt/Tnew) < rtol) {
546 string ErrString =
"No convergence in 500 iterations\n";
548 ErrString += fmt::format(
549 "\tTarget Entropy = {}\n" 550 "\tCurrent Specific Volume = {}\n" 551 "\tStarting Temperature = {}\n" 552 "\tCurrent Temperature = {}\n" 553 "\tCurrent Entropy = {}\n" 554 "\tCurrent Delta T = {}\n",
555 Starget, v, Tinit, Tnew, Snew, dt);
557 ErrString += fmt::format(
558 "\tTarget Entropy = {}\n" 559 "\tCurrent Pressure = {}\n" 560 "\tStarting Temperature = {}\n" 561 "\tCurrent Temperature = {}\n" 562 "\tCurrent Entropy = {}\n" 563 "\tCurrent Delta T = {}\n",
564 Starget, p, Tinit, Tnew, Snew, dt);
567 ErrString += fmt::format(
"\t - The phase became unstable (Cp < 0) T_unstable_last = {}\n",
583 const std::string&
id)
589 "ERROR: Can not find phase named {} in file" 590 " named {}",
id, inputFile);
607 "Missing species thermo data");
615 "Species {} has no thermo data", spec->name);
619 spec->thermo->validate(spec->name);
629 "Species {} has no thermo data", spec->name);
634 "New species '{}' does not match existing species '{}' at index {}",
637 spec->thermo->validate(spec->name);
653 "m_speciesData is the wrong size");
669 if (state.
hasChild(
"temperature")) {
670 double t =
getFloat(state,
"temperature",
"temperature");
674 double p =
getFloat(state,
"pressure",
"pressure");
678 double rho =
getFloat(state,
"density",
"density");
689 double rtol,
int max_steps,
int max_iter,
690 int estimate_equil,
int log_level)
692 if (solver ==
"auto" || solver ==
"element_potential") {
695 debuglog(
"Trying ChemEquil solver\n", log_level);
700 int ret = E.
equilibrate(*
this, XY.c_str(), log_level-1);
703 "ChemEquil solver failed. Return code: {}", ret);
706 for (
size_t m = 0; m <
nElements(); m++) {
710 debuglog(
"ChemEquil solver succeeded\n", log_level);
712 }
catch (std::exception& err) {
713 debuglog(
"ChemEquil solver failed.\n", log_level);
716 if (solver ==
"auto") {
723 if (solver ==
"auto" || solver ==
"vcs" || solver ==
"gibbs") {
727 M.
equilibrate(XY, solver, rtol, max_steps, max_iter,
728 estimate_equil, log_level);
732 if (solver !=
"auto") {
734 "Invalid solver specified: '{}'", solver);
741 "To be removed after Cantera 2.4");
743 if (lambda.size() < mm) {
744 throw CanteraError(
"setElementPotentials",
"lambda too small");
756 "To be removed after Cantera 2.4");
765 for (
size_t m = 0; m <
m_kk; m++) {
766 for (
size_t k = 0; k <
m_kk; k++) {
767 dlnActCoeffdlnN[ld * k + m] = 0.0;
773 void ThermoPhase::getdlnActCoeffdlnN_numderiv(
const size_t ld, doublereal*
const dlnActCoeffdlnN)
775 double deltaMoles_j = 0.0;
787 double v_totalMoles = 1.0;
788 double TMoles_base = v_totalMoles;
791 for (
size_t j = 0; j <
m_kk; j++) {
797 double moles_j_base = v_totalMoles * Xmol_Base[j];
798 deltaMoles_j = 1.0E-7 * moles_j_base + v_totalMoles * 1.0E-13 + 1.0E-150;
802 v_totalMoles = TMoles_base + deltaMoles_j;
803 for (
size_t k = 0; k <
m_kk; k++) {
804 Xmol[k] = Xmol_Base[k] * TMoles_base / v_totalMoles;
806 Xmol[j] = (moles_j_base + deltaMoles_j) / v_totalMoles;
814 double*
const lnActCoeffCol = dlnActCoeffdlnN + ld * j;
815 for (
size_t k = 0; k <
m_kk; k++) {
816 lnActCoeffCol[k] = (2*moles_j_base + deltaMoles_j) *(ActCoeff[k] - ActCoeff_Base[k]) /
817 ((ActCoeff[k] + ActCoeff_Base[k]) * deltaMoles_j);
820 v_totalMoles = TMoles_base;
829 fmt::memory_buffer b;
832 format_to(b,
"\n {}:\n",
name());
835 format_to(b,
" temperature {:12.6g} K\n",
temperature());
836 format_to(b,
" pressure {:12.6g} Pa\n",
pressure());
837 format_to(b,
" density {:12.6g} kg/m^3\n",
density());
842 format_to(b,
" potential {:12.6g} V\n", phi);
846 format_to(b,
" 1 kg 1 kmol\n");
847 format_to(b,
" ----------- ------------\n");
848 format_to(b,
" enthalpy {:12.5g} {:12.4g} J\n",
850 format_to(b,
" internal energy {:12.5g} {:12.4g} J\n",
852 format_to(b,
" entropy {:12.5g} {:12.4g} J/K\n",
854 format_to(b,
" Gibbs function {:12.5g} {:12.4g} J\n",
856 format_to(b,
" heat capacity c_p {:12.5g} {:12.4g} J/K\n",
859 format_to(b,
" heat capacity c_v {:12.5g} {:12.4g} J/K\n",
862 format_to(b,
" heat capacity c_v <not implemented> \n");
873 doublereal xMinor = 0.0;
874 doublereal yMinor = 0.0;
878 " Y Chem. Pot. / RT\n");
879 format_to(b,
" ------------- " 880 "------------ ------------\n");
881 for (
size_t k = 0; k <
m_kk; k++) {
882 if (abs(x[k]) >= threshold) {
884 format_to(b,
"{:>18s} {:12.6g} {:12.6g} {:12.6g}\n",
887 format_to(b,
"{:>18s} {:12.6g} {:12.6g}\n",
897 format_to(b,
" X Y\n");
898 format_to(b,
" ------------- ------------\n");
899 for (
size_t k = 0; k <
m_kk; k++) {
900 if (abs(x[k]) >= threshold) {
901 format_to(b,
"{:>18s} {:12.6g} {:12.6g}\n",
911 format_to(b,
" [{:+5d} minor] {:12.6g} {:12.6g}\n",
912 nMinor, xMinor, yMinor);
915 return to_string(b) + err.
what();
924 csvFile.precision(8);
927 std::vector<std::string> pNames;
928 std::vector<vector_fp> data;
931 csvFile << setw(tabS) <<
"Species,";
932 for (
size_t i = 0; i < pNames.size(); i++) {
933 csvFile << setw(tabM) << pNames[i] <<
",";
936 for (
size_t k = 0; k <
nSpecies(); k++) {
939 for (
size_t i = 0; i < pNames.size(); i++) {
940 csvFile << setw(tabM) << data[i][k] <<
",";
944 for (
size_t i = 0; i < pNames.size(); i++) {
945 csvFile << setw(tabM) << 0 <<
",";
953 std::vector<vector_fp>& data)
const 958 names.push_back(
"X");
961 names.push_back(
"Y");
964 names.push_back(
"Chem. Pot (J/kmol)");
967 names.push_back(
"Activity");
970 names.push_back(
"Act. Coeff.");
973 names.push_back(
"Part. Mol Enthalpy (J/kmol)");
976 names.push_back(
"Part. Mol. Entropy (J/K/kmol)");
979 names.push_back(
"Part. Mol. Energy (J/kmol)");
982 names.push_back(
"Part. Mol. Cp (J/K/kmol");
985 names.push_back(
"Part. Mol. Cv (J/K/kmol)");
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
Class ChemEquil implements a chemical equilibrium solver for single-phase solutions.
virtual void getLnActivityCoefficients(doublereal *lnac) const
Get the array of non-dimensional molar-based ln activity coefficients at the current solution tempera...
EquilOpt options
Options controlling how the calculation is carried out.
virtual void setState_SV(double s, double v, double tol=1e-9)
Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
size_t nElements() const
Number of elements.
virtual bool addSpecies(shared_ptr< Species > spec)
const vector_fp & elementPotentials() const
void restoreState(const vector_fp &state)
Restore a state saved on a previous call to saveState.
virtual void setState_RPX(doublereal rho, doublereal p, const doublereal *x)
Set the density (kg/m**3), pressure (Pa) and mole fractions.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual void modifySpecies(size_t k, shared_ptr< Species > spec)
Modify the thermodynamic data associated with a species.
XML_Node * findXMLPhase(XML_Node *root, const std::string &idtarget)
Search an XML_Node tree for a named phase XML_Node.
void getMassFractions(doublereal *const y) const
Get the species mass fractions.
std::string getChildValue(const XML_Node &parent, const std::string &nameString)
This function reads a child node with the name, nameString, and returns its XML value as the return s...
doublereal relTolerance
Relative tolerance.
bool ready(size_t nSpecies)
Check if data for all species (0 through nSpecies-1) has been installed.
doublereal temperature() const
Temperature (K).
const std::vector< const XML_Node * > & speciesData() const
Return a pointer to the vector of XML nodes containing the species data for this phase.
std::vector< const XML_Node * > m_speciesData
Vector of pointers to the species databases.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
An error indicating that an unimplemented function has been called.
virtual void resetHf298(const size_t k)
Restore the original heat of formation of one or more species.
virtual void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
virtual void modifySpecies(size_t index, shared_ptr< SpeciesThermoInterpType > spec)
Modify the species thermodynamic property parameterization for a species.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
doublereal cp_mass() const
Specific heat at constant pressure. Units: J/kg/K.
void saveState(vector_fp &state) const
Save the current internal state of the phase.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
const size_t npos
index returned by functions to indicate "no position"
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
const int cAC_CONVENTION_MOLAR
Standard state uses the molar convention.
bool getElementPotentials(doublereal *lambda) const
Returns the element potentials stored in the ThermoPhase object.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
void addPhase(ThermoPhase *p, doublereal moles)
Add a phase to the mixture.
const char * what() const
Get a description of the error.
const int cSS_CONVENTION_TEMPERATURE
Standard state uses the molar convention.
Class XML_Node is a tree-based representation of the contents of an XML file.
void setState_conditional_TP(doublereal t, doublereal p, bool set_p)
Helper function used by setState_HPorUV and setState_SPorSV.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
T clip(const T &value, const T &lower, const T &upper)
Clip value such that lower <= value <= upper.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
size_t nSpecies() const
Returns the number of species in the phase.
virtual doublereal density() const
Density (kg/m^3).
vector_fp m_lambdaRRT
Vector of element potentials.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature for which the thermodynamic data for the species or phase are valid...
doublereal enthalpy_mass() const
Specific enthalpy. Units: J/kg.
void setState_HPorUV(doublereal h, doublereal p, doublereal tol=1e-9, bool doUV=false)
Carry out work in HP and UV calculations.
virtual void setState_HP(double h, double p, double tol=1e-9)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void equilibrate(const std::string &XY, const std::string &solver="auto", double rtol=1e-9, int max_steps=50000, int max_iter=100, int estimate_equil=0, int log_level=0)
Equilibrate a ThermoPhase object.
void saveSpeciesData(const size_t k, const XML_Node *const data)
Store a reference pointer to the XML tree containing the species data for this phase.
virtual MultiSpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
doublereal m_tlast
last value of the temperature processed by reference state
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Headers for the MultiPhase object that is used to set up multiphase equilibrium problems (see Equilfu...
virtual void setState_PY(doublereal p, doublereal *y)
Set the internally stored pressure (Pa) and mass fractions.
void setState_SPorSV(double s, double p, double tol=1e-9, bool doSV=false)
Carry out work in SP and SV calculations.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getActivities(doublereal *a) const
Get the array of non-dimensional activities at the current solution temperature, pressure, and solution concentration.
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual void invalidateCache()
Invalidate any cached values which are normally updated only when a change in state is detected...
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the phase to the conditions specified in the state XML element.
virtual doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
A class for multiphase mixtures.
void getElectrochemPotentials(doublereal *mu) const
Get the species electrochemical potentials.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
virtual void getCsvReportData(std::vector< std::string > &names, std::vector< vector_fp > &data) const
Fills names and data with the column names and species thermo properties to be included in the output...
std::string speciesName(size_t k) const
Name of the species with index k.
virtual void setState_TPY(doublereal t, doublereal p, const doublereal *y)
Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase...
doublereal electricPotential() const
Returns the electric potential of this phase (V).
void setMoleFractionsByName(const compositionMap &xMap)
Set the species mole fractions by name.
int m_ssConvention
Contains the standard state convention.
doublereal entropy_mass() const
Specific entropy. Units: J/kg/K.
virtual int activityConvention() const
This method returns the convention used in specification of the activities, of which there are curren...
void setMassFractionsByName(const compositionMap &yMap)
Set the species mass fractions by name.
virtual void modifySpecies(size_t k, shared_ptr< Species > spec)
Modify the thermodynamic data associated with a species.
Base class for exceptions thrown by Cantera classes.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
virtual void invalidateCache()
Invalidate any cached values which are normally updated only when a change in state is detected...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void setMoleFractions(const doublereal *const x)
Set the mole fractions to the specified values.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
virtual void setState_UV(double u, double v, double tol=1e-9)
Set the specific internal energy (J/kg) and specific volume (m^3/kg).
virtual void resetHf298(const size_t k=npos)
Restore the original heat of formation of one or more species.
virtual void setState_RP(doublereal rho, doublereal p)
Set the density (kg/m**3) and pressure (Pa) at constant composition.
virtual bool addSpecies(shared_ptr< Species > spec)
Add a Species to this Phase.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
virtual void setState_TP(doublereal t, doublereal p)
Set the temperature (K) and pressure (Pa)
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
int equilibrate(thermo_t &s, const char *XY, int loglevel=0)
virtual void setState_SP(double s, double p, double tol=1e-9)
Set the specific entropy (J/kg/K) and pressure (Pa).
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
void debuglog(const std::string &msg, int loglevel)
Write a message to the log only if loglevel > 0.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
doublereal cv_mass() const
Specific heat at constant volume. Units: J/kg/K.
virtual std::string report(bool show_thermo=true, doublereal threshold=-1e-14) const
returns a summary of the state of the phase as a string
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
const doublereal SmallNumber
smallest number to compare to zero.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
doublereal gibbs_mass() const
Specific Gibbs function. Units: J/kg.
void init()
Process phases and build atomic composition array.
std::string name() const
Return the name of the phase.
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
Contains declarations for string manipulation functions within Cantera.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual void setMassFractions(const doublereal *const y)
Set the mass fractions to the specified values and normalize them.
void setElementPotentials(const vector_fp &lambda)
Stores the element potentials in the ThermoPhase object.
int maxIterations
Maximum number of iterations.
size_t m_kk
Number of species in the phase.
virtual void getdlnActCoeffdlnN(const size_t ld, doublereal *const dlnActCoeffdlnN)
Get the array of derivatives of the log activity coefficients with respect to the log of the species ...
A species thermodynamic property manager for a phase.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
virtual void reportCSV(std::ofstream &csvFile) const
returns a summary of the state of the phase to a comma separated file.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual void install_STIT(size_t index, shared_ptr< SpeciesThermoInterpType > stit)
Install a new species thermodynamic property parameterization for one species.
Namespace for the Cantera kernel.
doublereal intEnergy_mass() const
Specific internal energy. Units: J/kg.
bool m_hasElementPotentials
Boolean indicating whether there is a valid set of saved element potentials for this phase...
virtual void setState_RPY(doublereal rho, doublereal p, const doublereal *y)
Set the density (kg/m**3), pressure (Pa) and mass fractions.
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
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).
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase.