vcs_VolPhase.h Source File#
vcs_VolPhase.h
Go to the documentation of this file.
329 void setCreationMoleNumbers(const double* const n_k, const vector<size_t> &creationGlobalRxnNumbers);
Header file for class Cantera::Array2D.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition Array.h:32
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
This is the main structure used to hold the internal data used in vcs_solve_TP(), and to solve TP sys...
Definition vcs_solve.h:45
vector< double > StarChemicalPotential
Vector of calculated Star chemical potentials for the current Temperature and pressure.
Definition vcs_VolPhase.h:734
void setCreationMoleNumbers(const double *const n_k, const vector< size_t > &creationGlobalRxnNumbers)
Sets the creationMoleNum's within the phase object.
Definition vcs_VolPhase.cpp:594
void setElectricPotential(const double phi)
set the electric potential of the phase
Definition vcs_VolPhase.cpp:398
double electricPotential() const
Returns the electric field of the phase.
Definition vcs_VolPhase.cpp:409
size_t m_phiVarIndex
If the potential is a solution variable in VCS, it acts as a species.
Definition vcs_VolPhase.h:714
vector< double > Xmol_
Vector of the current mole fractions for species in the phase.
Definition vcs_VolPhase.h:687
double Temp_
Current value of the temperature for this object, and underlying objects.
Definition vcs_VolPhase.h:813
int speciesUnknownType(const size_t k) const
Returns the type of the species unknown.
Definition vcs_VolPhase.cpp:900
size_t elemGlobalIndex(const size_t e) const
Returns the global index of the local element index for the phase.
Definition vcs_VolPhase.cpp:739
void _updateGStar() const
Gibbs free energy calculation for standard states.
Definition vcs_VolPhase.cpp:152
vector< double > SS0ChemicalPotential
Vector of calculated SS0 chemical potentials for the current Temperature.
Definition vcs_VolPhase.h:726
void setMolesFromVCSCheck(const int vcsStateStatus, const double *molesSpeciesVCS, const double *const TPhMoles)
Set the moles within the phase.
Definition vcs_VolPhase.cpp:336
void setMoleFractionsState(const double molNum, const double *const moleFracVec, const int vcsStateStatus)
Set the moles and/or mole fractions within the phase.
Definition vcs_VolPhase.cpp:205
void setMolesOutOfDate(int stateCalc=-1)
Sets the mole flag within the object to out of date.
Definition vcs_VolPhase.cpp:632
vector< string > m_elementNames
vector of strings containing the element constraint names
Definition vcs_VolPhase.h:582
vector< int > m_elementActive
boolean indicating whether an element constraint is active for the current problem
Definition vcs_VolPhase.h:586
vector< double > creationMoleNumbers_
Vector of current creationMoleNumbers_.
Definition vcs_VolPhase.h:693
double _updateVolPM() const
Calculate the partial molar volumes of all species and return the total volume.
Definition vcs_VolPhase.cpp:449
size_t ChargeNeutralityElement
This is the element number for the charge neutrality condition of the phase.
Definition vcs_VolPhase.h:561
vector< size_t > m_elemGlobalIndex
Index of the element number in the global list of elements stored in VCS_SOLVE.
Definition vcs_VolPhase.h:619
Array2D np_dLnActCoeffdMolNumber
Vector of the derivatives of the ln activity coefficient wrt to the current mole number multiplied by...
Definition vcs_VolPhase.h:756
const Array2D & getFormulaMatrix() const
Get a constant form of the Species Formula Matrix.
Definition vcs_VolPhase.cpp:895
bool m_UpToDate_VolStar
Boolean indicating whether Star volumes are up to date.
Definition vcs_VolPhase.h:789
void updateFromVCS_MoleNumbers(const int stateCalc)
Update the moles within the phase, if necessary.
Definition vcs_VolPhase.cpp:354
vcs_SpeciesProperties * speciesProperty(const size_t kindex)
Retrieve the kth Species structure for the species belonging to this phase.
Definition vcs_VolPhase.cpp:665
size_t phiVarIndex() const
Return the index of the species that represents the the voltage of the phase.
Definition vcs_VolPhase.cpp:651
double totalMolesInert() const
Returns the value of the total kmol of inert in the phase.
Definition vcs_VolPhase.cpp:734
void setMolesFromVCS(const int stateCalc, const double *molesSpeciesVCS=0)
Set the moles within the phase.
Definition vcs_VolPhase.cpp:255
void setElemGlobalIndex(const size_t eLocal, const size_t eGlobal)
sets a local phase element to a global index value
Definition vcs_VolPhase.cpp:745
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.
Definition vcs_VolPhase.cpp:32
bool m_isIdealSoln
Boolean indicating whether the phase is an ideal solution and therefore its molar-based activity coef...
Definition vcs_VolPhase.h:635
vector< double > ActCoeff
Vector of calculated activity coefficients for the current state.
Definition vcs_VolPhase.h:747
const vector< double > & moleFractions() const
Return a const reference to the mole fractions stored in the object.
Definition vcs_VolPhase.cpp:195
size_t nElemConstraints() const
Returns the number of element constraints.
Definition vcs_VolPhase.cpp:752
size_t spGlobalIndexVCS(const size_t spIndex) const
Return the Global VCS index of the kth species in the phase.
Definition vcs_VolPhase.cpp:695
size_t transferElementsFM(const ThermoPhase *const tPhase)
Transfer all of the element information from the ThermoPhase object to the vcs_VolPhase object.
Definition vcs_VolPhase.cpp:786
double VolStar_calc_one(size_t kspec) const
Molar volume calculation for standard state of one species.
Definition vcs_VolPhase.cpp:441
double GStar_calc_one(size_t kspec) const
Gibbs free energy calculation for standard state of one species.
Definition vcs_VolPhase.cpp:158
void _updateVolStar() const
Molar volume calculation for standard states.
Definition vcs_VolPhase.cpp:435
void _updateG0() const
Gibbs free energy calculation at a temperature for the reference state of each species.
Definition vcs_VolPhase.cpp:138
double Pres_
Current value of the pressure for this object, and underlying objects.
Definition vcs_VolPhase.h:816
vector< double > PartialMolarVol
Vector of the Partial molar Volumes of the species. units m3 / kmol.
Definition vcs_VolPhase.h:740
double molefraction(size_t kspec) const
Returns the mole fraction of the kspec species.
Definition vcs_VolPhase.cpp:589
void _updateLnActCoeffJac()
Evaluation of Activity Coefficient Jacobians.
Definition vcs_VolPhase.cpp:470
void setTotalMoles(const double totalMols)
Sets the total moles in the phase.
Definition vcs_VolPhase.cpp:610
void setMolesCurrent(int vcsStateStatus)
Sets the mole flag within the object to be current.
Definition vcs_VolPhase.cpp:640
void sendToVCS_GStar(double *const gstar) const
Fill in the standard state Gibbs free energy vector for VCS.
Definition vcs_VolPhase.cpp:387
void sendToVCS_ActCoeff(const int stateCalc, double *const AC)
Fill in an activity coefficients vector within a VCS_SOLVE object.
Definition vcs_VolPhase.cpp:362
size_t m_numElemConstraints
Number of element constraints within the problem.
Definition vcs_VolPhase.h:576
vector< double > StarMolarVol
Vector of the Star molar Volumes of the species. units m3 / kmol.
Definition vcs_VolPhase.h:737
double sendToVCS_VolPM(double *const VolPM) const
Fill in the partial molar volume vector for VCS.
Definition vcs_VolPhase.cpp:375
void sendToVCS_LnActCoeffJac(Array2D &LnACJac_VCS)
Downloads the ln ActCoeff Jacobian into the VCS version of the ln ActCoeff Jacobian.
Definition vcs_VolPhase.cpp:535
void setTotalMolesInert(const double tMolesInert)
Sets the total moles of inert in the phase.
Definition vcs_VolPhase.cpp:709
double G0_calc_one(size_t kspec) const
Gibbs free energy calculation at a temperature for the reference state of a species,...
Definition vcs_VolPhase.cpp:144
void _updateActCoeff() const
Evaluate the activity coefficients at the current conditions.
Definition vcs_VolPhase.cpp:128
void setState_TP(const double temperature_Kelvin, const double pressure_PA)
Sets the temperature and pressure in this object and underlying ThermoPhase objects.
Definition vcs_VolPhase.cpp:414
string eos_name() const
Return the name corresponding to the equation of state.
Definition vcs_VolPhase.cpp:915
bool m_UpToDate_AC
Boolean indicating whether activity coefficients are up to date.
Definition vcs_VolPhase.h:780
ThermoPhase * TP_ptr
If we are using Cantera, this is the pointer to the ThermoPhase object.
Definition vcs_VolPhase.h:681
void _updateMoleFractionDependencies()
Updates the mole fraction dependencies.
Definition vcs_VolPhase.cpp:183
int elementType(const size_t e) const
Type of the element constraint with index e.
Definition vcs_VolPhase.cpp:890
const ThermoPhase * ptrThermoPhase() const
Return a const ThermoPhase pointer corresponding to this phase.
Definition vcs_VolPhase.cpp:579
vector< size_t > creationGlobalRxnNumbers_
Vector of creation global reaction numbers for the phase stability problem.
Definition vcs_VolPhase.h:710
void setSpGlobalIndexVCS(const size_t spIndex, const size_t spGlobalIndex)
set the Global VCS index of the kth species in the phase
Definition vcs_VolPhase.cpp:700
void setExistence(const int existence)
Set the existence flag in the object.
Definition vcs_VolPhase.cpp:675
void setMoleFractions(const double *const xmol)
Set the mole fractions from a conventional mole fraction vector.
Definition vcs_VolPhase.cpp:166
bool m_UpToDate
Boolean indicating whether the object has an up-to-date mole number vector and potential with respect...
Definition vcs_VolPhase.h:772
vector< vcs_SpeciesProperties * > ListSpeciesPtr
Vector of Species structures for the species belonging to this phase.
Definition vcs_VolPhase.h:675
void setState_T(const double temperature_Kelvin)
Sets the temperature in this object and underlying ThermoPhase objects.
Definition vcs_VolPhase.cpp:430
const vector< double > & creationMoleNumbers(vector< size_t > &creationGlobalRxnNumbers) const
Return a const reference to the creationMoleNumbers stored in the object.
Definition vcs_VolPhase.cpp:603
string elementName(const size_t e) const
Name of the element constraint with index e.
Definition vcs_VolPhase.cpp:757
bool m_UpToDate_VolPM
Boolean indicating whether partial molar volumes are up to date.
Definition vcs_VolPhase.h:798
bool isIdealSoln() const
Returns whether the phase is an ideal solution phase.
Definition vcs_VolPhase.cpp:646
void setPtrThermoPhase(ThermoPhase *tp_ptr)
Set the pointer for Cantera's ThermoPhase parameter.
Definition vcs_VolPhase.cpp:551
Defines and definitions within the vcs package.
#define VCS_STATECALC_OLD
State Calculation based on the old or base mole numbers.
Definition vcs_defs.h:297
Generated by 1.9.7