For almost a year and a half now, I’ve been talking with @MarkusLohmayer about open systems in non-equilibrium thermodynamics. He has a framework which he calls EPHS (Exergetic Port-Hamiltonian Systems), and it’s only now that I’m *starting* to understand what mathematically exergy represents. The thing that I couldn’t understand was what the role of “reference thermodynamic potentials” was in EPHS, and how EPHS could be a fundamental theory of thermodynamics with these reference potentials hanging around. This is mostly I think a function of my mathematician’s brain being unable to simply accept things on faith; engineers seem to have very little trouble working with exergy without worrying about any of this.

Recently, however, I’ve come to understand the GENERIC formalism for non-equilibrium thermodynamics, and I think I am coming around to seeing how the exergetic approach can be derived from GENERIC, which hopefully means that I’m closer to understanding exergy. Most of the ideas that are in this post come from a combination of Markus’s papers (1,2) and additionally the first chapter of Beyond Equilibrium Thermodynamics on GENERIC systems.

The idea behind exergy is that it measures the amount of “useful work” that can be extracted from a system before it equilibriates with an environment. So the first step in understanding exergy is to understand this equilibriation process.

First, we start with a brief review of the GENERIC formalism. I’m going to just go over all the pieces at once, and then go back and give an intuition for what they mean. A GENERIC system is described by the following equation

where x is a variable taking values in some (possibly infinite-dimensional) state space L(x) is an antisymmetric matrix, M(x) is a symmetric non-negative definite matrix, and E(x) and S(x) are scalar functions. We call L(x) the Poisson matrix, M(x) the friction matrix, E(x) the energy of the system, and S(x) the entropy of the system. We use \frac{\delta E}{\delta x} to denote the gradient of E; this notation is used to emphasize this this could be an infinite-dimensional system, and is standard in the literature.

Finally, we also have the *degeneracy conditions* of

and

GENERIC stands for “General Equation for Non-Equilibrium Reversible-Irreversible Coupling”. Essentially, one can think of a GENERIC system as consisting of some “reversible” dynamics, such as would come from classical mechanics or electromagnetics, and some “irreversible dynamics”, such as would come from resistive components like friction, resistors, diffusion, heat transfer, etc. The L(x) \frac{\delta E}{\delta x} component describes the reversible dynamics, and the M(x) \frac{\delta S}{\delta x} component describes the irreversible dynamics.

Each of L(x) and M(x) give rise to *brackets* of scalar functions, defined by

and

The bracket \{A,B\} is the classical Poisson bracket. These brackets are useful in describing the evolution of scalar functions according to GENERIC:

From this equation, we can investigate the evolution of energy and entropy. The equation for evolution of energy is

Then \{E,E\} = 0 by antisymmetry of L and [E,S] = 0 by the degeneracy condition, so energy is conserved. The equation for evolution of entropy is

By the degeneracy conditions, \{S,E\}=0, and because M(x) is non-negative definite, [S,S]\geq 0. Thus entropy always increases.

Now, the point of this post is to understand *exergy*. Exergy is defined to be “the amount of useful work which can be extracted from a system”. In the GENERIC setting, this is non-sensical, because there is no means for work to be extracted; the GENERIC equation presumes isolation. I have a hunch that a proper formalization of exergy can be derived from an open-systems perspective on GENERIC, which is in the works following the thread of Open classical mechanical systems via lenses. But for this post, we are just going to pretend to be a physicist, and play fast and loose with the math.

Assume that there are some quantities Q_1(x),\ldots,Q_n(x) which are *strongly conserved* by the evolution of the system. This means that

Additionally assume that these quantities along with S(x) are sufficient to constrain the energy of the system. That is, assume that if \vec{c} \in \mathbb{R}^{n+1}, then E|_{(S,\vec{Q})^{-1}(\vec{c})} is constant. For example, in the case of a gas, we might have Q_1 = V, the volume of the gas, and Q_2 = N, the number of particles in the gas.

We assume that we can “get work out” of the system by exchanging these conserved quantities with the environment. The environment consists of “generalized bath systems” for each conserved quantity, in the sense of Compositional Thermostatics, including a heat bath at constant temperature \frac{1}{\theta_0}, but possibly also a “pressure bath” and “chemical potential bath”. In this context, we find equilibrium by maximizing the quantity

The \lambda^i_0 here are intensive quantities like pressure and chemical potential, but also perhaps others like voltage or force.

We then let the equilibrium point x_{\mathrm{eq}}(\theta_0, \vec{\lambda}_0) be defined by

which we assume exists at a finite value of \Omega. We also generally assume that S is strictly concave, so that equilibrium point is unique. Note that \frac{\lambda_0^i}{\theta_0} and \frac{1}{\lambda_0} act like Lagrange multipliers here, so that at the point of equilibrium we have

We interpret this as implying that the system relaxes to an equilibrium where it matches intensive quantities with the environment.

Now, let’s see how much work we can get out of the system as it travels from x to x_\mathrm{eq}(\theta_0, \vec{\lambda}_0). Let \gamma be some path with \gamma(0) = x and \gamma(T) = x_{\mathrm{eq}}(\theta_0,\vec{\lambda}_0), and define

where \mathrm{d}W is a 1-form measuring the “useful power” we are getting out of the system as it tends toward equilibrium with the environment. To give a formula for \mathrm{d}W, assume that for each conserved quantity we can “exploit” the “generalized force differential” between the system and the environment to do some useful work. That is, if the system is hotter or colder than the environment, we can harvest the flow of entropy into the environment via a heat engine. If the system is at a higher or lower pressure than the environment, we can harvest the flow of volume into the environment via a turbine. If the system is at a higher or lower voltage than the environment, we can use the system to run some useful electronic circuit. And so on. We can measure these “generalized force differentials” via the difference between \frac{\partial E}{\partial Q_i} and \lambda_0^i, or in the case of heat differential, the difference between \frac{\partial E}{\partial S} and \theta_0.

This gives us a formula for \mathrm{d}W of

We can rewrite this as

By our assumption that E was constant when constrained to the joint level set of the Q_i and S, we have that

Thus,

This is simply a linear combination of exact 1-forms, so it is easy to integrate. Let

Then,

This expression for exergy is 0 precisely when the system is at equilibrium with the environment, and no useful work can be produced from it.

Now, we think of exergy as a *potential* for the system. Therefore, just like energy or entropy, we don’t really care if we add or remove constants from it. Thus, we can use a simpler expression for the exergy, which drops out all of the constant terms referencing x_{\mathrm{eq}}(\theta_0, \vec{\lambda}_0):

This is the form of exergy that shows up on Wikipedia (though, they use the letter B instead of A; I follow Markus’s lead in using A).

The beautiful thing about exergy is that, although I made all sorts of sketchy, shaky assumptions in deriving the form of exergy, I can *use* exergy to describe the evolution of the system without caring about how I derived it. Specifically,

because by the degeneracy conditions the cross terms are 0. Then by strong conservation, we can also throw in the other terms in A to get

This describes the evolution of the system purely in terms of the gradient of its exergy. Note that the only assumption I made about the Q_i now is that they are strongly conserved. From the perspective of “generating the evolution of the system”, then it appears to me that the exergy is highly non-canonical, and the choices of conserved quantities is essentially ad-hoc and only motivated by physical intuition.

However, exergy is highly interesting from an “operational” perspective. Namely, unlike entropy and energy, exergy can actually be measured by building a succession of ever more efficient devices for extracting energy from a given system via thermodynamic cycles that output the conserved quantities into the environment! Thus, I have some sympathy for the perspective that exergy is in fact the more fundamental quantity than energy and entropy, even though it seems somewhat ad-hoc in the way that I’ve presented it here. I’m not yet sure how to formalize “thermodynamic cycle” and “conserved quantity” and “environment”, but I think that once these are formalized, exergy will pop out naturally.

And, more importantly, exergy is highly useful in practice, as the success that Markus has had with his exergetic port-Hamiltonian systems has shown. So while there are still mysteries that I have about exergy, I hope that I now have enough intuition about it to allow me to help formalize the EPHS framework with an eye towards eventual computer implementation, so that engineers can access a powerful, flexible, and thermodynamically consistent system for modeling non-equilibrium thermodynamical systems.