Introducing the Thermofluids Python Module

I’m excited to announce the publication of the Thermofluids python module. The docs show you how to use it so I wanted to use this space to explain why I created it and why you might want to use it. Thermofluids embodies my philosophy of energy engineering:

We solve problems best and fastest by understanding the fundamental physical drivers and then plugging all the solution possibilities admitted by fundamentals into an analysis as fast as possible.

Breaking that dense idea down starting at the first bit about solving problems best, our fundamental goal as engineers should be to make the world a better place by solving problems. The world’s real problems today are, just like they always have been and I believe always will be, energy problems. Access to money and tokens are irrelevant compared to access to food and housing, both of which are fundamentally energy problems (I highly recommend Valcav Smil’s How the World Really Works for a full dissertation on this idea). Helping people means solving energy problems and that’s what thermofluids aims to help you do.

To solve those energy problems, thermofluids requires you to understand the fundamental physical drivers. The basic element behind thermofluids as a field and the thermofluids python library is the statepoint. A fluid in a process is full described at a statepoint by two independent thermodynamic properties. Think how the fuel injected into the engine of a car has a temperature and a pressure. Those two properties define everything about that statepoint including the energy content, the ability to do useful work, the way it fills the space, how it can move. This locks all the fundamental physics into the core unit of analysis.

Even more, every time you set up a thermofluids model, the code structure forces you to grapple with this idea. If you want to expand a fluid through a valve, you can reduce the pressure but then you’re explicitly forced to decide whether you want to do it as an isothermal process (constant temperature) or isenthalpic (constant energy) because you can only specify one other property. You’re simply not allowed to flagrantly create or destroy energy in a statepoint because it doesn’t make any sense as code. By enforcing the laws of physics at the simplest level, the author is forced to better understand the fundamental drivers of the process they’re modeling.

These days, its important to contrast this with how AI systems would analyze the systems. LLMs are fundamentally just phenomenally large heaps of y=mx+b (for those of you who stopped at algebra) or linear algebra (for those of you who did a little college math) or statistically guessing what’s next (if you don’t even want to remember algebra). And for all the AI hype, no one has claimed anything at all like developing a new thermofluids machine. This is because LLMs fundamentally struggle to internally represent ideas like statepoints. This is because the specific enthalpy at a statepoint isn’t correlated with the pressure and specific entropy, it is exactly set by those properties. This (in addition to the fact that AI founders seem to think they can exist aside from the physical world) is why LLMs will always struggle with the physical world.

Moving on to the final clause of the thermofluids philosophy, the approach makes solving problems fast because it let’s you explore a deep and wide solution space extremely fast. Once you’ve grappled with the fundmental physics to understand the drivers of your problem, you’re usually left trying to optimize the solution across design inputs. Compared with statistical analysis (LLMs) or full-dimensionality partial differential equation solvers (simulation tools), simplified dimensionality energy analysis (statepoint) is many orders of magnitude faster to run. The thermofluids python module is designed to plug right in to pythonic iterators to solve optimization problems or sweep across design spaces.

Since I started writing the thermofluids python library, it has become my favorite tool for analyzing thermofluids systems. I would estimate that I’ve used it to calculate the performance of hundreds of millions of thermofluids systems. Every one of my patents has millions of calculations done with the thermofluids module behind it.

So why might you want to use thermofluids? If you’re an engineer, I think you’ll find it has the same benefits I do: you can solve problems quickly by better understand them and quickly optimizing solutions. If you do, please share feedback. I want you to find it as useful as I do. I hope you’ll give thermofluids a try, let us know what you think, and suggest and contribute to improvements.

If you are someone who needs to solve some problems to make the world better but not an engineer, Capsica can help you do that using the thermofluids! Please reach out via our Contact page to talk about how we can get to work for you.