13 #ifndef CT_MIXTUREFUGACITYTP_H
14 #define CT_MIXTUREFUGACITYTP_H
24 #define FLUID_UNSTABLE -4
25 #define FLUID_UNDEFINED -3
26 #define FLUID_SUPERCRIT -2
28 #define FLUID_LIQUID_0 0
29 #define FLUID_LIQUID_1 1
30 #define FLUID_LIQUID_2 2
31 #define FLUID_LIQUID_3 3
32 #define FLUID_LIQUID_4 4
33 #define FLUID_LIQUID_5 5
34 #define FLUID_LIQUID_6 6
35 #define FLUID_LIQUID_7 7
36 #define FLUID_LIQUID_8 8
37 #define FLUID_LIQUID_9 9
273 virtual void getCp_R(doublereal* cpr)
const;
342 virtual void setState_TP(doublereal T, doublereal pres);
349 virtual void setState_TR(doublereal T, doublereal rho);
360 virtual void setState_TPX(doublereal t, doublereal p,
const doublereal* x);
411 void setMoleFractions_NoState(
const doublereal*
const x);
623 doublereal
z()
const;
632 virtual doublereal
sresid()
const;
640 virtual doublereal
hresid()
const;
651 virtual doublereal
psatEst(doublereal TKelvin)
const;
668 virtual doublereal
liquidVolEst(doublereal TKelvin, doublereal& pres)
const;
693 virtual doublereal
densityCalc(doublereal TKelvin, doublereal
pressure,
int phaseRequested,
694 doublereal rhoguess);
706 int corr0(doublereal TKelvin, doublereal pres, doublereal& densLiq,
707 doublereal& densGas, doublereal& liqGRT, doublereal& gasGRT);
720 int phaseState(
bool checkState =
false)
const ;
745 doublereal
calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
746 doublereal& molarVolLiquid);
754 virtual doublereal
satPressure(doublereal TKelvin);
766 virtual doublereal
pressureCalc(doublereal TKelvin, doublereal molarVol)
const;
779 virtual doublereal
dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc)
const;
781 virtual void updateMixingExpressions();
789 virtual int evalSS(
const doublereal t,
const doublereal*
const y, doublereal*
const r);
839 spinodalFunc* fdpdv_;
virtual doublereal satPressure(doublereal TKelvin)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
virtual void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
virtual doublereal densSpinodalGas() const
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize a ThermoPhase object, potentially reading activity coefficient information from an XML dat...
virtual doublereal densityCalc(doublereal TKelvin, doublereal pressure, int phaseRequested, doublereal rhoguess)
Calculates the density given the temperature and the pressure and a guess at the density.
virtual doublereal liquidVolEst(doublereal TKelvin, doublereal &pres) const
Estimate for the molar volume of the liquid.
An error indicating that an unimplemented function has been called.
virtual void getGibbs_ref(doublereal *g) const
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity.
int forcedState_
Force the system to be on a particular side of the spinodal curve.
void getPureGibbs(doublereal *gpure) const
Get the pure Gibbs free energies of each species.
doublereal z() const
Calculate the value of z.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at ...
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
virtual void setMoleFractions(const doublereal *const x)
Set the mole fractions to the specified values, and then normalize them so that they sum to 1...
Class XML_Node is a tree-based representation of the contents of an XML file.
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
MixtureFugacityTP & operator=(const MixtureFugacityTP &b)
Assignment operator.
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
doublereal calculatePsat(doublereal TKelvin, doublereal &molarVolGas, doublereal &molarVolLiquid)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temper...
MixtureFugacityTP()
Constructor.
doublereal pressure() const
Returns the current pressure of the phase.
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species reference states at the current T and reference pressure of the ...
virtual void initThermo()
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species at their standard states of solution at the cu...
Base class for a phase with thermodynamic properties.
virtual void setState_TR(doublereal T, doublereal rho)
Set the internally stored temperature (K) and density (kg/m^3)
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of each species in their standard states at the current T and P of the solution...
doublereal m_Pcurrent
Current value of the pressures.
virtual void setMassFractions_NoNorm(const doublereal *const y)
Set the mass fractions to the specified values without normalizing.
virtual void setMassFractions(const doublereal *const y)
Set the mass fractions to the specified values, and then normalize them so that they sum to 1...
virtual void setTemperature(const doublereal temp)
Set the temperature of the phase.
virtual doublereal psatEst(doublereal TKelvin) const
Estimate for the saturation pressure.
virtual doublereal densSpinodalLiquid() const
Return the value of the density at the liquid spinodal point (on the liquid side) for the current tem...
Virtual base class for DAE residual function evaluators.
virtual void setConcentrations(const doublereal *const c)
Set the concentrations to the specified values within the phase.
void modifyOneHf298SS(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
virtual void getdlnActCoeffdlnN_diag(doublereal *dlnActCoeffdlnN_diag) const
Get the array of log concentration-like derivatives of the log activity coefficients.
doublereal m_logc0
Temporary storage for log of p/rt.
const vector_fp & gibbs_RT_ref() const
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temper...
std::vector< doublereal > moleFractions_
Storage for the current values of the mole fractions of the species.
virtual doublereal pressureCalc(doublereal TKelvin, doublereal molarVol) const
Calculate the pressure given the temperature and the molar volume.
void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
virtual doublereal hresid() const
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture...
virtual void setForcedSolutionBranch(int solnBranch)
Set the solution branch to force the ThermoPhase to exist on one branch or another.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
virtual int forcedSolutionBranch() const
Report the solution branch which the solution is restricted to.
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the standard state at the current temperatu...
virtual void setMoleFractions_NoNorm(const doublereal *const x)
Set the mole fractions to the specified values without normalizing.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Enthalpy functions for the standard state species.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine.
int iState_
Current state of the fluid.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal m_Tlast_ref
The last temperature at which the reference state thermodynamic properties were calculated at...
int corr0(doublereal TKelvin, doublereal pres, doublereal &densLiq, doublereal &densGas, doublereal &liqGRT, doublereal &gasGRT)
Utility routine in the calculation of the saturation pressure.
virtual void setState_TP(doublereal T, doublereal pres)
Set the temperature and pressure at the same time.
virtual void getEntropy_R_ref(doublereal *er) const
virtual doublereal sresid() const
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture...
virtual void _updateReferenceStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution.
virtual int reportSolnBranchActual() const
Report the solution branch which the solution is actually on.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
virtual void getCp_R_ref(doublereal *cprt) const
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
vector_fp m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
virtual doublereal dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal &presCalc) const
Calculate the pressure and the pressure derivative given the temperature and the molar volume...
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the phase to the conditions specified in the state XML element.