ThermoPhase.h Source File#
ThermoPhase.h
Go to the documentation of this file.
Header for a general species thermodynamic property manager for a phase (see MultiSpeciesThermo).
Header file for class Phase.
Header for unit conversion utilities, which are used to translate user input from input files (See In...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
A species thermodynamic property manager for a phase.
Definition MultiSpeciesThermo.h:47
virtual double refPressure() const
The reference-state pressure (Pa) for all species.
Definition MultiSpeciesThermo.cpp:152
virtual double minTemp(size_t k=npos) const
Minimum temperature.
Definition MultiSpeciesThermo.cpp:130
virtual double maxTemp(size_t k=npos) const
Maximum temperature.
Definition MultiSpeciesThermo.cpp:141
virtual void modifyOneHf298(const size_t k, const double Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
Definition MultiSpeciesThermo.cpp:187
virtual double reportOneHf298(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
Definition MultiSpeciesThermo.cpp:177
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
Class Phase is the base class for phases of matter, managing the species and elements in a phase,...
Definition Phase.h:95
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
virtual void getPartialMolarEnthalpies(double *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
Definition ThermoPhase.h:801
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.
Definition ThermoPhase.cpp:134
double electricPotential() const
Returns the electric potential of this phase (V).
Definition ThermoPhase.h:621
virtual void getEntropy_R(double *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Definition ThermoPhase.h:880
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).
Definition ThermoPhase.cpp:139
bool chargeNeutralityNecessary() const
Returns the chargeNeutralityNecessity boolean.
Definition ThermoPhase.h:516
virtual double cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition ThermoPhase.h:545
double equivalenceRatio() const
Compute the equivalence ratio for the current mixture from available oxygen and required oxygen.
Definition ThermoPhase.cpp:782
virtual void setParameters(const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap())
Set equation of state parameters from an AnyMap phase description.
Definition ThermoPhase.cpp:1084
virtual double thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition ThermoPhase.h:580
virtual void getEnthalpy_RT_ref(double *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
Definition ThermoPhase.h:949
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition ThermoPhase.cpp:1099
virtual void setState_TP(double t, double p)
Set the temperature (K) and pressure (Pa)
Definition ThermoPhase.cpp:121
virtual double standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Definition ThermoPhase.h:718
virtual void getCp_R_ref(double *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
Definition ThermoPhase.h:1005
virtual void setState_TV(double t, double v, double tol=1e-9)
Set the temperature (K) and specific volume (m^3/kg).
Definition ThermoPhase.h:1237
virtual double logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
Definition ThermoPhase.cpp:55
double o2Present(const double *y) const
Helper function for computing the amount of oxygen available in the current mixture.
Definition ThermoPhase.cpp:666
virtual void setState_PV(double p, double v, double tol=1e-9)
Set the pressure (Pa) and specific volume (m^3/kg).
Definition ThermoPhase.h:1253
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition ThermoPhase.cpp:145
virtual double minTemp(size_t k=npos) const
Minimum temperature for which the thermodynamic data for the species or phase are valid.
Definition ThermoPhase.h:451
virtual void getdlnActCoeffdlnN_diag(double *dlnActCoeffdlnN_diag) const
Get the array of log species mole number derivatives of the log activity coefficients.
Definition ThermoPhase.h:1901
virtual void setState_TPX(double t, double p, const double *x)
Set the temperature (K), pressure (Pa), and mole fractions.
Definition ThermoPhase.cpp:85
void setState_SPorSV(double s, double p, double tol=1e-9, bool doSV=false)
Carry out work in SP and SV calculations.
Definition ThermoPhase.cpp:464
double RT() const
Return the Gas Constant multiplied by the current temperature.
Definition ThermoPhase.h:1062
virtual void getPartialMolarCp(double *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
Definition ThermoPhase.h:832
virtual void getGibbs_RT_ref(double *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
Definition ThermoPhase.h:960
virtual void setState_TPY(double t, double p, const double *y)
Set the internally stored temperature (K), pressure (Pa), and mass fractions of the phase.
Definition ThermoPhase.cpp:103
double m_tlast
last value of the temperature processed by reference state
Definition ThermoPhase.h:1985
virtual void setState_ST(double s, double t, double tol=1e-9)
Set the specific entropy (J/kg/K) and temperature (K).
Definition ThermoPhase.h:1221
void setState_HPorUV(double h, double p, double tol=1e-9, bool doUV=false)
Carry out work in HP and UV calculations.
Definition ThermoPhase.cpp:262
virtual void getActivityConcentrations(double *c) const
This method returns an array of generalized concentrations.
Definition ThermoPhase.h:697
double stoichAirFuelRatio(const double *fuelComp, const double *oxComp, ThermoBasis basis=ThermoBasis::molar) const
Compute the stoichiometric air to fuel ratio (kg oxidizer / kg fuel) given fuel and oxidizer composit...
Definition ThermoPhase.cpp:700
string type() const override
String indicating the thermodynamic model implemented.
Definition ThermoPhase.h:399
AnyMap parameters(bool withInput=true) const
Returns the parameters of a ThermoPhase object such that an identical one could be reconstructed usin...
Definition ThermoPhase.cpp:1089
bool m_chargeNeutralityNecessary
Boolean indicating whether a charge neutrality condition is a necessity.
Definition ThermoPhase.h:1979
virtual void getPureGibbs(double *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
Definition ThermoPhase.h:901
virtual string report(bool show_thermo=true, double threshold=-1e-14) const
returns a summary of the state of the phase as a string
Definition ThermoPhase.cpp:1277
virtual void getPartialMolarIntEnergies(double *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
Definition ThermoPhase.h:821
virtual void getIntEnergy_RT(double *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Definition ThermoPhase.h:911
virtual void getCp_R(double *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Definition ThermoPhase.h:922
virtual double maxTemp(size_t k=npos) const
Maximum temperature for which the thermodynamic data for the species are valid.
Definition ThermoPhase.h:504
double m_phi
Stored value of the electric potential for this phase. Units are Volts.
Definition ThermoPhase.h:1969
virtual double isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
Definition ThermoPhase.h:569
double mixtureFraction(const double *fuelComp, const double *oxComp, ThermoBasis basis=ThermoBasis::molar, const string &element="Bilger") const
Compute the mixture fraction = kg fuel / (kg oxidizer + kg fuel) for the current mixture given fuel a...
Definition ThermoPhase.cpp:915
double o2Required(const double *y) const
Helper function for computing the amount of oxygen required for complete oxidation.
Definition ThermoPhase.cpp:637
virtual double satTemperature(double p) const
Return the saturation temperature given the pressure.
Definition ThermoPhase.h:1708
virtual void getdlnActCoeffds(const double dTds, const double *const dXds, double *dlnActCoeffds) const
Get the change in activity coefficients wrt changes in state (temp, mole fraction,...
Definition ThermoPhase.h:1861
void getElectrochemPotentials(double *mu) const
Get the species electrochemical potentials.
Definition ThermoPhase.cpp:76
virtual void getdlnActCoeffdlnN(const size_t ld, double *const dlnActCoeffdlnN)
Get the array of derivatives of the log activity coefficients with respect to the log of the species ...
Definition ThermoPhase.cpp:1212
virtual void getGibbs_RT(double *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
Definition ThermoPhase.h:890
virtual void getActivityCoefficients(double *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
Definition ThermoPhase.h:747
virtual string phaseOfMatter() const
String indicating the mechanical phase of the matter in this Phase.
Definition ThermoPhase.h:428
virtual void getStandardVolumes(double *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution.
Definition ThermoPhase.h:934
virtual void setState_Tsat(double t, double x)
Set the state to a saturated system at a particular temperature.
Definition ThermoPhase.h:1730
void setElectricPotential(double v)
Set the electric potential of this phase (V).
Definition ThermoPhase.h:612
virtual int activityConvention() const
This method returns the convention used in specification of the activities, of which there are curren...
Definition ThermoPhase.cpp:39
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition ThermoPhase.cpp:1016
virtual void getGibbs_ref(double *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
Definition ThermoPhase.h:971
virtual MultiSpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
Definition ThermoPhase.cpp:984
virtual void setState_UP(double u, double p, double tol=1e-9)
Set the specific internal energy (J/kg) and pressure (Pa).
Definition ThermoPhase.h:1269
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
Definition ThermoPhase.cpp:995
virtual void setState_SP(double s, double p, double tol=1e-9)
Set the specific entropy (J/kg/K) and pressure (Pa).
Definition ThermoPhase.cpp:453
virtual void modifyOneHf298SS(const size_t k, const double Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1)
Definition ThermoPhase.h:481
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
Definition ThermoPhase.cpp:44
void modifySpecies(size_t k, shared_ptr< Species > spec) override
Modify the thermodynamic data associated with a species.
Definition ThermoPhase.cpp:1068
virtual void setState_SH(double s, double h, double tol=1e-9)
Set the specific entropy (J/kg/K) and the specific enthalpy (J/kg)
Definition ThermoPhase.h:1317
virtual void getdlnActCoeffdlnX_diag(double *dlnActCoeffdlnX_diag) const
Get the array of ln mole fraction derivatives of the log activity coefficients - diagonal component o...
Definition ThermoPhase.h:1881
void invalidateCache() override
Invalidate any cached values which are normally updated only when a change in state is detected.
Definition ThermoPhase.cpp:1162
virtual void getActivities(double *a) const
Get the array of non-dimensional activities at the current solution temperature, pressure,...
Definition ThermoPhase.cpp:60
void setMixtureFraction(double mixFrac, const double *fuelComp, const double *oxComp, ThermoBasis basis=ThermoBasis::molar)
Set the mixture composition according to the mixture fraction = kg fuel / (kg oxidizer + kg fuel)
Definition ThermoPhase.cpp:858
virtual void getStandardVolumes_ref(double *vol) const
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
Definition ThermoPhase.h:1017
virtual double vaporFraction() const
Return the fraction of vapor at the current conditions.
Definition ThermoPhase.h:1721
virtual void resetHf298(const size_t k=npos)
Restore the original heat of formation of one or more species.
Definition ThermoPhase.cpp:28
virtual void getStandardChemPotentials(double *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Definition ThermoPhase.h:860
virtual void getEnthalpy_RT(double *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Definition ThermoPhase.h:870
virtual void getEntropy_R_ref(double *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
Definition ThermoPhase.h:982
virtual void getChemPotentials(double *mu) const
Get the species chemical potentials. Units: J/kmol.
Definition ThermoPhase.h:775
double cp_mass() const
Specific heat at constant pressure. Units: J/kg/K.
Definition ThermoPhase.h:1048
virtual void setState_TH(double t, double h, double tol=1e-9)
Set the temperature (K) and the specific enthalpy (J/kg)
Definition ThermoPhase.h:1301
virtual void getLnActivityCoefficients(double *lnac) const
Get the array of non-dimensional molar-based ln activity coefficients at the current solution tempera...
Definition ThermoPhase.cpp:68
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition ThermoPhase.h:1831
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
Definition ThermoPhase.cpp:49
virtual void getIntEnergy_RT_ref(double *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
Definition ThermoPhase.h:993
double Hf298SS(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1)
Definition ThermoPhase.h:466
virtual double cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition ThermoPhase.h:550
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
Definition ThermoPhase.h:1962
virtual double satPressure(double t)
Return the saturation pressure given the temperature.
Definition ThermoPhase.h:1716
virtual double critCompressibility() const
Critical compressibility (unitless).
Definition ThermoPhase.h:1688
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition ThermoPhase.cpp:1054
virtual double intEnergy_mole() const
Molar internal energy. Units: J/kmol.
Definition ThermoPhase.h:530
virtual void setState_DP(double rho, double p)
Set the density (kg/m**3) and pressure (Pa) at constant composition.
Definition ThermoPhase.h:1335
void setEquivalenceRatio(double phi, const double *fuelComp, const double *oxComp, ThermoBasis basis=ThermoBasis::molar)
Set the mixture composition according to the equivalence ratio.
Definition ThermoPhase.cpp:731
void setState_TPQ(double T, double P, double Q)
Set the temperature, pressure, and vapor fraction (quality).
Definition ThermoPhase.cpp:1025
virtual void setState_VH(double v, double h, double tol=1e-9)
Set the specific volume (m^3/kg) and the specific enthalpy (J/kg)
Definition ThermoPhase.h:1285
virtual void getPartialMolarEntropies(double *sbar) const
Returns an array of partial molar entropies of the species in the solution.
Definition ThermoPhase.h:811
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).
Definition ThermoPhase.cpp:458
const AnyMap & input() const
Access input data associated with the phase description.
Definition ThermoPhase.cpp:1152
virtual void setState_Psat(double p, double x)
Set the state to a saturated system at a particular pressure.
Definition ThermoPhase.h:1739
void setState_conditional_TP(double t, double p, bool set_p)
Helper function used by setState_HPorUV and setState_SPorSV.
Definition ThermoPhase.cpp:254
virtual void getPartialMolarVolumes(double *vbar) const
Return an array of partial molar volumes for the species in the mixture.
Definition ThermoPhase.h:842
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
void equilibrate(const string &XY, const 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.
Definition ThermoPhase.cpp:1167
virtual bool compatibleWithMultiPhase() const
Indicates whether this phase type can be used with class MultiPhase for equilibrium calculations.
Definition ThermoPhase.h:1661
virtual void setToEquilState(const double *mu_RT)
This method is used by the ChemEquil equilibrium solver.
Definition ThermoPhase.h:1654
const int cSS_CONVENTION_VPSS
Standard state uses the molality convention.
Definition ThermoPhase.h:146
const int cSS_CONVENTION_TEMPERATURE
Standard state uses the molar convention.
Definition ThermoPhase.h:144
ThermoBasis
Differentiate between mole fractions and mass fractions for input mixture composition.
Definition ThermoPhase.h:154
const int cSS_CONVENTION_SLAVE
Standard state thermodynamics is obtained from slave ThermoPhase objects.
Definition ThermoPhase.h:148
const int cAC_CONVENTION_MOLALITY
Standard state uses the molality convention.
Definition ThermoPhase.h:137
Generated by 1.9.7