8. Second Law of Thermodynamics - Directionality of Processes, Entropy, Heat Engines and Refrigerators#
So far, we have focused our attention on evaluating properties of substancies (e.g., enthalpy, volume) using various techniques and evaluating processes by applying the First Law of Thermodynamics, or conservation of energy. And we know that if the First Law of Thermodynamics is not satisfied then a process or cycle is not possible. Yet, there are numerous situations where the First Law of Thermodynamics is satisfied but the process is still not possible. For example, consider a closed system with a paddle wheel contained within it. We know from experience that if we do work to the system by rotating the paddle wheel, that the system will heat up, its internal energy will increase, etc. Yet, the reverse will not happen - i.e., we cannot heat up the system and spontanesouly expect the paddle wheel to rotate, resulting in work done by the system. Yet this in no way would violate the first law of thermodynamics. This implies that there is a directionality associated with processes that is important, and it is the directionality of a process that is the realm of the Second Law of Thermodynamics. Thus, the Second Law of Thermodynamics adds further constraints to processes on top of the First Law. In fact, we will learn that no real process will happen spontaneously without an increase in a thermodynamic property which we will learn about called entropy (\(S\)). Simply put, entropy must always be increased for a process to occur (or for a reversible process, which is not possible in reality, entropy remains unchanged). Entropy can be thought of as a driving force for energy exchange - i.e, if it can be increased then energy transfer will occur. It is because of the Second Law that heat always flows from hot reservoirs to cold reservoirs, that pressures tend to equalize and that gases mix. In all of these cases we can show that entropy increases as a result. This is not to say that entropy cannot be decreased locally, but only that the total entropy of the control volume (i.e., the system) and the surroundings must be increased for a process to occur. As a result, the second law of thermodynamics is sometimes referred to as the increase in entropy principle.
In the remainder of this chapter will will motivate the idea of process directionality from a qualitative perspective and build on the concept of entropy and increasing entropy (or entropy generation) as a necessary condition for a process to occur. In later chapters we will build a mathematical framework for the description of entropy.
8.1. Directionality - Qualitative Motivation through Heat Engine Thermodynamic Cycles#
As mentioned prior, we are already innately aware that there is a directionality to processes. Energy always flows from hot to cold, which really means from low entropy to high entropy - if the reverse were true then your cup of hot coffee would continue to increase in temperature and the surroundings would cool. Gases that are well mixed such as nitrogen and oxygen do not spontaneously separate, and so on. This directionality has profound influences on thermodynamic processes and cycles and can be exemplified through the introduction of a heat engine. A heat engine operates on a thermodynamic cycle and is a device that takes advantage of the flow of heat to produce work. Now, when we mention the production of work within the context of a thermodynamic cycle, which we have learned prior means that we start and end at the same thermodynamic state, what we really mean is the net production of work resulting from the thermodynamic cycle. The entire framework for the Second Law of Thermodynamics was originally conceived by Sadi Carnot, who developed the concept of a heat engine and who at the time had no concept of entropy as a thermodynamic property. Yet, he recognized that it is impossible for any heat engine that operates on a cycle to produce a net amount of work without absorbing heat from the surroundings at a high temperature and rejecting a portion of it back to the surroundings at some lower temperature. That is, it is impossible to convert 100% of heat into work if operating on a cycle, and the direction of heat flow is from hot to cold. A schematic of an impossible process can be seen on the left side of Figure 8.1, where there is no heat rejection and thus no net work can be produced. Rather, some portion of the heat must be rejected at a lower temperature, as seen on the right side of Figure 8.1. And Carnot further observed that heat has an innate quality tied to it that is related to the heat engine efficiency, that is, the higher the temperature heat source the more efficient the heat engine can operate - we will learn later that this quality is closely tied to entropy. Carnot’s insights eventually formed the framework for one variation of the Second Law which is called the Kelvin-Plank statement. The Kelvin-Plank statement states that “It is impossible to construct a device that will operate in a cycle and produce no effect other than the raising of a weight and the exchange of heat with a single reservoir”.

Fig. 8.1 An example of an impossible process (left) which violates the second law of thermodynamcs because 100% of thermal energy cannot be converted to work. Rather, some smaller portion of the incident energy must be rejected at a lower temperature, as seen on the right side.#
The process of converting heat into work via a heat engine and two thermal reservoirs can be imagined similarly to a turbine producing work from the flow of liquid (e.g. a waterfall). If we wish to extract work from the potential energy of water at a high elevation, we can use a turbine, but we still must release the water at some lower elevation (and lower potential energy). Otherwise, the exiting fluid would quickly rise in elevation, and an equilibrium would be established such that the exit and inlet heights are the same and the turbine ceases to rotate. Thus, just as fluid flow will always spontaneously occur from high elevation to low elevation, but never the reverse, heat flow will always spontaneously travel from high temperature to low temperature. And if we wish to extract work we must still reject some portion of the energy flow at a lower quality than the inlet.
Let’s conceptualize why this must be true. Imagine a cycle that starts in one state, for example at given temperature, and we aim to extract energy in the form of work by adding heat to the system. For example, we could heat a piston filled with a gas and it will expand, producing work. An example is shown below in Figure 8.2 where in the first 4 iterations we raise a mass (shown in green) to a higher elevation. Yet, to complete the cycle, we will have to get back to our original state. One way to do this would be to follow the same path that we took to extract the work, by replacing the mass and then rejecting heat at the same high temperature (shown in the remaining iterations in Figure 8.2) but then this would mean that the same amount of energy we got out in the form of work would have to be put back into the process (assuming both were reversible). Thus there would be no net production of work and our heat engine will not operate.

Fig. 8.2 An example of an impossible process heat engine.#
This means that we must take a different path back to return to our original state if we want the chance of producing a net amout of work. What the system would have to do, it turns out, is to reject heat, and then compress the piston along a different path to get back to our original state. This is shown in Figure 8.3, where he piston is lowered first by rejecting heat to a low temperature reservoir. Then, to return to our initial state we can further compress the system by adding the mass back to the top of the piston, but from a lower elevation that before, thus requiring less work. In this way, we can decrease the work requirements to return to our original state, resulting in some net production of work. There are only two ways to impact the state of the system (and internal energy, volume, entropy etc) - through work or heat exchange - and by rejecting heat at a lower temperature instead of doing work following expansion, we can also locally decrease the energy and entropy of the system to help approach its initial value. The inevitable result is that if we return to our original state that the entropy (and energy, volume, etc) remain unchanged within the control volume, and thus the entropy will have to increase in the surroundings (unless we had a completely reversible heat engine). More on this later.

Fig. 8.3 An example of a simple heat engine that works by rejecting heat at a lower temperature than it is absorbed.#
8.2. Directionality - Entropy is Multiplicity Maximization#
And now the logical questions is, why must heat always flow from hot to cold in a spontaneous process, and not vice versa? Why should gases spontaneously mix and not separate, why do gases expand in closed systems, and why do chemical reactions spontaneously occur in one direction but not the reverse, for example the combustion of hydrocarbons even if energy is conserved in an adiabatic chamber. The reason for this, in all of the above cases and more, is that the entropy is maximized. And whenever there is the potential to increase entropy, a process will spontaneously occur (given sufficient time). Then the next logical question is, what is entropy? Although you may have learned prior it is a measure of disorder of the system (and this analogy can be useful), a better explanation, I think, is that entropy is simply related to the number of possible ways a system can be arranged or configured from a microscopic perspective, referred to as the multiplicity (\(W\)) of the system. It is purely a statistical phenomenon - the system will always tend towards the state in which it can be arranged the greatest number of ways. For example, lets consider why gases tend to want to disperse. If we have a system of two particles (e.g., gas molecules) which can be distributed in any of 4 different boxes like shown below in Figure 8.4 (imagine the number of boxes is related to the volume of the system), it is statistically more probable to find them in separate boxes rather than in the same. There are 4 configurations we can envision in which they are the same box (left side) and 6 in which they are separated (right side). And as the number of boxes increases, the chances that they are found in the same box become less probable. For example, if the number of boxes increased to 8, then there are only 8 configurations where they can be in the same box but 28 where they are different. When considered on the scale of real systems, with orders of magnitude more molecules, the probability of finding the molecules in a configuration not well dispursed becomes vanishingly small as the multiplicity increases. And thus from a statistical perspective, there are many more configurations available in which the molecules are well dispersed rather than confined near each other. Interestingly, this approach does not assume that it is impossible that the molecules remain in a clumped together configuration - is only statistically improbable. That is, the most statistically probable configuration is the one which is most likely to occur, and the most statistically probable outcome is the one with the largest number of possible configurations. Entropy is simply a measure of the number of ways we can arrange a system and thus this tends to want to be maximized because it is statistically more probable. Another way to think about multiplicity is that as it increases, our our uncertainty about the location of the molecules decreases. We can decscribe the multiplicity of a system (\(W\)) mathematically as
where \(N\) is the number of objects (in this case boxes) with i categories (in this case a box is either empty or not, so two categories). For example, in the case of both particles contained in the same box only 1 is not emtpy, thus, \(N\) = 4, \(n_\rm {1}\) = 1 and \(n_\rm {1} = 3\). For the case of finding both particles in separate boxes, only 2 are empty, and thus, \(N\) = 4, \(n_\rm {1}\) = 2 and \(n_\rm {1} = 2\).

Fig. 8.4 Why do gases tend to disperse rather than clump together? There are more ways to arrange the system in the latter case, thus the multiplicity, and entropy are greater. As seen on the left, there are 4 ways to arrange 2 gas molecules both in the same cube, with the remaining 3 empty. But if two are filled and two empty (more dispersed), when we can arrange the system 6 ways. Thus, the multiplicity of the latter is greater, thus also the probability that this outcome will occur. Entropy is simply a measure of the multiplicity - the system will more likely be in the configuration that maximizes multiplicity (because it is statistically more probable). So to will the entropy always be maximized.#
A slighty more complex example can be used to show why heat flows from hot to cold - as you may have guessed it is because entropy is maximized. For this example, lets consider two separate and isolated systems, A and B, that are brought into thermal contact and allowed to exchange heat, as illustrated below in Figure 8.5. The internal energy of these systems are dictated by 1) the number of particles (e.g., gas molecules) in the system and 2) whether or not those particles are energized (\(\epsilon\)). For this example we are considering only very simplified systems with only a limited number of particles and limited energy states equal to only 0 or 1. System A is initially composed of 5 particles (\(N_\rm {A} = 5\)) with internal energy (\(U_\rm {A} = 2\)) and System B is initially composed of 5 particles (\(N_\rm {A} = 5\)) with internal energy (\(U_\rm {A} = 4\)), shown schematically on the top of Figure 8.5. Note that because the particles can only have energies of 0 or 1, system A must have two energized particles and system B must have 4. We can calculate the multiplicity to see the number of ways in which we can arrange each of these systems, according to (8.1), and we see that for System A, \(W\)A = 10 and for System B, \(W\)B = 5. Now, initially Systems A and B cannot exchange heat but we can consider the total multiplicity of the combined systems by drawing a control volume around both systems, shown in the green dash-dotted line. For the combined number of configurations it is simply the product of each (e.g., 10 configurations of A with the 1st of B, 10 configurations with the 2nd, and so on). So, the total multiplicity for systems A and B is 50.
Now, if the adiabatic barrier between A and B is removed and energy can be exchanged, then the internal energy of each system can change but the total internal energy of the combined systems must remain constant (\(U_\rm A\) + \(U_\rm B\) = 6). We could imagine a scenario where the internal energy of A decreases to 1 and B increases to 5, in which case \(W\)A = 5 and \(W\)B = 1 and thus \(W\)total = 5 which is lower than the initial value. Thus, this is not statistically probable and therefore the energy flow will likely not be from cold to hot. However, consider the reverse case of heat transfer from hot to cold, in which case the internal energy of A could increase to 3 and of B could decrease to 3. This scenario is shown on the bottom of Figure 8.5. In this scenario, \(W\)A = 10 and \(W\)B = 10 and thus \(W\)total = 100 which is greater than the initial value of 50. Thus it is statistically more probable that energy will flow from the hotter system B to the lower temperature system A. Although we have only shown a few scenarios, ultimately the energies of each system will be determined by maximizing the multiplicity by considering all possible scenarios - however it turns out that the final condition considered here is where multiplicity is maximized. Thus, we can see that energy tends to want to flow from hot to cold (i.e., in this case higher specific internal energy to lower) and it does so because there are more ways to configure the system. Thus, it is statistically more probable that this occurs. And as mentioned, entropy is a measure of the multiplicity of the system and since this tends to want to increase, the entropy as well can be considered to want to increase.

Fig. 8.5 An example showing why energy tends to want to flow from higher temperature to lower. On the top two systems are isolated with different internal energies (i.e., different temperatures) and the total multiplicity of the combined systems is 50. When we allow energy to transfer by removing the adiabatic barrier, as shown on the bottom, the multiplicity is increased when the internal energy of B decreases and A increases. Thus, there are more ways to arrange this system and therefore it is more statistically probably. Thus, we can see the multiplicity and thus entrpoy increase if energy flows from hot to cold. In the reverse case the multiplicity and entropy would decrease below the initial value, which is statistically improbable.#
This insight leads to a different variation of the second law of thermodynamics - i.e., there is no process which results only in the transfer of heat from a cold reservoir to a hot reservoir. For this to be possible, work from an external source would have to be done to the system. This is commonly referred to as a heat pump, or refrigeration cycle. This was first formulated as the Clausius Statement. It states that “It is impossible to construct a device that operates in a cycle and produces no effect other than the transfer of heat from a cooler body to a warmer body.” And from our statistical example above, we know that the reason for this has to do with multiplicity, or entropy, and its tendancy to be maximized.
8.3. Thermodynamic Driving Forces#
Now, at this point we have shown that multiplicity tends to increase for spontaneous processes - i.e. as processes go towards equilibrium their multiplicity increases. Further, we have said that multiplicity is a measure of entropy - but this has not been proven. Specifically, for now let’s postulate the following since as of yet entropy has not been definied explicitly.
We have shown that \(W\) depends on volume (\(V\)) and internal energy (\(U\)). For example, W increases as N (e.g., the number of boxes in Figure 8.4, or volume) increases, keeping the number of particles constant. Further, W decreases as the internal energy decreases, also keeping the number of particles constant, as was shown in Figure 8.5. We can also shown that \(W\) is a function of the number of particles in the system. For example, imagine in Figure 8.5 that System A was initially composed of 6 particles instead of 5, with the same total internal energy. With 6 particles the multiplicity is 120 versus only 10 in the case of 5 particles. Thus, we can say the the multiplicty is a function of \(U\), \(V\) and the number of particles \(N\)a, or
and because \(S \propto W\)
For the time being we will consider only systems where the number of particles remains constant to simplify analysis. Further, all of our prior examples of thermodynamic systems were such that \(N\)a = constant. I.e., they were constant mass and there were no chemical reactions considered that could change the number of moles. Thus we can say the following for \(N\)a = constant.
Taking the derivitive we can see how this depends on variations of the independent properties \(U\) and \(V\).
With this as a starting framework, lets evaluate two different processes as they approach equilibrium. For this we will make one important assumption, of which we can later test the validity. This assumption is that the entropy is an extensive thermodynamic property of the system, and therefore dependent on the system size, just like internal energy and volume. We know that extensive thermodynamic properties are additive.
8.3.1. Process 1 - Constant Volume Equilibration#
Consider two separate systems, A and B, as shown in Figure 8.6 initially at different temperatures and internal energies, both with fixed volumes, separated by an adiabatic barrier. Then, the barrier is now diathermal and allowed to transfer heat until the total combined system (A + B) is equilibrated. We know from our prior example that at equilibrium, entropy is maximized and thus we can say that at the final state \(dS = 0\). Further, because each of the subsystem volumes are constant, then the total system volume must also be constant, or \(dV = 0\).

Fig. 8.6 For two fixed volume systems that are initially isolated and then allowed to exchange heat, it is equilibration of temperatures that dictates equilibrium.#
Conservation of energy states that the total internal energy of A and B must remain constant, and that the energy gained in one is lost in the other, i.e.
and
Starting from (8.6), recognizing \(dV = 0\) for each sub-system, as we approach equilibrium we can say for each of our two systems that
And because of our assumption that entropy is an extensive thermodynamic property, the total system entropy at equilibrium is
Substituting from above
and substituting (8.10)
This can be rearranged to show
In other words, at equilibrium
Now, this begs the question - what thermodynamic property of system A and system B are equal to each other at equilibrium that could represent the partial differentials that must be equal? The answer is intuitive - temperature! The thermodynamic property that is a driving force for energy exchange is temperature, not internal energy, volume, etc. Therefore, we can say that
or more generally
The reason that temperature is inverted has to do with the fact that we know enrgy flow must be from hot to cold and the entropy maximized. If instead we said \(T=\left( \frac{\partial S}{\partial U} \right)_{\rm V, N_a}\), the entropy change towards equilirium dS would be negative unless the energy flow were from cold to hot. You can convince yourselve with a quick calculation. Thus, we can say for fixed volume systems, temperature is the driving force for heat exchange and that it is equalized when the system reaches equilibrium.
8.3.2. Process 2 - Variable Volume Equilibration#
Consider two separate systems, A and B, as shown in Figure 8.7 initially at different temperatures and internal energies, separated by an adiabatic fixed barrier. Then, the barrier is allowed to conduct heat and move, enabling system A and B to exchange heat and work (but not with the surroundings) until the total combined system (A + B) is equilibrated. Again, we know from our prior example that at equilibrium entropy is maximized and thus we can say that at the final state \(dS = 0\).

Fig. 8.7 For two systems that are initially isolated and then allowed to exchange heat and work via a diathermal and movable membrane, equilibrium occures when the temperature and pressure of each side are equaized.#
Conservation of energy states that the total internal energy of A and B must remain constant, and that the energy gained in one is lost in the other, i.e.
, and
Because the total volume of the combined systems is constant we can also say that
Thus, starting from (8.6), as we approach equilibrium we can say for each of our two systems that
And because of our assumption that entropy is an extensive thermodynamic property, the total system entropy at equilibrium is
Substituting (8.25) and (8.26) into (8.27), then substituting (8.23) and (8.24) and rearranging we can see that
We know that at equilibrium the left hand terms equal zero because \(T_{\rm a}\) = \(T_{\rm b}\) and \(\frac{1}{T}=\left( \frac{\partial S}{\partial U} \right)_{\rm V}\). Therefore the terms \(\left( \frac{\partial S}{\partial V} \right)_{\rm U}\) for systems A and B must also be equal. Does this partial differential also equal some measurable property like in the prior example where \(\frac{1}{T}=\left( \frac{\partial S}{\partial U} \right)_{\rm V}\)? To see, let’s first consider the units of entropy. We know that \(\frac{1}{T}=\left( \frac{\partial S}{\partial U} \right)_{\rm V}\), and thus S has units kJ/K. Thus entropy per unit volume should have units kJ/K/m3. This can be rearranged as kN/m2/K which is the same units as we would expect for the ratio of properties, \(p/T\). And therefore, not surprisingly it turns out that \(\left( \frac{\partial S}{\partial V} \right)_{\rm U} = \frac{p}{T}\). That is, equilibration between systems with a diathermal and movable barrier results in the equality of the ratio of temperature to pressure. Physically, this make sense, as we intuitively know that the system at equilibrium should have equal temperatures and pressures.
8.4. Thermodynamic Definition of Entropy#
Recall that we started with the discussion above with the assumption that entropy is proportional to multiplicity, and thus a function of energy and volume, or
We then took the derivitive of this function and saw that
Which reduces to the following because \(\left( \frac{\partial S}{\partial U} \right)_{\rm V} = \frac{1}{T}\) and \(\left( \frac{\partial S}{\partial V} \right)_{\rm U} = \frac{p}{T}\).
Now, consider a reversible expansion or compression process of an ideal gas. Recall from Section 6.1 More on Boundary Work - Reversible Processes that a reversible process is one in which occurs very slowly and is not possible in reality - but it represents an ideal process. We can relate the reversible boundary work (\(\delta W_{\rm rev}\)) to \(pdV\), or
We also know from the First Law of Thermodynamics that
Thus, we we can substitute (8.32) and (8.33) into (8.31) to show that
or
and also
Now, although there are infinite number of pressure volume temperature paths that we could take to go from State 1 to State 2 (and thus varying degrees of reversible work), the change in entropy is only dependent on the heat transfer to or from the system. This is significant because it ties the entropy change of the system to a measureable quantity, namely the heat transfer, rather than relating it to probabiities or multiplicity which is not readily measurable. Also, significantly, it shows that the entropy of the system can be increased or decreased, depending on the direction of heat transfer, lending credence to the idea that entropy can be decreased locally at a system level, which partly explains how order can rise from apparant disorder.
8.4.1. Example - Evaluating Reversible Heat Transfer Using Entropy#
A piston cylinder maintaining constant pressure contains 0.1 kg saturated liquid water at 100°C. It is now boiled to become saturated vapor in a reversible process. Find the work term and then the heat transfer from the energy equation. Find the heat transfer from the entropy equation, is it the same?
Solution - If using the energy equation, for a closed system like this, \(\Delta U = Q_{\rm net}- W_{\rm net}\), and because this is a constant pressure process \(W_{\rm net}=P \Delta V\). Thus, the heat transfer can be solved knowing internal energy and volume at the initial and final states. Or, more simply we can also say \(Q_{\rm net}=\Delta H\) because the process is constant pressure. We can use Cantera to solve.
If using the entropy equation from above (8.37), \(\delta Q_{\rm rev} = TdS\), this can be readily integrated because the process occurs at constant temperature. Thus \(Q_{\rm rev} = T \Delta S\). Thus, we need only the entropy at the initial and final states. We can use Cantera to solve.
import cantera as ct
#State 1
m= 0.01 #kg
T1 = 100 + 273.15 #K
x1 = 0 # Sat. Liquid
species1 = ct.Water()# define state 1
species1.TQ = T1, x1
#State 2
T2=T1 #K
x2 = 1 # Sat. Liquid
species2 = ct.Water()# define state 2
species2.TQ = T2, x2
dh=species2.HP[0]-species1.HP[0]
ds=species2.SP[0]-species1.SP[0]
print(round(dh*m,2), "J, is Q using the Energy Equation")
print(round(ds*m*T1,2), "J, is Q using the Entropy Equation")
22570.44 J, is Q using the Energy Equation
22570.44 J, is Q using the Entropy Equation
8.5. Entropy Generation#
We have just stated that entropy can decrease locally, but this is seemingly at odds with the fact that the second law of thermodynamics earlier in this chapter was motivated by saying that any spontaneous process that tends toward equilibrium must result in an increase in entropy. At this point, it is important to consider the distinction between the system and surroundings, and that when we say entropy must always increase, this refers to the total, or combined, entropy of the system and surroundings. Thus, if the entropy of a system decreases (for example by rejecting heat), then the entropy of the surroundings must increase by at least as much, and even more unless the process were reversible. We can see why entropy must always be increased (or generated) in a real process by comparing it to a reversible one. Lets first consider the reversible and adiabatic expansion process between states 1 and 2, as shown on the left of Figure 8.8. Because it is adiabatic there is no heat transfer and so the change in entropy according to (8.35) is zero. If the expansion process is real (i.e., irreversible) and to the same pressure, then the path taken is different and the work is less. According to the conservation of energy equation, if the work is less, the change in internal energy is less and thus, the temperature change should also be less compared to the reversible process. Thus, \(T\)3 > \(T\)2. Now, the only way to get to State 3 from State 2 is to reject heat from the system. Considering entropy is a state property and doesn’t depend on the path, then \(S\)2-\(S\)1 = \(S\)2-\(S\)3 + \(S\)3-\(S\)1. Since \(S\)2-\(S\)1 = 0 (reversible and adiabatic) and \(S\)2-\(S\)3 < 0 because of (8.35) and the heat transfer is negative (i.e. heat rejection), then \(S\)3-\(S\)1 must be positive and thus \(S\)3 > \(S\)1. Entropy was generated during the irreversible and adiabatic expansion process!

Fig. 8.8 Entropy is generated for both expansion and compression processes that are irreversible. All irreversible processes result in entropy generation.#
Now, lets consider the reverse case. I.e., reversible and adiabatic compression versus irreversible and adiabatic compression, as shown on the right of Figure 8.8. In this case the temperature following irreversible compression will be greater than the reversible case because the work requirement will be greater and according to the first law the internal energy change must be greater. This compression process is shown going from State 2 to State 3a. Then, the only way to return back to State 1 is to again reject heat from the system. Again considering entropy is a state property and doesn’t depend on the path, then \(S\)1-\(S\)2 = \(S\)3a-\(S\)2 + \(S\)1-\(S\)3a. Since \(S\)1-\(S\)2 = 0 (reversible and adiabatic) and \(S\)1-\(S\)3a < 0 because of (8.35) and the heat transfer is negative (i.e. heat rejection), then \(S\)3a-\(S\)2 must be positive and thus \(S\)3a > \(S\)2. Entropy was also generated during the irreversible and adiabatic compression process! And in fact, the entropy change must always increase for an irreversible process.
Mathematically, because entropy generation is always equal to or greater than zero, the entropy change for a real process must be the entropy change due to heat transfer (from (8.35)) plus the entropy generation, or
Notice now that the heat transfer term is no longer necessarily reversible because of the added entropy generation term (\(S\)gen). Of course in the absence of entropy generation the heat transfer would have to be reversible and thus the equations are consistent. Put another way, because the entropy generation is always positive, the entropy change of a real process must always be greater than or equal to the entropy change due to heat transfer, or
8.6. Statistical Definition of Entropy#
To this point, we have used a statistical argument (i.e., increase in multiplicity), to derive the classical thermodynamic definition of entropy, assuming only that entropy is proportional to multiplicity and that it is an extensive property of the system. But we have not mathematically connnected the statistical interpretation of entropy to the classical, yet. It would be tempting to think that \(W\) and \(S\) are related only by a proportionality constant, but this cannot be true because entropy is an extensive thermodynamic property, and thus additive, and multiplicity is multiplicitive - i.e., the multiplicity of two combined sub-systems is the product of each individual. How to reconcile this? In fact, the link between entropy and mltiplicity then must be a logarithm, and the statistical definition, first derived by Boltzmann, is
where \(k\) is Boltzmanns constant, which is a proportionality factor to connect the statistical definition to the classical thermodynamic definition. The natural logarithm helps resolve the difference between the additive extensive entropy and multiplicative property, multiplicity. For example, two systems with individual multiplicity 5 and 10 have a total multiplicity of 50 but entropy of \(k\)ln(5) + \(k\)ln(10).
8.7. Heat Engines#
As discussed at the beginning of the chapter in section Section 8.1 Directionality - Qualitative Motivation through Heat Engine Thermodynamic Cycles, heat engines, also known as power cycles convert a high temperature source to work and must also reject some heat to a lower temperature reservoir. Heat engines may vary considerably from one another are not limited to just mechanical devices such as internal combustion engines. For example, a photovoltaic cell, which converts photons into electrical work is a semiconductor with no moving parts, but is nevertheless considered a heat engine and constrained by the second law. More generally, a heat engine, or power cycle are all characterized by the following:
They all receive heat from a high temperature source/reservoir (e.g. natural gas combustion, photons emitted from the sun, nuclear heat, etc.)
They all convert part of this heat into work.
They all reject the remaining waste heat to a low temperature sink.
They all operate on a cycle.
One good example of a heat engine is a steam power plant. The idealized steam power plant is composed of a pump, boiler, steam turbine, and condenser, as seen in Figure 8.9 below. Starting from State 1, H2O in saturated/compressed liquid form is pumped to a higher pressure, State 2. Heat is added to the H2O at constant pressure in a boiler, becoming a saturated vapor or superheated vapor leaving at State 3. Then, at elevated temperature and pressure the steam is expanded in a vapor turbine, producing mechanical work and decreasing the temperature and pressure of the steam, State 4. Finally, heat is rejected from the steam at a low temperature and constant pressure in a condenser to return to State 1. Heat addition and rejection occur from or to thermal reservoirs, which are large enough to supply or absorb energy to/from the heat engine without undergoing a change in temperature. Examples include a geothermal heat source from the earth or lake used as an energy sink for a power plant. Because ALL heat engines must reject heat, this lead to one formation of the Second Law of Thermodynamics, the Kelvin-Plank statement, already mentioned above in Section 8.1 Directionality - Qualitative Motivation through Heat Engine Thermodynamic Cycles but repeated here. The Kelvin-Plank statement states that “It is impossible to construct a device that will operate in a cycle and produce no effect other than the raising of a weight and the exchange of heat with a single reservoir”.

Fig. 8.9 Schematic depicting a generic steam power plant, composed of a pump, boiler, vapor turbine and condenser.#
Each component in the steam power plant may be analyzed individually as an open system, drawing an appropriate system boundary and applying the steady state open system energy balance discussed in Section 7 First Law of Thermodynamics - Open Systems, shown below.
In addition, a system boundary can also be drawn around the entire steam power plant, in which case there is no mass transfer and the system can be analyzed with the closed system energy balance equation, in rate form, discussed in Section 5.2 Energy Transfer and The First Law, shown below.
Because the process operates at stead state, \(\frac{dU}{dt} = 0\), and
Note that when applying the open system energy conservation equation ((8.40)) correctly, \(\dot Q_{\rm L}\) will be negative.
8.7.1. Heat Engine Thermal Efficiency#
The thermal efficiency (\(\eta\)) of a heat engine is defined as the net power (or work) output divided by the required rate of heat transfer (or heat transfer) to the cycle.
And taking the magnitude of \(\dot Q_{\rm L}\) so that it is always positive, this can be re-arranged into the following commonly seen form.
8.8. Refirgeration/Heat Pump Cycles#
We also learned above in Section 8.2 Directionality - Entropy is Multiplicity Maximization that there is no process which results only in the transfer of heat from a cold reservoir to a hot reservoir. This was first formulated as the Clausius Statement. For this to be possible, work from an external source would have to be done to the system using heat pump, or refrigeration cycle. This can be qualitatively visualized in Figure 8.10. Pictured on the left is an impossible processes where heat flows spontaneously from low to high temperature without any external work input. And on the right is a real process showing the transfer of heat from a low to high temperature reservoir using a refrigeration or heat pump cycle, which require work done to the cycle. In practice, refrigeration or heat pump cycles are used in common devices such as refrigerators, air conditioners and heat pumps. The name of the device is used to distinguish their purpose, but the underlying thermodynamic cycle remains unchanged. For example, an air conditioner, which is designed to keep a home or building cool, moves heat from the home (i.e. low temperature reservoir) and pumps it to the surroundings outside (i.e. high temperature reservoir). In the case of a heat pump, which is designed to heat a home or building, the low and high temeperature reservoirs are reversed but the cycle remains the same. The surroundings which are cooler than the home become the low temperature reservoir, and this energy is pump into the home which is now the high temperature reservoir.

Fig. 8.10 Schematic depicting an impossible process that violates the second law of thermodynamics (left side), and one which satisfies the second law (right side).#
The refrigeration or heat pump cycle can be visualized in a similar manner to the steam power plant, but in reverse, as seen in Figure 8.11. The working fluid is a refrigerant that undergoes phase change at lower temperatures compared to H2O and it’s flow direction is reversed. Starting at State 1, the refrigerant is evaporated at constant and low pressure by receiving heat from the low temperature reservoir, exiting at State 2. Then, it is compressed in a compressor via shaft work and leaves at a higher pressure and temperature vapor at State 3. Heat is then rejected at constant pressure to the high temperature reservoir using a condenser until State 4 is reached. And finally, to decrease the pressure back to State 1, the resuting liquid is expanded in an expansion valve or throttle. In principle, a turbine could also be used and the work output used to reduce compression work. This device is called a turboexpander, but at these relatively low temperatures the magnitude of the specific work output is small compared to a typical gas or vapor turbine.

Fig. 8.11 Schematic depicting a generic refrigeration/heat pump cycle, composed of an evaporator, compresser, condenser and expansion valve/throttle.#
Like the steam power plant, each component in the refrigeration cycle may be analyzed individually as an open system, drawing an appropriate system boundary and applying the steady state open system energy balance discussed in Section 7 First Law of Thermodynamics - Open Systems. In addition, a system boundary can also be drawn around the entire cycle, in which case there is no mass transfer and the system can be analyzed with the closed system energy balance equation, in rate form, resulting in (8.42).
8.8.1. Refirgeration/Heat Pump Coefficient of Performance#
The Coefficient of Performance (COP) is defined to describe the performance of refrigerators and heat pumps. Unlike heat engines which are constrained by the second law to have an efficieny less than 100%, COP is not constrained the same way. COP is a measure of the heat transfer term desried to be maximized relative to the required work input. Because the objective of a refriferator and air conditioner is to maximize the amount of heat transfer from the low temperature reservoir to the cycle (thereby keeping it cool), their COP is defined as below.
And taking the magnitude of \(\dot Q_{\rm H}\) so that it is always positive, this can be re-arranged into the following commonly seen form.
And for heat pumps, which are designed to maximize the heat transfer to a high temperature thermal reservoir, their COP is defined relative to the heat transfer to the high temperature reservoir, as below.
Taking the magnitude of \(\dot Q_{\rm H}\) so that it is always positive, this can also be re-arranged into the following commonly seen form.
In both cases, the COP is typically greater than 1, indicating that for every unit of energy or power going into the cycle, more is extracted from or delivered to the cold and hot reservoirs, respectively.
8.9. Reversibility and Carnot#
Reversible processes were introduced prior in Section 6.1 More on Boundary Work - Reversible Processes. It was discussed that reversible processes result in the minimum or maximum boundary work associated with piston cylinder compression or expansion. Further, a reversible process is one that can occur in both the forward and reverse directions without impacting the surroundings. To acheive this, in the case of a piston cylinder, the expansion and compression processes should be constrained in such a way that an infinite amount of time would be required. If unconstrained, the the work terms will not be maximixed or minimized and the process would require interaction with the surroundings to return to it’s initial state. Thus, we can say that unconstrined expansion is one type of irreversibility. Another irreversibility is heat transfer through a finite temperature difference. This is an implication of the second law and the Clausius statement, that says that there is no process which results only in the transfer of heat from a cold reservoir to a hot reservoir. In other words, heat transfer can only occur spontaneously in one directions, i.e. hot to cold, and as a result any heat transfer that occurs via a temperature gradient cannot be reversible. Finally, any frictional effects would also result in irreversibilities because this would lead to increased temperature and ultimately heat transfer as a result. To summarize, the three main irreversibilties are the following.
Unconstrained release of pressure
Heat transfer via a finite temperature difference
Friction
The most efficient thermodynamic cycles are those in which there are no irreversibilities within each process, and thus for the entire cycle. Such idealized and fully rerversible cycles are known as Carnot cycles. For heat engines these are referred to as Carnot heat engines, and for refrigerators/heat pumps, a Carnot refrigerator/heat pump. Carnot cycles will always result in the highest efficiency or coefficient of performance under a given set of constrained conditions.
8.9.1. Carnot Heat Engines#
The Carnot Heat Engine is composed of the following reversible processes.
Process 1-2: Reversible and adiabatic compression
Process 2-3: Isothermal heat addition and expansion
Process 3-4: Reversible and adiabatic expansion
Process 4-1: Isothermal heat rejection and compression
All compression and expansion processes are either adiabatic or isothermal in order to prevent any irreversibilities. Adiabatic compression and expansion can be conceptualized as a very slow, constrained process in either a piston cylinder or turbine/compressor. Isothermal heat addition and rejection can be conceptualized as either a phase transformation from liquid to gas which occurs at constant temperature, or as an expanding/compressing piston cylinder containing an ideal gas where the temperature remains constant. Recall that for an ideal gas, the internal energy is a function of temperature only, and thus, for a constant temperature process, the change in internal energy of the gas during these processes is 0. And, as a result of the closed system energy conservation equation, this means the heat transfer to/from the system at constant pressure must be equal to the work done by/to the system. Of course, the heat transfer to the system is governed by one of the three fundamental heat transfer modes, conduction, convection or radiation, all of which are proportional to the temperature difference between reservoirs and systems, heat transfer area, and time (refer to equations discussed in Section 5.2.1 Heat Transfer). Thus, any true isothermal and reversible heat transfer would also require infinite time, like constrained expansion/compression, or an infinite heat transfer area.
The Carnot Heat Engine described using a piston/cyclinder arrangement is shown in Figure 8.12.

Fig. 8.12 Carnot heat engine depicted as a series of piston cylinder compression and expansion processes using an ideal gas. Process 1-2 consists of adiabatic compression, Process 2-3 is isothermal heat addition and expansion, Process 3-4 comprises adiabatic expansion, and Process 4-1 is isothermal heat rejection and compression to complete the cycle.#
The maximum efficiency at which a Carnot Heat Engine can convert heat into work can be derived using the processes described in Figure 8.12, with application of the energy conservation equation (Section 5.2 Energy Transfer and The First Law), ideal gas law (Section 4.2 Ideal Gas Equation of State) and reversible polytropic boundary work equations (Section 6.2 More on Boundary Work - Polytropic Process). The derivation starts from the definition of thermal efficiency, shown below.
Heat addition and rejection during processes 2-3 and 4-1 is isothermal, and therefore applying the closed system energy conservation equation for each of these processes yields the following equations, understanding that the change in internal energy of an ideal gas during an isothermal process is 0 (e.g. \(\Delta U_{\rm 2-3} = 0 = Q_{\rm H} - W_{\rm 2-3}\)).
Therefore, we can also write the thermal efficiency in terms of the work terms as shown below.
The polytropic boundary work associated with isothermal expansion and compression can be evaluated with the following equations, understanding that the polytropic exponent is 1 for isothermal processes.
However, when starting with (8.49), the negative term associated with heat transfer to the low temperature reservoir has been applied a priori, and thus, the equivilent compression work which would be evaluated as a negative value, should be included as a positive term to be consistent. This results in the volume terms in (8.54) switching from numerator to denominator and vice versa, seen below.
The ratio of the work terms in (8.49) can then be substituted as
Applying the ideal gas law, we can substitute temperature terms for the product of pressure and volume.
Substituting the ideal gas law into the polytropic equation (\(PV^{\rm n} = {\rm const}\)) yields an alternative form that is a function of temperature and volume.
With some algebraic manipulation of (8.58) we can show that \(\frac{V_{\rm 4}}{V_{\rm 1}}=\frac{V_{\rm 3}}{V_{\rm 2}}\)
Becuase \(T_{\rm 2}=T_{\rm 3}\), (8.60) becomes the following.
Similarly for process 4-1, we can show the follwing.
Equating (8.62) and (8.62), it can then be shown that the volume terms in (8.57) cancel.
And therefore, we can rewrite (8.52) as the following.
This equation implies that the maximum efficiency of a heat engine is solely limited by the temperature of the high and low temperature thermal reservoirs. As the temperature of heat addition is increased, the maximum thermal efficiency of the process is increased, and likewise for a decrease in the heat rejection temperatures. This give a quantitative description of the “value” of thermal energy - i.e. the thermodynamic value, or potential, of a heat source is directly proportional to it’s temperature. The higher the temperature, the larger fraction of the energy input can be converted to work. Note that all heat engines, including Carnot, can be defined by (8.49), but only Carnot heat engines can be defined by both (8.49) and (8.64). Thus, knowing something about the temperature of heat addition and rejection, these equations can be a useful guage to compare real heat engine performance to the maximum possible, defined by Carnot. It is important to always ensure the Kelvin temperature scale is used when applying the Carnot equation.
8.9.1.1. Example - Analysis of a Carnot Heat Engine#
A Carnot heat engine receives 500 kJ of heat per cycle from a source at 652 °C and rejects heat to a source at 30 °C. Determine η and QL.
Solution First, we should recognize that we know the temperature of two thermal reservoirs, so have enough information to determine the Carnot efficiency from (8.64).
Tl = 30 + 273.15 #convert to K
Th = 652+273.15 #convert to K
eta = 1-Tl/Th
print("The efficiency is", round(eta,2))
The efficiency is 0.67
Then, we can use the fact that this efficiency can be related to the high and low temperature transfer terms as seen in (8.44), which is an equation that is general to ALL heat engines, not just Carnot. Since we are given the high temperature heat addition, we can solve for the low temperature or heat rejection term,QL.
Qh = 500 # kJ
#eta = 1-Ql/Qh
Ql = Qh*(1-eta)
print("The heat rejection is", round(Ql,2), "kJ")
The heat rejection is 163.84 kJ
8.9.2. Carnot Refrigerators/Heat Pumps#
Because the Carnot Heat Engine is composed of four reversible processes, the can all be reversed, resulting in the Carnot Refrigerator/Heat Pump cycle. Thus, the four reversible process describing the Carnot Refrigerator/Heat Pump are, following along the states as described in the refrigeration cycle diagram shown above in Figure 8.11:
Process 1-2: Isothermal heat addition and expansion
Process 2-3: Reversible and adiabatic compression
Process 3-4: Isothermal heat rejection and compression
Process 4-1: Reversible and adiabatic expansion This cycle dictates the maximum coefficient of performance that can be acheived under a set of constrained conditions.
The following equations governing Carnot refrigerator and heat pump COP’s can be derived in a similar manner to the Carnot Heat Engine, relating COP directly to the temperature of each thermal reservoir.
Similar to the Carnot Heat Engine, these equations enable one to compare real refrigerator/heat pump performance to the maximum possible, defined by Carnot. Again, it is important to always ensure the Kelvin temperature scale is used when applying the Carnot equations.
8.9.2.1. Example - Analysis of a Carnot Heat Pump#
A Carnot heat pump is used to heat a house during winter. The house is a constant 21 °C and loses heat at a rate of 135,000 kJ h-1 when the outside temperature is -5 °C. Determine Ẇin required to operate the heat pump.
Solution The key to solving this problem is recognizing that because the house is kept at a constant temperature and we know the rate that energy leaves, this must be equal to the rate of heat addition to the house. In addition, we should recognize that the outside is considered the low temperature reservoir and the inside of the house is the high temperature. So, we know the temperature of each reservoir, and the heat addition to the house (which is the high temperature reservoir of the heat pump cycle). We can use equations (8.47) and (8.66).
Tl = -5 + 273.15 #convert to K
Th = 21+273.15 #convert to K
COP = Th/(Th-Tl)
print("The heat pump COP is", round(COP,2))
The heat pump COP is 11.31
Qh = 135000/60/60 #convert kJ/h to kJ/s or kW
#COP = Qh/Win
Win = Qh/COP
print("The power required to operate the heat pump is", round(Win,2), "kW")
The power required to operate the heat pump is 3.31 kW
8.9.2.2. Example - Analysis of a Carnot Heat Pump with Entropy Property Evaluation#
A Carnot refrigeration cycle operates in the saturation dome with minimum and maximum temperatures of -8 °C and 20 °C (i.e. high temperaure operates between saturation points). Win is 15 kJ and the mass of R-134-A is 0.8 kg. Determine the fraction of mass that vaporizes during heat addition and pressure at the end of the heat rejection process.
Solution For this problem, we should first recognize that we know the high and low temperature heat transfers, as well as the required work input to the cycle. So, there is enough information to determine the COP using (8.65) and then using the COP to determine the heat transfer to the cold temperature of the cycle using (8.45).
Tl = -8 + 273.15 #convert to K
Th = 20+273.15 #convert to K
COP = Tl/(Th-Tl)
print("The heat pump COP is", round(COP,2))
The heat pump COP is 9.47
Win = 15 #kJ
#COP = Ql/Win
Win = Qh/COP
print("The heat transfer delivered to the refrigerant at -8 C is", round(Win,2), "kJ")
The heat transfer delivered to the refrigerant at -8 C is 3.96 kJ
To determine the fraciton of mass that vaporizes we will need to determine the vapor mass fractions prior to vaporization and after. The temperature is known, but not the pressure or other properties directly. However, we can use the fact that the expansion process following condensation is isentropic and equate the entropy at the saturated liquid state and 20 °C to the mixture at -8 °C to determine the quality.
import cantera as ct
state1 = ct.Hfc134a()# define state1 as r134
state1.TQ = Th,0
s1 = state1.ST[0]
print("The specific entropy before and after expansion is", round(s1,2), "kJ kg-1 K-1")
The specific entropy before and after expansion is 828.15 kJ kg-1 K-1
s2=s1
state2 = ct.Hfc134a()# define state2 as r134
state2.ST = s2,Tl
x2 = state2.TQ[1]
print("The quality after expansion is", round(x2,2))
The quality after expansion is 0.18
Similarly, we know the entropy after compression is the same prior to compression. Knowing this, we can solve for entropy after compression, and use this and the temperature prior to compression to solve for quality.
state4 = ct.Hfc134a()# define state4 as r134
state4.TQ = Th,1
s4 = state4.ST[0]
print("The specific entropy before and after compression is", round(s4,2), "kJ kg-1 K-1")
The specific entropy before and after compression is 1449.95 kJ kg-1 K-1
s3=s4
state3 = ct.Hfc134a()# define state3 as r134
state3.ST = s3,Tl
x3 = state3.TQ[1]
print("The quality after expansion is", round(x3,2))
The quality after expansion is 0.98
To determine the fraciton of mass that vaporizes we can use each of these qualities with the known total mass of 0.8 kg. We can determine the mass of vapor at each state, and the change in vapor mass relative to the total mass is the fraction of mass that vaporizes.
mtotal = 0.8 # kg
m2g = x2*mtotal
m3g = x3*mtotal
m_fraction = (m3g-m2g)/mtotal
print("The fraction of mass that vaporizes is", round(m_fraction,2))
The fraction of mass that vaporizes is 0.81
8.9.3. Exercise 6#
Heat Engines and Refrigeration Cycles (Not Carnot)
A window-mounted air conditioner removes 3.5 kJ from the inside of a home using 1.75 kJ work input. How much energy is released outside and what is its coefficient of performance?
A room is heated with a 1500-W electric heater. How much power can be saved if a heat pump with a COP of 2.5 is used instead?
A large coal fired power plant has an efficiency of 45% and produces net 1,500 MW of electricity. Coal releases 25000 kJ/kg as it burns so how much coal is used per hour and what is the heat rejection?
Heat Engines and Refrigeration Cycles (Carnot)
Find the power output and the low T heat rejection rate for a Carnot cycle heat engine that receives 7 kW at 250°C and rejects heat at 30°C.
A heat pump is used to heat a house during the winter. The house is to be maintained at 20°C at all times. When the ambient temperature outside drops to −10°C, the rate at which heat is lost from the house is estimated to be 25 kW. What is the minimum electrical power required to drive the heat pump?
An inventor claims to have developed a heat engine that receives 700 kJ of heat from a source at 500 K and produces 300 kJ of net work while rejecting the waste heat to a sink at 290 K. Is this a reasonable claim? Why?
A Carnot heat pump is to be used to heat a house and maintain it at 25 ºC in the winter. On a day when the average outdoor temperature is about 2 ºC, the house is estimated to lose heat at a rate of 55,000 kJ/hr. If the heat pump consumes 4.8 kW of power while operating, determine (a) how long the heat pump ran for that day, (b) the total heating costs, assuming average price of $0.11/kWh for electricity, and (c) the heating cost for the same day if resistance heating is used instead of a heat pump.
A heat pump with R-134a as the working fluid is used to keep a space at 25 ºC by absorbing heat from geothermal water that enters the evaporator at 60 ºC at a rate of 0.065 kg/s and leaves at 40 ºC. Refrigerant enters the evaporator at 12 ºC with a quality of 15 percent and leaves at the same pressure as saturated vapor. If the compressor consumes 1.6 kW of power, determine
the mass flow rate of the refrigerant
the rate of heat supply
the COP
the minimum power input to the compressor for the same rate of heat supply
Cold water at 10 ºC enters a water heater at the rate of 0.02 m3/min and leaves the water heater at 50 ºC. The water heater receives heat from a heat pump that receives heat from a heat source at 0 ºC .
Assuming water to be incompressible liquid that does not change phase during heat addition, determine the rate of heat supplied to the water in kJ/s.
Assuming the water heater acts as a heat sink having an average temperature of 30 ºC, determine the minimum power supplied to the heat pump in kW.