6#ifndef CT_PENGROBINSON_H
7#define CT_PENGROBINSON_H
32 const std::string&
id=
"");
34 virtual std::string
type()
const {
35 return "Peng-Robinson";
156 virtual bool addSpecies(shared_ptr<Species> spec);
159 AnyMap& speciesNode)
const;
178 const std::string& species_j,
double a);
183 virtual double sresid()
const;
184 virtual double hresid()
const;
186 virtual double liquidVolEst(
double T,
double& pres)
const;
191 virtual double dpdVCalc(
double T,
double molarVol,
double& presCalc)
const;
232 void calculateAB(
double& aCalc,
double& bCalc,
double& aAlpha)
const;
234 void calcCriticalConditions(
double& pc,
double& tc,
double& vc)
const;
237 int solveCubic(
double T,
double pres,
double a,
double b,
double aAlpha,
238 double Vroot[3])
const;
306 enum class CoeffSource { EoS, CritProps, Database };
Header file for class Cantera::Array2D.
Header file for a derived class of ThermoPhase that handles non-ideal mixtures based on the fugacity ...
A map of string keys to values whose type can vary at runtime.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Implementation of a multi-species Peng-Robinson equation of state.
virtual double cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual bool addSpecies(shared_ptr< Species > spec)
void setSpeciesCoeffs(const std::string &species, double a, double b, double w)
Set the pure fluid interaction parameters for a species.
virtual double standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
virtual double densityCalc(double T, double pressure, int phase, double rhoguess)
Calculates the density given the temperature and the pressure and a guess at the density.
virtual double pressure() const
Return the thermodynamic pressure (Pa).
static const double omega_b
Omega constant: b0 (= omega_b) used in Peng-Robinson equation of state.
virtual void getPartialMolarEnthalpies(double *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
vector_fp m_pp
Temporary storage - length = m_kk.
virtual double densSpinodalLiquid() const
Return the value of the density at the liquid spinodal point (on the liquid side) for the current tem...
virtual void getActivityCoefficients(double *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
virtual double dpdVCalc(double T, double molarVol, double &presCalc) const
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
virtual double cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
std::vector< CoeffSource > m_coeffSource
For each species, specifies the source of the a, b, and omega coefficients.
double m_dpdT
The derivative of the pressure with respect to the temperature.
PengRobinson(const std::string &infile="", const std::string &id="")
Construct and initialize a PengRobinson object directly from an input file.
virtual void updateMixingExpressions()
Update the , , and parameters.
virtual void getChemPotentials(double *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual double liquidVolEst(double T, double &pres) const
Estimate for the molar volume of the liquid.
virtual double densSpinodalGas() const
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
int solveCubic(double T, double pres, double a, double b, double aAlpha, double Vroot[3]) const
Prepare variables and call the function to solve the cubic equation of state.
std::map< std::string, std::map< std::string, double > > m_binaryParameters
Explicitly-specified binary interaction parameters, to enable serialization.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
double daAlpha_dT() const
Calculate temperature derivative .
void calculatePressureDerivatives() const
Calculate and at the current conditions.
virtual void getPartialMolarIntEnergies(double *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
double m_aAlpha_mix
Value of in the equation of state.
double m_a
Value of in the equation of state.
static const double omega_a
Omega constant: a0 (= omega_a) used in Peng-Robinson equation of state.
virtual std::string type() const
String indicating the thermodynamic model implemented.
void setBinaryCoeffs(const std::string &species_i, const std::string &species_j, double a)
Set values for the interaction parameter between two species.
static const double omega_vc
Omega constant for the critical molar volume.
virtual void getPartialMolarVolumes(double *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void calculateAB(double &aCalc, double &bCalc, double &aAlpha) const
Calculate the , , and parameters given the temperature.
virtual double sresid() const
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
double m_b
Value of in the equation of state.
virtual void getSpeciesParameters(const std::string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
vector_fp m_dpdni
Vector of derivatives of pressure with respect to mole number.
virtual double hresid() const
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
double d2aAlpha_dT2() const
Calculate second derivative .
virtual void getPartialMolarEntropies(double *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void getPartialMolarCp(double *cpbar) const
Calculate species-specific molar specific heats.
double m_dpdV
The derivative of the pressure with respect to the volume.
virtual double speciesCritTemperature(double a, double b) const
Calculate species-specific critical temperature.
vector_fp m_acentric
acentric factor for each species, length m_kk
std::string name() const
Return the name of the phase.
shared_ptr< Species > species(const std::string &name) const
Return the Species object for the named species.
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.