Getting Started
Using This Documentation
yaeos is a Fortran library of thermodynamic equations of state (EOS). If you’re reading this, you’re probably looking to use yaeos from Python.
Under the hood, all thermodynamic models are implemented in Fortran. The Python API provides simple functions that call these Fortran routines through a C interface (compiled using numpy.f2py).
If you’re only interested in using yaeos from Python, that’s totally fine — but keep in mind the following:
The documentation is divided into two parts: Python-side and Fortran-side.
The Python tutorial and API reference contain everything you need to work with the Python interface.
However, the Fortran documentation provides additional technical details for each model, such as mathematical expressions, derivatives, and bibliographic references. These may be useful if you want to understand the models more deeply.
Start with the Python documentation. Refer to the Fortran documentation only if you want to explore a model’s theory, equations, or parameters meaning in more detail.
Installation Instructions
Local Installation
To install the last version of yaeos uploaded to PyPI simply do:
pip install yaeos
Building from source
To build yaeos from source you can clone the repository and install it with pip. The system dependencies are:
LAPACK
Fortran compiler
To build and install do:
git clone https://github.com/ipqa-research/yaeos.git
cd yaeos/python
pip install .
Setting a Google Colab to use yaeos
To install yaeos on Google Colab you can do the following command to install the last version uploaded to PyPI:
%pip install yaeos
On the other hand, if you want to install the dev version of yaeos in a Google Colab and try out the new (and experimental) features you can execute the following code:
Note: do not execute the next commands if you don’t want the
devversion. use the previous command instead and skip the next ones.
# Installing the dev version into a google colab
try:
import google.colab
IN_COLAB = True
except:
IN_COLAB = False
if IN_COLAB:
%pip install 'git+https://github.com/ipqa-research/yaeos.git@dev#subdirectory=python'
Installation For Developers
If you want to contribute to yaeos, you may want to install the Python API in development mode. This lets you edit the code and test your changes without having to reinstall the package every time you modify the Python code.
To do this, run the following:
git clone https://github.com/ipqa-research/yaeos.git
cd yaeos/python
pip install -r requirements-build.txt
pip install -r requirements-dev.txt
pip install -e . --no-build-isolation
Yaeos units
In thermodynamics, the units of evaluated properties are defined by the value of the ideal gas constant R. In yaeos, we use the value of R as:
\(R = 0.08314462618 \frac{bar \; L}{K \; mol}\)
Because of that, pressure must be specified as bar \([bar]\), volume as liters \([L]\), temperature as Kelvin \([K]\) and number of moles as moles \([mol]\). The returns of the properties will be in the same units as the inputs. Energetic properties as enthalpy, entropy, etc. will have unit of \([bar \; L]\), which equals to centijoules \([cJ]\).