10 #ifndef CT_THERMOPHASE_H
11 #define CT_THERMOPHASE_H
179 #ifdef H298MODIFY_CAPABILITY
189 doublereal
Hf298SS(
const int k)
const {
216 return err(
"Hf298SS - H298MODIFY_CAPABILITY not compiled in");
228 (void)
err(
"Hf298SS - H298MODIFY_CAPABILITY not compiled in");
265 return err(
"enthalpy_mole");
275 return err(
"entropy_mole");
285 return err(
"cp_mole");
290 return err(
"cv_mole");
298 virtual doublereal
cv_vib(
int,
double)
const {
299 return err(
"cv_vib");
315 return err(
"pressure");
347 err(
"isothermalCompressibility");
359 err(
"thermalExpansionCoeff()");
466 err(
"getActivityConcentrations");
488 err(
"standardConcentration");
531 int sizeUA = 6)
const;
557 err(
"getActivityCoefficients");
582 err(
"getChemPotentials_RT");
596 err(
"getChemPotentials");
617 for (
size_t k = 0; k <
m_kk; k++) {
629 err(
"getPartialMolarEnthalpies");
639 err(
"getPartialMolarEntropies");
649 err(
"getPartialMolarIntEnergies");
660 err(
"getPartialMolarCp");
670 err(
"getPartialMolarVolumes");
682 err(
"getdPartialMolarVolumes_dT");
694 err(
"getdPartialMolarVolumes_dP");
712 err(
"getStandardChemPotentials");
722 err(
"getEnthalpy_RT");
763 err(
"getIntEnergy_RT");
786 err(
"getStandardVolumes");
799 err(
"getdStandardVolumes_dT");
812 err(
"getdStandardVolumes_dP");
831 err(
"getEnthalpy_RT_ref");
842 err(
"getGibbs_RT_ref");
866 err(
"getEntropy_R_ref");
878 err(
"getIntEnergy_RT_ref");
891 err(
"getCp_R_ref()");
903 err(
"getStandardVolumes_ref");
999 virtual void setState_TPX(doublereal t, doublereal p,
const doublereal* x);
1023 virtual void setState_TPX(doublereal t, doublereal p,
const std::string& x);
1035 virtual void setState_TPY(doublereal t, doublereal p,
const doublereal* y);
1059 virtual void setState_TPY(doublereal t, doublereal p,
const std::string& y);
1068 virtual void setState_TP(doublereal t, doublereal p);
1079 virtual void setState_PX(doublereal p, doublereal* x);
1091 virtual void setState_PY(doublereal p, doublereal* y);
1101 virtual void setState_HP(doublereal h, doublereal p, doublereal tol = 1.e-4);
1114 virtual void setState_UV(doublereal u, doublereal v, doublereal tol = 1.e-4);
1128 doublereal tol = 1.e-4,
bool doUV =
false);
1143 virtual void setState_SP(doublereal s, doublereal p, doublereal tol = 1.e-4);
1156 virtual void setState_SV(doublereal s, doublereal v, doublereal tol = 1.e-4);
1170 doublereal tol = 1.e-4,
bool doSV =
false);
1199 err(
"setToEquilState");
1242 err(
"critTemperature");
1248 err(
"critPressure");
1273 err(
"satTemperature");
1288 err(
"vaprFraction");
1298 err(
"setState_sat");
1307 err(
"setState_sat");
1337 const std::vector<const XML_Node*> &
speciesData()
const;
1387 const std::string&
id);
1521 doublereal* dlnActCoeffds)
const {
1522 err(
"getdlnActCoeffds");
1543 err(
"getdlnActCoeffdlnX_diag");
1564 err(
"getdlnActCoeffdlnN_diag");
1588 virtual void getdlnActCoeffdlnN_numderiv(
const size_t ld, doublereal*
const dlnActCoeffdlnN);
1599 virtual std::string
report(
bool show_thermo =
true)
const;
1608 virtual void reportCSV(std::ofstream& csvFile)
const;
1617 std::vector<vector_fp>& data)
const;
1679 doublereal
err(
const std::string& msg)
const;
std::map< std::string, doublereal > compositionMap
Map connecting a string name with a double.
virtual void setState_HP(doublereal h, doublereal p, doublereal tol=1.e-4)
Set the internally stored specific enthalpy (J/kg) and pressure (Pa) of the phase.
ThermoPhase()
Constructor.
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the gibbs function of the reference state at the current temperature of the sol...
virtual doublereal vaporFraction() const
Return the fraction of vapor at the current conditions.
doublereal electricPotential() const
Returns the electric potential of this phase (V).
doublereal err(const std::string &msg) const
Error function that gets called for unhandled cases.
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
virtual void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
std::vector< const XML_Node * > m_speciesData
Vector of pointers to the species databases.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
virtual void setState_Psat(doublereal p, doublereal x)
Set the state to a saturated system at a particular pressure.
void setElectricPotential(doublereal v)
Set the electric potential of this phase (V).
virtual doublereal cv_vib(int, double) const
doublereal _RT() const
Return the Gas Constant multiplied by the current temperature.
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"
ThermoPhase & operator=(const ThermoPhase &right)
Assignment operator.
Header file for class Phase.
const int cAC_CONVENTION_MOLAR
Standard state uses the molar convention.
virtual doublereal maxTemp(size_t k=npos) const =0
Maximum temperature.
void setState_HPorUV(doublereal h, doublereal p, doublereal tol=1.e-4, bool doUV=false)
Carry out work in HP and UV calculations.
virtual void modifyOneHf298SS(const int k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
virtual void reportCSV(std::ofstream &csvFile) const
returns a summary of the state of the phase to a comma separated file.
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Virtual base class for the calculation of multiple-species thermodynamic reference-state property man...
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution...
Base class for phases of matter.
virtual void getdlnActCoeffdlnX_diag(doublereal *dlnActCoeffdlnX_diag) const
Get the array of ln mole fraction derivatives of the log activity coefficients - diagonal component o...
virtual doublereal critTemperature() const
Critical temperature (K).
vector_fp m_lambdaRRT
Vector of element potentials.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
virtual doublereal satPressure(doublereal t)
Return the saturation pressure given the temperature.
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.
Pure Virtual base class for the species thermo manager classes.
virtual void setState_PY(doublereal p, doublereal *y)
Set the internally stored pressure (Pa) and mass fractions.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual void getdlnActCoeffdlnN_diag(doublereal *dlnActCoeffdlnN_diag) const
Get the array of log species mole number derivatives of the log activity coefficients.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
doublereal intEnergy_mass() const
Specific internal energy.
ThermoPhase thermo_t
typedef for the ThermoPhase class
Base class for a phase with thermodynamic properties.
virtual void setReferenceComposition(const doublereal *const x)
Sets the reference composition.
bool getElementPotentials(doublereal *lambda) const
Returns the element potentials stored in the ThermoPhase object.
bool m_chargeNeutralityNecessary
Boolean indicating whether a charge neutrality condition is a necessity.
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.
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution...
virtual void getActivities(doublereal *a) const
Get the array of non-dimensional activities at the current solution temperature, pressure, and solution concentration.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual doublereal critDensity() const
Critical density (kg/m3).
doublereal gibbs_mass() const
Specific Gibbs function.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
doublereal entropy_mass() const
Specific entropy.
doublereal m_phi
Stored value of the electric potential for this phase.
doublereal molarVolume() const
Molar volume (m^3/kmol).
virtual void getUnitsStandardConc(double *uA, int k=0, int sizeUA=6) const
Returns the units of the standard and generalized concentrations.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
virtual void getdStandardVolumes_dT(doublereal *d_vol_dT) const
Get the derivative of the molar volumes of the species standard states wrt temperature at the current...
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
virtual void getdPartialMolarVolumes_dT(doublereal *d_vbar_dT) const
Return an array of derivatives of partial molar volumes wrt temperature for the species in the mixtur...
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
doublereal cp_mass() const
Specific heat at constant pressure.
bool chargeNeutralityNecessary() const
Returns the chargeNeutralityNecessity boolean.
virtual void setState_SP(doublereal s, doublereal p, doublereal tol=1.e-4)
Set the specific entropy (J/kg/K) and pressure (Pa).
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 Hf298SS(const int k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
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...
int m_ssConvention
Contains the standard state convention.
virtual doublereal refPressure(size_t k=npos) const =0
The reference-state pressure for species k.
virtual void getdlnActCoeffds(const doublereal dTds, const doublereal *const dXds, doublereal *dlnActCoeffds) const
Get the change in activity coefficients wrt changes in state (temp, mole fraction, etc) along a line in parameter space or along a line in physical space.
virtual void getReferenceComposition(doublereal *const x) const
Gets the reference composition.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
const int cAC_CONVENTION_MOLALITY
Standard state uses the molality convention.
doublereal cv_mass() const
Specific heat at constant volume.
void setElementPotentials(const vector_fp &lambda)
Stores the element potentials in the ThermoPhase object.
virtual void setState_UV(doublereal u, doublereal v, doublereal tol=1.e-4)
Set the specific internal energy (J/kg) and specific volume (m^3/kg).
virtual std::string report(bool show_thermo=true) const
returns a summary of the state of the phase as a string
virtual void getdStandardVolumes_dP(doublereal *d_vol_dP) const
Get the derivative molar volumes of the species standard states wrt pressure at the current T and P o...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual void setState_TP(doublereal t, doublereal p)
Set the temperature (K) and pressure (Pa)
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species reference states at the current T and P_ref of the solution...
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual doublereal critPressure() const
Critical pressure (Pa).
virtual doublereal minTemp(size_t k=npos) const =0
Minimum temperature.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
virtual void installSlavePhases(Cantera::XML_Node *phaseNode)
Add in species from Slave phases.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual void setState_SV(doublereal s, doublereal v, doublereal tol=1.e-4)
Set the specific entropy (J/kg/K) and specific volume (m^3/kg).
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
doublereal temperature() const
Temperature (K).
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
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.
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
void setState_SPorSV(doublereal s, doublereal p, doublereal tol=1.e-4, bool doSV=false)
Carry out work in SP and SV calculations.
virtual void getLnActivityCoefficients(doublereal *lnac) const
Get the array of non-dimensional molar-based ln activity coefficients at the current solution tempera...
virtual int eosType() const
Equation of state type flag.
doublereal enthalpy_mass() const
Specific enthalpy.
virtual void getdPartialMolarVolumes_dP(doublereal *d_vbar_dP) const
Return an array of derivatives of partial molar volumes wrt pressure for the species in the mixture...
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
virtual int activityConvention() const
This method returns the convention used in specification of the activities, of which there are curren...
const int cSS_CONVENTION_VPSS
Standard state uses the molality convention.
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< doublereal > xMol_Ref
Reference Mole Fraction Composition.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters.
virtual SpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
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 ...
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void setSpeciesThermo(SpeciesThermo *spthermo)
Install a species thermodynamic property manager.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
virtual void setState_Tsat(doublereal t, doublereal x)
Set the state to a saturated system at a particular temperature.
virtual ~ThermoPhase()
Destructor. Deletes the species thermo manager.
virtual doublereal satTemperature(doublereal p) const
Return the saturation temperature given the pressure.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
bool m_hasElementPotentials
Boolean indicating whether there is a valid set of saved element potentials for this phase...
void getElectrochemPotentials(doublereal *mu) const
Get the species electrochemical potentials.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
SpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
const int cSS_CONVENTION_SLAVE
Standard state thermodynamics is obtained from slave ThermoPhase objects.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature for which the thermodynamic data for the species or phase are valid...
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...