Cantera  2.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
vcs_VolPhase Class Reference

Phase information and Phase calculations for vcs. More...

#include <vcs_VolPhase.h>

Collaboration diagram for vcs_VolPhase:
[legend]

Public Member Functions

 vcs_VolPhase (VCS_SOLVE *owningSolverObject=0)
 Base constructor for the class.
 
 vcs_VolPhase (const vcs_VolPhase &b)
 Copy constructor.
 
vcs_VolPhaseoperator= (const vcs_VolPhase &b)
 Assignment operator.
 
 ~vcs_VolPhase ()
 Destructor.
 
void resize (const size_t phaseNum, const size_t numSpecies, const size_t numElem, const char *const phaseName, const double molesInert=0.0)
 The resize() function fills in all of the initial information if it is not given in the constructor.
 
void elemResize (const size_t numElemConstraints)
 
double AC_calc_one (size_t kspec) const
 Evaluate activity coefficients and return the kspec coefficient.
 
void setMoleFractionsState (const double molNum, const double *const moleFracVec, const int vcsStateStatus)
 Set the moles and/or mole fractions within the phase.
 
void setMolesFromVCS (const int stateCalc, const double *molesSpeciesVCS=0)
 Set the moles within the phase.
 
void setMolesFromVCSCheck (const int vcsStateStatus, const double *molesSpeciesVCS, const double *const TPhMoles)
 Set the moles within the phase.
 
void updateFromVCS_MoleNumbers (const int stateCalc)
 Update the moles within the phase, if necessary.
 
void sendToVCS_ActCoeff (const int stateCalc, double *const AC)
 Fill in an activity coefficients vector within a VCS_SOLVE object.
 
void setElectricPotential (const double phi)
 set the electric potential of the phase
 
double electricPotential () const
 Returns the electric field of the phase.
 
double GStar_calc_one (size_t kspec) const
 Gibbs free energy calculation for standard state of one species.
 
double G0_calc_one (size_t kspec) const
 Gibbs free energy calculation at a temperature for the reference state of a species, return a value for one species.
 
double VolStar_calc_one (size_t kspec) const
 Molar volume calculation for standard state of one species.
 
double sendToVCS_VolPM (double *const VolPM) const
 Fill in the partial molar volume vector for VCS.
 
void sendToVCS_GStar (double *const gstar) const
 Fill in the partial molar volume vector for VCS.
 
void setState_TP (const double temperature_Kelvin, const double pressure_PA)
 Sets the temperature and pressure in this object and underlying objects.
 
void setState_T (const double temperature_Kelvin)
 Sets the temperature in this object and underlying objects.
 
void sendToVCS_LnActCoeffJac (double *const *const LnACJac_VCS)
 
void setPtrThermoPhase (Cantera::ThermoPhase *tp_ptr)
 Set the pointer for Cantera's ThermoPhase parameter.
 
const Cantera::ThermoPhaseptrThermoPhase () const
 Return a const ThermoPhase pointer corresponding to this phase.
 
double totalMoles () const
 Return the total moles in the phase.
 
double molefraction (size_t kspec) const
 Returns the mole fraction of the kspec species.
 
void setTotalMoles (const double totalMols)
 Sets the total moles in the phase.
 
void setMolesOutOfDate (int stateCalc=-1)
 Sets the mole flag within the object to out of date.
 
void setMolesCurrent (int vcsStateStatus)
 Sets the mole flag within the object to be current.
 
const std::vector< double > & moleFractions () const
 Return a const reference to the mole fractions stored in the object.
 
double moleFraction (size_t klocal) const
 
void setCreationMoleNumbers (const double *const n_k, const std::vector< size_t > &creationGlobalRxnNumbers)
 Sets the creationMoleNum's within the phase object.
 
const std::vector< double > & creationMoleNumbers (std::vector< size_t > &creationGlobalRxnNumbers) const
 Return a const reference to the creationMoleNumbers stored in the object.
 
bool isIdealSoln () const
 Returns whether the phase is an ideal solution phase.
 
bool usingCanteraCalls () const
 Returns whether the object is using cantera calls.
 
size_t phiVarIndex () const
 Return the index of the species that represents the the voltage of the phase.
 
void setPhiVarIndex (size_t phiVarIndex)
 
vcs_SpeciesProperties * speciesProperty (const size_t kindex)
 Retrieve the kth Species structure for the species belonging to this phase.
 
int exists () const
 int indicating whether the phase exists or not
 
void setExistence (const int existence)
 Set the existence flag in the object.
 
size_t spGlobalIndexVCS (const size_t spIndex) const
 Return the Global VCS index of the kth species in the phase.
 
void setSpGlobalIndexVCS (const size_t spIndex, const size_t spGlobalIndex)
 set the Global VCS index of the kth species in the phase
 
void setTotalMolesInert (const double tMolesInert)
 Sets the total moles of inert in the phase.
 
double totalMolesInert () const
 returns the value of the total kmol of inert in the phase
 
size_t elemGlobalIndex (const size_t e) const
 Returns the global index of the local element index for the phase.
 
void setElemGlobalIndex (const size_t eLocal, const size_t eGlobal)
 sets a local phase element to a global index value
 
size_t nElemConstraints () const
 Returns the number of element constraints.
 
std::string elementName (const size_t e) const
 Name of the element constraint with index e.
 
int elementType (const size_t e) const
 Type of the element constraint with index e.
 
void setElementType (const size_t e, const int eType)
 Set the element Type of the element constraint with index e.
 
size_t transferElementsFM (const Cantera::ThermoPhase *const tPhase)
 Transfer all of the element information from the ThermoPhase object to the vcs_VolPhase object.
 
double const *const * getFormulaMatrix () const
 Get a constant form of the Species Formula Matrix.
 
int speciesUnknownType (const size_t k) const
 Returns the type of the species unknown.
 
int elementActive (const size_t e) const
 
size_t nSpecies () const
 Return the number of species in the phase.
 

Public Attributes

size_t VP_ID_
 Original ID of the phase in the problem.
 
int Domain_ID
 ID of the surface or volume domain in which the this phase exists.
 
bool m_singleSpecies
 If true, this phase consists of a single species.
 
bool m_gasPhase
 If true, this phase is a gas-phase like phase.
 
int m_eqnState
 Type of the equation of state.
 
size_t ChargeNeutralityElement
 This is the element number for the charge neutrality condition of the phase.
 
int p_VCS_UnitsFormat
 Units for the chemical potential data, pressure data, volume, and species amounts.
 
int p_activityConvention
 Convention for the activity formulation.
 
std::string PhaseName
 String name for the phase.
 

Private Member Functions

void setMoleFractions (const double *const xmol)
 Set the mole fractions from a conventional mole fraction vector.
 
void _updateActCoeff () const
 Evaluate the activity coefficients at the current conditions.
 
void _updateGStar () const
 Gibbs free energy calculation for standard states.
 
void _updateG0 () const
 Gibbs free energy calculation at a temperature for the reference state of each species.
 
void _updateVolStar () const
 Molar volume calculation for standard states.
 
double _updateVolPM () const
 Calculate the partial molar volumes of all species and return the total volume.
 
void _updateLnActCoeffJac ()
 Evaluation of Activity Coefficient Jacobians.
 
void _updateMoleFractionDependencies ()
 Updates the mole fraction dependencies.
 

Private Attributes

VCS_SOLVEm_owningSolverObject
 Backtrack value of VCS_SOLVE *.
 
size_t m_numElemConstraints
 Number of element constraints within the problem.
 
std::vector< std::string > m_elementNames
 vector of strings containing the element constraint names
 
std::vector< int > m_elementActive
 boolean indicating whether an element constraint is active for the current problem
 
std::vector< int > m_elementType
 Type of the element constraint.
 
DoubleStarStar m_formulaMatrix
 Formula Matrix for the phase.
 
std::vector< int > m_speciesUnknownType
 Type of the species unknown.
 
std::vector< size_t > m_elemGlobalIndex
 Index of the element number in the global list of elements stored in VCS_PROB or VCS_SOLVE.
 
size_t m_numSpecies
 Number of species in the phase.
 
double m_totalMolesInert
 Total moles of inert in the phase.
 
bool m_isIdealSoln
 Boolean indicating whether the phase is an ideal solution and therefore its molar-based activity coefficients are uniformly equal to one.
 
int m_existence
 Current state of existence:
 
int m_MFStartIndex
 
std::vector< size_t > IndSpecies
 Index into the species vectors.
 
std::vector
< vcs_SpeciesProperties * > 
ListSpeciesPtr
 Vector of Species structures for the species belonging to this phase.
 
bool m_useCanteraCalls
 If this is true, then calculations are actually performed within Cantera.
 
Cantera::ThermoPhaseTP_ptr
 If we are using Cantera, this is the pointer to the ThermoPhase object.
 
double v_totalMoles
 Total mols in the phase.
 
std::vector< double > Xmol_
 Vector of the current mole fractions for species in the phase.
 
std::vector< double > creationMoleNumbers_
 Vector of current creationMoleNumbers_.
 
std::vector< size_t > creationGlobalRxnNumbers_
 Vector of creation global reaction numbers for the phase stability problem.
 
size_t m_phiVarIndex
 If the potential is a solution variable in VCS, it acts as a species.
 
double m_totalVol
 Total Volume of the phase.
 
std::vector< double > SS0ChemicalPotential
 Vector of calculated SS0 chemical potentials for the current Temperature.
 
std::vector< double > StarChemicalPotential
 Vector of calculated Star chemical potentials for the current Temperature and pressure.
 
std::vector< double > StarMolarVol
 Vector of the Star molar Volumes of the species.
 
std::vector< double > PartialMolarVol
 Vector of the Partial molar Volumes of the species.
 
std::vector< double > ActCoeff
 Vector of calculated activity coefficients for the current state.
 
DoubleStarStar dLnActCoeffdMolNumber
 Vector of the derivatives of the ln activity coefficient wrt to the current mole number.
 
int m_vcsStateStatus
 Status.
 
double m_phi
 Value of the potential for the phase (Volts)
 
bool m_UpToDate
 Boolean indicating whether the object has an up-to-date mole number vector and potential with respect to the current vcs state calc status.
 
bool m_UpToDate_AC
 Boolean indicating whether activity coefficients are up to date.
 
bool m_UpToDate_VolStar
 Boolean indicating whether Star volumes are up to date.
 
bool m_UpToDate_VolPM
 Boolean indicating whether partial molar volumes are up to date.
 
bool m_UpToDate_GStar
 Boolean indicating whether GStar is up to date.
 
bool m_UpToDate_G0
 Boolean indicating whether G0 is up to date.
 
double Temp_
 Current value of the temperature for this object, and underlying objects.
 
double Pres_
 Current value of the pressure for this object, and underlying objects.
 

Detailed Description

Phase information and Phase calculations for vcs.

Each phase in a vcs calculation has a vcs_VolPhase object associated with it. This object helps to coordinate property evaluations for species within the phase. Usually these evaluations must be carried out on a per phase basis. However, vcs frequently needs per species quantities. Therefore, we need an interface layer between vcs and Cantera's ThermoPhase.

The species stay in the same ordering within this structure. The vcs algorithm will change the ordering of species in the global species list. However, the indexing of species in this list stays the same. This structure contains structures that point to the species belonging to this phase in the global vcs species list.

This object is considered not to own the underlying Cantera ThermoPhase object for the phase.

This object contains an idea of the temperature and pressure. It checks to see if if the temperature and pressure has changed before calling underlying property evaluation routines.

The object contains values for the electric potential of a phase. It coordinates the evaluation of properties wrt when the electric potential of a phase has changed.

The object knows about the mole fractions of the phase. It controls the values of mole fractions, and coordinates the property evaluation wrt to changes in the mole fractions. It also will keep track of the likely values of mole fractions in multicomponent phases even when the phase doesn't actually exist within the thermo program.

The object knows about the total moles of a phase. It checks to see if the phase currently exists or not, and modifies its behavior accordingly.

Activity coefficients and volume calculations are lagged. They are only called when they are needed (and when the state has changed so that they need to be recalculated).

Definition at line 111 of file vcs_VolPhase.h.

Constructor & Destructor Documentation

vcs_VolPhase ( VCS_SOLVE owningSolverObject = 0)

Base constructor for the class.

Definition at line 33 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_owningSolverObject.

vcs_VolPhase ( const vcs_VolPhase b)

Copy constructor.

Parameters
bobject to be copied

Definition at line 97 of file vcs_VolPhase.cpp.

Destructor.

Definition at line 79 of file vcs_VolPhase.cpp.

References vcs_VolPhase::ListSpeciesPtr, and vcs_VolPhase::m_numSpecies.

Member Function Documentation

vcs_VolPhase & operator= ( const vcs_VolPhase b)

Assignment operator.

Parameters
bobject to be copied

Definition at line 144 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::ActCoeff, vcs_VolPhase::ChargeNeutralityElement, vcs_VolPhase::creationGlobalRxnNumbers_, vcs_VolPhase::creationMoleNumbers_, vcs_VolPhase::dLnActCoeffdMolNumber, vcs_VolPhase::Domain_ID, vcs_VolPhase::IndSpecies, vcs_VolPhase::ListSpeciesPtr, vcs_VolPhase::m_elementActive, vcs_VolPhase::m_elementNames, vcs_VolPhase::m_elementType, vcs_VolPhase::m_elemGlobalIndex, vcs_VolPhase::m_eqnState, vcs_VolPhase::m_existence, vcs_VolPhase::m_formulaMatrix, vcs_VolPhase::m_gasPhase, vcs_VolPhase::m_isIdealSoln, vcs_VolPhase::m_MFStartIndex, vcs_VolPhase::m_numElemConstraints, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_phi, vcs_VolPhase::m_phiVarIndex, vcs_VolPhase::m_singleSpecies, vcs_VolPhase::m_speciesUnknownType, vcs_VolPhase::m_totalMolesInert, vcs_VolPhase::m_totalVol, vcs_VolPhase::m_UpToDate, vcs_VolPhase::m_UpToDate_AC, vcs_VolPhase::m_UpToDate_G0, vcs_VolPhase::m_UpToDate_GStar, vcs_VolPhase::m_UpToDate_VolPM, vcs_VolPhase::m_UpToDate_VolStar, vcs_VolPhase::m_useCanteraCalls, vcs_VolPhase::m_vcsStateStatus, vcs_VolPhase::p_activityConvention, vcs_VolPhase::p_VCS_UnitsFormat, vcs_VolPhase::PartialMolarVol, vcs_VolPhase::PhaseName, vcs_VolPhase::Pres_, DoubleStarStar::resize(), vcs_VolPhase::setState_TP(), vcs_VolPhase::SS0ChemicalPotential, vcs_VolPhase::StarChemicalPotential, vcs_VolPhase::StarMolarVol, vcs_VolPhase::Temp_, vcs_VolPhase::TP_ptr, vcs_VolPhase::v_totalMoles, vcs_VolPhase::VP_ID_, and vcs_VolPhase::Xmol_.

void resize ( const size_t  phaseNum,
const size_t  numSpecies,
const size_t  numElem,
const char *const  phaseName,
const double  molesInert = 0.0 
)
double AC_calc_one ( size_t  kspec) const

Evaluate activity coefficients and return the kspec coefficient.

We carry out a calculation whenever UpTODate_AC is false. Specifically whenever a phase goes zero, we do not carry out calculations on it.

Parameters
kspecspecies number

Definition at line 379 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::ActCoeff, and vcs_VolPhase::m_UpToDate_AC.

void setMoleFractionsState ( const double  molNum,
const double *const  moleFracVec,
const int  vcsStateStatus 
)

Set the moles and/or mole fractions within the phase.

Sets the mole fraction and total moles within the phase

Parameters
molNumtotal moles in the phase
moleFracVecVector of input mole fractions
vcsStateStatusStatus flag for this update

Definition at line 500 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::m_existence, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_totalMolesInert, vcs_VolPhase::m_UpToDate, vcs_VolPhase::m_vcsStateStatus, vcs_VolPhase::totalMoles(), vcs_VolPhase::v_totalMoles, VCS_PHASE_EXIST_NO, VCS_PHASE_EXIST_YES, VCS_PHASE_EXIST_ZEROEDPHASE, VCS_STATECALC_TMP, and vcs_VolPhase::Xmol_.

Referenced by VCS_SOLVE::vcs_phaseStabilityTest(), and VCS_SOLVE::vcs_prob_update().

void setMolesFromVCS ( const int  stateCalc,
const double *  molesSpeciesVCS = 0 
)
void setMolesFromVCSCheck ( const int  vcsStateStatus,
const double *  molesSpeciesVCS,
const double *const  TPhMoles 
)

Set the moles within the phase.

This function takes as input the mole numbers in vcs format, and then updates this object with their values. This is essentially a gather routine.

Additionally it checks to see that the total moles value in TPhMoles[iplace] is equal to the internally computed value. If this isn't the case, an error exit is carried out.

Parameters
vcsStateStatusState calc value either VCS_STATECALC_OLD or VCS_STATECALC_NEW. With any other value nothing is done.
molesSpeciesVCSarray of mole numbers. Note, the indices for species in this array may not be contiguous. IndSpecies[] is needed to gather the species into the local contiguous vector format.
TPhMolesVCS's array containing the number of moles in each phase.

Definition at line 679 of file vcs_VolPhase.cpp.

References plogf, vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::v_totalMoles, and vcs_VolPhase::VP_ID_.

Referenced by VCS_SOLVE::vcs_delete_species(), and VCS_SOLVE::vcs_updateVP().

void updateFromVCS_MoleNumbers ( const int  stateCalc)

Update the moles within the phase, if necessary.

This function takes as input the stateCalc value, which determines where within VCS_SOLVE to fetch the mole numbers. It then updates this object with their values. This is essentially a gather routine.

Parameters
stateCalcState calc value either VCS_STATECALC_OLD or VCS_STATECALC_NEW. With any other value nothing is done.

Definition at line 713 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_owningSolverObject, vcs_VolPhase::m_UpToDate, vcs_VolPhase::m_vcsStateStatus, vcs_VolPhase::setMolesFromVCS(), VCS_STATECALC_NEW, and VCS_STATECALC_OLD.

Referenced by vcs_VolPhase::sendToVCS_ActCoeff(), VCS_SOLVE::vcs_dfe(), and VCS_SOLVE::vcs_updateMolNumVolPhases().

void sendToVCS_ActCoeff ( const int  stateCalc,
double *const  AC 
)

Fill in an activity coefficients vector within a VCS_SOLVE object.

This routine will calculate the activity coefficients for the current phase, and fill in the corresponding entries in the VCS activity coefficients vector.

Parameters
ACvector of activity coefficients for all of the species in all of the phases in a VCS problem. Only the entries for the current phase are filled in.

Definition at line 735 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::ActCoeff, vcs_VolPhase::IndSpecies, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_UpToDate_AC, and vcs_VolPhase::updateFromVCS_MoleNumbers().

Referenced by VCS_SOLVE::vcs_add_all_deleted(), VCS_SOLVE::vcs_chemPotPhase(), VCS_SOLVE::vcs_dfe(), and VCS_SOLVE::vcs_phaseStabilityTest().

void setElectricPotential ( const double  phi)
double electricPotential ( ) const

Returns the electric field of the phase.

Units are potential

Definition at line 799 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_phi.

Referenced by VCS_SOLVE::vcs_chemPotPhase(), VCS_SOLVE::vcs_dfe(), VCS_SOLVE::vcs_printSpeciesChemPot(), VCS_SOLVE::vcs_prob_specify(), and VCS_SOLVE::vcs_prob_update().

double GStar_calc_one ( size_t  kspec) const

Gibbs free energy calculation for standard state of one species.

Calculate the Gibbs free energies for the standard state of the kth species. The results are held internally within the object.

Parameters
kspecSpecies number (within the phase)
Returns
Gstar[kspec] returns the gibbs free energy for the standard state of the kth species.

Definition at line 435 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateGStar(), vcs_VolPhase::m_UpToDate_GStar, and vcs_VolPhase::StarChemicalPotential.

Referenced by VCS_PROB::prob_report().

double G0_calc_one ( size_t  kspec) const

Gibbs free energy calculation at a temperature for the reference state of a species, return a value for one species.

Parameters
kspecspecies index
Returns
return value of the gibbs free energy

Definition at line 408 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateG0(), vcs_VolPhase::m_UpToDate_G0, and vcs_VolPhase::SS0ChemicalPotential.

Referenced by VCS_PROB::prob_report().

double VolStar_calc_one ( size_t  kspec) const

Molar volume calculation for standard state of one species.

Calculate the molar volume for the standard states. The results are held internally within the object. Return the molar volume for one species.

Parameters
kspecSpecies number (within the phase)
Returns
molar volume of the kspec species's standard state (m**3/kmol)

Definition at line 867 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateVolStar(), vcs_VolPhase::m_UpToDate_VolStar, and vcs_VolPhase::StarMolarVol.

double sendToVCS_VolPM ( double *const  VolPM) const

Fill in the partial molar volume vector for VCS.

This routine will calculate the partial molar volumes for the current phase (if needed), and fill in the corresponding entries in the VCS partial molar volumes vector.

Parameters
VolPMvector of partial molar volumes for all of the species in all of the phases in a VCS problem. Only the entries for the current phase are filled in.

Definition at line 759 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateVolPM(), vcs_VolPhase::IndSpecies, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_totalVol, vcs_VolPhase::m_UpToDate_VolPM, and vcs_VolPhase::PartialMolarVol.

Referenced by VCS_SOLVE::vcs_VolTotal().

void sendToVCS_GStar ( double *const  gstar) const

Fill in the partial molar volume vector for VCS.

This routine will calculate the partial molar volumes for the current phase (if needed), and fill in the corresponding entries in the VCS partial molar volumes vector.

Parameters
VolPMvector of partial molar volumes for all of the species in all of the phases in a VCS problem. Only the entries for the current phase are filled in.
Todo:
This function's documentation is incorrect.

Definition at line 772 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateGStar(), vcs_VolPhase::IndSpecies, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_UpToDate_GStar, and vcs_VolPhase::StarChemicalPotential.

void setState_TP ( const double  temperature_Kelvin,
const double  pressure_PA 
)

Sets the temperature and pressure in this object and underlying objects.

Sets the temperature and pressure in this object and underlying objects. The underlying objects refers to the Cantera's ThermoPhase object for this phase.

Parameters
temperature_Kelvin(Kelvin)
pressure_PAPressure (MKS units - Pascal)

Definition at line 815 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_phi, vcs_VolPhase::m_UpToDate_AC, vcs_VolPhase::m_UpToDate_G0, vcs_VolPhase::m_UpToDate_GStar, vcs_VolPhase::m_UpToDate_VolPM, vcs_VolPhase::m_UpToDate_VolStar, vcs_VolPhase::m_useCanteraCalls, vcs_VolPhase::Pres_, ThermoPhase::setElectricPotential(), ThermoPhase::setState_TP(), vcs_VolPhase::Temp_, and vcs_VolPhase::TP_ptr.

Referenced by vcs_VolPhase::operator=(), VCS_PROB::prob_report(), vcs_VolPhase::setPtrThermoPhase(), vcs_VolPhase::setState_T(), and VCS_SOLVE::vcs_VolTotal().

void setState_T ( const double  temperature_Kelvin)

Sets the temperature in this object and underlying objects.

Sets the temperature and pressure in this object and underlying objects. The underlying objects refers to the Cantera's ThermoPhase object for this phase.

Parameters
temperature_Kelvin(Kelvin)

Definition at line 845 of file vcs_VolPhase.cpp.

References vcs_VolPhase::Pres_, and vcs_VolPhase::setState_TP().

void setPtrThermoPhase ( Cantera::ThermoPhase tp_ptr)
const Cantera::ThermoPhase * ptrThermoPhase ( ) const

Return a const ThermoPhase pointer corresponding to this phase.

Returns
pointer to the ThermoPhase.

Definition at line 1109 of file vcs_VolPhase.cpp.

References vcs_VolPhase::TP_ptr.

double totalMoles ( ) const

Return the total moles in the phase.

Units -> depends on VCS_UnitsFormat variable Cantera -> J/kmol

Definition at line 1115 of file vcs_VolPhase.cpp.

References vcs_VolPhase::v_totalMoles.

Referenced by VCS_PROB::prob_report(), vcs_MultiPhaseEquil::reportCSV(), vcs_VolPhase::setMoleFractionsState(), VCS_SOLVE::vcs_prob_update(), and VCS_SOLVE::vcs_report().

double molefraction ( size_t  kspec) const

Returns the mole fraction of the kspec species.

Parameters
kspecIndex of the species in the phase
Returns
Value of the mole fraction

Definition at line 1121 of file vcs_VolPhase.cpp.

References vcs_VolPhase::Xmol_.

Referenced by VCS_SOLVE::vcs_prob_update(), and VCS_SOLVE::vcs_solve_TP().

void setTotalMoles ( const double  totalMols)

Sets the total moles in the phase.

We don't have to flag the internal state as changing here because we have just changed the total moles.

Parameters
totalMolsTotal moles in the phase (kmol)

Definition at line 1150 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_existence, vcs_VolPhase::m_phiVarIndex, vcs_VolPhase::m_singleSpecies, vcs_VolPhase::m_totalMolesInert, vcs_VolPhase::v_totalMoles, VCS_PHASE_EXIST_ALWAYS, VCS_PHASE_EXIST_NO, and VCS_PHASE_EXIST_YES.

Referenced by VCS_SOLVE::vcs_delete_multiphase(), VCS_SOLVE::vcs_prob_update(), and VCS_SOLVE::vcs_tmoles().

void setMolesOutOfDate ( int  stateCalc = -1)

Sets the mole flag within the object to out of date.

This will trigger the object to go get the current mole numbers when it needs it.

Definition at line 1182 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_UpToDate, and vcs_VolPhase::m_vcsStateStatus.

void setMolesCurrent ( int  vcsStateStatus)

Sets the mole flag within the object to be current.

Definition at line 1192 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_UpToDate, and vcs_VolPhase::m_vcsStateStatus.

void setMoleFractions ( const double *const  xmol)
private

Set the mole fractions from a conventional mole fraction vector.

Parameters
xmolValue of the mole fractions for the species in the phase. These are contiguous.

Definition at line 450 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_UpToDate, vcs_VolPhase::m_vcsStateStatus, VCS_STATECALC_TMP, and vcs_VolPhase::Xmol_.

Referenced by vcs_VolPhase::_updateLnActCoeffJac().

const std::vector< double > & moleFractions ( ) const

Return a const reference to the mole fractions stored in the object.

Definition at line 488 of file vcs_VolPhase.cpp.

References vcs_VolPhase::Xmol_.

Referenced by VCS_SOLVE::vcs_prob_update().

void setCreationMoleNumbers ( const double *const  n_k,
const std::vector< size_t > &  creationGlobalRxnNumbers 
)

Sets the creationMoleNum's within the phase object.

Parameters
F_kPointer to a vector of n_k's

Definition at line 1127 of file vcs_VolPhase.cpp.

References vcs_VolPhase::creationGlobalRxnNumbers_, vcs_VolPhase::creationMoleNumbers_, and VCS_DATA_PTR.

Referenced by VCS_SOLVE::vcs_phaseStabilityTest().

const std::vector< double > & creationMoleNumbers ( std::vector< size_t > &  creationGlobalRxnNumbers) const

Return a const reference to the creationMoleNumbers stored in the object.

Returns
Returns a const reference to the vector of creationMoleNumbers

Definition at line 1136 of file vcs_VolPhase.cpp.

References vcs_VolPhase::creationGlobalRxnNumbers_, and vcs_VolPhase::creationMoleNumbers_.

Referenced by VCS_SOLVE::vcs_phaseStabilityTest(), and VCS_SOLVE::vcs_popPhaseRxnStepSizes().

bool isIdealSoln ( ) const

Returns whether the phase is an ideal solution phase.

Definition at line 1244 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_isIdealSoln.

bool usingCanteraCalls ( ) const

Returns whether the object is using cantera calls.

Definition at line 1251 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_useCanteraCalls.

size_t phiVarIndex ( ) const

Return the index of the species that represents the the voltage of the phase.

Definition at line 1257 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_phiVarIndex.

Referenced by VCS_SOLVE::vcs_prob_update().

vcs_SpeciesProperties * speciesProperty ( const size_t  kindex)

Retrieve the kth Species structure for the species belonging to this phase.

The index into this vector is the species index within the phase.

Parameters
kindexkth species index.

Definition at line 1282 of file vcs_VolPhase.cpp.

References vcs_VolPhase::ListSpeciesPtr.

Referenced by VCS_SOLVE::vcs_prep_oneTime(), and VCS_SOLVE::vcs_prob_specifyFully().

int exists ( ) const

int indicating whether the phase exists or not

returns the m_existence int for the phase

  • VCS_PHASE_EXIST_ZEROEDPHASE = -6: Set to not exist by fiat from a higher level. This is used in phase stability boundary calculations
  • VCS_PHASE_EXIST_NO = 0: Doesn't exist currently
  • VCS_PHASE_EXIST_MINORCONC = 1: Exists, but the concentration is so low that an alternate method is used to calculate the total phase concentrations.
  • VCS_PHASE_EXIST_YES = 2 : Does exist currently
  • VCS_PHASE_EXIST_ALWAYS = 3: Always exists because it contains inerts which can't exist in any other phase. Or, the phase exists always because it consists of a single species, which is identified with the voltage, i.e., it's an electron metal phase.

Definition at line 1289 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_existence.

Referenced by VCS_SOLVE::recheck_deleted_phase(), VCS_SOLVE::vcs_delete_species(), VCS_SOLVE::vcs_phasePopDeterminePossibleList(), VCS_SOLVE::vcs_popPhaseID(), VCS_SOLVE::vcs_popPhasePossible(), VCS_SOLVE::vcs_popPhaseRxnStepSizes(), VCS_SOLVE::vcs_solve_TP(), and VCS_SOLVE::vcs_species_type().

void setExistence ( const int  existence)

Set the existence flag in the object.

Note the total moles of the phase must have been set appropriately before calling this routine.

Parameters
existencePhase existence flag
Note
try to eliminate this routine

Definition at line 1296 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_existence, vcs_VolPhase::m_phiVarIndex, vcs_VolPhase::m_singleSpecies, vcs_VolPhase::m_totalMolesInert, plogendl, plogf, vcs_VolPhase::v_totalMoles, VCS_PHASE_EXIST_NO, and VCS_PHASE_EXIST_ZEROEDPHASE.

Referenced by VCS_SOLVE::vcs_prob_specify(), and VCS_SOLVE::vcs_SSPhase().

size_t spGlobalIndexVCS ( const size_t  spIndex) const

Return the Global VCS index of the kth species in the phase.

Parameters
spIndexlocal species index (0 to the number of species in the phase)
Returns
Returns the VCS_SOLVE species index of the species. This changes as rearrangements are carried out.

Definition at line 1345 of file vcs_VolPhase.cpp.

References vcs_VolPhase::IndSpecies.

Referenced by VCS_PROB::prob_report(), VCS_SOLVE::recheck_deleted_phase(), VCS_SOLVE::vcs_chemPotPhase(), VCS_SOLVE::vcs_deltag(), VCS_SOLVE::vcs_deltag_Phase(), VCS_SOLVE::vcs_phasePopDeterminePossibleList(), VCS_SOLVE::vcs_phaseStabilityTest(), VCS_SOLVE::vcs_popPhaseID(), VCS_SOLVE::vcs_popPhasePossible(), VCS_SOLVE::vcs_popPhaseRxnStepSizes(), VCS_SOLVE::vcs_prob_specifyFully(), VCS_SOLVE::vcs_prob_update(), and VCS_SOLVE::vcs_switch_pos().

void setSpGlobalIndexVCS ( const size_t  spIndex,
const size_t  spGlobalIndex 
)

set the Global VCS index of the kth species in the phase

Parameters
spIndexlocal species index (0 to the number of species in the phase)
Returns
Returns the VCS_SOLVE species index of the that species This changes as rearrangements are carried out.

Definition at line 1359 of file vcs_VolPhase.cpp.

References vcs_VolPhase::creationGlobalRxnNumbers_, vcs_VolPhase::IndSpecies, and vcs_VolPhase::m_numElemConstraints.

Referenced by VCS_PROB::addOnePhaseSpecies(), and VCS_SOLVE::vcs_switch_pos().

void setTotalMolesInert ( const double  tMolesInert)
double totalMolesInert ( ) const

returns the value of the total kmol of inert in the phase

Returns
Returns the total value of the kmol of inert in the phase

Definition at line 1401 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_totalMolesInert.

Referenced by VCS_PROB::prob_report(), VCS_SOLVE::vcs_prob_specify(), VCS_SOLVE::vcs_prob_specifyFully(), and VCS_SOLVE::vcs_prob_update().

size_t elemGlobalIndex ( const size_t  e) const

Returns the global index of the local element index for the phase.

Definition at line 1408 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_elemGlobalIndex, and vcs_VolPhase::m_numElemConstraints.

Referenced by VCS_PROB::addOnePhaseSpecies(), and VCS_SOLVE::vcs_switch_elem_pos().

void setElemGlobalIndex ( const size_t  eLocal,
const size_t  eGlobal 
)

sets a local phase element to a global index value

Parameters
eLocalLocal phase element index
eGlobalGlobal phase element index

Definition at line 1416 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_elemGlobalIndex, and vcs_VolPhase::m_numElemConstraints.

Referenced by VCS_PROB::addPhaseElements(), and VCS_SOLVE::vcs_switch_elem_pos().

size_t nElemConstraints ( ) const

Returns the number of element constraints.

Definition at line 1424 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_numElemConstraints.

Referenced by VCS_PROB::addOnePhaseSpecies(), VCS_PROB::addPhaseElements(), and VCS_SOLVE::vcs_switch_elem_pos().

std::string elementName ( const size_t  e) const

Name of the element constraint with index e.

Parameters
eElement index.

Definition at line 1430 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_elementNames.

Referenced by VCS_PROB::addPhaseElements().

int elementType ( const size_t  e) const

Type of the element constraint with index e.

Parameters
eElement index.

Definition at line 1603 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_elementType.

Referenced by VCS_PROB::addPhaseElements().

void setElementType ( const size_t  e,
const int  eType 
)

Set the element Type of the element constraint with index e.

Parameters
eElement index
eTypetype of the element.

Definition at line 1614 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_elementType.

size_t transferElementsFM ( const Cantera::ThermoPhase *const  tPhase)
double const *const * getFormulaMatrix ( ) const

Get a constant form of the Species Formula Matrix.

Returns a double ** pointer such that

fm[e][f] is the formula matrix entry for element e for species k

Definition at line 1620 of file vcs_VolPhase.cpp.

References DoubleStarStar::constBaseDataAddr(), and vcs_VolPhase::m_formulaMatrix.

Referenced by VCS_PROB::addOnePhaseSpecies().

int speciesUnknownType ( const size_t  k) const

Returns the type of the species unknown.

Parameters
kspecies index

returns the SpeciesUnknownType[k] = type of species Normal -> VCS_SPECIES_TYPE_MOLUNK ( unknown is the mole number in the phase) metal electron -> VCS_SPECIES_INTERFACIALVOLTAGE ( unknown is the interfacial voltage (volts)

Definition at line 1627 of file vcs_VolPhase.cpp.

References vcs_VolPhase::m_speciesUnknownType.

Referenced by VCS_SOLVE::vcs_prob_update().

size_t nSpecies ( ) const
void _updateActCoeff ( ) const
private

Evaluate the activity coefficients at the current conditions.

Evaluate activity coefficients.

We carry out a calculation whenever UpTODate_AC is false. Specifically whenever a phase goes zero, we do not carry out calculations on it.

We carry out a calculation whenever UpTODate_AC is false. Specifically whenever a phase goes zero, we do not carry out calculations on it.

(private)

Definition at line 359 of file vcs_VolPhase.cpp.

References vcs_VolPhase::ActCoeff, ThermoPhase::getActivityCoefficients(), vcs_VolPhase::m_isIdealSoln, vcs_VolPhase::m_UpToDate_AC, vcs_VolPhase::m_useCanteraCalls, vcs_VolPhase::TP_ptr, and VCS_DATA_PTR.

Referenced by vcs_VolPhase::_updateLnActCoeffJac(), vcs_VolPhase::AC_calc_one(), and vcs_VolPhase::sendToVCS_ActCoeff().

void _updateGStar ( ) const
private
void _updateG0 ( ) const
private
void _updateVolStar ( ) const
private

Molar volume calculation for standard states.

Calculate the molar volume for the standard states. The results are held internally within the object. Units are in m**3/kmol.

Definition at line 851 of file vcs_VolPhase.cpp.

References ThermoPhase::getStandardVolumes(), vcs_VolPhase::IndSpecies, vcs_VolPhase::ListSpeciesPtr, vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_UpToDate_VolStar, vcs_VolPhase::m_useCanteraCalls, vcs_VolPhase::Pres_, vcs_VolPhase::StarMolarVol, vcs_VolPhase::Temp_, vcs_VolPhase::TP_ptr, and VCS_DATA_PTR.

Referenced by vcs_VolPhase::VolStar_calc_one().

double _updateVolPM ( ) const
private
void _updateLnActCoeffJac ( )
private

Evaluation of Activity Coefficient Jacobians.

This is the derivative of the ln of the activity coefficient with respect to mole number of jth species. (temp, pressure, and other mole numbers held constant)

We employ a finite difference derivative approach here. Because we have to change the mole numbers, this is not a const function, even though the paradigm would say that it should be.

Definition at line 919 of file vcs_VolPhase.cpp.

References vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::ActCoeff, vcs_VolPhase::dLnActCoeffdMolNumber, ThermoPhase::getdlnActCoeffdlnN(), vcs_VolPhase::m_numSpecies, vcs_VolPhase::m_UpToDate_AC, vcs_VolPhase::setMoleFractions(), vcs_VolPhase::TP_ptr, vcs_VolPhase::v_totalMoles, VCS_DATA_PTR, and vcs_VolPhase::Xmol_.

void _updateMoleFractionDependencies ( )
private

Member Data Documentation

VCS_SOLVE* m_owningSolverObject
private

Backtrack value of VCS_SOLVE *.

Note the default for this is 0. That's a valid value too, since VCS_PROB also uses vcs_VolPhase objects.

Definition at line 646 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::updateFromVCS_MoleNumbers(), and vcs_VolPhase::vcs_VolPhase().

size_t VP_ID_

Original ID of the phase in the problem.

If a non-ideal phase splits into two due to a miscibility gap, these numbers will stay the same after the split.

Definition at line 655 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), VCS_PROB::prob_report(), vcs_VolPhase::resize(), vcs_VolPhase::setMolesFromVCSCheck(), vcs_VolPhase::setPtrThermoPhase(), vcs_VolPhase::transferElementsFM(), and VCS_SOLVE::vcs_prob_specify().

int Domain_ID

ID of the surface or volume domain in which the this phase exists.

This ventures into the idea of installing a physical location into a thermodynamics program. This unknown is currently not being used.

Deprecated:

Definition at line 665 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=().

bool m_singleSpecies
bool m_gasPhase

If true, this phase is a gas-phase like phase.

A RTlog(p/1atm) term is added onto the chemical potential for inert species if this is true.

Definition at line 675 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateVolPM(), vcs_VolPhase::operator=(), VCS_PROB::prob_report(), VCS_SOLVE::vcs_GibbsPhase(), and VCS_SOLVE::vcs_prob_specify().

int m_eqnState

Type of the equation of state.

The known types are listed at the top of this file.

Definition at line 681 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), VCS_PROB::prob_report(), and VCS_SOLVE::vcs_prob_specify().

size_t ChargeNeutralityElement

This is the element number for the charge neutrality condition of the phase.

If it has one. If it does not have a charge neutrality constraint, then this value is equal to -1

Definition at line 689 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), and vcs_VolPhase::transferElementsFM().

int p_VCS_UnitsFormat

Units for the chemical potential data, pressure data, volume, and species amounts.

All internally stored quantities will have these units. Also, printed quantities will display in these units. Input quantities are expected in these units.

                     Chem_Pot                 Pres      vol   moles

-1 VCS_UNITS_KCALMOL = kcal/gmol Pa m**3 kmol 0 VCS_UNITS_UNITLESS = MU / RT -> no units Pa m**3 kmol 1 VCS_UNITS_KJMOL = kJ / gmol Pa m**3 kmol 2 VCS_UNITS_KELVIN = KELVIN -> MU / R Pa m**3 kmol

3 VCS_UNITS_MKS = Joules / Kmol (Cantera) Pa m**3 kmol

see vcs_defs.h for more information.

Currently, this value should be the same as the owning VCS_PROB or VCS_SOLVE object. There is no code for handling anything else atm.

(This variable is needed for the vcsc code, where it is not equal to VCS_UNITS_MKS).

Definition at line 715 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateG0(), vcs_VolPhase::_updateGStar(), vcs_VolPhase::operator=(), and vcs_VolPhase::setPtrThermoPhase().

int p_activityConvention

Convention for the activity formulation.

0 = molar based activities (default) 1 = Molality based activities mu = mu_0 + ln a_molality standard state is based on unity molality

Definition at line 724 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), and VCS_SOLVE::vcs_prob_specifyFully().

size_t m_numElemConstraints
private

Number of element constraints within the problem.

This is usually equal to the number of elements.

Definition at line 731 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::elemGlobalIndex(), vcs_VolPhase::nElemConstraints(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setElemGlobalIndex(), and vcs_VolPhase::setSpGlobalIndexVCS().

std::vector<std::string> m_elementNames
private

vector of strings containing the element constraint names

Length = nElemConstraints

Definition at line 737 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::elementName(), vcs_VolPhase::operator=(), and vcs_VolPhase::transferElementsFM().

std::vector<int> m_elementActive
private

boolean indicating whether an element constraint is active for the current problem

Definition at line 741 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), and vcs_VolPhase::transferElementsFM().

std::vector<int> m_elementType
private

Type of the element constraint.

m_elType[j] = type of the element 0 VCS_ELEM_TYPE_ABSPOS Normal element that is positive or zero in all species. 1 VCS_ELEM_TPYE_ELECTRONCHARGE element dof that corresponds to the charge DOF. 2 VCS_ELEM_TYPE_OTHERCONSTRAINT Other constraint which may mean that a species has neg 0 or pos value of that constraint (other than charge)

Definition at line 754 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::elementType(), vcs_VolPhase::operator=(), vcs_VolPhase::setElementType(), and vcs_VolPhase::transferElementsFM().

DoubleStarStar m_formulaMatrix
private

Formula Matrix for the phase.

FormulaMatrix[j][kspec] = Formula Matrix for the species Number of elements, j, in the kspec species

Definition at line 763 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::getFormulaMatrix(), vcs_VolPhase::operator=(), and vcs_VolPhase::transferElementsFM().

std::vector<int> m_speciesUnknownType
private

Type of the species unknown.

SpeciesUnknownType[k] = type of species Normal -> VCS_SPECIES_TYPE_MOLUNK ( unknown is the mole number in the phase) metal electron -> VCS_SPECIES_INTERFACIALVOLTAGE ( unknown is the interfacial voltage (volts)

Definition at line 773 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::speciesUnknownType(), and vcs_VolPhase::transferElementsFM().

std::vector<size_t> m_elemGlobalIndex
private

Index of the element number in the global list of elements stored in VCS_PROB or VCS_SOLVE.

Definition at line 777 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::elemGlobalIndex(), vcs_VolPhase::operator=(), and vcs_VolPhase::setElemGlobalIndex().

size_t m_numSpecies
private
std::string PhaseName
double m_totalMolesInert
private
bool m_isIdealSoln
private

Boolean indicating whether the phase is an ideal solution and therefore its molar-based activity coefficients are uniformly equal to one.

Definition at line 793 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::isIdealSoln(), vcs_VolPhase::operator=(), and vcs_VolPhase::setPtrThermoPhase().

int m_existence
private

Current state of existence:

VCS_PHASE_EXIST_ZEROEDPHASE = -6: Set to not exist by fiat from a higher level. This is used in phase stability boundary calculations VCS_PHASE_EXIST_NO = 0: Doesn't exist currently VCS_PHASE_EXIST_MINORCONC = 1: Exists, but the concentration is so low that an alternate method is used to calculate the total phase concentrations. VCS_PHASE_EXIST_YES = 2 : Does exist currently VCS_PHASE_EXIST_ALWAYS = 3: Always exists because it contains inerts which can't exist in any other phase. Or, the phase exists always because it consists of a single species, which is identified with the voltage, i.e., its an electron metal phase.

Definition at line 811 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::exists(), vcs_VolPhase::operator=(), vcs_VolPhase::setExistence(), vcs_VolPhase::setMoleFractionsState(), vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::setTotalMoles(), and vcs_VolPhase::setTotalMolesInert().

int m_MFStartIndex
private

This is always equal to zero. Am anticipating the case where the phase potential is species # 0, for multiphase phases. Right now we have the phase potential equal to 0 for single species phases, where we set by hand the mole fraction of species 0 to one.

Definition at line 821 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateMoleFractionDependencies(), and vcs_VolPhase::operator=().

std::vector<size_t> IndSpecies
private

Index into the species vectors.

Maps the phase species number into the global species number. Note, as part of the vcs algorithm, the order of the species vector is changed during the algorithm

Definition at line 829 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateG0(), vcs_VolPhase::_updateGStar(), vcs_VolPhase::_updateVolPM(), vcs_VolPhase::_updateVolStar(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::sendToVCS_ActCoeff(), vcs_VolPhase::sendToVCS_GStar(), vcs_VolPhase::sendToVCS_VolPM(), vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::setSpGlobalIndexVCS(), and vcs_VolPhase::spGlobalIndexVCS().

std::vector<vcs_SpeciesProperties*> ListSpeciesPtr
private

Vector of Species structures for the species belonging to this phase.

The index into this vector is the species index within the phase.

Definition at line 835 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateG0(), vcs_VolPhase::_updateGStar(), vcs_VolPhase::_updateVolPM(), vcs_VolPhase::_updateVolStar(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::speciesProperty(), and vcs_VolPhase::~vcs_VolPhase().

bool m_useCanteraCalls
private
Cantera::ThermoPhase* TP_ptr
private
double v_totalMoles
private
std::vector<double> Xmol_
private
std::vector<double> creationMoleNumbers_
private

Vector of current creationMoleNumbers_.

These are the actual unknowns in the phase stability problem

Definition at line 860 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::creationMoleNumbers(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setCreationMoleNumbers(), vcs_VolPhase::setMolesFromVCS(), and vcs_VolPhase::setPtrThermoPhase().

std::vector<size_t> creationGlobalRxnNumbers_
private

Vector of creation global reaction numbers for the phase stability problem.

The phase stability problem requires a global reaction number for each species in the phase. Usually this is the krxn = kglob - M for species in the phase that are not components. For component species, the choice of the reaction is one which maximizes the chance that the phase pops into (or remains in) existence. The index here is the local phase species index. the value of the variable is the global vcs reaction number. Note, that the global reaction number will go out of order when the species positions are swapped. So, this number has to be recalculated.

Definition at line 874 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::creationMoleNumbers(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setCreationMoleNumbers(), and vcs_VolPhase::setSpGlobalIndexVCS().

size_t m_phiVarIndex
private

If the potential is a solution variable in VCS, it acts as a species.

This is the species index in the phase for the potential

Definition at line 878 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), vcs_VolPhase::phiVarIndex(), vcs_VolPhase::resize(), vcs_VolPhase::setExistence(), vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::setTotalMoles(), and vcs_VolPhase::setTotalMolesInert().

double m_totalVol
mutableprivate

Total Volume of the phase.

units are m**3

Definition at line 884 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateVolPM(), vcs_VolPhase::operator=(), and vcs_VolPhase::sendToVCS_VolPM().

std::vector<double> SS0ChemicalPotential
mutableprivate

Vector of calculated SS0 chemical potentials for the current Temperature.

Note, This is the chemical potential derived strictly from the polynomial in temperature. Pressure effects have to be added in to get to the standard state.

Units -> depends on VCS_UnitsFormat variable Cantera -> J/kmol

Definition at line 896 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateG0(), vcs_VolPhase::G0_calc_one(), vcs_VolPhase::operator=(), and vcs_VolPhase::resize().

std::vector<double> StarChemicalPotential
mutableprivate

Vector of calculated Star chemical potentials for the current Temperature and pressure.

Note, This is the chemical potential at unit activity. Thus, we can call it the standard state chemical potential as well.

Units -> depends on VCS_UnitsFormat variable Cantera -> J/kmol

Definition at line 907 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateGStar(), vcs_VolPhase::GStar_calc_one(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), and vcs_VolPhase::sendToVCS_GStar().

std::vector<double> StarMolarVol
mutableprivate

Vector of the Star molar Volumes of the species.

units m3 / kmol

Definition at line 913 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateVolPM(), vcs_VolPhase::_updateVolStar(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), and vcs_VolPhase::VolStar_calc_one().

std::vector<double> PartialMolarVol
mutableprivate

Vector of the Partial molar Volumes of the species.

units m3 / kmol

Definition at line 919 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateVolPM(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), and vcs_VolPhase::sendToVCS_VolPM().

std::vector<double> ActCoeff
mutableprivate

Vector of calculated activity coefficients for the current state.

Whether or not this vector is current is determined by the bool m_UpToDate_AC.

Definition at line 926 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::_updateLnActCoeffJac(), vcs_VolPhase::AC_calc_one(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), and vcs_VolPhase::sendToVCS_ActCoeff().

DoubleStarStar dLnActCoeffdMolNumber
mutableprivate

Vector of the derivatives of the ln activity coefficient wrt to the current mole number.

dLnActCoeffdMolNumber[j][k]; j = id of the species mole number k = id of the species activity coefficient

Definition at line 935 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateLnActCoeffJac(), vcs_VolPhase::operator=(), and vcs_VolPhase::resize().

int m_vcsStateStatus
private
double m_phi
private
bool m_UpToDate
private

Boolean indicating whether the object has an up-to-date mole number vector and potential with respect to the current vcs state calc status.

Definition at line 952 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setMoleFractions(), vcs_VolPhase::setMoleFractionsState(), vcs_VolPhase::setMolesCurrent(), vcs_VolPhase::setMolesFromVCS(), vcs_VolPhase::setMolesOutOfDate(), vcs_VolPhase::setTotalMolesInert(), and vcs_VolPhase::updateFromVCS_MoleNumbers().

bool m_UpToDate_AC
mutableprivate

Boolean indicating whether activity coefficients are up to date.

Activity coefficients and volume calculations are lagged. They are only called when they are needed (and when the state has changed so that they need to be recalculated).

Definition at line 960 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateActCoeff(), vcs_VolPhase::_updateLnActCoeffJac(), vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::AC_calc_one(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::sendToVCS_ActCoeff(), vcs_VolPhase::setElectricPotential(), vcs_VolPhase::setState_TP(), and vcs_VolPhase::setTotalMolesInert().

bool m_UpToDate_VolStar
mutableprivate

Boolean indicating whether Star volumes are up to date.

Activity coefficients and volume calculations are lagged. They are only called when they are needed (and when the state has changed so that they need to be recalculated). Star volumes are sensitive to temperature and pressure

Definition at line 969 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateVolStar(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setElectricPotential(), vcs_VolPhase::setState_TP(), vcs_VolPhase::setTotalMolesInert(), and vcs_VolPhase::VolStar_calc_one().

bool m_UpToDate_VolPM
mutableprivate

Boolean indicating whether partial molar volumes are up to date.

Activity coefficients and volume calculations are lagged. They are only called when they are needed (and when the state has changed so that they need to be recalculated). partial molar volumes are sensitive to everything

Definition at line 978 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateMoleFractionDependencies(), vcs_VolPhase::_updateVolPM(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::sendToVCS_VolPM(), vcs_VolPhase::setElectricPotential(), vcs_VolPhase::setState_TP(), and vcs_VolPhase::setTotalMolesInert().

bool m_UpToDate_GStar
mutableprivate

Boolean indicating whether GStar is up to date.

GStar is sensitive to the temperature and the pressure, only

Definition at line 984 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateGStar(), vcs_VolPhase::GStar_calc_one(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::sendToVCS_GStar(), vcs_VolPhase::setElectricPotential(), vcs_VolPhase::setState_TP(), and vcs_VolPhase::setTotalMolesInert().

bool m_UpToDate_G0
mutableprivate

Boolean indicating whether G0 is up to date.

G0 is sensitive to the temperature and the pressure, only

Definition at line 991 of file vcs_VolPhase.h.

Referenced by vcs_VolPhase::_updateG0(), vcs_VolPhase::G0_calc_one(), vcs_VolPhase::operator=(), vcs_VolPhase::resize(), vcs_VolPhase::setState_TP(), and vcs_VolPhase::setTotalMolesInert().

double Temp_
private
double Pres_
private

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