Added an IntEnergy calculation routine.

This commit is contained in:
Harry Moffat 2007-05-11 17:40:16 +00:00
parent e3a04abeea
commit 8161cebeec
2 changed files with 28 additions and 2 deletions

View file

@ -322,6 +322,16 @@ namespace Cantera {
return sum;
}
/// The internal energy of the mixture (J).
doublereal MultiPhase::IntEnergy() const {
index_t i;
doublereal sum = 0.0;
updatePhases();
for (i = 0; i < m_np; i++)
sum += m_phase[i]->intEnergy_mole() * m_moles[i];
return sum;
}
/// The entropy of the mixture (J/K).
doublereal MultiPhase::entropy() const {
index_t i;

View file

@ -22,17 +22,30 @@ namespace Cantera {
//! number of phases of any type.
/*!
* All phases have the same
* temperature and pressure, and a specified number of moles.
* temperature and pressure, and a specified number of moles for
* each phase.
* The phases do not need to have the same elements. For example,
* a mixture might consist of a gaseous phase with elements (H,
* C, O, N), a solid carbon phase containing only element C,
* etc. A master element set will be constructed for the mixture
* that is the union of the elements of each phase.
* that is the intersection of the elements of each phase.
*
* This object is the basic tool used by Cantera for use in
* Multiphase equilibrium calculations.
*
* Below, reference is made to global species and global elements.
* These refer to the collective species and elements encompassing
* all of the phases tracked by the object.
*
* The global element list kept by this object is an
* intersection of the element lists of all the phases that
* comprise the MultiPhase.
*
* The global species list kept by this object is a
* concatenated list of all of the species in all the phases that
* comprise the MultiPhase. The ordering of species is contiguous
* with respect to the phase id.
*
* @ingroup equilfunctions
*/
class MultiPhase {
@ -333,6 +346,9 @@ namespace Cantera {
/// Enthalpy [J].
doublereal enthalpy() const;
/// Enthalpy [J].
doublereal IntEnergy() const;
/// Entropy [J/K].
doublereal entropy() const;