Thermopack
Thermopack is a thermodynamic model library for fluid properties and PVT calculations
Install / Use
/learn @thermotools/ThermopackREADME
ThermoPack homepage
For the full documentation and user guide to ThermoPack, see the ThermoPack homepage.
If you are running ThermoPack installed via pip, make sure to check the documentation for the correct version by selecting
the version number in the sidebar.
About
Thermopack is a thermodynamics library for multi-component and multi-phase thermodynamics developed at SINTEF Energy Research and NTNU Department of Chemistry. Through decades of research, we have developed a software that performs thermodynamic calculations. A large selection of equations of state has been implemented in this software. Most of these equations of state have been developed by other research groups around the world, but some of them have been developed by us. Thermopack has been a much-appreciated in-house powerhouse.

Thermopack is available for everybody, free of charge under the Apache 2.0 open-source licenses. Thermopack is written in FORTRAN to handle heavy numerical computations associated with process and computational fluid dynamics (CFD) simulations. The thermodynamic framework is easily interfaced from C/C++ and also contains a flexible Python wrapper to make scripting easy.
Table of contents
- Please cite
- Authors and contact persons
- License
- Acknowledgments
- Program structure
- Building from Source
- Getting started - Python
- Doing calculations
- Advanced usage - Python
- Component identifiers
Please Cite
Thermopack has been developed through many projects, and have produced many articles. If you are writing academic publications, please cite one or more of the following articles:
-
For general usage:
Thermodynamic Modeling with Equations of State: Present Challenges with Established Methods -
Quantum cubic:
Accurate quantum-corrected cubic equations of state for helium, neon, hydrogen, deuterium and their mixtures -
SAFT-VR Mie and SAFT-VRQ Mie:
Equation of state and force fields for Feynman--Hibbs-corrected Mie fluids. I. Application to pure helium, neon, hydrogen, and deuterium
Equation of state and force fields for Feynman–Hibbs-corrected Mie fluids. II. Application to mixtures of helium, neon, hydrogen, and deuterium
Choice of reference, the influence of non-additivity and challenges in thermodynamic perturbation theory for mixtures -
CPA, PC-SAFT or cubic models with Wong–Sandler, Huron–Vidal or UNIFAC mixing rules:
Thermodynamic models to accurately describe the PVTxy-behavior of water/carbon dioxide mixtures -
Using dry-ice and water-ice model or the tc-PR/tc-RK:
Depressurization of CO<sub>2</sub>-N<sub>2</sub> and CO<sub>2</sub>-He in a pipe: Experiments and modelling of pressure and temperature dynamics -
Energy-density and entropy-density flashes:
The influence of CO2 mixture composition and equations of state on simulations of transient pipeline decompression -
Mapping spinodals or critical points:
The spinodal of single-and multi-component fluids and its role in the development of modern equations of state
Predicting triggering and consequence of delayed LNG RPT -
Perturbation theories for Lennard-Jones spline fluid:
Perturbation theories for fluids with short-ranged attractive forces: A case study of the Lennard-Jones spline fluid
Thermodynamic properties of the 3D Lennard-Jones/spline model
License
Thermopack is distributed under the Apache 2.0.
Acknowledgments
A number of colleagues at SINTEF Energy Research and NTNU have contributed to the development of thermopack. We gratefully acknowledge their contributions.
Program structure
Each EoS in thermopack is a class, which inherits from the thermopack class found in thermo.py. The primary documentation
for the thermopack python wrapper consists of the docstrings of the thermopack class.
This class contains all generic methods used to compute thermodynamic properties, phase equilibria, etc. The inheriting
classes simply ensure that the correct part of the Fortran-module is linked when performing calculations, and provide
some extended functionality for handling EoS parameters and such. See the wiki
for more information on this.
Fluid parameters are compiled into the Fortran-module, and are not directly accessible through the Python-wrapper.
The entire fluid parameter database used by thermopack may be found in the /fluids directory
in the GitHub repo. In order to model fluids not currently supported in the module available through pip, thermopack
must be compiled from source with the new parameters. See the wiki
for information on how to add new fluids, and the GitHub README for a guide
on how to compile from source. Please feel free to leave a PR for new parameter sets such that these can be included in
future releases of thermopack.
File System
Brief description of file structure:
thermopack/: Main library folder containing make scripts etc.thermopack/src/: Main path for Fortran source codethermopack/unittest/: Test files written for pFUunitthermopack/bin/: Compiled binaries and librariesthermopack/doc/: Memos and doxygen documentationthermopack/fluids/: Pure fluid filesthermopack/binaries/: Files containing binary interaction parameters etc.thermopack/MSVStudio/: Microsoft Visual Studio project and solution filesthermopack/include/: C/C++ include filethermopack/pyplot/: Example plot-scripts (Plotting text files generated by Thermopack)thermopack/addon/: Add-on functionalitythermopack/addon/pycThermopack/: Python interfacethermopack/addon/pyUtils/: Python utilities for generating fortran code and makefile input.
Installing the latest version of ThermoPack
Using pip
Thermopack has been compiled for Windows, Linux and macOS and made available on the Python Package Index (pypi), and can be installed using pip
pip3 install thermopack
For documentation on the version available on pypi, refer to the appropriate version number in the sidebar.
Installing from wheels
Pre-built wheels for the latest version of ThermoPack on GitHub are available for download here. Refer to the linked page for instructions on how to install packages directly from a python wheel. Please note that the latest version on GitHub may be less stable, tested, and well documented than the versions distributed on PyPI.
Building from source
The following sections show how to fetch, compile and install Thermopack and the Python frontend pycThermopack. When things are properly installed, it may be useful to look into the examples provided in the getting started guide, and the pyExamples.
Prerequisites
Thermopack source code can be compiled with the GNU Fortran compiler or [Intel FORTRAN](https://softwa
