Cantera  2.2.1

Class Phase is the base class for phases of matter, managing the species and elements in a phase, as well as the independent variables of temperature, mass density, species mass/mole fraction, and other generalized forces and intrinsic properties (such as electric potential) that define the thermodynamic state. More...

#include <Phase.h>

Inheritance diagram for Phase:
[legend]
Collaboration diagram for Phase:
[legend]

## Public Member Functions

Phase ()
Default constructor. More...

virtual ~Phase ()
Destructor. More...

Phase (const Phase &right)
Copy Constructor. More...

Phaseoperator= (const Phase &right)
Assignment operator. More...

XML_Nodexml () const
Returns a const reference to the XML_Node that describes the phase. More...

void setXMLdata (XML_Node &xmlPhase)
Stores the XML tree information for the current phase. More...

void saveState (vector_fp &state) const
Save the current internal state of the phase Write to vector 'state' the current internal state. More...

void saveState (size_t lenstate, doublereal *state) const
Write to array 'state' the current internal state. More...

void restoreState (const vector_fp &state)
Restore a state saved on a previous call to saveState. More...

void restoreState (size_t lenstate, const doublereal *state)
Restore the state of the phase from a previously saved state vector. More...

doublereal molecularWeight (size_t k) const
Molecular weight of species k. More...

void getMolecularWeights (vector_fp &weights) const
Copy the vector of molecular weights into vector weights. More...

void getMolecularWeights (doublereal *weights) const
Copy the vector of molecular weights into array weights. More...

const vector_fpmolecularWeights () const
Return a const reference to the internal vector of molecular weights. More...

doublereal size (size_t k) const
This routine returns the size of species k. More...

doublereal charge (size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the magnitude of the electron charge. More...

doublereal chargeDensity () const
Charge density [C/m^3]. More...

size_t nDim () const
Returns the number of spatial dimensions (1, 2, or 3) More...

void setNDim (size_t ndim)
Set the number of spatial dimensions (1, 2, or 3). More...

Returns a bool indicating whether the object is ready for use. More...

int stateMFNumber () const
Return the State Mole Fraction Number. More...

Name and ID

Class Phase contains two strings that identify a phase. The ID is the value of the ID attribute of the XML phase node that is used to initialize a phase when it is read. The name field is also initialized to the value of the ID attribute of the XML phase node.

However, the name field may be changed to another value during the course of a calculation. For example, if a phase is located in two places, but has the same constitutive input, the IDs of the two phases will be the same, but the names of the two phases may be different.

It is an error to have two phases in a single problem with the same name and ID (or the name from one phase being the same as the id of another phase). Thus, it is expected that there is a 1-1 correspondence between names and unique phases within a Cantera problem.

std::string id () const
Return the string id for the phase. More...

void setID (const std::string &id)
Set the string id for the phase. More...

std::string name () const
Return the name of the phase. More...

void setName (const std::string &nm)
Sets the string name for the phase. More...

Element and Species Information
std::string elementName (size_t m) const
Name of the element with index m. More...

size_t elementIndex (const std::string &name) const
Return the index of element named 'name'. More...

const std::vector< std::string > & elementNames () const
Return a read-only reference to the vector of element names. More...

doublereal atomicWeight (size_t m) const
Atomic weight of element m. More...

doublereal entropyElement298 (size_t m) const
Entropy of the element in its standard state at 298 K and 1 bar. More...

int atomicNumber (size_t m) const
Atomic number of element m. More...

int elementType (size_t m) const
Return the element constraint type Possible types include: More...

int changeElementType (int m, int elem_type)
Change the element type of the mth constraint Reassigns an element type. More...

const vector_fpatomicWeights () const
Return a read-only reference to the vector of atomic weights. More...

size_t nElements () const
Number of elements. More...

void checkElementIndex (size_t m) const
Check that the specified element index is in range Throws an exception if m is greater than nElements()-1. More...

void checkElementArraySize (size_t mm) const
Check that an array size is at least nElements() Throws an exception if mm is less than nElements(). More...

doublereal nAtoms (size_t k, size_t m) const
Number of atoms of element m in species k. More...

void getAtoms (size_t k, double *atomArray) const
Get a vector containing the atomic composition of species k. More...

size_t speciesIndex (const std::string &name) const
Returns the index of a species named 'name' within the Phase object. More...

std::string speciesName (size_t k) const
Name of the species with index k. More...

std::string speciesSPName (int k) const
Returns the expanded species name of a species, including the phase name This is guaranteed to be unique within a Cantera problem. More...

const std::vector< std::string > & speciesNames () const
Return a const reference to the vector of species names. More...

size_t nSpecies () const
Returns the number of species in the phase. More...

void checkSpeciesIndex (size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1. More...

void checkSpeciesArraySize (size_t kk) const
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). More...

Set thermodynamic state

Set the internal thermodynamic state by setting the internally stored temperature, density and species composition. Note that the composition is always set first.

Temperature and density are held constant if not explicitly set.

void setMoleFractionsByName (const compositionMap &xMap)
Set the species mole fractions by name. More...

void setMoleFractionsByName (const std::string &x)
Set the mole fractions of a group of species by name. More...

void setMassFractionsByName (const compositionMap &yMap)
Set the species mass fractions by name. More...

void setMassFractionsByName (const std::string &x)
Set the species mass fractions by name. More...

void setState_TRX (doublereal t, doublereal dens, const doublereal *x)
Set the internally stored temperature (K), density, and mole fractions. More...

void setState_TRX (doublereal t, doublereal dens, const compositionMap &x)
Set the internally stored temperature (K), density, and mole fractions. More...

void setState_TRY (doublereal t, doublereal dens, const doublereal *y)
Set the internally stored temperature (K), density, and mass fractions. More...

void setState_TRY (doublereal t, doublereal dens, const compositionMap &y)
Set the internally stored temperature (K), density, and mass fractions. More...

void setState_TNX (doublereal t, doublereal n, const doublereal *x)
Set the internally stored temperature (K), molar density (kmol/m^3), and mole fractions. More...

void setState_TR (doublereal t, doublereal rho)
Set the internally stored temperature (K) and density (kg/m^3) More...

void setState_TX (doublereal t, doublereal *x)
Set the internally stored temperature (K) and mole fractions. More...

void setState_TY (doublereal t, doublereal *y)
Set the internally stored temperature (K) and mass fractions. More...

void setState_RX (doublereal rho, doublereal *x)
Set the density (kg/m^3) and mole fractions. More...

void setState_RY (doublereal rho, doublereal *y)
Set the density (kg/m^3) and mass fractions. More...

Composition
void getMoleFractionsByName (compositionMap &x) const
Get the mole fractions by name. More...

compositionMap getMoleFractionsByName (double threshold=0.0) const
Get the mole fractions by name. More...

doublereal moleFraction (size_t k) const
Return the mole fraction of a single species. More...

doublereal moleFraction (const std::string &name) const
Return the mole fraction of a single species. More...

compositionMap getMassFractionsByName (double threshold=0.0) const
Get the mass fractions by name. More...

doublereal massFraction (size_t k) const
Return the mass fraction of a single species. More...

doublereal massFraction (const std::string &name) const
Return the mass fraction of a single species. More...

void getMoleFractions (doublereal *const x) const
Get the species mole fraction vector. More...

virtual void setMoleFractions (const doublereal *const x)
Set the mole fractions to the specified values There is no restriction on the sum of the mole fraction vector. More...

virtual void setMoleFractions_NoNorm (const doublereal *const x)
Set the mole fractions to the specified values without normalizing. More...

void getMassFractions (doublereal *const y) const
Get the species mass fractions. More...

const doublereal * massFractions () const
Return a const pointer to the mass fraction array. More...

virtual void setMassFractions (const doublereal *const y)
Set the mass fractions to the specified values and normalize them. More...

virtual void setMassFractions_NoNorm (const doublereal *const y)
Set the mass fractions to the specified values without normalizing. More...

void getConcentrations (doublereal *const c) const
Get the species concentrations (kmol/m^3). More...

doublereal concentration (const size_t k) const
Concentration of species k. More...

virtual void setConcentrations (const doublereal *const conc)
Set the concentrations to the specified values within the phase. More...

doublereal elementalMassFraction (const size_t m) const
Elemental mass fraction of element m. More...

doublereal elementalMoleFraction (const size_t m) const
Elemental mole fraction of element m. More...

const doublereal * moleFractdivMMW () const
Returns a const pointer to the start of the moleFraction/MW array. More...

Thermodynamic Properties
doublereal temperature () const
Temperature (K). More...

virtual doublereal density () const
Density (kg/m^3). More...

doublereal molarDensity () const
Molar density (kmol/m^3). More...

doublereal molarVolume () const
Molar volume (m^3/kmol). More...

virtual void setDensity (const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent variable. More...

virtual void setMolarDensity (const doublereal molarDensity)
Set the internally stored molar density (kmol/m^3) of the phase. More...

virtual void setTemperature (const doublereal temp)
Set the internally stored temperature of the phase (K). More...

Mean Properties
doublereal mean_X (const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q. More...

doublereal mean_X (const vector_fp &Q) const
Evaluate the mole-fraction-weighted mean of an array Q. More...

doublereal mean_Y (const doublereal *const Q) const
Evaluate the mass-fraction-weighted mean of an array Q. More...

doublereal meanMolecularWeight () const
The mean molecular weight. Units: (kg/kmol) More...

doublereal sum_xlogx () const
Evaluate $$\sum_k X_k \log X_k$$. More...

doublereal sum_xlogQ (doublereal *const Q) const
Evaluate $$\sum_k X_k \log Q_k$$. More...

These methods are used to add new elements or species.

These are not usually called by user programs.

Since species are checked to insure that they are only composed of declared elements, it is necessary to first add all elements before adding any species.

size_t addElement (const std::string &symbol, doublereal weight=-12345.0, int atomicNumber=0, doublereal entropy298=ENTROPY298_UNKNOWN, int elem_type=CT_ELEM_TYPE_ABSPOS)

Add an element from an XML specification. More...

void addUniqueElement (const std::string &symbol, doublereal weight=-12345.0, int atomicNumber=0, doublereal entropy298=ENTROPY298_UNKNOWN, int elem_type=CT_ELEM_TYPE_ABSPOS)
Add an element, checking for uniqueness The uniqueness is checked by comparing the string symbol. More...

Add an element, checking for uniqueness The uniqueness is checked by comparing the string symbol. More...

Add all elements referenced in an XML_Node tree. More...

void freezeElements ()

bool elementsFrozen ()
True if freezeElements has been called. More...

size_t addUniqueElementAfterFreeze (const std::string &symbol, doublereal weight, int atomicNumber, doublereal entropy298=ENTROPY298_UNKNOWN, int elem_type=CT_ELEM_TYPE_ABSPOS)
Add an element after elements have been frozen, checking for uniqueness The uniqueness is checked by comparing the string symbol. More...

virtual bool addSpecies (shared_ptr< Species > spec)
Add a Species to this Phase. More...

void addSpecies (const std::string &name, const doublereal *comp, doublereal charge=0.0, doublereal size=1.0)

void addUniqueSpecies (const std::string &name, const doublereal *comp, doublereal charge=0.0, doublereal size=1.0)
Add a species to the phase, checking for uniqueness of the name This routine checks for uniqueness of the string name. More...

shared_ptr< Speciesspecies (const std::string &name) const
Return the Species object for the named species. More...

shared_ptr< Speciesspecies (size_t k) const
Return the Species object for species whose index is k. More...

void ignoreUndefinedElements ()
Set behavior when adding a species containing undefined elements to just skip the species. More...

Set behavior when adding a species containing undefined elements to add those elements to the phase. More...

void throwUndefinedElements ()
Set the behavior when adding a species containing undefined elements to throw an exception. More...

## Public Attributes

enum CT_RealNumber_Range_Behavior realNumberRangeBehavior_
Overflow behavior of real number calculations involving this thermo object. More...

## Protected Member Functions

void setMolecularWeight (const int k, const double mw)
Set the molecular weight of a single species to a given value. More...

## Protected Attributes

ValueCache m_cache
Cached for saved calculations within each ThermoPhase. More...

size_t m_kk
Number of species in the phase. More...

size_t m_ndim
Dimensionality of the phase. More...

vector_fp m_speciesComp
Atomic composition of the species. More...

vector_fp m_speciesSize
Vector of species sizes. More...

vector_fp m_speciesCharge
Vector of species charges. length m_kk. More...

std::map< std::string,
shared_ptr< Species > >
m_species

UndefElement::behavior m_undefinedElementBehavior
Flag determining behavior when adding species with an undefined element. More...

## Private Attributes

XML_Nodem_xml
XML node containing the XML info for this phase. More...

std::string m_id
ID of the phase. More...

std::string m_name
Name of the phase. More...

doublereal m_temp
Temperature (K). This is an independent variable. More...

doublereal m_dens
Density (kg m-3). More...

doublereal m_mmw
mean molecular weight of the mixture (kg kmol-1) More...

vector_fp m_ym
m_ym[k] = mole fraction of species k divided by the mean molecular weight of mixture. More...

vector_fp m_y
Mass fractions of the species. More...

vector_fp m_molwts
species molecular weights (kg kmol-1) More...

vector_fp m_rmolwts
inverse of species molecular weights (kmol kg-1) More...

int m_stateNum
State Change variable. More...

std::vector< std::string > m_speciesNames
Vector of the species names. More...

std::map< std::string, size_t > m_speciesIndices
Map of species names to indices. More...

size_t m_mm
Number of elements. More...

vector_fp m_atomicWeights
element atomic weights (kg kmol-1) More...

vector_int m_atomicNumbers
element atomic numbers More...

std::vector< std::string > m_elementNames
element names More...

vector_int m_elem_type
Vector of element types. More...

vector_fp m_entropy298
Entropy at 298.15 K and 1 bar of stable state pure elements (J kmol-1) More...

## Detailed Description

Class Phase is the base class for phases of matter, managing the species and elements in a phase, as well as the independent variables of temperature, mass density, species mass/mole fraction, and other generalized forces and intrinsic properties (such as electric potential) that define the thermodynamic state.

Class Phase provides information about the elements and species in a phase - names, index numbers (location in arrays), atomic or molecular weights, etc. The set of elements must include all those that compose the species, but may include additional elements.

It also stores an array of species molecular weights, which are used to convert between mole and mass representations of the composition. For efficiency in mass/mole conversion, the vector of mass fractions divided by molecular weight $$Y_k/M_k$$ is also stored.

Class Phase is not usually used directly. Its primary use is as a base class for class ThermoPhase. It is not generally necessary to overloaded any of class Phase's methods, with the exception of incompressible phases. In that case, the density must be replaced by the pressure as the independent variable and functions such as setMassFraction within class Phase must actually now calculate the density (at constant T and P) instead of leaving it alone as befits an independent variable. This also applies for nearly- incompressible phases or phases which utilize standard states based on a T and P, in which case they need to overload these functions too.

Class Phase contains a number of utility functions that will set the state of the phase in its entirety, by first setting the composition, then the temperature and then the density. An example of this is the function Phase::setState_TRY(double t, double dens, const double* y).

Class Phase contains method for saving and restoring the full internal states of each phase. These are saveState() and restoreState(). These functions operate on a state vector, which is in general of length (2 + nSpecies()). The first two entries of the state vector are temperature and density.

A species name may be referred to via three methods:

• "speciesName"
• "PhaseId:speciesName"
• "phaseName:speciesName"

The first two methods of naming may not yield a unique species within complicated assemblies of Cantera Phases.

Todo:
Make the concept of saving state vectors more general, so that it can handle other cases where there are additional internal state variables, such as the voltage, a potential energy, or a strain field.

Specify that the input mole, mass, and volume fraction vectors must sum to one on entry to the set state routines. Non-conforming mole/mass fraction vectors are not thermodynamically consistent. Moreover, unless we do this, the calculation of Jacobians will be altered whenever the treatment of non-conforming mole fractions is changed. Add setState functions corresponding to specifying mole numbers, which is actually what is being done (well one of the options, there are many) when non-conforming mole fractions are input. Note, we realize that most numerical Jacobian and some analytical Jacobians use non-conforming calculations. These can easily be changed to the set mole number setState functions.

Definition at line 92 of file Phase.h.

## Constructor & Destructor Documentation

 Phase ( )

Default constructor.

Definition at line 19 of file Phase.cpp.

 ~Phase ( )
virtual

Destructor.

Definition at line 114 of file Phase.cpp.

References Phase::m_xml, and XML_Node::root().

 Phase ( const Phase & right )

Copy Constructor.

Parameters
 right Reference to the class to be used in the copy

Definition at line 35 of file Phase.cpp.

References Phase::operator=().

## Member Function Documentation

 Phase & operator= ( const Phase & right )

Assignment operator.

Parameters
 right Reference to the class to be used in the copy

Definition at line 53 of file Phase.cpp.

Referenced by Phase::Phase().

 XML_Node & xml ( ) const

Returns a const reference to the XML_Node that describes the phase.

The XML_Node for the phase contains all of the input data used to set up the model for the phase during its initialization.

Definition at line 123 of file Phase.cpp.

References Phase::m_xml.

 void setXMLdata ( XML_Node & xmlPhase )

Stores the XML tree information for the current phase.

This function now stores the complete XML_Node tree as read into the code via a file. This is needed to move around within the XML tree during construction of transport and kinetics mechanisms after copy construction operations.

Parameters
 xmlPhase Reference to the XML node corresponding to the phase

Definition at line 128 of file Phase.cpp.

References Cantera::findXMLPhase(), XML_Node::id(), Phase::m_xml, and XML_Node::root().

Referenced by IonsFromNeutralVPSSTP::constructPhaseFile(), and Cantera::importPhase().

 std::string id ( ) const

Return the string id for the phase.

Definition at line 147 of file Phase.cpp.

References Phase::m_id.

 void setID ( const std::string & id )

Set the string id for the phase.

Parameters
 id String id of the phase

Definition at line 152 of file Phase.cpp.

References Phase::m_id.

Referenced by FixedChemPotSSTP::FixedChemPotSSTP(), and Cantera::importPhase().

 std::string name ( ) const

Return the name of the phase.

Names are unique within a Cantera problem.

Definition at line 157 of file Phase.cpp.

References Phase::m_name.

 void setName ( const std::string & nm )

Sets the string name for the phase.

Parameters
 nm String name of the phase

Definition at line 162 of file Phase.cpp.

References Phase::m_name.

Referenced by FixedChemPotSSTP::FixedChemPotSSTP(), and Cantera::importPhase().

 string elementName ( size_t m ) const

Name of the element with index m.

Parameters
 m Element index.

Definition at line 186 of file Phase.cpp.

References Phase::checkElementIndex(), and Phase::m_elementNames.

 size_t elementIndex ( const std::string & name ) const

Return the index of element named 'name'.

The index is an integer assigned to each element in the order it was added. Returns npos if the specified element is not found.

Parameters
 name Name of the element

Definition at line 192 of file Phase.cpp.

References Phase::m_elementNames, Phase::m_mm, and Cantera::npos.

 const vector< string > & elementNames ( ) const

Return a read-only reference to the vector of element names.

Definition at line 202 of file Phase.cpp.

References Phase::m_elementNames.

Referenced by IonsFromNeutralVPSSTP::initThermoXML().

 doublereal atomicWeight ( size_t m ) const

Atomic weight of element m.

Parameters
 m Element index

Definition at line 207 of file Phase.cpp.

References Phase::m_atomicWeights.

Referenced by Phase::elementalMassFraction(), ChemEquil::initialize(), and WaterSSTP::initThermoXML().

 doublereal entropyElement298 ( size_t m ) const

Entropy of the element in its standard state at 298 K and 1 bar.

Parameters
 m Element index

Definition at line 212 of file Phase.cpp.

References AssertThrowMsg, AssertTrace, ENTROPY298_UNKNOWN, Phase::m_entropy298, and Phase::m_mm.

Referenced by LatticeSolidPhase::installSlavePhases(), and PDSS_HKFT::LookupGe().

 int atomicNumber ( size_t m ) const

Atomic number of element m.

Parameters
 m Element index

Definition at line 226 of file Phase.cpp.

References Phase::m_atomicNumbers.

 int elementType ( size_t m ) const

Return the element constraint type Possible types include:

CT_ELEM_TYPE_TURNEDOFF -1 CT_ELEM_TYPE_ABSPOS 0 CT_ELEM_TYPE_ELECTRONCHARGE 1 CT_ELEM_TYPE_CHARGENEUTRALITY 2 CT_ELEM_TYPE_LATTICERATIO 3 CT_ELEM_TYPE_KINETICFROZEN 4 CT_ELEM_TYPE_SURFACECONSTRAINT 5 CT_ELEM_TYPE_OTHERCONSTRAINT 6

The default is CT_ELEM_TYPE_ABSPOS.

Parameters
 m Element index
Returns
Returns the element type

Definition at line 231 of file Phase.cpp.

References Phase::m_elem_type.

Referenced by LatticeSolidPhase::installSlavePhases(), and vcs_VolPhase::transferElementsFM().

 int changeElementType ( int m, int elem_type )

Change the element type of the mth constraint Reassigns an element type.

Parameters
 m Element index elem_type New elem type to be assigned
Returns
Returns the old element type

Definition at line 236 of file Phase.cpp.

References Phase::m_elem_type.

 const vector_fp & atomicWeights ( ) const

Return a read-only reference to the vector of atomic weights.

Definition at line 221 of file Phase.cpp.

References Phase::m_atomicWeights.

 size_t nElements ( ) const
 void checkElementIndex ( size_t m ) const

Check that the specified element index is in range Throws an exception if m is greater than nElements()-1.

Definition at line 172 of file Phase.cpp.

References Phase::m_mm.

 void checkElementArraySize ( size_t mm ) const

Check that an array size is at least nElements() Throws an exception if mm is less than nElements().

Used before calls which take an array pointer.

Definition at line 179 of file Phase.cpp.

References Phase::m_mm.

 doublereal nAtoms ( size_t k, size_t m ) const

Number of atoms of element m in species k.

Parameters
 k species index m element index

Definition at line 243 of file Phase.cpp.

 void getAtoms ( size_t k, double * atomArray ) const

Get a vector containing the atomic composition of species k.

Parameters
 k species index atomArray vector containing the atomic number in the species. Length: m_mm

Definition at line 250 of file Phase.cpp.

References Phase::m_mm, and Phase::m_speciesComp.

 size_t speciesIndex ( const std::string & name ) const

Returns the index of a species named 'name' within the Phase object.

The first species in the phase will have an index 0, and the last one will have an index of nSpecies() - 1.

Parameters
 name String name of the species. It may also be in the form phaseName:speciesName
Returns
The index of the species. If the name is not found, the value npos is returned.

Definition at line 257 of file Phase.cpp.

 std::string speciesSPName ( int k ) const

Returns the expanded species name of a species, including the phase name This is guaranteed to be unique within a Cantera problem.

Parameters
 k Species index within the phase
Returns
The "phaseName:speciesName" string

Definition at line 297 of file Phase.cpp.

References Phase::m_name, and Phase::speciesName().

 const vector< string > & speciesNames ( ) const

Return a const reference to the vector of species names.

Definition at line 278 of file Phase.cpp.

References Phase::m_speciesNames.

 void checkSpeciesIndex ( size_t k ) const

Check that the specified species index is in range Throws an exception if k is greater than nSpecies()-1.

Definition at line 283 of file Phase.cpp.

References Phase::m_kk.

 void checkSpeciesArraySize ( size_t kk ) const

Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies().

Used before calls which take an array pointer.

Definition at line 290 of file Phase.cpp.

References Phase::m_kk.

 void saveState ( vector_fp & state ) const

Save the current internal state of the phase Write to vector 'state' the current internal state.

Parameters
 state output vector. Will be resized to nSpecies() + 2.

Definition at line 302 of file Phase.cpp.

References Phase::nSpecies().

 void saveState ( size_t lenstate, doublereal * state ) const

Write to array 'state' the current internal state.

Parameters
 lenstate length of the state array. Must be >= nSpecies()+2 state output vector. Must be of length nSpecies() + 2 or greater.

Definition at line 307 of file Phase.cpp.

References Phase::density(), Phase::getMassFractions(), and Phase::temperature().

 void restoreState ( const vector_fp & state )

Restore a state saved on a previous call to saveState.

Parameters
 state State vector containing the previously saved state.

Definition at line 314 of file Phase.cpp.

 void restoreState ( size_t lenstate, const doublereal * state )

Restore the state of the phase from a previously saved state vector.

Parameters
 lenstate Length of the state vector state Vector of state conditions.

Definition at line 319 of file Phase.cpp.

 void setMoleFractionsByName ( const compositionMap & xMap )

Set the species mole fractions by name.

Species not listed by name in xMap are set to zero.

Parameters
 xMap map from species names to mole fraction values.

Definition at line 376 of file Phase.cpp.

 void setMoleFractionsByName ( const std::string & x )

Set the mole fractions of a group of species by name.

Species which are not listed by name in the composition map are set to zero.

Parameters
 x string x in the form of a composition map

Definition at line 385 of file Phase.cpp.

 void setMassFractionsByName ( const compositionMap & yMap )

Set the species mass fractions by name.

Species not listed by name in yMap are set to zero.

Parameters
 yMap map from species names to mass fraction values.

Definition at line 415 of file Phase.cpp.

 void setMassFractionsByName ( const std::string & x )

Set the species mass fractions by name.

Species not listed by name in x are set to zero.

Parameters
 x String containing a composition map

Definition at line 424 of file Phase.cpp.

 void setState_TRX ( doublereal t, doublereal dens, const doublereal * x )

Set the internally stored temperature (K), density, and mole fractions.

Parameters
 t Temperature in kelvin dens Density (kg/m^3) x vector of species mole fractions, length m_kk

Definition at line 429 of file Phase.cpp.

References Phase::setDensity(), Phase::setMoleFractions(), and Phase::setTemperature().

 void setState_TRX ( doublereal t, doublereal dens, const compositionMap & x )

Set the internally stored temperature (K), density, and mole fractions.

Parameters
 t Temperature in kelvin dens Density (kg/m^3) x Composition Map containing the mole fractions. Species not included in the map are assumed to have a zero mole fraction.

Definition at line 443 of file Phase.cpp.

 void setState_TRY ( doublereal t, doublereal dens, const doublereal * y )

Set the internally stored temperature (K), density, and mass fractions.

Parameters
 t Temperature in kelvin dens Density (kg/m^3) y vector of species mass fractions, length m_kk

Definition at line 450 of file Phase.cpp.

References Phase::setDensity(), Phase::setMassFractions(), and Phase::setTemperature().

 void setState_TRY ( doublereal t, doublereal dens, const compositionMap & y )

Set the internally stored temperature (K), density, and mass fractions.

Parameters
 t Temperature in kelvin dens Density (kg/m^3) y Composition Map containing the mass fractions. Species not included in the map are assumed to have a zero mass fraction.

Definition at line 457 of file Phase.cpp.

 void setState_TNX ( doublereal t, doublereal n, const doublereal * x )

Set the internally stored temperature (K), molar density (kmol/m^3), and mole fractions.

Parameters
 t Temperature in kelvin n molar density (kmol/m^3) x vector of species mole fractions, length m_kk

Definition at line 436 of file Phase.cpp.

 void setState_TR ( doublereal t, doublereal rho )

Set the internally stored temperature (K) and density (kg/m^3)

Parameters
 t Temperature in kelvin rho Density (kg/m^3)

Definition at line 464 of file Phase.cpp.

References Phase::setDensity(), and Phase::setTemperature().

 void setState_TX ( doublereal t, doublereal * x )

Set the internally stored temperature (K) and mole fractions.

Parameters
 t Temperature in kelvin x vector of species mole fractions, length m_kk

Definition at line 470 of file Phase.cpp.

References Phase::setMoleFractions(), and Phase::setTemperature().

 void setState_TY ( doublereal t, doublereal * y )

Set the internally stored temperature (K) and mass fractions.

Parameters
 t Temperature in kelvin y vector of species mass fractions, length m_kk

Definition at line 476 of file Phase.cpp.

References Phase::setMassFractions(), and Phase::setTemperature().

 void setState_RX ( doublereal rho, doublereal * x )

Set the density (kg/m^3) and mole fractions.

Parameters
 rho Density (kg/m^3) x vector of species mole fractions, length m_kk

Definition at line 482 of file Phase.cpp.

References Phase::setDensity(), and Phase::setMoleFractions().

 void setState_RY ( doublereal rho, doublereal * y )

Set the density (kg/m^3) and mass fractions.

Parameters
 rho Density (kg/m^3) y vector of species mass fractions, length m_kk

Definition at line 488 of file Phase.cpp.

References Phase::setDensity(), and Phase::setMassFractions().

 doublereal molecularWeight ( size_t k ) const

Molecular weight of species k.

Parameters
 k index of species k
Returns
Returns the molecular weight of species k.

Definition at line 494 of file Phase.cpp.

References Phase::checkSpeciesIndex(), and Phase::m_molwts.

 void getMolecularWeights ( vector_fp & weights ) const

Copy the vector of molecular weights into vector weights.

Parameters
 weights Output vector of molecular weights (kg/kmol)

Definition at line 500 of file Phase.cpp.

References Phase::molecularWeights().

 void getMolecularWeights ( doublereal * weights ) const

Copy the vector of molecular weights into array weights.

Parameters
 weights Output array of molecular weights (kg/kmol)

Definition at line 509 of file Phase.cpp.

References Phase::molecularWeights().

 const vector_fp & molecularWeights ( ) const

Return a const reference to the internal vector of molecular weights.

units = kg / kmol

Definition at line 515 of file Phase.cpp.

References Phase::m_molwts.

 doublereal size ( size_t k ) const
inline

This routine returns the size of species k.

Parameters
 k index of the species
Returns
The size of the species. Units are meters.

Definition at line 411 of file Phase.h.

References Phase::m_speciesSize.

 void getMoleFractionsByName ( compositionMap & x ) const

Get the mole fractions by name.

Parameters
 [out] x composition map containing the species mole fractions.
Deprecated:
To be removed after Cantera 2.2. use compositionMap getMoleFractionsByName(double threshold) instead.

Definition at line 520 of file Phase.cpp.

 compositionMap getMoleFractionsByName ( double threshold = 0.0 ) const

Get the mole fractions by name.

Parameters
 threshold Exclude species with mole fractions less than or equal to this threshold.
Returns
Map of species names to mole fractions

Definition at line 532 of file Phase.cpp.

References Phase::m_kk, Phase::moleFraction(), and Phase::speciesName().

 doublereal moleFraction ( const std::string & name ) const

Return the mole fraction of a single species.

Parameters
 name String name of the species
Returns
Mole fraction of the species

Definition at line 567 of file Phase.cpp.

References Phase::moleFraction(), Cantera::npos, and Phase::speciesIndex().

 compositionMap getMassFractionsByName ( double threshold = 0.0 ) const

Get the mass fractions by name.

Parameters
 threshold Exclude species with mass fractions less than or equal to this threshold.
Returns
Map of species names to mass fractions

Definition at line 544 of file Phase.cpp.

References Phase::m_kk, Phase::massFraction(), and Phase::speciesName().

 doublereal massFraction ( size_t k ) const

Return the mass fraction of a single species.

Parameters
 k species index
Returns
Mass fraction of the species

Definition at line 582 of file Phase.cpp.

References Phase::checkSpeciesIndex(), and Phase::m_y.

Referenced by Phase::elementalMassFraction(), and Phase::getMassFractionsByName().

 doublereal massFraction ( const std::string & name ) const

Return the mass fraction of a single species.

Parameters
 name String name of the species
Returns
Mass Fraction of the species

Definition at line 588 of file Phase.cpp.

References Phase::massFractions(), Cantera::npos, and Phase::speciesIndex().

 void setMoleFractions ( const doublereal *const x )
virtual

Set the mole fractions to the specified values There is no restriction on the sum of the mole fraction vector.

Internally, the Phase object will normalize this vector before storing its contents.

Parameters
 x Array of unnormalized mole fraction values (input). Must have a length greater than or equal to the number of species, m_kk.

Definition at line 331 of file Phase.cpp.

References Phase::m_kk, Phase::m_mmw, Phase::m_molwts, Phase::m_stateNum, Phase::m_y, and Phase::m_ym.

 void setMoleFractions_NoNorm ( const doublereal *const x )
virtual

Set the mole fractions to the specified values without normalizing.

This is useful when the normalization condition is being handled by some other means, for example by a constraint equation as part of a larger set of equations.

Parameters
 x Input vector of mole fractions. Length is m_kk.

Reimplemented in IonsFromNeutralVPSSTP, GibbsExcessVPSSTP, LatticePhase, MixtureFugacityTP, IdealSolidSolnPhase, and RedlichKwongMFTP.

Definition at line 367 of file Phase.cpp.

 void getMassFractions ( doublereal *const y ) const

Get the species mass fractions.

Parameters
 [out] y Array of mass fractions, length nSpecies()

Definition at line 598 of file Phase.cpp.

References Phase::m_y.

 const doublereal* massFractions ( ) const
inline

Return a const pointer to the mass fraction array.

Definition at line 482 of file Phase.h.

References Phase::m_y.

 void setMassFractions ( const doublereal *const y )
virtual

Set the mass fractions to the specified values and normalize them.

Parameters
 [in] y Array of unnormalized mass fraction values. Length must be greater than or equal to the number of species. The Phase object will normalize this vector before storing its contents.

Definition at line 390 of file Phase.cpp.

 void setMassFractions_NoNorm ( const doublereal *const y )
virtual

Set the mass fractions to the specified values without normalizing.

This is useful when the normalization condition is being handled by some other means, for example by a constraint equation as part of a larger set of equations.

Parameters
 y Input vector of mass fractions. Length is m_kk.

Definition at line 404 of file Phase.cpp.

References Phase::m_kk, Phase::m_mmw, Phase::m_rmolwts, Phase::m_stateNum, Phase::m_y, and Phase::m_ym.

 void getConcentrations ( doublereal *const c ) const

Get the species concentrations (kmol/m^3).

Parameters
 [out] c The vector of species concentrations. Units are kmol/m^3. The length of the vector must be greater than or equal to the number of species within the phase.

Definition at line 609 of file Phase.cpp.

References Phase::m_dens, Phase::m_ym, and Cantera::scale().

 doublereal concentration ( const size_t k ) const

Concentration of species k.

If k is outside the valid range, an exception will be thrown.

Parameters
 [in] k Index of the species within the phase.
Returns
Returns the concentration of species k (kmol m-3).

Definition at line 603 of file Phase.cpp.

References Phase::checkSpeciesIndex(), Phase::m_dens, Phase::m_rmolwts, and Phase::m_y.

Referenced by SurfPhase::entropy_mole().

 void setConcentrations ( const doublereal *const conc )
virtual

Set the concentrations to the specified values within the phase.

We set the concentrations here and therefore we set the overall density of the phase. We hold the temperature constant during this operation. Therefore, we have possibly changed the pressure of the phase by calling this routine.

Parameters
 [in] conc Array of concentrations in dimensional units. For bulk phases c[k] is the concentration of the kth species in kmol/m3. For surface phases, c[k] is the concentration in kmol/m2. The length of the vector is the number of species in the phase.

Definition at line 614 of file Phase.cpp.

 doublereal elementalMassFraction ( const size_t m ) const

Elemental mass fraction of element m.

The elemental mass fraction $$Z_{\mathrm{mass},m}$$ of element $$m$$ is defined as

$Z_{\mathrm{mass},m} = \sum_k \frac{a_{m,k} M_m}{M_k} Y_k$

with $$a_{m,k}$$ being the number of atoms of element $$m$$ in species $$k$$, $$M_m$$ the atomic weight of element $$m$$, $$M_k$$ the molecular weight of species $$k$$, and $$Y_k$$ the mass fraction of species $$k$$.

Parameters
 [in] m Index of the element within the phase. If m is outside the valid range, an exception will be thrown.
Returns
the elemental mass fraction of element m.

Definition at line 634 of file Phase.cpp.

 doublereal elementalMoleFraction ( const size_t m ) const

Elemental mole fraction of element m.

The elemental mole fraction $$Z_{\mathrm{mole},m}$$ of element $$m$$ is the number of atoms of element m divided by the total number of atoms. It is defined as:

$Z_{\mathrm{mole},m} = \frac{\sum_k a_{m,k} X_k} {\sum_k \sum_j a_{j,k} X_k}$

with $$a_{m,k}$$ being the number of atoms of element $$m$$ in species $$k$$, $$\sum_j$$ being a sum over all elements, and $$X_k$$ being the mole fraction of species $$k$$.

Parameters
 [in] m Index of the element within the phase. If m is outside the valid range, an exception will be thrown.
Returns
the elemental mole fraction of element m.

Definition at line 645 of file Phase.cpp.

 const doublereal * moleFractdivMMW ( ) const

Returns a const pointer to the start of the moleFraction/MW array.

This array is the array of mole fractions, each divided by the mean molecular weight.

Definition at line 577 of file Phase.cpp.

References Phase::m_ym.

 doublereal charge ( size_t k ) const
inline
 doublereal chargeDensity ( ) const

Charge density [C/m^3].

Definition at line 678 of file Phase.cpp.

References Phase::charge(), Phase::m_kk, and Phase::moleFraction().

 size_t nDim ( ) const
inline

Returns the number of spatial dimensions (1, 2, or 3)

Definition at line 586 of file Phase.h.

References Phase::m_ndim.

 void setNDim ( size_t ndim )
inline

Set the number of spatial dimensions (1, 2, or 3).

The number of spatial dimensions is used for vector involving directions.

Parameters
 ndim Input number of dimensions.

Definition at line 593 of file Phase.h.

References Phase::m_ndim.

 doublereal molarVolume ( ) const

Molar volume (m^3/kmol).

Returns
The molar volume of the phase

Definition at line 673 of file Phase.cpp.

References Phase::molarDensity().

 virtual void setDensity ( const doublereal density_ )
inlinevirtual
 void setMolarDensity ( const doublereal molarDensity )
virtual

Set the internally stored molar density (kmol/m^3) of the phase.

Parameters
 [in] molarDensity Input molar density (kmol/m^3).

Reimplemented in HMWSoln, DebyeHuckel, IdealMolalSoln, IdealSolidSolnPhase, and MaskellSolidSolnPhase.

Definition at line 668 of file Phase.cpp.

References Phase::m_dens, and Phase::meanMolecularWeight().

Referenced by LatticePhase::calcDensity(), LatticePhase::setParameters(), and Phase::setState_TNX().

 virtual void setTemperature ( const doublereal temp )
inlinevirtual

Set the internally stored temperature of the phase (K).

Parameters
 temp Temperature in Kelvin

Reimplemented in HMWSoln, DebyeHuckel, IonsFromNeutralVPSSTP, WaterSSTP, MixtureFugacityTP, VPStandardStateTP, and RedlichKwongMFTP.

Definition at line 638 of file Phase.h.

References Phase::m_temp.

 doublereal mean_X ( const doublereal *const Q ) const

Evaluate the mole-fraction-weighted mean of an array Q.

$\sum_k X_k Q_k.$

Q should contain pure-species molar property values.

Parameters
 [in] Q Array of length m_kk that is to be averaged.
Returns
mole-fraction-weighted mean of Q

Definition at line 687 of file Phase.cpp.

References Phase::m_mmw, and Phase::m_ym.

 doublereal mean_X ( const vector_fp & Q ) const

Evaluate the mole-fraction-weighted mean of an array Q.

$\sum_k X_k Q_k.$

Q should contain pure-species molar property values.

Parameters
 [in] Q Array of length m_kk that is to be averaged.
Returns
mole-fraction-weighted mean of Q

Definition at line 692 of file Phase.cpp.

References Phase::m_mmw, and Phase::m_ym.

 doublereal mean_Y ( const doublereal *const Q ) const

Evaluate the mass-fraction-weighted mean of an array Q.

$\sum_k Y_k Q_k$

Parameters
 [in] Q Array of species property values in mass units.
Returns
The mass-fraction-weighted mean of Q.
Deprecated:
Unused. To be removed after Cantera 2.2.

Definition at line 697 of file Phase.cpp.

References Cantera::dot(), Phase::m_y, and Cantera::warn_deprecated().

 doublereal sum_xlogx ( ) const

Evaluate $$\sum_k X_k \log X_k$$.

Returns
The indicated sum. Dimensionless.

Definition at line 703 of file Phase.cpp.

References Phase::m_mmw, Phase::m_ym, and Cantera::sum_xlogx().

 doublereal sum_xlogQ ( doublereal *const Q ) const

Evaluate $$\sum_k X_k \log Q_k$$.

Parameters
 Q Vector of length m_kk to take the log average of
Returns
The indicated sum.
Deprecated:
Unused. To be removed after Cantera 2.2.

Definition at line 708 of file Phase.cpp.

References Phase::m_mmw, Phase::m_ym, Cantera::sum_xlogQ(), and Cantera::warn_deprecated().

 size_t addElement ( const std::string & symbol, doublereal weight = -12345.0, int atomicNumber = 0, doublereal entropy298 = ENTROPY298_UNKNOWN, int elem_type = CT_ELEM_TYPE_ABSPOS )

Parameters
 symbol Atomic symbol std::string. weight Atomic mass in amu. atomicNumber Atomic number of the element (unitless) entropy298 Entropy of the element at 298 K and 1 bar in its most stable form. The default is the value ENTROPY298_UNKNOWN, which is interpreted as an unknown, and if used will cause Cantera to throw an error. elem_type Specifies the type of the element constraint equation. This defaults to CT_ELEM_TYPE_ABSPOS, i.e., an element.
Returns

Definition at line 714 of file Phase.cpp.

 void addElement ( const XML_Node & e )

Add an element from an XML specification.

Parameters
 e Reference to the XML_Node where the element is described.
Deprecated:
. To be removed after Cantera 2.2.

Definition at line 771 of file Phase.cpp.

 void addUniqueElement ( const std::string & symbol, doublereal weight = -12345.0, int atomicNumber = 0, doublereal entropy298 = ENTROPY298_UNKNOWN, int elem_type = CT_ELEM_TYPE_ABSPOS )

Add an element, checking for uniqueness The uniqueness is checked by comparing the string symbol.

If not unique, nothing is done.

Parameters
 symbol String symbol of the element weight Atomic weight of the element (kg kmol-1). atomicNumber Atomic number of the element (unitless) entropy298 Entropy of the element at 298 K and 1 bar in its most stable form. The default is the value ENTROPY298_UNKNOWN, which is interpreted as an unknown, and if used will cause Cantera to throw an error. elem_type Specifies the type of the element constraint equation. This defaults to CT_ELEM_TYPE_ABSPOS, i.e., an element.
Deprecated:
. Equivalent to addElement. To be removed after Cantera 2.2.

Definition at line 798 of file Phase.cpp.

 void addUniqueElement ( const XML_Node & e )

Add an element, checking for uniqueness The uniqueness is checked by comparing the string symbol.

If not unique, nothing is done.

Parameters
 e Reference to the XML_Node where the element is described.
Deprecated:
. To be removed after Cantera 2.2.

Definition at line 808 of file Phase.cpp.

 void addElementsFromXML ( const XML_Node & phase )

Add all elements referenced in an XML_Node tree.

Parameters
 phase Reference to the root XML_Node of a phase
Deprecated:
. To be removed after Cantera 2.2.

Definition at line 815 of file Phase.cpp.

References Cantera::installElements(), and Cantera::warn_deprecated().

 void freezeElements ( )

Deprecated:
. To be removed after Cantera 2.2.

Definition at line 823 of file Phase.cpp.

References Cantera::warn_deprecated().

 bool elementsFrozen ( )

True if freezeElements has been called.

Deprecated:
. To be removed after Cantera 2.2.

Definition at line 828 of file Phase.cpp.

References Cantera::warn_deprecated().

 size_t addUniqueElementAfterFreeze ( const std::string & symbol, doublereal weight, int atomicNumber, doublereal entropy298 = ENTROPY298_UNKNOWN, int elem_type = CT_ELEM_TYPE_ABSPOS )

Add an element after elements have been frozen, checking for uniqueness The uniqueness is checked by comparing the string symbol.

If not unique, nothing is done.

Parameters
 symbol String symbol of the element weight Atomic weight of the element (kg kmol-1). atomicNumber Atomic number of the element (unitless) entropy298 Entropy of the element at 298 K and 1 bar in its most stable form. The default is the value ENTROPY298_UNKNOWN, which if used will cause Cantera to throw an error. elem_type Specifies the type of the element constraint equation. This defaults to CT_ELEM_TYPE_ABSPOS, i.e., an element.
Deprecated:
. Equivalent to addElement. To be removed after Cantera 2.2.

Definition at line 834 of file Phase.cpp.

 bool addSpecies ( shared_ptr< Species > spec )
virtual

Add a Species to this Phase.

Returns true if the species was successfully added, or false if the species was ignored.

Reimplemented in ThermoPhase, and VPStandardStateTP.

Definition at line 844 of file Phase.cpp.

 void addSpecies ( const std::string & name, const doublereal * comp, doublereal charge = 0.0, doublereal size = 1.0 )
Deprecated:

Definition at line 930 of file Phase.cpp.

 void addUniqueSpecies ( const std::string & name, const doublereal * comp, doublereal charge = 0.0, doublereal size = 1.0 )

Add a species to the phase, checking for uniqueness of the name This routine checks for uniqueness of the string name.

It only adds the species if it is unique.

Parameters
 name String name of the species comp Array containing the elemental composition of the species. charge Charge of the species. Defaults to zero. size Size of the species (meters). Defaults to 1 meter.
Deprecated:

Definition at line 946 of file Phase.cpp.

 shared_ptr< Species > species ( const std::string & name ) const

Return the Species object for the named species.

Definition at line 978 of file Phase.cpp.

References Cantera::getValue().

Referenced by LatticeSolidPhase::installSlavePhases(), and Phase::species().

 shared_ptr< Species > species ( size_t k ) const

Return the Species object for species whose index is k.

Definition at line 983 of file Phase.cpp.

References Phase::m_speciesNames, and Phase::species().

 void ignoreUndefinedElements ( )

Set behavior when adding a species containing undefined elements to just skip the species.

Definition at line 988 of file Phase.cpp.

References Phase::m_undefinedElementBehavior.

Referenced by Cantera::importPhase().

Set behavior when adding a species containing undefined elements to add those elements to the phase.

Definition at line 992 of file Phase.cpp.

References Phase::m_undefinedElementBehavior.

 void throwUndefinedElements ( )

Set the behavior when adding a species containing undefined elements to throw an exception.

This is the default behavior.

Definition at line 996 of file Phase.cpp.

References Cantera::error(), and Phase::m_undefinedElementBehavior.

virtual

Returns a bool indicating whether the object is ready for use.

Returns
returns true if the object is ready for calculation, false otherwise.

Reimplemented in Interface, IdealGasMix, Edge, PureFluid, IncompressibleSolid, and Metal.

Definition at line 1000 of file Phase.cpp.

References Phase::m_kk.

 int stateMFNumber ( ) const
inline

Return the State Mole Fraction Number.

Definition at line 823 of file Phase.h.

References Phase::m_stateNum.

 void setMolecularWeight ( const int k, const double mw )
inlineprotected

Set the molecular weight of a single species to a given value.

Parameters
 k id of the species mw Molecular Weight (kg kmol-1)

Definition at line 838 of file Phase.h.

References Phase::m_molwts, and Phase::m_rmolwts.

## Member Data Documentation

 ValueCache m_cache
mutableprotected

Cached for saved calculations within each ThermoPhase.

For more information on how to use this, see examples within the source code and documentation for this within ValueCache class itself.

Definition at line 833 of file Phase.h.

 size_t m_ndim
protected

Dimensionality of the phase.

Volumetric phases have dimensionality 3 and surface phases have dimensionality 2.

Definition at line 847 of file Phase.h.

Referenced by Phase::nDim(), Phase::operator=(), and Phase::setNDim().

 vector_fp m_speciesComp
protected

Atomic composition of the species.

The number of atoms of element i in species k is equal to m_speciesComp[k * m_mm + i] The length of this vector is equal to m_kk * m_mm

Definition at line 852 of file Phase.h.

 vector_fp m_speciesSize
protected

Vector of species sizes.

length m_kk. Used in some equations of state which employ the constant partial molar volume approximation.

Definition at line 856 of file Phase.h.

 vector_fp m_speciesCharge
protected

Vector of species charges. length m_kk.

Definition at line 858 of file Phase.h.

 UndefElement::behavior m_undefinedElementBehavior
protected

Flag determining behavior when adding species with an undefined element.

Definition at line 863 of file Phase.h.

 XML_Node* m_xml
private

XML node containing the XML info for this phase.

Definition at line 866 of file Phase.h.

Referenced by Phase::operator=(), Phase::setXMLdata(), Phase::xml(), and Phase::~Phase().

 std::string m_id
private

ID of the phase.

This is the value of the ID attribute of the XML phase node. The field will stay that way even if the name is changed.

Definition at line 870 of file Phase.h.

Referenced by Phase::id(), Phase::operator=(), Phase::setID(), and Phase::speciesIndex().

 std::string m_name
private

Name of the phase.

Initially, this is the value of the ID attribute of the XML phase node. It may be changed to another value during the course of a calculation.

Definition at line 875 of file Phase.h.

 doublereal m_temp
private

Temperature (K). This is an independent variable.

Definition at line 877 of file Phase.h.

Referenced by Phase::operator=(), Phase::setTemperature(), and Phase::temperature().

 doublereal m_dens
private

Density (kg m-3).

This is an independent variable except in the incompressible degenerate case. Thus, the pressure is determined from this variable rather than other way round.

Definition at line 882 of file Phase.h.

 doublereal m_mmw
private

mean molecular weight of the mixture (kg kmol-1)

Definition at line 884 of file Phase.h.

 vector_fp m_ym
mutableprivate

m_ym[k] = mole fraction of species k divided by the mean molecular weight of mixture.

Definition at line 888 of file Phase.h.

 vector_fp m_y
mutableprivate

Mass fractions of the species.

Note, this vector Length is m_kk

Definition at line 895 of file Phase.h.

 vector_fp m_molwts
private

species molecular weights (kg kmol-1)

Definition at line 897 of file Phase.h.

 vector_fp m_rmolwts
private

inverse of species molecular weights (kmol kg-1)

Definition at line 899 of file Phase.h.

 int m_stateNum
private

State Change variable.

Whenever the mole fraction vector changes, this int is incremented.

Definition at line 903 of file Phase.h.

 std::vector m_speciesNames
private

Vector of the species names.

Definition at line 906 of file Phase.h.

 std::map m_speciesIndices
private

Map of species names to indices.

Definition at line 909 of file Phase.h.

 size_t m_mm
private

Number of elements.

Definition at line 911 of file Phase.h.

 vector_fp m_atomicWeights
private

element atomic weights (kg kmol-1)

Definition at line 912 of file Phase.h.

Referenced by Phase::addElement(), Phase::atomicWeight(), Phase::atomicWeights(), and Phase::operator=().

 vector_int m_atomicNumbers
private

element atomic numbers

Definition at line 913 of file Phase.h.

Referenced by Phase::addElement(), Phase::atomicNumber(), and Phase::operator=().

 std::vector m_elementNames
private

element names

Definition at line 914 of file Phase.h.

 vector_int m_elem_type
private

Vector of element types.

Definition at line 915 of file Phase.h.

Referenced by Phase::addElement(), Phase::changeElementType(), Phase::elementType(), and Phase::operator=().

 vector_fp m_entropy298
private

Entropy at 298.15 K and 1 bar of stable state pure elements (J kmol-1)

Definition at line 918 of file Phase.h.

Referenced by Phase::addElement(), Phase::entropyElement298(), and Phase::operator=().

 enum CT_RealNumber_Range_Behavior realNumberRangeBehavior_

Overflow behavior of real number calculations involving this thermo object.

The default is THROWON_OVERFLOW_CTRB Which throws an error in debug mode, but silently changes the answer in non-debug mode

Deprecated:
To be removed after Cantera 2.2.

Definition at line 927 of file Phase.h.

Referenced by Phase::operator=().

The documentation for this class was generated from the following files: