Related Experiment Video
Updated: Nov 17, 2025

Analyzing Melts and Fluids from Ab Initio Molecular Dynamics Simulations with the UMD Package
Published on: September 17, 2021
SGTPy: A Python Code for Calculating the Interfacial Properties of Fluids Based on the Square Gradient Theory Using
Andrés Mejía1, Erich A Müller2, Gustavo Chaparro Maldonado1
1Departamento de Ingeniería Química, Universidad de Concepción, Concepción 4030000, Chile.
Abstract:
In this work, we showcase SGTPy, a Python open-source code developed to calculate interfacial properties (interfacial concentration profiles and interfacial or surface tension) for pure fluids and fluid mixtures. SGTPy employs the Square Gradient Theory (SGT) coupled to the Statistical Associating Fluid Theory of Variable Range employing a Mie potential (SAFT-VR-Mie). SGTPy uses standard Python numerical packages (i.e., NumPy, SciPy) and can be used under Jupyter notebooks. Its features are the calculation of phase stability, phase equilibria, interfacial properties, and the optimization of the SGT and SAFT parameters for vapor-liquid, liquid-liquid and vapor-liquid-liquid equilibria for pure fluids and multicomponent mixtures. Phase equilibrium calculations include two-phase and multiphase flash, bubble and dew points, and the tangent plane distance. For the computation of interfacial properties, SGTPy incorporates several options to solve the interfacial concentration, such as the path technique, an auxiliary time function, and orthogonal collocation. Additionally, the SGTPy code allows the inclusion of subroutines from other languages (e.g., Fortran, and C++) through Cython and f2py Python tools, which opens the possibility for future extensions or recycling tested and optimized subroutines from other codes. Supporting Information includes a review of the theoretical expressions required to couple SAFT-VR-Mie equation of state with the SGT. The use and capabilities of SGTPy are illustrated through step by step examples written on Jupyter notebooks for the cases of pure fluids and binary and ternary mixtures in bi- and three- phasic equilibria. The SGTPy code can be downloaded from https://github.com/gustavochm/SGTPy.
More Related Videos
Related Concept Videos
Surface Tension of Fluid
Surface tension varies...
Accelerating Fluids
The motion of the liquid within this infinitesimal cylinder is considered to obtain the pressure difference. Three vertical forces act on this liquid:
Newtonian Fluid: Problem Solving
A velocity gradient forms within the fluid when a Newtonian fluid is placed between two parallel plates, with...
Vapor Pressure of Fluid
When a liquid is placed in a closed container with a small air space, and the space is evacuated, vapor molecules will...
Viscosity of Fluid
Pressure of Fluids

