Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

thermo-utils

status python license

thermo-utils is a command-line thermodynamics calculator for chemical engineering. It covers pure fluids, heat effects, flow devices, mixtures, phase equilibrium, chemical equilibrium and surface phenomena, and is accurate enough for design work. You only type the substance name: Tc, Pc, ω, Cp, ΔHf, Psat and the other data come from built-in databanks.

Screenshots


Main menu

Brayton cycle with its T-s diagram

Property change between two states

Installation

pipx install thermo-utils

or uv tool install thermo-utils, or pip install thermo-utils inside a virtual environment.

Usage

Run thermo-utils to open the interactive menu (Esc exits), or run a calculation directly:

thermo-utils delta water T1=25C P1=1atm T2=300C P2=20bar
thermo-utils delta nitrogen T1=300 P1=1bar V2=3117cm3/mol dS=0
thermo-utils pump water T1=25C P1=1atm P2=50bar efficiency=0.75 flow=10kg/s
thermo-utils otto T1=27C P1=100kPa r=8 q_in=800
thermo-utils otto T1=27C P1=100kPa r=8 q_in=800 --details   # every step of the calculation
thermo-utils brayton T1=300 T3=1300 w_net=300 eta_c=0.85     # finds rp
thermo-utils rankine P1=10kPa P3=3MPa x3=1 Wdot=10MW eta_t=0.87
thermo-utils step steam-turbine P1=3MPa T1=350C P2=10kPa x2=0.9
thermo-utils diagram ethanol,water P=1atm --plot
thermo-utils rankine P1=10kPa P3=8.6MPa T3=500C --plot --csv   # P-v and T-s plots + result table
thermo-utils gibbs CH4,H2O,CO,CO2,H2 T=1000 P=1 feed=CH4=2,H2O=3
thermo-utils list           # every calculation and its inputs
thermo-utils info ammonia   # databank values of a substance
  • Units: type them with the value (25C, 10atm, 300cm3/mol, 5kmol/h), with no space so no quotes are needed. Without a unit the defaults are K, bar, cm³/mol and J/mol. Output units can be changed in the menu (u) or with --T-unit, --P-unit, --E-unit, --V-unit.
  • Substances: English names, formulas or CAS numbers (water, H2O, 7732-18-5), right after the calculation name. air is available as a pseudo-pure fluid (reference EOS of Lemmon et al., 2000). Mixtures are comma separated (ethanol,water).
  • Devices: pump, compressor, turbine and valve are shortcuts for device kind=....
  • Cycles: give any values that fix the cycle (states T1...P4, v, u, h, s, x, or results like r, rp, rc, q_in, w_net, eta, mep, Wdot) and the rest is solved. Energies default to kJ/kg. Gas cycles use Cp(T); k=1.4 switches to the cold air-standard.
  • Plot and Table (CSV): after a result, Plot saves a PNG (with a CSV of the curve data) and Table (CSV) saves every computed value as section, item, quantity, value, unit; both open in the default app. Plots exist for cycles, devices, property changes, phase diagrams and the other calculations where a curve helps. Files go to the cache folder (~/.cache/thermo-utils, or $THERMO_UTILS_PLOTS), which keeps the latest 100. On the command line: --plot, --csv, and --no-open to only save.
  • Details: after a result, Show details opens the step-by-step calculation, like a worked exercise: formulas, substituted values and the result of each step, iterations included (↑/↓ scroll, q goes back). On the command line, add --details.
  • Percent: 0.2 and 20% are the same; values without % are fractions (efficiencies, excess air, qualities).

Calculations

Pure fluids

  • PVT with ideal gas, virial, van der Waals, RK, SRK, Peng-Robinson, fitted Peng-Robinson and reference EOS, with a side-by-side comparison
  • State properties: V, Z, H, S, U, G, A, Cp, Cv, φ, fugacity, κ, β, μJT, speed of sound
  • Property changes ΔH, ΔS, ΔU, ΔG, ΔA between two states given by any two of T, P, V (phase changes included), with the residual-property path
  • The reverse: the missing T, P or V of a state for a given ΔH, ΔS, ΔU, ΔG or ΔA (e.g. isentropic compression with ΔS = 0)
  • Saturation (Psat, Tsat, ΔHvap)

Heat effects

  • Sensible and latent heats (Riedel, Watson)
  • Adiabatic flame temperature

Flow devices

  • One-step devices: compressor, pump, turbine and valve, with efficiency and power for a given flow

Power cycles

  • Otto, Diesel, Brayton and Rankine, solved from any consistent data: known data in, the rest out, in either direction (e.g. r from η, T3 from q_in, rp from w_net, ṁ from the power)
  • Isentropic efficiencies of compressor, turbine, pump and piston strokes; engine power from displacement and rpm
  • Single steps (compression, expansion, heating at constant v or P, compressor, turbine, pump, boiler, condenser) solved the same way
  • Air with Cp(T) on the air-table reference or the cold air-standard (constant k); Rankine with the reference EOS of water (or another fluid)
  • P-v or T-s diagram of the cycle (with the saturation dome for Rankine) and the equipment sketch, drawn in the terminal

Mixtures

  • Fugacity of species in mixtures (PR, SRK, virial) and the Lewis-Randall rule
  • Activity coefficients and excess properties: Margules, van Laar, Wilson, NRTL, UNIQUAC, UNIFAC, UNIFAC-Dortmund
  • Margules and van Laar fits from P-x-y data (CSV)

Phase equilibrium

  • VLE: bubble/dew P and T and flash, using γ-φ, modified Raoult, Raoult or φ-φ, for multicomponent mixtures
  • Pxy, Txy and xy diagrams with azeotrope detection
  • LLE with the binodal curve, SLE (eutectic), solubility of solids, osmotic pressure

Chemical equilibrium

  • K(T), ΔG° and ΔH° with rigorous ΔCp integration and the van 't Hoff plot
  • Equilibrium conversion of one reaction: ideal gas, gas with virial φ̂, ideal liquid or UNIFAC
  • Multi-reaction equilibrium by Gibbs energy minimization (no need to write the reactions)

Surface phenomena

  • Surface tension σ(T) with surface entropy and enthalpy (databank, Brock-Bird, parachor)
  • Kelvin equation (vapor pressure over drops, bubbles and pores)
  • Adsorption isotherms (Langmuir, Freundlich, BET with specific surface area) fitted to CSV data
  • Gibbs adsorption isotherm (Szyszkowski fit), micellization (CMC, ΔG°mic)

Accuracy

Model Use Typical error
Reference EOS (CoolProp) ~120 common fluids (water, CO₂, hydrocarbons, refrigerants, air gases...) < 0.1 % in density and enthalpy
Fitted Peng-Robinson (Twu α + volume translation) any substance in the databank ~1 % in Psat, ~2 % in liquid density
Peng-Robinson / SRK any substance in the databank 1-5 % for gases, 5-30 % for liquid volumes
Virial (Pitzer) gases at low to moderate pressure < 1-2 % when Vr > 2
UNIFAC / NRTL / UNIQUAC (ChemSep) liquid mixtures azeotropes within ~0.5 K for common systems

The auto model uses the reference EOS when available and the fitted Peng-Robinson otherwise. Its α function and volume shift are fitted to the databank vapor pressure and liquid density of each substance.

Every result starts with the equations used in the calculation, and Show details lists each step with its numbers. H, S, U, G and A share one reference state (ideal gas at 298.15 K and 1 bar), so differences between models are meaningful. Data come from chemicals, thermo and CoolProp.

Contributing

Contributions are very welcome! thermo-utils still has a lot of room to grow, and I'd be happy to get your help. Found a wrong result, a missing substance or a bug? Have an idea for a new calculation? Open an issue or send a pull request.

Metadata

Release files for thermo-utils 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for thermo-utils 0.6.0
File Size Uploaded Provenance Actions
thermo_utils-0.6.0.tar.gz 103.6 kB Without provenance Details for thermo_utils-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for thermo-utils 0.6.0
File Interpreter ABI Platform Actions
thermo_utils-0.6.0-py3-none-any.whl Python 3 none any Details for thermo_utils-0.6.0-py3-none-any.whl

Total release size: 215.2 kB

Release files / thermo_utils-0.6.0.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL thermo_utils-0.6.0.tar.gz
Size 103.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad14b96a09fe7488da5df304ff5ddd5a1f2dc6f600dd7978924af6946b0cc22f
BLAKE2b-256 checksum
How to use checksums
98d2c8afd00140b2bd1be35ea186751ccfcdebf1dbfad8713acf4dfe898915da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / thermo_utils-0.6.0-py3-none-any.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL thermo_utils-0.6.0-py3-none-any.whl
Size 111.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5502e9263e1b29f666908e3faeaa9ce76b7befd9145f2e5f2b00e34e740edee8
BLAKE2b-256 checksum
How to use checksums
c4786e5665c6a71c4c773105312436175aacb7dd86ca2b94d7fd949021b90ff0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for thermo-utils 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.5.0 2 files With provenance
  • Added 0.6.0 2 files Without provenance

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page