6#ifndef CT_REDLICHKWONGMFTP_H
7#define CT_REDLICHKWONGMFTP_H
10#include "cantera/numerics/eigen_dense.h"
77 string type()
const override {
78 return "Redlich-Kwong";
83 double cp_mole()
const override;
84 double cv_mole()
const override;
309 bool addSpecies(shared_ptr<Species> spec)
override;
344 const string& species_j,
double a0,
double a1);
349 double sresid()
const override;
350 double hresid()
const override;
353 double liquidVolEst(
double T,
double& pres)
const override;
355 double dpdVCalc(
double T,
double molarVol,
double& presCalc)
const override;
385 void calculateAB(
double T,
double& aCalc,
double& bCalc)
const;
389 double da_dt()
const;
391 void calcCriticalConditions(
double& pc,
double& tc,
double& vc)
const override;
394 int solveCubic(
double T,
double pres,
double a,
double b, span<double> Vroot)
const;
434 enum class CoeffSource { EoS, CritProps, Database };
440 double Vroot_[3] = {0.0, 0.0, 0.0};
446 mutable vector<double> m_partialMolarVolumes;
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.
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
string name() const
Return the name of the phase.
double m_aMix
Value of a in the equation of state.
Eigen::ArrayXd m_dpdni
Vector of derivatives of pressure wrt mole number.
double dpdT_
The derivative of the pressure wrt the temperature.
Eigen::MatrixXd m_a
Current temperature-dependent value of for each species pair.
double thermalExpansionCoeff() const override
Return the volumetric thermal expansion coefficient. Units: 1/K.
void setBinaryCoeffs(const string &species_i, const string &species_j, double a0, double a1)
Set values for the interaction parameter between two species.
Eigen::ArrayXd m_Ak
. Length m_kk.
double sresid() const override
Calculate the deviation terms for the total entropy of the mixture from the ideal gas mixture.
void getPartialMolarEnthalpies(span< double > hbar) const override
Return partial molar enthalpies (J/kmol).
double soundSpeed() const override
Return the speed of sound. Units: m/s.
double pressure() const override
Return the thermodynamic pressure (Pa).
int m_formTempParam
Form of the temperature parameterization.
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...
void getPartialMolarCp(span< double > cpbar) const override
Get the partial molar heat capacities at constant pressure [J/kmol/K].
static const double omega_b
Omega constant for b.
void getActivityCoefficients(span< double > ac) const override
Get the array of non-dimensional activity coefficients at the current solution temperature,...
string type() const override
String indicating the thermodynamic model implemented.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getPartialMolarIntEnergies_TV(span< double > utilde) const override
Get the species molar internal energies associated with the derivatives of total internal energy at c...
double internalPressure() const override
Return the internal pressure [Pa].
Eigen::MatrixXd m_a1
Temperature coefficient in the expression for .
double cv_mole() const override
Molar heat capacity at constant volume and composition [J/kmol/K].
void pressureDerivatives() const
Calculate dpdV and dpdT at the current conditions.
double liquidVolEst(double T, double &pres) const override
Estimate for the molar volume of the liquid.
Eigen::ArrayXd m_dAkdT
. Length m_kk.
double m_bMix
Value of b in the equation of state.
double isothermalCompressibility() const override
Returns the isothermal compressibility. Units: 1/Pa.
double hresid() const override
Calculate the deviation terms for the total enthalpy of the mixture from the ideal gas mixture.
static const double omega_a
Omega constant for a -> value of a in terms of critical properties.
void getPartialMolarCv_TV(span< double > cvtilde) const override
Get the species molar heat capacities associated with the constant volume partial molar internal ener...
static const double omega_vc
Omega constant for the critical molar volume.
vector< CoeffSource > m_coeffSource
For each species, specifies the source of the a and b coefficients.
Eigen::MatrixXd m_a0
Constant term in the expression for for each species pair.
void updateMixingExpressions() override
Update the a and b parameters.
double cp_mole() const override
Molar heat capacity at constant pressure and composition [J/kmol/K].
void getPartialMolarVolumes(span< double > vbar) const override
Return an array of partial molar volumes for the species in the mixture.
void getPartialMolarEntropies(span< double > sbar) const override
Returns an array of partial molar entropies of the species in the solution.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
double dpdV_
The derivative of the pressure wrt the volume.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
double dpdVCalc(double T, double molarVol, double &presCalc) const override
Calculate the pressure and the pressure derivative given the temperature and the molar volume.
Eigen::ArrayXd m_b
Coefficients for each species. Size m_kk.
void getChemPotentials(span< double > mu) const override
Get the species chemical potentials. Units: J/kmol.
int solveCubic(double T, double pres, double a, double b, span< double > Vroot) const
Prepare variables and call the function to solve the cubic equation of state.
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.
map< string, map< string, pair< double, double > > > m_binaryParameters
Explicitly-specified binary interaction parameters.
void setSpeciesCoeffs(const string &species, double a0, double a1, double b)
Set the pure fluid interaction parameters for a species.
void calculateAB(double T, double &aCalc, double &bCalc) const
Calculate the a and the b parameters given the temperature.
void getPartialMolarIntEnergies(span< double > ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
Namespace for the Cantera kernel.