Scope and purpose
PYroMat is a Python package for conveniently retrieving the thermodynamic properties of substances from the command line or in scripts. PYroMat is and will always be free and open. The original source data will always be fully disclosed, and errors will continuously be rooted out and eliminated.
Providing the properties of substances is an awfully broad mandate; so we have to start somewhere. As of version 2.0.1, most of PYroMat's 390+ species are ideal gases, but there is also support for two-phase (only steam so far) and ideal gas mixtures. Work is already underway to broaden two-phase support to refrigerants and some important substances like nitrogen, oxygen, and especially carbon dioxide.
There are some excellent alternatives out there that do some similar things, but all of them are either for profit, have limited capabilities, are devoted to much narrower data sets, or are built to perform a specific job. PYroMat is written entirely in Python and is designed with the intent of minimizing the clicks and keystrokes required to get data that should be available to us all.
A little poem
There once was a student with work ethic prudent she scripted to speed her work. In Python t'was coded, so when it was loaded, she could all the tedium shirk. A thermodynamic fluid mechanic problem she had solved. Her colleagues were avid she share the package frustration to resolve. Good, was the mood. Researchers all cooed, until she read her mail. With no contradiction, viscosity-friction; with it her package would sail. She furiously typed new modules to write. The people, they must be heard. What thanks had it gotten? why, STEAM she'd forgotten! Without it, the code was absurd. Downtrodden indeed, she sat at the screen, multiphase soon to add. Though coffee was drunk and sleepless nights sunk, her code, it really was bad! The syntax was rambling no hope of unscrambling the endless nonsensical edits. Compatible, reverse, a programmer's curse no fixing - it's time to shred it. "I'm done," she then plead. To the airport, she fled. "I'll fly off to someplace that's random." Her useful creation was once a sensation; forgotten and now is abandoned. Her colleagues still moan, "Please pick up your phone! Your software, it just isn't working." Ye coders beware the fate most unfair, within all your projects is lurking.
The story behind PYroMat
In 2006, I needed to calculate enthalpies of lots of ideal gases for combustion modeling, and I was disappointed with my options. I created HOT for Matlab and Octave, and it's still available from Sourceforge and the Mathworks File Exchange. When I released it, there was a warm response from a community of students and researchers, but there were a number of poor implementation decisions. About the same time, Python was gaining ground in scientific computing, so rather than improving the Matlab code, I started from scratch in Python. I haven't updated HOT since 2010, and I've never regretted the transition.
In 2015, I shared the first version on Sourceforge, and I was very proud of my cute working title for the package. Pyro is a popular remote object toolkit for Python, with which my working title collided. With a nod to the intent for its future breadth, the project became PYroMat.
The first release of PYroMat supported ideal gas data through two classes; igfit and igtab. The igfit class supplied properties through the so-called NASA polynomials. Meanwhile, igtab objects simply performed interpolation on tabulated data.
In version 1, I experimented with a number of different strategies for providing inverse property routines (e.g. calculating temperature from entropy and pressure). I tried exposing a generic iterative inversion routine called psolve, but it was awfully inefficient and it had predictable convergence problems near phase transitions. I finally settled on class-specific methods like T_s(). They're much faster, more stable, and because they are specific to a class, I can keep improving them without having to re-validate their behavior over the ENTIRE data set.
At the close of 2017, version 2.0.1 marked a total transition to the Shomate Equation used by the NIST webbook, implemented by a class simply called ig. The same release also introduced the use of collections to organize species by their type.
The PYroMat logo is entirely thanks to the wonderful and talented Janet Montgomery. I mentioned to her that the package needed an icon, and before I had time to think I had a multitude of options of every color and shape. Together, we whittled it down to a snake's head combined with a flame to represent the union of Python and thermal properties. Thanks Janet.
Version 2.0.1 is the beginning of a long transition to a new internal structure that will expose a wide range of new tools to the user. The number of species has roughly quadrupled since the original code, so the package needs a better way to search and browse the species list than than it has. Additional multi-phase substances like refrigerants have been in the works for a long time, and there are a number of other important fluids on the way.
I also have plans to incorporate viscosity and other transport models for some of the most important ideal gases. In some version soon, I'd like to include metals and other solids of engineering interest. There is no reason that important mechanical, thermal, and electrical properties shouldn't be available too.
Lest we forget the Matlab and Octave roots of PYroMat, this is an excellent time to emphasize Matlab's Python support. I have not yet investigated the new package's performance within Matlab. One day, I may even write some wrapper functions in Matlab that call up the Python back-end.
PYroMat is released under the GNU Public License version 3. You, the user, are free to copy the code. You are free to edit the program (please do). You are free to share your changes with anyone you like as long as you tell people you made changes. In fact, I'd really love to hear about it if you make your own additions!
While I will continue to pour effort into verifying the integrity of the code and the data I maintain, PYroMat is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.