A unified deduction of the expressions of exergy and flow exergy

Exergy analysis is a branch of thermodynamics receiving an increasing interest in the scientific literature and in didactic presentations. Exergy represents the maximum useful work obtainable by a system that can interact with a reference environment. There exist two exergy functions: exergy, which refers to a collection of matter contained within the reference environment; flow exergy, which refers to a collection of matter flowing in a pipe, that can interact with the environment and diffuse into it. The usual derivations of the expressions of exergy and flow exergy are either complicated or not general. Moreover, two separate derivations are necessary, due to the different conceptual schemes employed in the definitions of these properties. As a consequence, the expressions of exergy and flow exergy are often reported without a derivation in didactic treatises. In this paper, we provide a simple and general unified deduction of the expressions of exergy and flow exergy. Moreover, we show that the logical scheme proposed, based on the concept of useful energy of a system contained in a pressure field, allows a simpler deduction and a deeper interpretation of the energy balance equation for a control volume in a steady state. Finally, in order to complete the didactic treatment, we rewrite the expression of the molar exergy of a pure substance at ambient temperature and pressure in a form applicable to reactive substances, and we present an application of this form.


Introduction
In order to reduce the environmental impact of the use of fossil fuels, two ways are fundamental. One way is the development of technologies based on the use of renewable energy sources, such as wind, solar, geothermal and nuclear energy sources. The other way is improving the efficiency in the conversion of energy from the source to the utilization. A correct initial step towards learning how to design an efficient energy conversion system is to understand that not only the amount of energy used to obtain a result is important, but also the quality of that amount of energy. Mechanical energy is the highest-quality energy because an amount of mechanical energy can be easily transformed into the same amount of any other form of energy. Thermal energy is all the more valuable the higher its temperature is. It cannot be transformed completely into work; a part of it must be rejected to a lower-temperature thermal reservoir.
The key concept to compare correctly amounts of different kinds of energy is the concept of exergy.
Exergy can be defined as follows. Consider a system composed of three subsystems: a collection of matter, that we call system A; the environment of A, schematized as a reference thermal reservoir R 0 , with constant values of temperature, T 0 , pressure p 0 , and chemical potentials, μ i0 ; a cyclic device, X, namely an auxiliary system that performs thermodynamic cycles and is employed to transfer heat between A and R 0 , and work between A and a suitable mechanical apparatus. System A can exchange energy, volume and matter with R 0 , but the total volume of AR 0 is constant. We call exergy of A, in a state A 1 , the maximum work that can be obtained in an adiabatic process of the composite system AR 0 X, with initial state A 1 .
An alternative configuration of the composite system AR 0 X is as follows. The collection of matter A is not contained in R 0 but flows from the inlet to the outlet section a fixed region of space, called control volume, that remains in a stationary state. System A can exchange energy and matter with R 0 , and the volume of R 0 is constant. We call the flow exergy of A, in a state A 1 , the maximum useful work that can be obtained in an adiabatic process of the composite system AR 0 X, with initial state A 1 . The useful work differs from the total work because it does not include the work exchanged by A with the fluid that precedes the inlet section and with the fluid that follows the outlet section of the control volume. The concept of useful work will be sharpened in section 2.
For both exergy and flow exergy, in order to extract all the possible work, the initial state A 1 must be changed to a final state such that the system has the same temperature, pressure and chemical potentials as R 0 , i.e. is in complete thermodynamic equilibrium with R 0 . Contrary to energy, exergy is not conserved for an isolated system: it decreases due to the entropy production caused by irreversibilities.
The branch of thermodynamics that deals with the evaluation of the property exergy (or flow exergy) and with the analysis of the exergy (or flow exergy) destruction caused by irreversibilities is called exergy analysis. It is now recognized as an important branch of thermodynamics, aimed at the optimal use of energy resources in technological processes. Many scientific papers presenting results of exergy analysis appear every year in the literature. They concern, for instance, combined cycle power plants [1][2][3][4], steam Rankine cycles [5][6][7][8], organic Rankine cycles [9][10][11][12], refrigeration cycles [13][14][15][16], thermal and PV solar systems [17][18][19][20], fuel cells [21][22][23][24], heat exchangers [25][26][27][28]. Review papers on the exergy analysis of combined cycle power plants [29], steam power plants [30], solar energy applications [31], fuel cells [32], and heat exchangers [33] are available. In parallel with the growth of the scientific literature on this topic, the education on exergy evaluation and exergy analysis is developing. Courses on exergy analysis are present in many universities, and wide treatises on exergy analysis have been published [34][35][36]. In this framework, studies aimed at improving the didactic presentations of the expressions of exergy and flow exergy and of the methods to evaluate these properties for different systems appear as interesting.
Some authors [34][35][36][37] define exergy as the sum of different parts, namely kinetic exergy, potential exergy, physical exergy and chemical exergy. The kinetic exergy and the potential exergy are, respectively, the kinetic energy with respect to a reference system united with the Earth's surface, E k , and the gravitational potential energy with respect to a selected reference level, E p . If kinetic energy and potential energy are nonvanishing, they are obviously parts of the exergy, because they are already forms of mechanical energy.
The physical exergy of system A is the maximum amount of work that can be obtained by an adiabatic process of the composite system AR 0 X described before, if A is closed, no chemical reaction takes place, and the pressure and temperature of A are changed to the pressure p 0 and the temperature T 0 of R 0 . The chemical exergy of system A is the maximum amount of work that can be obtained by an adiabatic process of AR 0 X, if A is open, chemical reactions can take place, and the state of A is changed from the state with pressure p 0 and temperature T 0 mentioned above to a state with pressure p 0 and temperature T 0 in which the chemical potentials of the constituents of A are equal to those of the same constituents in R 0 . In this final state, the matter of A is indistinguishable from that of R 0 , and it is possible to think that all the matter of A has been transferred to R 0 .
Other authors [38][39][40] prefer not to employ the concepts of physical and chemical exergy, and to derive, either by steps [38,39] or directly [40], the expressions of the total exergy and of the total flow exergy of the system. These expressions reduce to those of physical exergy and physical flow exergy if A is closed and no reaction takes place. In this paper, after a brief survey of the literature on the definition of exergy, we present a direct deduction of a slightly generalized expression of the total exergy, that contains those of exergy and of flow exergy as special cases.
Brzustowski and Golem [38] derive from the basic principles of thermodynamics the following expressions of the exergy, Ξ, and the flow exergy, Ψ, of a collection of matter with r constituents Equations (1) and (2) refer to a collection of matter, hereafter called system A, that either is in a stable equilibrium state or is composed of subsystems in stable equilibrium states. Clearly, if A has kinetic energy and/or potential energy, these terms must be added to the exergy and to the flow exergy. In equations (1) and (2), U, S, V, H and n i are the internal energy, the entropy, the volume, the enthalpy and the number of moles of the ith constituent of A, T 0 and p 0 are the temperature and the pressure of the environment of A, R 0 , and m i0 is the chemical potential of the ith constituent of A, evaluated in R 0 . Both for exergy and flow exergy, the deduction is performed in two parts: first, the system is brought from its initial state to a stable equilibrium state with p = p 0 and T = T 0 called by the authors dead state, then, it is brought to its final state, in mutual stable equilibrium with the environment. The deduction is correct, but rather long. Moreover, it is not quite complete. In fact, the authors evaluate the maximum work obtainable in the process from the dead state to the final equilibrium state as the decrease in the Gibbs free energy of the system but do not prove the equality between maximum work and decrease in Gibbs free energy in that process.
Kotas [38] presents a rather complex scheme for evaluating exergy and flow exergy, where the fluid is supposed to pass through three modules: module A, where the fluid is brought by a physical process to a stable equilibrium state with p = p 0 and T = T 0 , called by the author constrained equilibrium state; module B, where the fluid undergoes a chemical reaction with some common constituents of the environment; module C, where the reaction products diffuse to the environment and unconstrained equilibrium with the environment is reached. The author does not obtain equations (1) and (2), because he considers only substances that react with the environment. In this case, equations (1) and (2) need further development, because the values of m i0 are not known.
Expressions of the decrease in exergy and flow exergy of a system A that undergoes a change of state A 1 → A 2 are derived by Gyftopoulos and Beretta [39]. The derived expressions agree with equations (1) and (2) and are obtained in three steps. First, the authors assume that system A can exchange neither volume nor matter with R 0 ; then, they assume that A can exchange volume, but not matter; finally, they assume that A can exchange both volume and matter with R 0 , and obtain the complete expressions of X -X 1 2 and of Y -Y . 1 2 In the deduction, the authors assume that no reaction occurs in the composite system AR 0 . Rigorous deductions of equations (1) and (2), where chemical reactions are considered, are presented by Zanchini and Terlizzese [40].
Szargut [34] suggests to evaluate the flow exergy of a substance flowing through a fixed boundary as the sum of the kinetic exergy, the potential exergy, the physical exergy and the chemical exergy, i.e. by the expression where E k is the kinetic exergy, E p is the potential exergy, Y ph and Y ch are the physical flow exergy and the chemical flow exergy, respectively. The author reports the following  (4) from the basic principles of thermodynamics is presented in [34]. Similarly, the author reports without deduction some expressions for the calculation of Ψ ch , and the relation between the flow exergy, Ψ, and the exergy Ξ Y = X + - where V is the system volume. Sala Lizarraga and Picallo-Perez [35] present exergy as the sum of kinetic, potential, physical and chemical exergy and focus on the non-obvious parts, namely physical and chemical exergy. They derive the expressions of the physical flow exergy, equation (4), and of the physical exergy of a closed system contained in R 0 , by energy and entropy balances. They define chemical exergy as the maximum useful work that can be obtained when the state of the system is changed from ( ) T p , 0 0 to complete mutual equilibrium with the environment, and prove that the maximum useful work equals the decrease in Gibbs free energy of the system. They do not propose compact expressions of the total exergy and flow exergy of the system.

Eur. J. Phys. 44 (2023) 045103 E Zanchini
Dincer and Rosen [36] report, without deduction, expressions of exergy and flow exergy written as sums of physical exergy, or physical flow exergy, chemical exergy, kinetic exergy and potential exergy. In the case of vanishing kinetic and potential energy, the sums yield the following expressions of exergy and flow exergy: In equations (7) and (8): T 0 and p 0 are the temperature and the pressure of the reference environment R 0 ; m i0 is the chemical potential of the ith constituent of the system in the state of complete mutual equilibrium with R 0 ; U, S, V, and H are the internal energy, the entropy, the volume and the enthalpy of the system in its initial state; i 0 0 are the internal energy, the entropy, the volume, the enthalpy and the chemical potential of the ith constituent of the system in the state (T 0 , p 0 ) of constrained mutual equilibrium with R 0 , that is reached from the initial state without matter exchange or chemical reactions. The terms preceding the summation correspond to the physical exergy in equation (7) and to the physical flow exergy in equation (8). Although written in a different form, equations (7) and (8) agree with equations (1) and (2). In fact, equation (7) can be written, for instance, as where the term in square brackets is vanishing, on account of the Euler equation.
Since recent and wide treatises on exergy analysis, such as [34] and [36], report the expressions of exergy and flow exergy without derivations, it is reasonable to argue that the available derivations of these expressions are not completely satisfactory for didactic use. Indeed, most derivations are either complicated or not completely general. The simplest ones [39] do not consider the possibility of chemical reactions. Moreover, at least two separated derivations for Ξ and Ψ are necessary if the usual schemes are adopted. Several authors [35,39] prefer to introduce gradually the concepts of exergy and flow exergy, starting from the simplest cases and presenting a separate derivation for each case. Although this can be a good teaching method, a simple and general unified deduction of the expressions of Ξ and Ψ can be interesting for postgraduate programmes in Energy Physics and Energy Engineering, either as an alternative to traditional procedures, or as a synthetic complement. A conceptual scheme that allows a unified deduction of the expressions of Ξ and Ψ has been proposed in [41]. However, this reference has not been written for didactic purposes and employs a rather difficult axiomatic language. Here, the same method is proposed in a simplified form, suitable for didactic presentations. Moreover, it is shown that the logical scheme employed, based on the concept of useful energy of a system in a pressure field, allows a simpler proof and a clearer interpretation of the energy balance equation for a control volume in a steady state.
2. Useful energy of a system in a pressure field Consider a close system A embedded in an external pressure field p e (x, y, z), and a process A 1 → A 2 of A in which the region of space occupied by A changes from V 1 to V 2 . The energy balance equation for the process is where E A is the energy of A, Q is the quantity of heat absorbed by A and W is the work performed by A. A part of the work W is performed unavoidably against the external pressure field, and cannot be collected as a useful result. The remaining part of the work, which is performed against the other external forces, will be called useful work, denoted by W u . Thus, for any process of A, one has where W pe is the work performed against the external pressure field p e (x, y, z). Let us clarify the meaning of useful work by means of a simple example. Consider a gas, A, contained in a vertical cylinder whose top is a frictionless moving piston, with area S. The gas performs a quasistatic expansion with constant pressure p, from volume V 1 to volume V 2 , i.e. from the level z 1 to the level z 2 of the surface between the gas and piston. The expansion work W = p (V 2 −V 1 ) = p S (z 2 −z 1 ) is used to raise a weight. If the external pressure is vanishing, the gas rises a weight with mass m such that p S = m g, where g is the gravitational acceleration, and the whole work W = p S (z 2 −z 1 ) = m g (z 2 −z 1 ) is transformed into the desired effect, namely into the potential energy of the weight. If the external pressure is p 0 > 0, a part of the pressure p of the gas is balanced by p 0 , and the mass m' of the weight that can be lifted is given by (p−p 0 ) S = m′ g. Thus, only the part (p-p 0 ) S (z 2 −z 1 ) = m′ g (z 2 −z 1 ) of the work W is transformed into the desired effect, namely into the potential energy of the weight. This part is called useful work, denoted by W u .
The substitution of equation (11) in equation (10) yields It is easily proved that 2 1 In fact, let V be the region of space occupied by A at an instant of time t, and let S be the external surface of V. As illustrated in figure 1, in an infinitely short time interval, dt, the external surface of A displaces from S to S′. Consider an infinitely small element dS of S, in the neighborhood of a point P, that undergoes an infinitely small displacement dl. The force that must be exerted on dS in order to balance the external pressure where n is the unit outward normal to S in P. The work performed against the external pressure to produce the displacement dl of dS is where dh is the height of the prism between dS and dS′, dV is the volume of the prism, the sign + holds if dl has the same direction as the outward normal, n, so that dV is gained by A, and the sign-holds in the opposite case, i.e. when dV is lost by A. If one considers the integral over S of the infinitesimal work quantities d ¢ W , and denotes by D + V the sum of the volume elements gained by A and by D -V the sum of the volume elements lost by A, one obtains, for the whole infinitesimal displacement of S ò ò ò If one now considers the sequence of the infinitesimal deformations of S that yield the displacement of A from V 1 to V 2 , one obtains equation (13).
By substituting equation (13) in equation (12), one gets We call useful energy of a system A embedded in an external pressure field p e (x, y, z) the quantity By this symbol, we write equation (16) in the form For a system composed of simple subsystems, each in stable equilibrium except for a motion of the whole subsystem in a uniform gravity field, the useful energy can be expressed as where E k is the kinetic energy, E p is the gravitational potential energy, and U is the internal energy, namely the sum of the internal energies of the subsystems. An interesting special case occurs when, in every state considered, the external pressure surrounding the system is uniform and equal to the pressure p of the system. In this case, equation (19) becomes where H is the system enthalpy.
Equations (18) and (20) yield directly the energy balance equation for control volume in a steady state, crossed by a fluid flow. The only effect of the process, in a time interval Δτ equal to the inverse of the mass flow rate, is as follows: the unit mass of fluid is transferred from the inlet section, 1, to the outlet section 2, with production of the useful work w u and exchange of the heat quantity q. For the process 1 → 2 of the unit mass of the fluid, equations where lowercase letters denote quantities referred to the unit mass. Consider now a process A 1 → A 2 of a closed system A, such that the change in kinetic and potential energy is vanishing, no useful work is performed, and in the states A 1 and A 2 the external pressure p e is uniform and equal to the pressure p of A. Equations (18) and (20)  Equation (22) is often derived in textbooks with the unnecessary assumptions that the process of A is quasistatic and at constant pressure. There is no need for the process to be quasistatic, and for the final pressure to be equal to the initial one.

Generalized exergy
In this section, we state a slightly generalized definition of exergy, which we call generalized exergy, and derive its expression. Generalized exergy includes exergy, flow exergy and all the other known availability functions as special cases.
Consider a system A, embedded in an external pressure field p e (x, y, z), that is open and can interact with an open reference thermal reservoir R 0 , with the aid of a cyclic device, X, as is represented in figure 2. System A can exchange energy and matter with R 0 ; the latter contains all the constituents of A and crosses only stable equilibrium states with fixed volume, temperature, T 0 , pressure, p 0 , and chemical potentials, μ i0 . We call the generalized exergy of A in any state A 1 , denoted by X , g1 the maximum useful work that can be obtained by an adiabatic process of the composite system AXR 0 , starting from the initial state A 1 .
Clearly, the maximum useful work can be obtained when all the matter of A is transferred to R 0 , i.e. when the final state of A is such that the system has vanishing mole numbers and volume. In this condition, only the system R 0 remains available, in a stable equilibrium state with a fixed volume, and no more useful work can be obtained, on account of the impossibility of a perpetual motion machine of the second kind. We will denote by A 0 the end state of A, by R 1 0 and R 2 0 the initial and the final state of R 0 , and will determine the expression of X .

g1
On account of equation (18), the useful work obtained in an adiabatic process of AXR 0 with the change of state A 1 → A 0 of A is equal to the decrease in useful energy of the composite system AR 0 . Since the useful energy of A in the final state A 0 is vanishing, one has The Gibbs equation for R 0 , which has constant volume and constant values of T 0 , p 0 , and μ i0 , yields are the entropy and the number of moles of the ith constituent of R 0 . By substituting equation (24) in equation (23), one gets Assume, provisionally, that no chemical reaction occurs in the whole system AXR 0 . Then one has, for each constituent The principle of entropy nondecrease yields, for every adiabatic process is the entropy production in the process. Since By substituting equations (27) and (29) in equation (25), one obtains Clearly, the maximum useful work, X , g1 is obtained in every reversible adiabatic process A 1 → A 0 of AXR 0 , where = S 0, irr and is given by We prove now that equation ( (27), equation (31) still holds.
If system A is composed of simple subsystems, each in stable equilibrium except for a motion of the whole subsystem in a uniform gravity field, equation (19) holds, and equation (31) yields, for every state of A ò å m Since E k and E p are obvious parts of Ξ g , whenever they are nonvanishing, we will use in the following the simpler notation where it is understood that the properties without the subscript 0 refer to system A.
4. Special cases: exergy, Keenan's availability function, physical exergy, available energy, flow exergy, flow availability and physical flow exergy In this short section, we show that the exergy function given by equation (38) includes as special cases all the known availability functions. If the external pressure field is uniform, and has a value equal to the pressure p 0 of R 0 , equation ( If, in addition, system A is closed, the summation term in equation (24), that yields the summation term in equations (31), (38) and (39) is vanishing, because there are no changes in the mole numbers of R 0 . Thus, the exergy of a closed system is given by is often called Keenan's availability function. Therefore, if a closed system A and undergoes a change of state A 1 → A 2 , its decrease in exergy is given by Equation (41) holds even if chemical reactions take place in A because no assumption on the existence of chemical reactions is needed to obtain equation (40). If the state A 2 has pressure p 0 and temperature T 0 and is denoted by the subscript 0, and no chemical reaction occurs, the right-hand side of equation (41) coincides with that of equation (6) and yields the physical exergy.
If system A is closed and undergoes a change of state A 1 → A 2 , the volume of A does not change or the external pressure field is vanishing, equation (40) yields where the function W = -U T S 0 is often called available energy. Like equation (41), equation (42) holds even if chemical reactions take place in A.
If the external pressure field is uniform in the region of space occupied by A, and its value is equal to the pressure p of A, equation ( If, in addition, system A is closed, the summation term does not appear in equation (43), so that the flow exergy becomes Therefore, if a closed system A in steady flow undergoes a change of state A 1 → A 2 , its decrease in flow exergy is given by where the lowercase letters ξ, ψ, u, v, s, and h denote the molar properties, and m 0 is the chemical potential of the substance under exam in the reference thermal reservoir, R 0 . The basic point is to determine ξ and ψ for T = T 0 and p = p 0 . In fact, values for different temperatures and pressures can be then determined by the standard methods of thermodynamics, through the relations Therefore, in this section we illustrate how to determine the molar exergy and the molar flow exergy of a pure substance at T = T 0 and p = p 0 . If p = p 0 , exergy and flow exergy coincide. We will refer to the molar exergy, ξ, and we will select the atmosphere in thermodynamic equilibrium as the reference thermal reservoir. Consider, first, a pure substance, A, that is nonreactive with atmospheric gases. For one mole of A, at T = T 0 and p = p 0 , equation (46) yields where we have used the equality between the molar Gibbs free energy, g A , and the chemical potential, m , A and we have specified that the chemical potential of a gas A in the atmosphere, m , A0 is equal to the chemical potential of A at T 0 and at the partial pressure p A0 of A in the atmosphere.
For a nonreactive substance A, the value of p A0 is known and x ( ) T p , A 0 0 can be easily determined. For instance, if A is an ideal gas, by considering that m A = g A = h A −T 0 s A and that h A depends only on temperature, one has where R is the universal gas constant, R ≈ 8.314 46 J (mol K) −1 , and y A0 is the molar fraction of gas A in the atmosphere. Consider now a pure substance, F, such as a fuel, that is reactive with atmospheric gases. For one mole of F, at T = T 0 and p = p 0 , equation (46) yields, in analogy with equation This time, however, the value of the partial pressure p F0 is not known. Even if measured values of the molar fractions of some gaseous fuels in the atmosphere are available, these values do not correspond to a true stable equilibrium state of the atmosphere, and cannot be used in equation (52). Therefore, equation (52) requires further processing. If we denote by ν i the stoichiometric coefficients of the reaction of F with atmospheric gases, and by p i0 the partial pressures in the atmosphere, the condition of chemical equilibrium in R 0 yields , , Since both reactants and reaction products are ideal gases in the atmosphere, one has The sum of the first two terms of the right-hand side of equation (  where DG 0 0 denotes the standard Gibbs free energy of reaction, and y i0 denotes the molar fraction in the atmosphere of the ith substance that takes part to the reaction. The first term, -DG , 0 0 can be calculated as [39] - , 62 The numerical value can be found in CRC Handbook of Chemistry and Physics [42], or in NIST-JANAF Thermochemical Tables [43]. The second term in the right-hand side of equation (61)  As an example of evaluation of the molar exergy of an ideal gas nonreactive with the atmosphere, let us calculate the molar exergy of oxygen at T 0 = 298.15 K and p 0 = 1.013 25 bar, with relative humidity of the atmosphere 0.5. By applying equation (

Conclusion
A unified deduction of the expressions of exergy and flow exergy has been presented, suitable for didactic presentations in postgraduate programmes in Energy Physics and Energy Engineering. The proposed derivation yields a broader exergy function, that includes the usual functions exergy and flow exergy as special cases, and is based on the concept of useful energy of a system in an external pressure field. Moreover, it has been shown that this concept allows a straightforward deduction and a deeper interpretation of two widely employed thermodynamic equations: the energy balance equation for a control volume in steady state; the equality between enthalpy change and heat received in a process of a closed system that exchanges work only with the external pressure, if the latter is equal to the pressure of the system in the initial and in the final state. Finally, the expression of the molar exergy of a pure substance at ambient temperature and pressure has been rewritten in a form applicable to reactive substances.

Data availability statement
No new data were created or analysed in this study.

Conflicts of interest
The author has no conflicts to disclose.