Skip to main content

Vapor-liquid equilibrium (VLE) thermodynamic calculator: 22+ cubic EOS, activity models, flash algorithms

Project description

vle-thermo

Vapor-liquid equilibrium (VLE) thermodynamic calculator with a Rust computation engine and a Python interface.

PyPI Python License: MIT

A modern Rust + Python port of two legacy thermodynamic codebases (VB6 ~15,000 lines + Pascal ~2,500 lines). The Rust core (vle-thermo crate) does the computation; this Python package wraps it for interactive use in scripts and Jupyter notebooks.

Install

pip install vle-thermo

Optional extras:

pip install "vle-thermo[plot]"   # adds matplotlib
pip install "vle-thermo[db]"     # adds `thermo` for extended component-database seeding
pip install "vle-thermo[dev]"    # adds pytest, maturin

The distribution name on PyPI is vle-thermo, but the import name is vle (following the common distribution-vs-import split, like Pillowimport PIL or python-dateutilimport dateutil):

import vle

Status

0.1.x — the component database, CLI, and units layer work today. Numerical kernels (flash algorithms, equation-of-state solvers, parameter regression) are under active development. Treat 0.1.x as pre-release; semver promises begin at 1.0.

See the roadmap for what's shipped vs. planned.

What works today

# Initialize the bundled component database (SQLite) and seed with the 15
# compounds from Chapter IV of the source thesis.
vle-db init
vle-db seed --source chapter4

# Browse and inspect
vle-db list
vle-db show methane
vle-db validate chapter4
from vle.db import list_components, get_component

for c in list_components():
    print(c.name, c.tc, c.pc, c.omega)

methane = get_component("methane")

Unit-aware input/output (gauge pressure, °C, °F, psi, barg, mmHg, …):

from vle.units import ureg, Q_

T = Q_(25, "degC")                # 298.15 K internally
P = Q_(3.5, "bar").to("kPa")      # 350 kPa

Features (full roadmap)

  • 22+ cubic equations of state — Peng-Robinson, RKS, van der Waals, Schmidt-Wenzel, Patel-Teja, and more
  • 5 activity coefficient models — Wilson, van Laar, Margules, Scatchard-Hildebrand, Ideal
  • 11 mixing rules — Classical (IVDW, IIVDW), Wong-Sandler, Huron-Vidal, MHV1/MHV2
  • 6 saturation pressure correlations — Antoine, Riedel, Müller, RPM
  • 6 flash calculation types — bubble/dew point (T/P), isothermal (Rachford-Rice), adiabatic
  • Parameter regression — kij (binary interaction) and Aij (activity model)

Use it in Jupyter

A curated set of notebooks reproducing Chapter IV of the source thesis ships alongside the project at https://github.com/miguelju/vle/tree/main/notebooks. To run them in your own environment:

pip install "vle-thermo[plot]" jupyterlab
git clone https://github.com/miguelju/vle.git
cd vle/notebooks
jupyter lab

For a zero-setup option, a ready-to-run Docker image is published at ghcr.io/miguelju/vle-thermo:

docker run --rm -p 8888:8888 ghcr.io/miguelju/vle-thermo:latest

Origin

Based on the thesis "Desarrollo de un Programa Computacional para el Cálculo del Equilibrio Líquido Vapor de Mezclas Multicomponentes bajo el Ambiente Windows" (Jackson & Mendible, Universidad Simón Bolívar, 1999), with additional models from Da Silva & Báez (1989). See the research paper (English translation) for algorithms, parameters, and their academic references.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vle_thermo-0.1.2.tar.gz (40.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vle_thermo-0.1.2-cp310-abi3-win_amd64.whl (154.3 kB view details)

Uploaded CPython 3.10+Windows x86-64

vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl (285.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ x86-64

vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl (280.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

vle_thermo-0.1.2-cp310-abi3-macosx_11_0_arm64.whl (246.4 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file vle_thermo-0.1.2.tar.gz.

File metadata

  • Download URL: vle_thermo-0.1.2.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vle_thermo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 494bb48acca9073ed9de1b8536028a336c07ee7e4bccfa9e978e8af591f2c410
MD5 ed82972f1411c7ed71baf18a39692f5c
BLAKE2b-256 05ba885b5998ac72d1383582393dd80a247473ea2bbef8887e06d2ef9ea96603

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.2.tar.gz:

Publisher: release.yml on miguelju/vle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vle_thermo-0.1.2-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: vle_thermo-0.1.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 154.3 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vle_thermo-0.1.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f860abf5aabdfd41753c16c785157044350c5d341e85ec8b44ca602861614082
MD5 0b8233daf2ccfb6ba60857a060bb0e5c
BLAKE2b-256 420c9860f56c8f9d848c29b279a200c7fc229ec9607bb96e5c60ea62fc8108d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.2-cp310-abi3-win_amd64.whl:

Publisher: release.yml on miguelju/vle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5a88a511ea6ca8b7e021aca8c9c3b108a4ca943345d68cde573622f76ec02a2b
MD5 f118ecef4c7d9a4e76efd6fa5cdf9880
BLAKE2b-256 ab0bbdcca5f8cb6e76946e6be60fde460485d061c888bd5629b179a32a524c09

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on miguelju/vle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cc2b75d99da764b3a7502c5f882e295a7c610b30c58d9d37b194cdae391ca766
MD5 d5e56fbf5bc0ddb6c7b5143a3cc36aaa
BLAKE2b-256 13b91020b06988d1c6ebae48d638961f6824e66da2e698f2247061cbb8b49e3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.2-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on miguelju/vle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vle_thermo-0.1.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 03341aefa660d657a6228c969d395951d514d31649875d1d724135d30534b075
MD5 d75820fa1e04f5d394893ed458838f69
BLAKE2b-256 9aa6b40780cac75d13893b1f748dca44bc09a6b50c2371c71fc1e0daee0a49ed

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.2-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on miguelju/vle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page