Skip to the content.

The cubic class, found in addon/pycThermopack/thermopack/cubic.py, is the interface to the Cubic Equation of State. This class implements utility methods to access mixing parameters etc.

In addition to the cubic class, there are several convenience classes to give easy access to specific cubic equations of state. The sections Initialiser keys, Pure fluid α, α mixing rules and β mixing rules summarise the various valid input keys that can be used to modify mixing rules, the α -parameter and the underlying EoS.

Documentation for the methods in the cubic class is found in the remaining sections, summarised in the table of contents below.

Input keys

Specific cubics

Table of contents

Parent class “cubic”

Table of contents

Initialiser keys

Model Input key
Van der Waal VdW
Soave Redlich Kwong SRK
Peng Robinson PR
Schmidt-Wensel SW
Patel Teja PT
Translated consistent PR tcPR

Pure fluid α

Model Input key
Model default (*) Classic
Twu-Coon-Bluck-Cunninghan TWU
Mathias-Copeman MC
Graboski and Daubert GD
Redlich-Kwong RK
Soave Soave
Peng Robinson 76 PR
UMR α formulation UMR
Peng Robinson 78 PR78
Van der Waal VdW
Schmidt-Wensel SW
Patel Teja PT

(*) Will use original α for specified EOS. E.g. SRK will use Soave α, Peng-Robinson will use PR α etc.

α mixing rules

Model Input key
Van der Waal Classic or vdW
Huron-Vidal HV or HV2
Wong-Sandler WS
NRTL NRTL
UNIFAC UNIFAC

β mixing rules

SoaveRedlichKwong

Interface to the SoaveRedlichKwong EoS

__init__(self, comps, mixing='vdW', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='SRK'.

         

RedlichKwong

Interface to the RedlichKwong EoS

__init__(self, comps, mixing='vdW', alpha='RK', parameter_reference='Default', volume_shift=False)

Convenience class for Redlich-Kwong, calls the cubic constructor. Set alpha=Soave in order to get SRK model.

         

VanDerWaals

Interface to the VanDerWaals EoS

__init__(self, comps, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='VdW'.

         

PengRobinson

Interface to the PengRobinson EoS

__init__(self, comps, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='PR'. Default alpha is the original 1976 correlation.

         

PengRobinson78

Interface to the PengRobinson78 EoS

__init__(self, comps, mixing='vdW', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='PR'. Using the 1978 alpha correlation.

         

PatelTeja

Interface to the PatelTeja EoS

__init__(self, comps, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='PT'.

         

SchmidtWensel

Interface to the SchmidtWensel EoS

__init__(self, comps, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Basic convenience class, calls the cubic constructor with eos='SW'.

         

Constructor

Methods to initialise Cubic model.

Table of contents

__init__(self, comps=None, eos=None, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Initialize cubic model in thermopack

          Unless both ‘comps’ and ‘eos’ parameters are specified, model must be initialized for specific components

          later by direct call to ‘init’.

          Model can at any time be re-initialized for new components or parameters by direct calls to ‘init’

         

Args:

     comps (str, optional):

          Comma separated list of component names

     eos (str, optional):

          Equation of state (SRK, PR, …)

     mixing (str, optional):

          Mixture model. Defaults to “vdW”.

     alpha (str, optional):

          Alpha model. Defaults to “Classic”.

     parameter_reference (str, optional):

          Which parameters to use?. Defaults to “Default”.

         

init(self, comps, eos, mixing='vdW', alpha='Classic', parameter_reference='Default', volume_shift=False)

Initialize cubic model in thermopack

Args:

     comps (str):

          Comma separated list of component names

     eos (str):

          Equation of state (SRK, PR, …)

     mixing (str, optional):

          Mixture model. Defaults to “vdW”.

     alpha (str, optional):

          Alpha model. Defaults to “Classic”.

     parameter_reference (str, optional):

          Which parameters to use?. Defaults to “Default”.

         

init_pseudo(self, comps, Tclist, Pclist, acflist, Mwlist=None, mixing='vdW', alpha='Classic')

Initialize pseudocomponents of cubic model in thermopack. The cubic init routine must have been called first.

Args:

     comps (str):

          Comma separated list of names for all components

     Tclist (array_like):

          Critical temperatures (K)

     Pclist (array_like):

          Critical pressures (Pa)

     acflist (array_like):

          acentric factors (-)

     Mwlist (array_like):

          Molar masses (kg/mol)

     mixing (str):

          Mixing rule

     alpha (str):

          alpha correlation

         

Utility methods

Set- and get methods for interaction parameters, mixing parameters …

Table of contents

get_ci(self, cidx)

Get volume correction parameters

Args:

     cidx (int):

          Component index

         

Returns:

     ciA (float):

          Volume shift param of component cidx (m3/mol)

     ciB (float):

          Volume shift param of component cidx (m3/mol/K)

     ciC (float):

          Volume shift param of component cidx (m3/mol/K^2)

     ci_type (int):

          Volume shift type (CONSTANT=1, LINEAR=2, QUADRATIC=3)

         

get_covolumes(self)

Get component covolumes (L/mol)

Returns:

     np.ndarray:

          Component covolumes (L/mol)

         

get_energy_constants(self)

Get component energy constants in front of alpha. (Pa*L^2/mol^2)

Returns:

     np.ndarray:

          Component energy constants in front of alpha. (Pa*L^2/mol^2)

         

get_hv_param(self, c1, c2)

Get Huron-Vidal parameters

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

         

Returns:

     alpha_ij (float):

          alpha param i-j

     alpha_ji (float):

          alpha param j-i

     a_ij (float):

          a param i-j

     a_ji (float):

          a param j-i

     b_ij (float):

          b param i-j

     b_ji (float):

          b param j-i

     c_ij (float):

          c param i-j

     c_ji (float):

          c param j-i

         

get_kij(self, c1, c2)

Get attractive energy interaction parameter kij, where aij = sqrt(aiaj)(1-kij)

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

         

Returns:

     kij (float):

          i-j interaction parameter

         

get_lij(self, c1, c2)

Get co-volume interaction parameter lij, where bij = 0.5(bi+bj)(1-lij)

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

         

Returns:

     lij (float):

          i-j interaction parameter

         

get_ws_param(self, c1, c2)

Get Wong-Sandler parameters

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

         

Returns:

     alpha_ij (float):

          alpha param i-j

     alpha_ji (float):

          alpha param j-i

     k_ij (float):

          k param i-j

     k_ji (float):

          k param j-i

     tau_ij (float):

          tau param i-j

     tau_ji (float):

          tau param j-i

         

set_alpha_corr(self, ic, corrname, coeffs)

Set alpha correlation

Args:

     ic (in):

          Component number

     corrname (string):

          Name of correlation

     coeffs (ndarray):

          Coefficients in correlation

         

set_beta_corr(self, ic, corrname, coeffs)

Set beta correlation

Args:

     ic (in):

          Component number

     corrname (string):

          Name of correlation

     coeffs (ndarray):

          Coefficients in correlation

         

set_ci(self, cidx, ciA, ciB=0.0, ciC=0.0, ciD=0.0, ciE=0.0, ciF=0.0, ci_type=1)

Set volume correction parameters

Args:

     cidx (int):

          Component index

     ciA (float):

          Volume shift param of component cidx (m3/mol)

     ciB (float):

          Volume shift param of component cidx (m3/mol/K)

     ciC (float):

          Volume shift param of component cidx (m3/mol/K^2)

     ci_type (int):

          Volume shift type (CONSTANT=1, LINEAR=2, QUADRATIC=3, QUINTIC=6)

         

set_hv_param(self, c1, c2, alpha_ij, alpha_ji, a_ij, a_ji, b_ij, b_ji, c_ij, c_ji)

Set Huron-Vidal parameters

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

     alpha_ij (float):

          alpha param i-j

     alpha_ji (float):

          alpha param j-i

     a_ij (float):

          a param i-j

     a_ji (float):

          a param j-i

     b_ij (float):

          b param i-j

     b_ji (float):

          b param j-i

     c_ij (float):

          c param i-j

     c_ji (float):

          c param j-i

         

set_kij(self, c1, c2, kij)

Set attractive energy interaction parameter kij, where aij = sqrt(aiaj)(1-kij)

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

     kij (float):

          i-j interaction parameter

         

set_lij(self, c1, c2, lij)

Set co-volume interaction parameter lij, where bij = 0.5(bi+bj)(1-lij)

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

     lij ([type]):

          [description]

         

set_ws_param(self, c1, c2, alpha_ij, alpha_ji, k_ij, k_ji, tau_ij, tau_ji)

Set Wong-Sandler parameters

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

     alpha_ij (float):

          alpha param i-j

     alpha_ji (float):

          alpha param j-i

     k_ij (float):

          k param i-j

     k_ji (float):

          k param j-i

     tau_ij (float):

          tau param i-j

     tau_ji (float):

          tau param j-i