PengRobinson.cpp Source File#
PengRobinson.cpp
Go to the documentation of this file.
Declaration for class Cantera::Species.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
Definition AnyMap.h:630
double convert(const string &key, const string &units) const
Convert the item stored by the given key to the units specified in units.
Definition AnyMap.cpp:1535
static AnyMap fromYamlFile(const string &name, const string &parent_name="")
Create an AnyMap from a YAML file.
Definition AnyMap.cpp:1771
virtual void resize(size_t n, size_t m, double v=0.0)
Resize the array, and fill the new entries with 'v'.
Definition Array.cpp:47
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition AnyMap.h:738
void getGibbs_ref(double *g) const override
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
Definition MixtureFugacityTP.cpp:133
double critTemperature() const override
Critical temperature (K).
Definition MixtureFugacityTP.cpp:744
virtual void _updateReferenceStateThermo() const
Updates the reference state thermodynamic functions at the current T of the solution.
Definition MixtureFugacityTP.cpp:722
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.
Definition MixtureFugacityTP.cpp:785
vector< double > moleFractions_
Storage for the current values of the mole fractions of the species.
Definition MixtureFugacityTP.h:516
void setTemperature(const double temp) override
Set the temperature of the phase.
Definition MixtureFugacityTP.cpp:179
virtual double psatEst(double TKelvin) const
Estimate for the saturation pressure.
Definition MixtureFugacityTP.cpp:283
void getStandardVolumes(double *vol) const override
Get the molar volumes of each species in their standard states at the current T and P of the solution...
Definition MixtureFugacityTP.cpp:114
vector< double > m_cp0_R
Temporary storage for dimensionless reference state heat capacities.
Definition MixtureFugacityTP.h:534
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition MixtureFugacityTP.cpp:161
void getEnthalpy_RT_ref(double *hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
Definition MixtureFugacityTP.cpp:123
An error indicating that an unimplemented function has been called.
Definition ctexceptions.h:195
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition PengRobinson.cpp:632
double densSpinodalLiquid() const override
Return the value of the density at the liquid spinodal point (on the liquid side) for the current tem...
Definition PengRobinson.cpp:574
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition PengRobinson.cpp:204
void getChemPotentials(double *mu) const override
Get the species chemical potentials. Units: J/kmol.
Definition PengRobinson.cpp:169
void setSpeciesCoeffs(const string &species, double a, double b, double w)
Set the pure fluid interaction parameters for a species.
Definition PengRobinson.cpp:29
double sresid() const override
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
Definition PengRobinson.cpp:459
double soundSpeed() const override
Return the speed of sound. Units: m/s.
Definition PengRobinson.cpp:638
double pressure() const override
Return the thermodynamic pressure (Pa).
Definition PengRobinson.cpp:120
map< string, map< string, double > > m_binaryParameters
Explicitly-specified binary interaction parameters, to enable serialization.
Definition PengRobinson.h:272
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition PengRobinson.cpp:423
static const double omega_b
Omega constant: b0 (= omega_b) used in Peng-Robinson equation of state.
Definition PengRobinson.h:320
void setBinaryCoeffs(const string &species_i, const string &species_j, double a)
Set values for the interaction parameter between two species.
Definition PengRobinson.cpp:74
vector< double > m_dpdni
Vector of derivatives of pressure with respect to mole number.
Definition PengRobinson.h:303
PengRobinson(const string &infile="", const string &id="")
Construct and initialize a PengRobinson object directly from an input file.
Definition PengRobinson.cpp:24
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition PengRobinson.cpp:338
double densSpinodalGas() const override
Return the value of the density at the gas spinodal point (on the gas side) for the current temperatu...
Definition PengRobinson.cpp:596
double m_dpdT
The derivative of the pressure with respect to the temperature.
Definition PengRobinson.h:296
void getPartialMolarVolumes(double *vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Definition PengRobinson.cpp:281
double cv_mole() const override
Molar heat capacity at constant volume. Units: J/kmol/K.
Definition PengRobinson.cpp:112
double liquidVolEst(double T, double &pres) const override
Estimate for the molar volume of the liquid.
Definition PengRobinson.cpp:485
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.
Definition PengRobinson.cpp:763
void calculatePressureDerivatives() const
Calculate and at the current conditions.
Definition PengRobinson.cpp:644
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
Definition PengRobinson.cpp:626
double hresid() const override
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
Definition PengRobinson.cpp:472
static const double omega_a
Omega constant: a0 (= omega_a) used in Peng-Robinson equation of state.
Definition PengRobinson.h:314
static const double omega_vc
Omega constant for the critical molar volume.
Definition PengRobinson.h:323
vector< CoeffSource > m_coeffSource
For each species, specifies the source of the a, b, and omega coefficients.
Definition PengRobinson.h:307
void calculateAB(double &aCalc, double &bCalc, double &aAlpha) const
Calculate the , , and parameters given the temperature.
Definition PengRobinson.cpp:676
void getPartialMolarIntEnergies(double *ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
Definition PengRobinson.cpp:265
void updateMixingExpressions() override
Update the , , and parameters.
Definition PengRobinson.cpp:656
double cp_mole() const override
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition PengRobinson.cpp:98
void getPartialMolarCp(double *cpbar) const override
Calculate species-specific molar specific heats.
Definition PengRobinson.cpp:276
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
Definition PengRobinson.cpp:130
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition PengRobinson.cpp:318
double dpdVCalc(double T, double molarVol, double &presCalc) const override
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
Definition PengRobinson.cpp:618
void getActivityCoefficients(double *ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
Definition PengRobinson.cpp:136
double densityCalc(double T, double pressure, int phase, double rhoguess) override
Calculates the density given the temperature and the pressure and a guess at the density.
Definition PengRobinson.cpp:516
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Definition PengRobinson.cpp:254
double m_dpdV
The derivative of the pressure with respect to the volume.
Definition PengRobinson.h:289
double speciesCritTemperature(double a, double b) const
Calculate species-specific critical temperature.
Definition PengRobinson.cpp:307
vector< double > m_acentric
acentric factor for each species, length m_kk
Definition PengRobinson.h:261
void checkSpeciesIndex(size_t k) const
Check that the specified species index is in range.
Definition Phase.cpp:153
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:129
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:439
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition Phase.cpp:616
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
Definition Phase.cpp:856
double RT() const
Return the Gas Constant multiplied by the current temperature.
Definition ThermoPhase.h:1062
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
Definition ThermoPhase.cpp:995
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition ThermoPhase.h:1831
double convert(double value, const string &src, const string &dest) const
Convert value from the units of src to the units of dest.
Definition Units.cpp:538
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
Definition utilities.h:104
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...
Generated by 1.9.7