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.0.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.0-cp310-abi3-win_amd64.whl (154.3 kB view details)

Uploaded CPython 3.10+Windows x86-64

vle_thermo-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl (285.3 kB view details)

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

vle_thermo-0.1.0-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.0-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.0.tar.gz.

File metadata

  • Download URL: vle_thermo-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 9189312a49b35cbf62232c8a2366e946e8c1debd5e73151d500eaa8cc77ab429
MD5 4511247579a6c94f3a9d8c6fa5afcba1
BLAKE2b-256 a45372669027106f8f949496b978da875ad1af4c10b64f462d3d5c0be90d70b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.0.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.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: vle_thermo-0.1.0-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.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 37236431e5ef315c3b69d71f5a1396ec4d49cba5f7bac953496971520cc49097
MD5 a02993c1c9bdbe0ca473d17a55a4ddc0
BLAKE2b-256 c8babfc362146900b4d61ffc01f05fa46d01219528be00a14aaed64945feca7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.0-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.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1bd4ddc64f775a580cda209a0fe1caa6463a4e9e06c97e27d337ad085f74f645
MD5 088210f70b937accb461a7230f5cfbfe
BLAKE2b-256 f89e8490da97fc42c3e56d398e8de012e4e5dd946c1aaf228187059b0208ee1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.0-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.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 baf32681e4211e60c8b73d5e033ad86908981f4ed789d472b5f6ba468438e161
MD5 b46fed405d26343dd80a18f96e07fc7f
BLAKE2b-256 9387de22a2fdd98b5ccd3ba612f0ddceaa6f5664d524ea53ebe9f0411e1293b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.0-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.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vle_thermo-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69ee8d36e67b4418d88a8932c88cd96213ed73dec077b53bdc8bb1033386bb64
MD5 b21f68b40f1880332b17a5229181e64c
BLAKE2b-256 4388e8058cce18a519843df15d6a27ee41a07a8c4b392f88b7a5d42a548b1c61

See more details on using hashes here.

Provenance

The following attestation bundles were made for vle_thermo-0.1.0-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