A Library for Thermodynamics using Cubic & Associative contributions written in Rust.
Project description
Welcome to ℜeos
ℜeos is a thermodynamic library written in Rust with a Python interface. It provides tools for calculating thermodynamic properties and phase equilibria.
import numpy as np
from reos.cpa import CPAParameters, CPAPureRecord
from reos.eos import EquationOfState
from reos.state import State
parameters = CPAParameters.from_records([
CPAPureRecord.new(
name = "water",
molar_weight = 18.01528,
a0 = 0.12277,
b = 0.014515e-3,
c1 = 0.67359,
tc = 647.29,
epsilon = 166.55e2,
kappa = 0.0692,
na = 2,
nb = 2
)
])
# or CPAParameters.from_json(["water"], "./parameters/cpa/kontogeorgis2006.json")
eos = EquationOfState.scpa(parameters)
t = 298.15
p = 1e5
x = np.array([1.0])
s = State.tpx(eos, t, p, x)
print(s)
X = eos.unbonded_sites_fraction(t, s.density, x)
print(f"Unbonded sites fraction = {X}")
State(t = 298.150 K, p = 100000.000000 Pa, ρ = 55784.919890 mol/m³)
Unbonded sites fraction = [0.07825138 0.07825138]
Models
| Model | Description |
|---|---|
| CPA | Cubic Plus Association (srk, pr76, pr78) |
| cubic | Soave-Redlich-Kwong, Peng-Robinson 1976, Peng-Robinson 1978 |
Each model implement its analytical expressions of derived properties of Helmholtz potential.
Installation
Python
From pip
pip install reos
From source
You must have rust compiler and maturin/PyO3 installed.
To install the python package in your machine (such pip install -e .) and use the optimized version of the package:
cd pyreos
maturin develop --release
To build the the python wheel, just use
maturin build --release
Project layout
Repository
├── crates
├── parameters
├── pyreos
├── pyreos-dev
└── pyreos-examples
crates: Containsreos, which is the Rust package that implement all the core functionalitespyreos: Rust package that create the Python interface fromreospyreos-dev: Directory used to test functionalites ofreosin Pythonpyreos-examples: Python examples of how to usereos
Python package
reos.eos: Enables the creation and manipulation of equations of state with different models.reos.state: Provides tools for working with thermodynamic states, including property calculations and phase equilibria.reos.{model_name}: Each current model has its own submodule with its name, which contains the pure model record, the binary model record and the parameters objects .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reos-0.1.0.tar.gz.
File metadata
- Download URL: reos-0.1.0.tar.gz
- Upload date:
- Size: 55.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bb12571a86d16666717fc9ac294bcaa10d73fc808962c32a685f33b09739c98
|
|
| MD5 |
54537bc486e82a7cd6f1a6663a0608ef
|
|
| BLAKE2b-256 |
33bb14d05ab08f58bc139458431de99e217072b5752b39b396e806399c0f3e25
|
File details
Details for the file reos-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: reos-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 576.4 kB
- Tags: CPython 3.12, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adada2842eda337da465a966b59675a9e72b706c8759a9bf162bd2ddaa6ed09f
|
|
| MD5 |
76b05205380ff42a376e5b38d3592c5b
|
|
| BLAKE2b-256 |
ce9b33765345b26e05ba086211369abd5687fbb3981cf56a1c66967a2a5e3f05
|