17 IdealGasPhase::IdealGasPhase() :
39 m_logc0(right.m_logc0)
58 m_expg0_RT = right.m_expg0_RT;
88 warn_deprecated(
"IdealGasPhase::cv_tr",
"To be removed after Cantera 2.2.");
95 doublereal refPressure_;
98 throw CanteraError(
"Error in IdealGasPhase.cpp",
"cv_tr only supported for StatMech!. \n\n");
109 warn_deprecated(
"IdealGasPhase::cv_trans",
"To be removed after Cantera 2.2.");
115 warn_deprecated(
"IdealGasPhase::cv_rot",
"To be removed after Cantera 2.2.");
121 warn_deprecated(
"IdealGasPhase::cv_vib",
"To be removed after Cantera 2.2.");
128 doublereal refPressure_;
134 throw CanteraError(
"Error in IdealGasPhase.cpp",
"cv_vib only supported for StatMech!. \n\n");
151 for (
size_t k = 0; k <
m_kk; k++) {
159 scale(gibbsrt.begin(), gibbsrt.end(), muStar,
_RT());
162 for (
size_t k = 0; k <
m_kk; k++) {
173 for (
size_t k = 0; k <
m_kk; k++) {
175 mu[k] += rt * (log(xx));
183 scale(_h.begin(), _h.end(), hbar, rt);
191 for (
size_t k = 0; k <
m_kk; k++) {
201 for (
size_t k = 0; k <
m_kk; k++) {
202 ubar[k] = rt * (_h[k] - 1.0);
215 for (
size_t k = 0; k <
m_kk; k++) {
225 copy(_h.begin(), _h.end(), hrt);
231 copy(_s.begin(), _s.end(), sr);
233 for (
size_t k = 0; k <
m_kk; k++) {
241 copy(gibbsrt.begin(), gibbsrt.end(), grt);
243 for (
size_t k = 0; k <
m_kk; k++) {
251 scale(gibbsrt.begin(), gibbsrt.end(), gpure,
_RT());
254 for (
size_t k = 0; k <
m_kk; k++) {
262 for (
size_t k = 0; k <
m_kk; k++) {
263 urt[k] = _h[k] - 1.0;
270 copy(_cpr.begin(), _cpr.end(), cpr);
276 for (
size_t k = 0; k <
m_kk; k++) {
286 copy(_h.begin(), _h.end(), hrt);
292 copy(gibbsrt.begin(), gibbsrt.end(), grt);
298 scale(gibbsrt.begin(), gibbsrt.end(), g,
_RT());
304 copy(_s.begin(), _s.end(), er);
310 for (
size_t k = 0; k <
m_kk; k++) {
311 urt[k] = _h[k] - 1.0;
318 copy(_cpr.begin(), _cpr.end(), cprt);
324 for (
size_t k = 0; k <
m_kk; k++) {
335 m_expg0_RT.resize(
m_kk);
353 doublereal pres = 0.0;
354 for (
size_t k = 0; k <
m_kk; k++) {
355 double tmp = -grt[k] + mu_RT[k];
358 }
else if (tmp > 300.0) {
359 double tmp2 = tmp / 300.;
379 if (cached.
state1 != tnow) {
384 for (
size_t k = 0; k <
m_kk; k++) {
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the species standard states at the current T an...
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
virtual void setToEquilState(const doublereal *lambda_RT)
Method used by the ChemEquil equilibrium solver.
void _updateThermo() const
Update the species reference state thermodynamic functions.
int getId()
Get a unique id for a cached value.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
ThermoPhase * duplMyselfAsThermoPhase() const
Duplicator from the ThermoPhase parent class.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
vector_fp m_pp
Temporary array containing internally calculated partial pressures.
virtual void getPartialMolarCp(doublereal *cpbar) const
Get the partial molar heat capacities Units: J/kmol/K.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
doublereal _RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state...
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
ThermoPhase & operator=(const ThermoPhase &right)
Assignment operator.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current 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...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual doublereal pressure() const
Pressure.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Get the species partial molar enthalpies. Units: J/kmol.
doublereal m_p0
Reference state pressure.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Get the species partial molar enthalpies. Units: J/kmol.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume.
doublereal molarDensity() const
Molar density (kmol/m^3).
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
virtual int reportType(size_t index=npos) const =0
This utility function reports the type of parameterization used for the species with index number ind...
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
Base class for a phase with thermodynamic properties.
virtual doublereal cv_trans() const
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty ThermoPhase object.
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
doublereal sum_xlogx() const
Evaluate .
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 getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
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 getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species standard states at the current ...
ValueCache m_cache
Cached for saved calculations within each ThermoPhase.
virtual doublereal refPressure(size_t k=npos) const =0
The reference-state pressure for species k.
doublereal m_logc0
Temporary storage for log of p/RT.
Base class for exceptions thrown by Cantera classes.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Get the species partial molar volumes. Units: m^3/kmol.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
IdealGasPhase & operator=(const IdealGasPhase &right)
Assignment operator.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
doublereal temperature() const
Temperature (K).
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
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.
Templates for operations on vector-like objects.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
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 setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
virtual doublereal cv_rot(double atomicity) const
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the dimensionless reference state enthalpy vector.
double state1
Value of the first state variable for the state at which value was evaluated, e.g.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species standard states at the current T and P of the ...
size_t m_kk
Number of species in the phase.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species standard states at their standard states at...
virtual void reportParams(size_t index, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const =0
This utility function reports back the type of parameterization and all of the parameters for the spe...
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const =0
Compute the reference-state properties for all species.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
virtual void getPartialMolarEntropies(doublereal *sbar) const
Get the species partial molar entropies. Units: J/kmol/K.
virtual doublereal cv_tr(doublereal) const
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P_ref of the solution...
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
SpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual doublereal cv_vib(int k, doublereal T) const
vector_fp m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
virtual doublereal entropy_mole() const
Molar entropy.