11#ifndef CT_MIXTUREFUGACITYTP_H
12#define CT_MIXTUREFUGACITYTP_H
22#define FLUID_UNSTABLE -4
23#define FLUID_UNDEFINED -3
24#define FLUID_SUPERCRIT -2
26#define FLUID_LIQUID_0 0
27#define FLUID_LIQUID_1 1
28#define FLUID_LIQUID_2 2
29#define FLUID_LIQUID_3 3
30#define FLUID_LIQUID_4 4
31#define FLUID_LIQUID_5 5
32#define FLUID_LIQUID_6 6
33#define FLUID_LIQUID_7 7
34#define FLUID_LIQUID_8 8
35#define FLUID_LIQUID_9 9
87 virtual std::string
type()
const {
88 return "MixtureFugacity";
246 virtual void getCp_R(doublereal* cpr)
const;
344 virtual bool addSpecies(shared_ptr<Species> spec);
360 doublereal
z()
const;
369 virtual doublereal
sresid()
const;
378 virtual doublereal
hresid()
const;
388 virtual doublereal
psatEst(doublereal TKelvin)
const;
405 virtual doublereal
liquidVolEst(doublereal TKelvin, doublereal& pres)
const;
429 virtual doublereal
densityCalc(doublereal TKelvin, doublereal
pressure,
int phaseRequested,
430 doublereal rhoguess);
442 int corr0(doublereal TKelvin, doublereal pres, doublereal& densLiq,
443 doublereal& densGas, doublereal& liqGRT, doublereal& gasGRT);
456 int phaseState(
bool checkState =
false)
const;
481 doublereal
calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
482 doublereal& molarVolLiquid);
491 virtual doublereal
satPressure(doublereal TKelvin);
505 virtual doublereal
dpdVCalc(doublereal TKelvin, doublereal molarVol, doublereal& presCalc)
const;
507 virtual void updateMixingExpressions();
518 virtual void calcCriticalConditions(
double& pc,
double& tc,
double& vc)
const;
545 int solveCubic(
double T,
double pres,
double a,
double b,
546 double aAlpha,
double Vroot[3],
double an,
547 double bn,
double cn,
double dn,
double tc,
double vc)
const;
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the phase to the conditions specified in the state XML element.
int iState_
Current state of the fluid.
vector_fp m_g0_RT
Temporary storage for dimensionless reference state Gibbs energies.
virtual int reportSolnBranchActual() const
Report the solution branch which the solution is actually on.
vector_fp m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
virtual double entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
virtual double enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species at their standard states of solution at the cu...
virtual doublereal hresid() const
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
virtual double critCompressibility() const
Critical compressibility (unitless).
doublereal z() const
Calculate the value of z.
vector_fp m_h0_RT
Temporary storage for dimensionless reference state enthalpies.
virtual doublereal satPressure(doublereal TKelvin)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void getdlnActCoeffdlnN_diag(doublereal *dlnActCoeffdlnN_diag) const
Get the array of log species mole number derivatives of the log activity coefficients.
virtual void _updateReferenceStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution.
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...
vector_fp m_s0_R
Temporary storage for dimensionless reference state entropies.
int solveCubic(double T, double pres, double a, double b, double aAlpha, double Vroot[3], double an, double bn, double cn, double dn, double tc, double vc) const
Solve the cubic equation of state.
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 doublereal sresid() const
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at ...
virtual double critVolume() const
Critical volume (m3/kmol).
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
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 psatEst(doublereal TKelvin) const
Estimate for the saturation pressure.
virtual doublereal liquidVolEst(doublereal TKelvin, doublereal &pres) const
Estimate for the molar volume of the liquid.
const vector_fp & gibbs_RT_ref() const
Returns the vector of nondimensional Gibbs free energies of the reference state at the current temper...
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
virtual doublereal densSpinodalGas() const
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
virtual std::string type() const
String indicating the thermodynamic model implemented.
virtual double critDensity() const
Critical density (kg/m3).
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the standard state at the current temperatu...
virtual void setTemperature(const doublereal temp)
Set the temperature of the phase.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
vector_fp moleFractions_
Storage for the current values of the mole fractions of the species.
doublereal calculatePsat(doublereal TKelvin, doublereal &molarVolGas, doublereal &molarVolLiquid)
Calculate the saturation pressure at the current mixture content for the given temperature.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity.
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species reference states at the current T and P_ref of the solution.
int forcedState_
Force the system to be on a particular side of the spinodal curve.
virtual int forcedSolutionBranch() const
Report the solution branch which the solution is restricted to.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual double critTemperature() const
Critical temperature (K).
virtual void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...
virtual void getActivityConcentrations(double *c) const
This method returns an array of generalized concentrations.
virtual void setForcedSolutionBranch(int solnBranch)
Set the solution branch to force the ThermoPhase to exist on one branch or another.
int corr0(doublereal TKelvin, doublereal pres, doublereal &densLiq, doublereal &densGas, doublereal &liqGRT, doublereal &gasGRT)
Utility routine in the calculation of 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...
MixtureFugacityTP()
Constructor.
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual void getPureGibbs(doublereal *gpure) const
Get the pure Gibbs free energies of each species.
vector_fp m_tmpV
Temporary storage - length = m_kk.
virtual double critPressure() const
Critical pressure (Pa).
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
An error indicating that an unimplemented function has been called.
virtual double pressure() const
Return the thermodynamic pressure (Pa).
Base class for a phase with thermodynamic properties.
Class XML_Node is a tree-based representation of the contents of an XML file.
Namespace for the Cantera kernel.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.