Thermodynamic Computational Tools
for Python

PYro is a flexible platform for calculating thermodynamic properties in Python. If you are a Python user who also works with thermodynamic calculations, it could be the tool for you. From students to researchers, a free standard interface for conveniently retrieving thermodynamic property data can make all our lives easier. With that in mind, PYro is designed for everything from quick property calculations to being embedded in larger models.

Download, share, contribute, comment, enjoy!


Version 1.2 of PYro contains 79 substances with data for multi-phase substances, imperfect gases, and mixtures. PYro is made unique by its capacity for retrieving data from different sources stored in different formats with a standard interface; making the peculiarities of the data invisible to the user. Whether stored as tabulated data or curve fits, primary source data are managed automatically by classes that encapsulate interaction in a standard command interface. Detailed citations for original sources provide the traceability needed for professional applications, and a flexible user-configurable back-end allows users to pop the hood to write their own data and classes.

As of version 1.2, PYro includes multi-phase data for steam with refrigerants on the way. The new psolve() function also lets users invert properties for applications like cycle analysis or flame temperature calculations.


When a user wants to work with a substance, the user requests an object that represents that substance (say Argon). These objects have their own methods for calculating enthalpy, entropy, density, specific volume, molecular weight, internal energy, and others from temperature and pressure.

>>> import pyro
>>> S = pyro.get('steam')
>>> air = pyro.get('air')

Once retrieved, these objects provide the interface for the data.

>>> # This retrieves the saturation enthalpies for steam at 900K
>>> hliq, hvap = S.hs(T=900.)
>>> # This retrieves the specific heat of air at 432K
>>> C = air.cp(T=432.)

For a more extensive idea of what PYro can do, check out the examples.

Authored By:
Christopher R. Martin, Ph.D.
Assistant Professor of Mechanical Engineering
The Pennsylvania State University, Penn State Altoona