Skip to the content.

The pcsaft class, found in addon/pycThermopack/thermopack/pcsaft.py, inherits from the saft class, and is the interface to the PC-SAFT Equation of State. This class implements utility methods to access mixing parameters etc.

Table of contents

Constructor

Methods to initialise PC-SAFT model.

Table of contents

__init__(self, comps=None, parameter_reference='Default', simplified=False, polar=False)

Initialize PC-SAFT model in thermopack If no components 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

     parameter_reference (str, optional):

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

     simplified (bool):

          Use simplified PC-SAFT (sPC-SAFT: 10.1021/ie020753p) (Default False)

     polar (bool):

          Use dipole and quadrupole contributions PCP-SAFT (10.1002/aic.10502, 10.1002/aic.10683 and 10.1021/jp072619u) (Default False)

         

init(self, comps, parameter_reference='Default', simplified=False, polar=False)

Initialize PC-SAFT model in thermopack

Args:

     comps (str):

          Comma separated list of component names

     parameter_reference (str, optional):

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

     simplified (bool):

          Use simplified PC-SAFT (sPC-SAFT: 10.1021/ie020753p) (Default False)

     polar (bool):

          Use dipole and quadrupole contributions PCP-SAFT (10.1002/aic.10502, 10.1002/aic.10683 and 10.1021/jp072619u) (Default True)

         

Utility methods

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

Table of contents

association_energy_density(self, temp, n_alpha, phi=None, phi_t=None, phi_n=None, phi_tt=None, phi_tn=None, phi_nn=None, Xk=None)

Calculate association functional of Sauer and Gross https://doi.org/10/f95br5

Args:

     temp (float):

          Temperature (K)

     n_alpha (np.ndarray):

          Weighted densities (mol based)

     phi (No type, optional):

          Flag to activate calculation. Defaults to None.

     phi_t (No type, optional):

          Flag to activate calculation. Defaults to None.

     phi_n (No type, optional):

          Flag to activate calculation. Defaults to None.

     phi_tt (No type, optional):

          Flag to activate calculation. Defaults to None.

     phi_tn (No type, optional):

          Flag to activate calculation. Defaults to None.

     phi_nn (No type, optional):

          Flag to activate calculation. Defaults to None.

     Xk (np.ndarray):

          Fraction of non-bonded molecules. Initial value on input, calculated value on output. Set to 0.2 initially.

         

Returns:

          Optionally energy density and differentials

         

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_kij(self, c1, c2)

Get binary well depth interaction parameter

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

         

Returns:

     kij (float):

          Well depth interaction parameter

         

get_pure_fluid_param(self, c)

Get pure fluid PC-SAFT parameters

Args:

     c (int):

          Component index (FORTRAN)

Returns:

     m (float):

          Mean number of segments

     sigma (float):

          Segment diameter (m)

     eps_div_kb (float):

          Well depth divided by Boltzmann’s constant (K)

     eps (float):

          Association energy (J/mol)

     beta (float):

          Association volume (-)

         

lng_ii(self, temp, volume, n, i, lng_t=None, lng_v=None, lng_n=None, lng_tt=None, lng_vv=None, lng_tv=None, lng_tn=None, lng_vn=None, lng_nn=None)

Calculate logarithm of the radial distribution function at contact given temperature, volume and mol numbers. Differentials are computed as functions of (T, V, n).

Args:

     temp (float):

          Temperature (K)

     volume (float):

          Volume (m3)

     n (array_like):

          Mol numbers (mol)

     i (int):

          FORTRAN component index

     lng_t (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_v (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_n (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_tt (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_vv (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_tv (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_tn (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_vn (No type, optional):

          Flag to activate calculation. Defaults to None.

     lng_nn (No type, optional):

          Flag to activate calculation. Defaults to None.

         

Returns:

     ndarry:

         

          Optionally differentials

         

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_kij(self, c1, c2, kij)

Set binary well depth interaction parameter

Args:

     c1 (int):

          Component one

     c2 (int):

          Component two

     kij (float):

          Well depth interaction parameter

         

set_pure_fluid_param(self, c, m, sigma, eps_div_kb, eps=0.0, beta=0.0)

Set pure fluid PC-SAFT parameters

Args:

     c (int):

          Component index (FORTRAN)

     m (float):

          Mean number of segments

     sigma (float):

          Segment diameter (m)

     eps_div_kb (float):

          Well depth divided by Boltzmann’s constant (K)

     eps (float):

          Association energy (J/mol)

     beta (float):

          Association volume (-)

         

Deprecated methods

Deprecated methods are not maintained, and may be removed in the future.

Table of contents

get_pure_params(self, c)

Get pure fluid PC-SAFT parameters

Args:

     c (int):

          Component index (FORTRAN)

Returns:

     m (float):

          Mean number of segments

     sigma (float):

          Segment diameter (m)

     eps_div_kb (float):

          Well depth divided by Boltzmann’s constant (K)

     eps (float):

          Association energy (J/mol)

     beta (float):

          Association volume (-)

         

set_pure_params(self, c, m, sigma, eps_div_kb, eps=0.0, beta=0.0)

Set pure fluid PC-SAFT parameters

Args:

     c (int):

          Component index (FORTRAN)

     m (float):

          Mean number of segments

     sigma (float):

          Segment diameter (m)

     eps_div_kb (float):

          Well depth divided by Boltzmann’s constant (K)

     eps (float):

          Association energy (J/mol)

     beta (float):

          Association volume (-)