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

Uploaded CPython 3.10+Windows x86-64

vle_thermo-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl (285.5 kB view details)

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

vle_thermo-0.1.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: vle_thermo-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 10adaecf72b8cf2b83f8b96c460fc424de7dbe72a674401b7ee35a88104ecd6e
MD5 bc2ce5d80f47b4b45267eeb99ad90f64
BLAKE2b-256 090db730800e09a8a2e5e4e10dd0a4e706f3dd7f753541c741f6aec38703b5b6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: vle_thermo-0.1.1-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.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 dd5032e906998db2f5d4b9f28ab6744f12c78ff8c700e0e4c8730cfc03ebe2e4
MD5 5bf5359abcac68fcf79f308f87c62ba2
BLAKE2b-256 f50636a8f6ffda21cf66d4d94213ead24f8afdbad4d73a5e9d4b7aa8e5782820

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vle_thermo-0.1.1-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d631d6e42cd9a6326e601529d9f4c62fb113a442bcdcbaf750e254954c09b38f
MD5 c32b66376284349d15ab8d1253f02162
BLAKE2b-256 2fd04fbe111fc1b691c2f4760535b66992c034de2cadfa528c8134aee1f94aa0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vle_thermo-0.1.1-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3ef9094d908014fa2111c8bfcafecdd5ebd7b13c5d8607b50a85d75b9d7aa6f2
MD5 8f82c0eafac6ba2a7fcd3036b34e0a2b
BLAKE2b-256 c6b7a0f3d03ab24a6a8b0035761cc434177dd35db318ae230936043971aed902

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vle_thermo-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4f0ec609d506fd45776c8cf2c0ce6f4aa992898441052ac7f343bf44a1a68ee
MD5 45d08c52d7cf7a0e143939316016f20e
BLAKE2b-256 e4b567e4fed9f4a613c98a0898e73c97e961a422bfdff6e7eec44ad7fb36c120

See more details on using hashes here.

Provenance

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