20 IdealGasPhase::IdealGasPhase() :
61 for (
size_t k = 0; k <
m_kk; k++) {
69 scale(gibbsrt.begin(), gibbsrt.end(), muStar,
RT());
71 for (
size_t k = 0; k <
m_kk; k++) {
81 for (
size_t k = 0; k <
m_kk; k++) {
83 mu[k] +=
RT() * log(xx);
90 scale(_h.begin(), _h.end(), hbar,
RT());
98 for (
size_t k = 0; k <
m_kk; k++) {
107 for (
size_t k = 0; k <
m_kk; k++) {
108 ubar[k] =
RT() * (_h[k] - 1.0);
121 for (
size_t k = 0; k <
m_kk; k++) {
131 copy(_h.begin(), _h.end(), hrt);
137 copy(_s.begin(), _s.end(), sr);
139 for (
size_t k = 0; k <
m_kk; k++) {
147 copy(gibbsrt.begin(), gibbsrt.end(), grt);
149 for (
size_t k = 0; k <
m_kk; k++) {
157 scale(gibbsrt.begin(), gibbsrt.end(), gpure,
RT());
159 for (
size_t k = 0; k <
m_kk; k++) {
167 for (
size_t k = 0; k <
m_kk; k++) {
168 urt[k] = _h[k] - 1.0;
175 copy(_cpr.begin(), _cpr.end(), cpr);
181 for (
size_t k = 0; k <
m_kk; k++) {
191 copy(_h.begin(), _h.end(), hrt);
197 copy(gibbsrt.begin(), gibbsrt.end(), grt);
203 scale(gibbsrt.begin(), gibbsrt.end(), g,
RT());
209 copy(_s.begin(), _s.end(), er);
215 for (
size_t k = 0; k <
m_kk; k++) {
216 urt[k] = _h[k] - 1.0;
223 copy(_cpr.begin(), _cpr.end(), cprt);
228 doublereal tmp =
RT() /
m_p0;
229 for (
size_t k = 0; k <
m_kk; k++) {
243 m_expg0_RT.push_back(0.0);
260 doublereal pres = 0.0;
261 for (
size_t k = 0; k <
m_kk; k++) {
262 double tmp = -grt[k] + mu_RT[k];
265 }
else if (tmp > 300.0) {
266 double tmp2 = tmp / 300.;
286 if (cached.
state1 != tnow) {
291 for (
size_t k = 0; k <
m_kk; k++) {
virtual doublereal cv_mole() const
Molar heat capacity at constant volume.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
int getId()
Get a unique id for a cached value.
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...
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual doublereal pressure() const
Pressure.
vector_fp m_pp
Temporary array containing internally calculated partial pressures.
doublereal temperature() const
Temperature (K).
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
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 getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
doublereal sum_xlogx() const
Evaluate .
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Class XML_Node is a tree-based representation of the contents of an XML file.
doublereal m_p0
Reference state pressure.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
void _updateThermo() const
Update the species reference state thermodynamic functions.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure.
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
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 getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution...
virtual doublereal entropy_mole() const
Molar entropy.
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
doublereal molarDensity() const
Molar density (kmol/m^3).
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
IdealGasPhase()
Default empty Constructor.
CachedScalar getScalar(int id)
Get a reference to a CachedValue object representing a scalar (doublereal) with the given id...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
ValueCache m_cache
Cached for saved calculations within each ThermoPhase.
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
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...
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.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
double state1
Value of the first state variable for the state at which value was evaluated, e.g.
size_t m_kk
Number of species in the phase.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
Namespace for the Cantera kernel.
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 void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
vector_fp m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.