Reaktoro
A unified framework for modeling chemically reactive systems

Defines a cubic equation of state and calculates thermodynamic properties of a fluid phase. More...

#include <CubicEOS.hpp>

Classes

struct  InteractionParamsResult
 Class to define or store Binary Interaction Parameters (BIPs) from a calculation or input. More...
 
struct  Params
 Parameters to be passed to the Cubic Equation of State. More...
 
struct  Result
 

Public Types

enum  Model { VanDerWaals, RedlichKwong, SoaveRedlichKwong, PengRobinson }
 Defines the enumeration of available cubic EOS models.
 
using InteractionParamsFunction = std::function< InteractionParamsResult(const double &)>
 Function wrapper to calculate (temperature-dependent) binary interaction parameters.
 

Public Member Functions

 CubicEOS (unsigned nspecies, Params params)
 Construct a CubicEOS instance with given number of species. More...
 
 CubicEOS (const CubicEOS &other)
 Construct a copy of a CubicEOS instance.
 
virtual ~CubicEOS ()
 Destroy this CubicEOS instance.
 
auto operator= (CubicEOS other) -> CubicEOS &
 Assign a CubicEOS instance to this.
 
auto numSpecies () const -> unsigned
 Return the number of species in the phase.
 
auto setModel (Model model) -> void
 Set the type of the cubic equation of state (default: PengRobinson). More...
 
auto setPhaseAsLiquid () -> void
 Set the equation of state to compute properties for a liquid phase.
 
auto setPhaseAsVapor () -> void
 Set the equation of state to compute properties for a vapor phase.
 
auto setCriticalTemperatures (const std::vector< double > &values) -> void
 Set the critical temperatures of the species (in units of K).
 
auto setCriticalPressures (const std::vector< double > &values) -> void
 Set the critical pressures of the species (in units of Pa).
 
auto setAcentricFactors (const std::vector< double > &values) -> void
 Set the acentric factors of the species.
 
auto setInteractionParamsFunction (const InteractionParamsFunction &func) -> void
 Set the function that calculates the interaction parameters kij (k) and its temperature derivatives (kT and kTT). More...
 
auto operator() (const ThermoScalar &T, const ThermoScalar &P, const ChemicalVector &x) -> Result
 Calculate the thermodynamic properties of the phase. More...
 

Detailed Description

Defines a cubic equation of state and calculates thermodynamic properties of a fluid phase.

Constructor & Destructor Documentation

◆ CubicEOS()

CubicEOS ( unsigned  nspecies,
CubicEOS::Params  params 
)
explicit

Construct a CubicEOS instance with given number of species.

Parameters
nspeciesThe number of species in the phase.

Member Function Documentation

◆ setModel()

auto setModel ( Model  model) -> void

Set the type of the cubic equation of state (default: PengRobinson).

See also
Model

◆ setInteractionParamsFunction()

auto setInteractionParamsFunction ( const InteractionParamsFunction func) -> void

Set the function that calculates the interaction parameters kij (k) and its temperature derivatives (kT and kTT).

Parameters
funcA wrapper function to calculate the BIPs matrices
See also
InteractionParamFunction, InteractionParamArgs, InteractionParamResult

◆ operator()()

auto operator() ( const ThermoScalar T,
const ThermoScalar P,
const ChemicalVector x 
) -> Result

Calculate the thermodynamic properties of the phase.

Parameters
TThe temperature of the phase (in units of K)
PThe pressure of the phase (in units of Pa)
xThe mole fractions of the species in the phase (in units of mol/mol)

The documentation for this class was generated from the following files:
  • Reaktoro/Thermodynamics/EOS/CubicEOS.hpp
  • Reaktoro/Thermodynamics/EOS/CubicEOS.cpp