Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Interfacethermopy

Interfacethermopy is a Python package that calculates Vapor-liquid interfcial tension (IFT) of pure fluids using emperical correlations [1,2] and Vapor-liquid IFT of mixtures using Parachor model [3]. It supports loading JSON data sources containing fluid-specific coefficients which are required to calculate IFTs.

Features

  • Read and retrive fluid-specific empercial coefficients (s, n, and optionally Tc) from JSON files.
  • Compute IFTs of pure fluids gamma using the correlation,

\gamma(T) = \sum_i s_i (1 - T/T_c)^{n_i}

  • Compute IFTs of mixtures using Parachor model,

\gamma_{\mathrm{mix}} = (\rho^L \sum_{j=1}^N \sum_{i=1}^N x_i x_j \mathcal{P}_{ij} - \rho^V \sum_{j=1}^N \sum_{i=1}^N y_i y_j \mathcal{P}_{ij})^n

\mathcal{P}_{ij} = (1 - \delta_{ij}) \frac{\mathcal{P}_{i} + \mathcal{P}_{j}}{2}

  • p_ij is the cross Parachor term calculated using the component-specific Parachor number P and the fit parameter delta_ij (similar to binary interaction parameter).
  • The component-specific Parachor number P is obtained at the given temperature of the mixture, {\mathrm{mix}} using the following expression,

P_i = gamma^(1/n) / (rho^L - rho^V)

  • n is the exponential constant of the Parachor model equal to 3.87 [4].
  • If T_{\mathrm{mix}} > 0.9*T_c of the component i in the mixture then P_i is computed at 0.9*T_c for numerical stability. The same approach is also applied in REFPROP V10.
  • The Parachor model is used in addition with other Equation of State (EoS) models (Peng–Robinson, SRK, GERG-2008, EoS-CG, etc.) to compute rho^L_\mathrm{mix}, rho^V_\mathrm{mix}, P(T)_{i}, rho^L_i, rho^V, x, and y.
  • Interfacethermopy can be used as a plugin with other thermodynamic packages like Clapeyron, FeOs and REFPROP to compute IFTs of pure fluids and mixtures.
  • Compute IFTs of mixtures using the Winterfeld–Scriven–Davis (WSD) model. For a general multicomponent system,

WSD general formula

  • Here gamma_alpha_0 and gamma_beta_0 are the IFTs of the pure components alpha and beta, respectively. rho_alpha_0L and rho_alpha_0V are the equilibrium liquid and vapor molar densities of the pure component. rho_alpha_L and rho_alpha_V are the liquid and vapor molar densities of component alpha in the mixture. Phi_ab for nonaqueous, weakly polar fluids. The Kronecker delta delta_ab equals one when alpha=beta and zero otherwise.
  • For a binary system where the mixture temperature is below the critical temperature of both components, the WSD model simplifies to,

WSD binary formula

  • When the mixture temperature exceeds the critical temperature of component 2, the standard WSD formulation reduces to a form in which the supercritical component has no effect on IFT, which is physically unrealistic. To correct for this, an empirical correction is applied,

WSD corrected supercritical formula

  • The correction factor 1 - x2L accounts for the IFT-reducing effect of the supercritical component dissolved in the liquid phase, analogous to a surfactant effect. Here x2L is the liquid mole fraction of the supercritical component [5].

  • Estimate metastable phase limits using Classical Nucleation Theory (CNT).
    The nucleation rate is given by

J = K exp(-Delta G* / k_B T)

  • The free energy barrier for the formation of a critical nucleus is

Delta G* = 4 pi gamma r_c^2 / 3

  • Here J is the nucleation rate, K is the kinetic prefactor, gamma is the interfacial tension, r_c is the critical nucleus radius, k_B is the Boltzmann constant, and T is the temperature.
  • Using the computed interfacial tension together with thermodynamic properties from an Equation of State, Interfacethermopy can estimate metastable limits associated with nucleation phenomena.

Installation

Git clone the package and install the package,

git clone https://github.com/Darz2/Interfacethermopy.git
pip install .

External thermodynamic packages are needed to do EoS calcualtions in addition to Python's standard libraries.

For example, if one is using REFPROP to do EoS calculations, python wrapper of REFPROP and the corresponding REFPROP library files will be required.

pip install ctREFPROP

If one is using Clapeyron.jl, then using PythonCall in julia can be used to calculate IFTs using compute_gamma_pure, compute_gamma_mixture and parachor_number functions in InterfacialTension class.

JSON Input Format

Each JSON file must contain a list of dictionaries, each describing one fluid. Example:

[
  {
    "Fluid": "methane",
    "Tc": 190.56,
    "s": [0.2358, 0.0121],
    "n": [1.23, 2.34]
  },
  {
    "Fluid": "argon",
    "Tc": 150.86,
    "s": [0.152],
    "n": [1.26]
  }
]

Example Usage

from Interfacethermopy import parachor as IFT
import numpy as np

if __name__ == '__main__':
    
    json_files  = ["Mulero_2012.json"]
    model       = IFT.InterfacialTension(json_files)
    model.ctREFPROP_init('~/Software/REFPROP_BETA/REFPROP-cmake/build', gerg_enable=1)

    MIXTURE   = "CO2;Methane"
    z         = [0.95, 0.05]
    T         = 250.0
    PRESSURES = np.arange(20.0, 31.0, 5.0)
    kij       = 0.0

    Pbar, gamma = model.REFPROP_MIXTURE(MIXTURE, z, T, PRESSURES, kij)

    for P, s in zip(Pbar, gamma):
        print(f"P = {P:.1f} bar | gamma = {s:.4f} mN/m")

References

  1. Cachadina, I., Vega, L. F., & de Miguel, E. (2015)
    Empirical correlations for the surface tension of pure fluids
    Journal of Chemical Thermodynamics, 87, 162–170.
    https://doi.org/10.1063/1.4921749

  2. Mulero, A., Cachadina, I., & Parra, M. I. (2012)
    Recommended correlations for the surface tension of common fluids
    Journal of Physical and Chemical Reference Data, 41(4), 043105.
    https://doi.org/10.1063/5.0277723

  3. Sugden, S. (1924)
    A relation between surface tension, density, and chemical composition
    Journal of the Chemical Society, Transactions, 125, 32–41.
    https://doi.org/10.1039/CT9242500032

  4. Log, A. M.; Diky, V.; Huber, M. L. (2023)
    Assessment of a parachor model for the surface tension of binary mixtures
    International Journal of Thermophysics, 44, Article 110.
    https://doi.org/10.1007/s10765-023-03230-0

  5. Raju, D.; Skartlien, R.; Ramdin, M.; Vlugt, T. J. H. (2025)
    Vapor–Liquid Interfacial Properties of CO2 Mixtures for Sequestration Applications: Molecular Simulations, Classical Density Functional Theory, and Equations of State
    Industrial & Engineering Chemistry Research.
    https://doi.org/10.1021/acs.iecr.5c04932

Note: More correlations can be added for n-alkanes, ethers, and esters.

TO DO:

  • Python TEST need to be written
  • Julia Integration using Python Call need to be added (in v0.3.0)

About

Python package for vapour-liquid interfacial tension of pure fluids and mixtures: empirical correlations, the Parachor model, Winterfeld-Scriven-Davis, and metastable limits from classical nucleation theory.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages