yaeos is a Fortran library for calculating fluid properties and phase
equilibria. It includes equations of state (EOS) for gases and liquids, and
activity-coefficient models for non-ideal liquid mixtures.
You can use it to answer questions such as “What pressure does this mixture have?”, “When does the first liquid drop appear?”, or “How much liquid and vapor coexist at this temperature and pressure?” These are different calculations, and this guide helps you choose the right one.
The getting-started tutorial builds a small program, predicts a mixture’s pressure, solves for volume, and explains how to check the result. If terms such as mole fraction, fugacity, or volume root are unfamiliar, keep thermodynamics essentials alongside the tutorial. You do not need to derive an EOS before running it.
| Step | Read | What you will be able to do |
|---|---|---|
| 1 | Getting started | Install the library and run a complete Fortran calculation |
| 2 | Thermodynamics essentials | Distinguish amounts, compositions, phases, units, and energy references |
| 3 | EOS guides or activity models | Choose a model family and assemble its input data |
| 4 | Property reference | Evaluate properties and understand optional derivatives |
| 5 | Phase equilibrium | Select saturation, flash, stability, or envelope calculations |
| 6 | Adding models | Extend the library and check a new model’s derivatives |
| 7 | Developer handbook | Navigate the codebase and contribute across Fortran, C-facing wrappers, and Python |
ArModel
interface, so property calls stay similar when you switch between models.GeModel
interface supplies activity coefficients and excess properties, not a
general pressure–volume relationship.Complete programs can be copied into a project’s app/main.f90. A block
explicitly described as a snippet or an insertable block depends on the setup
shown before it; do not compile it as a standalone program. Routine names
linked into the generated API lead to argument-level documentation.
Most Fortran examples use pr, the library’s real-number precision, and the
default unit system: pressure in bar, volume in litres, temperature in kelvin,
and amount in moles. Check model parameter units separately. Component arrays
must always have the same ordering as the model’s construction data.
The guides introduce the physical idea first, then a practical calculation, then the equations or advanced options. It is fine to postpone the detailed derivations until you need them. No model or convergence status can replace checking units, parameters, material balances, and comparison with measured data.
This library and its documentation are evolving. Please report problems or missing explanations through the issue tracker, including your library version and a small reproducing example when possible.