Skip to the content.

The saft class, found in addon/pycThermopack/thermopack/saft.py, is an “abstract” class, that is inherited by the saftvrmie, pcsaft and saftvrqmie classes. It contains some generic utility methods to compute quantities of interest when investigating SAFT-type equations of state.

Table of contents

Utility methods

Methods for computing specific parameters and contributions to the residual Helmholtz energy for SAFT-type equations of state

Table of contents

a_chain(self, temp, volume, n, a_t=None, a_v=None, a_n=None, a_tt=None, a_vv=None, a_tv=None, a_tn=None, a_vn=None, a_nn=None)

Calculate chain contribution given temperature, volume and mol numbers. $a = A_{chain}/(nRT)$

Args:

     temp (float):

          Temperature (K)

     volume (float):

          Volume (m3)

     n (array_like):

          Mol numbers (mol)

     a_t (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_v (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_n (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tt (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_nn (No type, optional):

          Flag to activate calculation. Defaults to None.

         

Returns:

     ndarry:

         

          Optionally differentials

         

a_dispersion(self, temp, volume, n, a_t=None, a_v=None, a_n=None, a_tt=None, a_vv=None, a_tv=None, a_tn=None, a_vn=None, a_nn=None)

Calculate dispersion contribution given temperature, volume and mol numbers. $a = A_{disp}/(nRT)$

Args:

     temp (float):

          Temperature (K)

     volume (float):

          Volume (m3)

     n (array_like):

          Mol numbers (mol)

     a_t (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_v (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_n (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tt (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_nn (No type, optional):

          Flag to activate calculation. Defaults to None.

         

Returns:

     ndarry:

         

          Optionally differentials

         

a_hard_sphere(self, temp, volume, n, a_t=None, a_v=None, a_n=None, a_tt=None, a_vv=None, a_tv=None, a_tn=None, a_vn=None, a_nn=None)

Calculate hard-sphere contribution given temperature, volume and mol numbers. a = A_hs/(nRT) Args: temp (float): Temperature (K) volume (float): Volume (m3) n (array_like): Mol numbers (mol) a_t (No type, optional): Flag to activate calculation. Defaults to None. a_v (No type, optional): Flag to activate calculation. Defaults to None. a_n (No type, optional): Flag to activate calculation. Defaults to None. a_tt (No type, optional): Flag to activate calculation. Defaults to None. a_vv (No type, optional): Flag to activate calculation. Defaults to None. a_tv (No type, optional): Flag to activate calculation. Defaults to None. a_tn (No type, optional): Flag to activate calculation. Defaults to None. a_vn (No type, optional): Flag to activate calculation. Defaults to None. a_nn (No type, optional): Flag to activate calculation. Defaults to None.

Returns:

     ndarry:

         

          Optionally differentials

         

a_soft_repulsion(self, temp, volume, n, a_t=None, a_v=None, a_n=None, a_tt=None, a_vv=None, a_tv=None, a_tn=None, a_vn=None, a_nn=None)

Calculate soft repuslion contribution given temperature, volume and mol numbers. a = A_soft_rep/(nRT)

Args:

     temp (float):

          Temperature (K)

     volume (float):

          Volume (m3)

     n (array_like):

          Mol numbers (mol)

     a_t (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_v (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_n (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tt (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tv (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_tn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_vn (No type, optional):

          Flag to activate calculation. Defaults to None.

     a_nn (No type, optional):

          Flag to activate calculation. Defaults to None.

         

Returns:

     ndarry:

         

          Optionally differentials

         

adjust_mass_to_de_boer_parameter(self, c, de_boer)

Adjust mass in order to get specified de Boer parameter

Args:

     c (int):

          Component index (FORTRAN)

     de_boer (float):

          de Boer parameter

         

         

alpha(self, temperature)

Get dimensionless van der Waals energy

Args:

     temperature (float):

          Temperature (K)

         

Returns:

     alpha (ndarray):

          Dimensionless van der Waals energy (-)

         

         

calc_bmcsl_gij_fmt(self, n_alpha, mu_ij, calc_g_ij_n=False, mu_ij_T=None)

Calculate g_ij at contact according to Yu and Wu: 10.1063/1.1463435

Args:

     n_alpha (np.ndarray):

          Weighted densities (n0, n1, n2, n3, nV1, nV2)

     mu_ij (float):

          mu_ij = d_i*d_j/(d_i+d_j)

     mu_ij_T (float):

          Temperature differential of mu_ij

         

Returns:

     float:

          g_ij

     np.ndarray:

          g_ij_n

     float:

          g_ij_T

         

de_boer_parameter(self, c)

Get de Boer parameter

Args:

     c (int):

          Component index (FORTRAN)

     Results:

         

     de_boer (float):

          de Boer parameter

         

         

de_broglie_wavelength(self, c, temp)

Calculate de Broglie wavelength

Args:

     c (int):

          Component index (FORTRAN)

     temp (float):

          Temperature (K)

         

Returns:

     float:

          de Broglie wavelength (m)

         

epsilon_eff_ij(self, i, j, temperature)

Effective well depth divided by Boltzmann constant for i-j interaction for Feynman-Hibbs corrected Mie potentials. For classical (not quantum-corrected models), returns the sigma parameter.

Args:

     i (int):

          Component index (FORTRAN)

     j (int):

          Component index (FORTRAN)

     temperature (float):

          Temperature (K)

     Results:

         

     epsilon_ij (float):

          Effective well depth divided by Boltzmann constant (K)

         

         

epsilon_ij(self, i, j)

Well depth divided by Boltzmann constant for i-j interaction

Args:

     i (int):

          Component index (FORTRAN)

     j (int):

          Component index (FORTRAN)

     Results:

         

     epsilon_ij (float):

          Well depth divided by Boltzmann constant (K)

         

         

fmt_energy_density(self, n_alpha, phi_n=False, phi_nn=False, fmt_model='WB')

Calculate FMT reduced energy density

Args:

     n_alpha (np.ndarray):

          Weighted densities (n0, n1, n2, n3, nV1, nV2) for the entire grid

     phi_n (bool):

          Calculate first order differetnials?

     phi_nn (bool):

          Calculate second order differetnials?

     fmt_model (str):

          FMT model (RF (Rosenfeld), WB (White Bear), WBII (White Bear Mark II))

         

Returns:

     np.ndarray:

          phi

     np.ndarray:

          phi_n

     np.ndarray:

          phi_nn

         

fres_polar(self, temp, volume, n, qq=True, dd=True, dq=True)

Calculate reduced Helmholtz energy contribution from polar model

Args:

     temp (float):

          Temperature (K)

     volume (float):

          Volume (m3)

     n (array_like):

          Mol numbers (mol)

     qq (bool):

          Include quadrupole-quadrupole contribution?

     dd (bool):

          Include dipole-dipole contribution?

     dq (bool):

          Include dipole-quadrupole contribution?

         

Returns:

     float:

          Reduced Helmholtz energy contribution (mol)

         

get_n_assoc_sites(self)

Get number of association sites

     Results:

         

     n_assoc_sites (int):

          Number of association sites.

         

get_pure_assoc_param(self, ic)

Set pure association parameters

Args:

     ic (int):

          Component index

     Results:

         

     eps_assoc (float):

          Association energy (J/mol).

     beta_assoc (float):

          Association volume (-)

         

hard_sphere_diameter_ij(self, i, j, temp)

Calculate non-additive hard-sphere diameter for i-j interaction given temperature.

Args:

     i (int):

          Component index (FORTRAN)

     j (int):

          Component index (FORTRAN)

     temp (float):

          Temperature (K)

         

Returns:

     float:

          Hard-sphere diameter (m)

     float:

          Temperature differential of hard-sphere diameter (m/K)

         

hard_sphere_diameters(self, temp)

Calculate hard-sphere diameters given temperature, volume and mol numbers.

Args:

     temp (float):

          Temperature (K)

         

Returns:

     np.ndarray:

          Hard-sphere diameter (m)

     np.ndarray:

          Temperature differential of hard-sphere diameter (m/K)

         

polar_model_control(self, qq, dd, dq)

Dictate what terms are included with for polar model

Args:

     qq (bool):

          Include quadrupole-quadrupole contribution?

     dd (bool):

          Include dipole-dipole contribution?

     dq (bool):

          Include dipole-quadrupole contribution?

         

potential(self, ic, jc, r, temp)

Get potential energy divided by Boltzmann constant as a function of r

Args:

     ic, jc (int):

          Component indices (FORTRAN)

     r (array_like):

          Distance between particles (m)

     temp (float):

          Temperature (K)

Returns:

     array_like:

          Potential energy divided by Boltzmann constant (K)

         

Print report of SAFT parameters for binary mixture

         

Print saft parameters for component c

Args:

     c (int):

          Component index (FORTRAN)

         

         

set_pure_assoc_param(self, ic, eps_assoc, beta_assoc)

Set pure association parameters

Args:

     ic (int):

          Component index

     eps_assoc (float):

          Association energy (J/mol).

     beta_assoc (float):

          Association volume (-)

         

sigma_eff_ij(self, i, j, temperature)

Get effective size parameter for i-j interaction for Feynman-Hibbs corrected Mie potentials. For classical (not quantum-corrected models), returns the sigma parameter.

Args:

     i (int):

          Component index (FORTRAN)

     j (int):

          Component index (FORTRAN)

     temperature (float):

          Temperature (K)

     Results:

         

     sigma_ij (float):

          Size parameter (m)

         

         

sigma_ij(self, i, j)

Get size parameter for i-j interaction

Args:

     i (int):

          Component index (FORTRAN)

     j (int):

          Component index (FORTRAN)

     Results:

         

     sigma_ij (float):

          Size parameter (m)

         

         

test_fmt_compatibility(self)

Test if model setup is compatible with the Fundamental Measure Theory (FMT)

Returns:

     bool:

          Is model FMT consistent?

     bool:

          Is non-additive hard-sphere term used?

         

truncation_correction(self, enable_truncation_correction, enable_shift_correction, reduced_radius_cut=3.5)

Enable/disable truncation corrections

Args:

     enable_truncation_correction (bool):

          Enable long range truncation correction

     enable_shift_correction (bool):

          Enable potential shift correction

     reduced_radius_cut (float):

          Reduced length cut-off

         

Internal methods

Methods for handling communication with the Fortran library.

Table of contents

__init__(self)

Initialize SAFT specific function pointers