Skip to main content

ℜeos: A Rust Library for Equations Of State and Thermodynamics

Project description

Welcome to ℜeos

docs

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_json(["water", "carbon dioxide"], 
                             rdf_model="kg",
                             cubic_model="srk",
                             ppath="../../../parameters/cpa/tsivintzelis2011.json", 
                             bpath= "../../../parameters/cpa/tsivintzelis2011_binary.json")

eos = EquationOfState.cpa(parameters)

# 2. Initialize the state
T = 323.15; P = 1e5; z = np.array([0.75, 0.25])
state = State.tpx(eos, T, P, z)

# 3. Calculate properties
unbonded_sites_fraction = eos.get_assoc_calcs(state.temperature, state.density, state.composition)["X"]

Models

Model Description
CPA CPA, SCPA
cubic SRK, PR76, PR78, Twu-91, volume-translation

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
  • parameters: Directory with pure and binary parameters for the current models implemented in Reos

  • crates: Contains reos, which is the Rust package that implement all the core functionalites

  • pyreos: Rust package that create the Python interface from reos

  • pyreos-dev: Directory used to test functionalites of reos in Python

  • pyreos-examples: Python examples of how to use reos

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


Download files

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

Source Distribution

reos-1.0.0.tar.gz (64.7 kB view details)

Uploaded Source

Built Distribution

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

reos-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl (623.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file reos-1.0.0.tar.gz.

File metadata

  • Download URL: reos-1.0.0.tar.gz
  • Upload date:
  • Size: 64.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for reos-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1de74e754d35c5b6f31f3e2567d0622d1d8c5aed02bf3b7b12b10c2c01e658b4
MD5 36431c375abf1e2f684d25f355fd93ff
BLAKE2b-256 992c743d03dc08b30ea07a20b399bcec96c6e7426cf91769399921d10cf43f1d

See more details on using hashes here.

File details

Details for the file reos-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for reos-1.0.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e8ce991d191705f45a7b11ba1f771538d8dffbf7d2cb24a5d4b1940eb7c35cf3
MD5 f6473621175ee0f4b383f41823cf41c3
BLAKE2b-256 a6ba6e5e52a2a14a068f4c2f1d80f5abc6ea3431b0b2dfe5486abb9921d01dff

See more details on using hashes here.

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