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.

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 &alpha -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.

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

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”.

         

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_ci(self, cidx, ciA, ciB=0.0, ciC=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)

         

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