Which way do things go?
The first law is a strict accountant: every joule in must come out somewhere. But it is strangely indifferent to direction. A cup of tea cooling in a room satisfies the first law; so would the same cup growing hotter by drawing heat out of the cooler room, which never happens. A flywheel spinning down by friction warms its bearings; the bearings never cool down by themselves and spin the flywheel back up. An engine that took heat from the sea and turned all of it into work would conserve energy perfectly, and would power every ship on Earth for nothing. No one has built one, and no one ever will.
In Energy and efficiency you saw that a car engine turns only a quarter to a third of its fuel's energy into motion, and were promised that this is not only poor design but a law of physics. This lesson keeps the promise. The second law of thermodynamics says which processes can happen and which cannot, and it sets a hard ceiling on the efficiency of every engine and the performance of every refrigerator and heat pump. Its quantitative tool, entropy, lets an engineer find exactly where in a machine the potential to do work is being thrown away, and how much.
Chemists use the same law to decide which reactions can run, counting microscopic arrangements of molecules; that side of the story is told in Lumenary Chemistry's entropy and free energy. This lesson tells the engineer's side: engines, refrigerators, turbines and the cost of irreversibility.
Engines, refrigerators and heat pumps
Strip any engine down to its essentials and you find the same pattern. A working fluid — steam, air, combustion gas — receives heat from something hot, delivers net work , and rejects heat to something cold, then returns to its starting state to repeat the cycle. To keep the analysis clean, we imagine the hot and cold bodies as thermal reservoirs: bodies so large that taking heat from them or giving heat to them does not change their temperatures. A furnace, the atmosphere, a river and the sea are good approximations.
Writing all quantities as positive magnitudes, the first law over a cycle gives for the engine and for the refrigerator. Their performance is measured by what you want divided by what you pay for.
Definition— thermal efficiency and coefficient of performance
The thermal efficiency of a heat engine is . The coefficient of performance of a refrigerator is , and of a heat pump .
An efficiency cannot exceed 1, since that would create energy. A COP routinely does exceed 1, and that is no paradox: a heat pump does not make heat from work, it moves heat, and moving 3 or 4 joules of heat for each joule of work is entirely ordinary. The interesting questions are why can never reach 1, and how large a COP can be.
The second law and the Carnot limit
The second law has two classical statements. Both are summaries of experience, like the first law.
Definition— Kelvin–Planck statement
It is impossible for any device operating in a cycle to receive heat from a single reservoir and produce an equal amount of net work. Every heat engine must reject some heat to a colder body: , so .
Definition— Clausius statement
It is impossible for any device operating in a cycle to have no effect other than transferring heat from a colder body to a hotter one. Heat flows uphill only if something else, such as work, pays for it.
Theorem— The two statements are equivalent
A device that violates either statement could be combined with ordinary machines to violate the other.
Proof
Suppose a device moves heat from a cold reservoir to a hot one with no work. Pair it with an ordinary engine that takes from the hot reservoir, delivers and rejects exactly to the cold reservoir. The cold reservoir is now unchanged, and the pair takes from the hot reservoir alone and turns all of it into work: a violation of Kelvin–Planck. Conversely, suppose an engine turns heat from the hot reservoir entirely into work . Use that work to drive an ordinary refrigerator, which takes from the cold reservoir and delivers to the hot one. The net effect is moved from cold to hot with nothing else: a violation of Clausius.
∎
Reversible processes and irreversibilities
A process is reversible if, after it, the system and its surroundings can both be returned to their initial states, leaving no trace anywhere. No real process is reversible, but the idea is the yardstick for all of them. The factors that make a process irreversible are called irreversibilities, and an engineer learns to see them everywhere:
- heat transfer across a finite temperature difference;
- friction, in bearings and in viscous fluid flow;
- unrestrained (free) expansion of a gas, and throttling;
- mixing of different substances or of the same substance at different temperatures;
- electric current through a resistance, and inelastic deformation;
- chemical reactions not at equilibrium, such as combustion.
The Carnot cycle and the Carnot principles
The French engineer Sadi Carnot imagined, in 1824, the best possible engine: one whose every step is reversible. Between two reservoirs that means heat may cross only when the working fluid is at the reservoir's own temperature, so the cycle is two reversible isothermal processes (heat in at , heat out at ) joined by two reversible adiabatic processes (expansion from to , compression back).
Theorem— The Carnot principles
(1) No heat engine operating between two reservoirs is more efficient than a reversible engine operating between the same two reservoirs. (2) All reversible engines operating between the same two reservoirs have the same efficiency.
Proof
(1) Suppose an engine X is more efficient than a reversible engine R, both taking the same from the hot reservoir, so . Run R backwards as a refrigerator, which a reversible engine can do with all its arrows reversed, driven by of X's output. R returns exactly to the hot reservoir, so the hot reservoir is unchanged, and the pair delivers net work drawn from the cold reservoir alone, violating Kelvin–Planck. (2) If two reversible engines had different efficiencies, the same argument with the less efficient one run backwards would give the same contradiction.
∎
Since the efficiency of a reversible engine depends only on the two reservoirs, it can depend only on their temperatures. Kelvin used this to define an absolute temperature scale by for a reversible engine, and it agrees exactly with the ideal-gas (kelvin) scale. That gives the most important result in this lesson.
Theorem— Carnot efficiency and Carnot COPs
For reversible devices operating between reservoirs at absolute temperatures and ,
Every real device operating between the same reservoirs does worse.
The Carnot limit, computed
How hot must heat be to be useful? The program computes the Carnot efficiency for several heat sources, with heat rejected to cooling water or air at 300 K. It also prints a second, smaller number, explained below.
import numpy as np
# The Carnot limit, eta = 1 - T_L / T_H, for heat engines rejecting heat at T_L = 300 K.
T_L = 300.0
sources = [
("geothermal brine", 150),
("pressurised-water reactor steam", 285),
("ultra-supercritical coal plant steam", 600),
("gas-turbine inlet gas", 1500),
]
print(f"{'heat source':38} {'T_H':>7} {'Carnot':>7} {'Curzon-Ahlborn':>14}")
for name, t_c in sources:
T_H = t_c + 273.15
carnot = 1 - T_L / T_H
ca = 1 - np.sqrt(T_L / T_H) # efficiency at maximum power (see the text)
print(f"{name:38} {t_c:5d} C {carnot:7.1%} {ca:14.1%}")
# Reversed: the largest possible coefficients of performance.
def cop_fridge(T_cold, T_hot):
return T_cold / (T_hot - T_cold)
def cop_heat_pump(T_cold, T_hot):
return T_hot / (T_hot - T_cold)
K = 273.15
print()
print(f"freezer at -18 C in a 25 C kitchen: COP_R <= {cop_fridge(-18 + K, 25 + K):.1f}")
print(f" ... refrigerant at -28 C and 40 C: COP_R <= {cop_fridge(-28 + K, 40 + K):.1f}")
print(f"heat pump, 7 C outside, 35 C floor heating: COP_HP <= {cop_heat_pump(7 + K, 35 + K):.1f}")
print(f"heat pump, -7 C outside, 55 C radiators: COP_HP <= {cop_heat_pump(-7 + K, 55 + K):.1f}")The Carnot column is a ceiling that real plants come nowhere near: a geothermal plant on 150 °C brine could in principle reach 29%, a coal plant with 600 °C steam 66%, and a gas turbine burning at 1500 °C 83%. Real efficiencies, roughly and as of 2026, are about 10 to 15% for small geothermal plants, 33 to 37% for pressurised-water nuclear reactors, around 45% for the best coal plants, and 60 to 64% for the best combined-cycle gas plants. Higher source temperature is clearly the way to higher efficiency, which is why engineers fight so hard for hotter turbine blades and steam.
The last column comes from a 1975 argument by Frank Curzon and Boris Ahlborn. A Carnot engine is reversible only because its heat transfers happen across vanishing temperature differences, which takes forever: its power is zero. If heat must flow at a finite rate through real heat exchangers, the efficiency at maximum power in a simple model is . It lands close to the real figures for the coal and combined-cycle plants and the geothermal plant, and well below the nuclear plant, which shows both its charm and its limits: it is a model, not a law.
Entropy
The Carnot result for a reversible cycle, , can be written : the sum of each heat transfer divided by the absolute temperature at which it happens is zero. For an irreversible engine, which delivers less work and so rejects more heat, the sum is negative. Clausius generalised this to any cycle.
Theorem— The Clausius inequality
For any cycle, , where is the absolute temperature at the part of the boundary where crosses. Equality holds if and only if the cycle is reversible.
If the integral of is zero around every reversible cycle, then between two states it takes the same value along every reversible path, so it is the change of a property.
Definition— entropy
The entropy of a system, in J/K, is the property whose change is
the heat transferred along any internally reversible path divided by the absolute temperature at which it is transferred. Specific entropy is in J/(kg K).
Because is a property, between two states is the same however the system actually got there, reversibly or not; you simply compute it along an imagined reversible path. The useful formulas follow from the first law with and , which gives the Gibbs equation :
| Substance | Entropy change |
|---|---|
| Ideal gas (constant , ) | |
| Liquid or solid (constant ) | |
| Phase change at constant and | ; for water at 100 °C, kJ/(kg K) |
For steam and refrigerants, tables and property libraries list alongside , with the quality rule inside the two-phase region.
A process that is both adiabatic and reversible is isentropic: . For an ideal gas this gives , the same you met as the reversible adiabatic process in the last lesson.
The entropy balance
Applying the Clausius inequality to a cycle made of an actual process followed by a reversible return gives the law that makes entropy so useful.
Theorem— Entropy balance (the increase of entropy principle)
For a closed system,
where is the boundary temperature where heat crosses. is the entropy generated by irreversibilities inside the boundary: zero for a reversible process, positive for every real one, and never negative. For a control volume in steady flow with one inlet and one outlet, .
So entropy is not conserved. It enters and leaves with heat (and with mass), and it is created, never destroyed, by every irreversibility. An isolated system receives no heat, so its entropy can only increase: this is the second law in its most compact form. The entropy of a part of the world can decrease — a cup of tea cooling loses entropy — but only if heat carries entropy out, and the surroundings then gain more than the tea lost.
Note
What is entropy, physically? Statistical mechanics answers: , where is the number of microscopic arrangements of the molecules consistent with the macroscopic state and J/K is Boltzmann's constant. Heat added at low temperature opens up many more arrangements than the same heat added at high temperature, which is why divides . Lumenary Chemistry builds entropy this way, by counting, in entropy and free energy and statistical thermodynamics; the engineering definition here and the statistical one agree.
Entropy generation and lost work
Every irreversibility generates entropy, and the entropy generated measures the damage: it is proportional to the work that could have been obtained and was not. The program computes for three everyday irreversibilities, and the product , where is the temperature of the environment; the section on exergy below shows that this is exactly the work potential destroyed.
import numpy as np
T0 = 293.15 # K: the environment (20 C), the "dead state" for exergy
c_w, R_air = 4180.0, 287.0
def report(what, S_gen):
print(f"{what:42} S_gen = {S_gen:7.2f} J/K T0 * S_gen = {T0 * S_gen:6.0f} J")
# 1. 1000 J of heat leaks through a furnace wall from gas at 900 K to the room at T0.
Q, T_hot = 1000.0, 900.0
report("heat leak: 1000 J from 900 K to 293 K", Q / T0 - Q / T_hot)
# 2. Mix 1 kg of water at 80 C with 2 kg at 20 C in an insulated jug.
m = np.array([1.0, 2.0])
T = np.array([80.0, 20.0]) + 273.15
Tf = np.sum(m * T) / np.sum(m) # first law: energy is conserved
report(f"mixing water: final temperature {Tf - 273.15:.1f} C", np.sum(m * c_w * np.log(Tf / T)))
# 3. 1 kg of air in half of an insulated rigid tank bursts a membrane and fills it all.
report("free expansion of 1 kg of air: V doubles", 1.0 * R_air * np.log(2.0)) # T unchanged
# 4. Heating a room at 20 C on a 0 C day: now the environment is the outdoors.
T_room, T_out = 293.15, 273.15
worth = 1 - T_out / T_room # the work that 1 J of heat at T_room is worth
print(f"\nheating at 20 C on a 0 C day: 1 J of heat in the room is worth {worth:.3f} J of work")
print(f" resistance heater (1 J of electricity per J of heat): second-law efficiency {worth:.1%}")
print(f" heat pump with COP 3.5: second-law efficiency {3.5 * worth:.1%}")In each case the first law sees nothing wrong: the 1000 J of heat still exists in the room, the water's energy is unchanged, and the air's internal energy is the same after the free expansion. The second law sees a loss. Of the 1000 J of heat at 900 K, 674 J could have been turned into work by a reversible engine before it reached the room, and that opportunity is gone. Mixing hot and cold water throws away 14.4 kJ of work potential. Letting a kilogram of compressed air rush into a vacuum, instead of letting it push a piston, throws away 58.3 kJ.
The last lines are the most practical. Heating a room to 20 °C on a 0 °C day, each joule of heat is worth only 0.068 J of work, because a reversible heat pump could deliver about 15 J of heat per joule of work. A resistance heater, which turns each joule of electricity into one joule of heat, is 100% efficient by the first law and only 6.8% by the second. A real heat pump with a COP of 3.5 does three and a half times better. That single comparison is why heat pumps are replacing boilers and resistance heaters in so many countries.
Isentropic efficiency of turbines and compressors
Turbines, compressors, pumps and nozzles are nearly adiabatic, so the ideal against which to judge them is the isentropic process between the same inlet state and the same exit pressure.
Definition— isentropic efficiency
For a turbine, , the actual work out over the isentropic work out. For a compressor or pump, , the isentropic work in over the actual work in. For a nozzle, . Here is the state at the actual exit pressure with the inlet's entropy.
Large modern turbines and axial compressors reach isentropic efficiencies of roughly 0.85 to 0.92; small machines usually do worse, because clearances and surface friction matter more at small size. The program below takes a compressor with a pressure ratio of 12, typical of an industrial gas turbine, and shows what the efficiency costs.
import numpy as np
# Air compressor and gas turbine with isentropic efficiencies (ideal gas, constant cp).
cp, R = 1005.0, 287.0 # J/(kg K)
k = R / cp # (gamma - 1) / gamma = 0.2856
T0 = 288.0 # K: the environment, for exergy
T1, r = 288.0, 12.0 # compressor inlet (K) and pressure ratio
T2s = T1 * r**k # isentropic exit temperature
print(f"compressor, pressure ratio {r:.0f}: isentropic exit {T2s:.0f} K, ideal work {cp * (T2s - T1) / 1e3:.0f} kJ/kg")
print(" eta_C T2 (K) work in (kJ/kg) s_gen (J/(kg K)) T0 * s_gen (kJ/kg)")
for eta in [1.00, 0.90, 0.85, 0.80]:
T2 = T1 + (T2s - T1) / eta # definition of isentropic efficiency
w = cp * (T2 - T1)
s_gen = cp * np.log(T2 / T1) - R * np.log(r) # adiabatic, so all of ds is generated
s_gen = round(s_gen, 9) + 0.0 # tidy -0.0 when eta = 1
print(f" {eta:.2f} {T2:8.0f} {w / 1e3:14.0f} {s_gen:16.1f} {T0 * s_gen / 1e3:18.1f}")
T3, eta_T = 1500.0, 0.90 # turbine inlet (K) and efficiency
T4s = T3 / r**k
T4 = T3 - eta_T * (T3 - T4s)
s_gen = cp * np.log(T4 / T3) + R * np.log(r)
print(f"\nturbine from {T3:.0f} K, eta_T = {eta_T}: T4s = {T4s:.0f} K, T4 = {T4:.0f} K,"
f" work out {cp * (T3 - T4) / 1e3:.0f} kJ/kg (ideal {cp * (T3 - T4s) / 1e3:.0f}),"
f" s_gen = {s_gen:.1f} J/(kg K)")With the compressor needs 352 kJ/kg instead of 299 kJ/kg, and delivers air at 638 K instead of 586 K. The turbine with delivers 689 kJ/kg instead of 766. In a gas turbine, where the compressor absorbs about half of what the turbine produces, a few points of component efficiency make a large difference to the net output, as you will see in power and refrigeration cycles.
Exergy in brief
The examples above point to a single measure of the quality of energy: how much work it could deliver in a given environment. That measure is called exergy (or availability).
Definition— exergy
The exergy of a system or stream is the largest work obtainable by bringing it reversibly into equilibrium with the environment, the dead state at temperature and pressure (typically 25 °C and 1 atm, or the local conditions). Heat available at temperature carries exergy . A flowing stream carries specific flow exergy .
Work and electricity are pure exergy. Heat at a high temperature is mostly exergy; heat close to ambient temperature is almost none, however many joules it contains. And unlike energy, exergy is not conserved: irreversibilities destroy it, at a rate fixed by the entropy they generate.
Theorem— Lost work (Gouy–Stodola)
The work potential destroyed by an irreversible process is .
Proof
Take the simplest case: heat from a source at drives a device that rejects heat to the environment at and delivers work . The entropy balance for the device over a cycle is , so and . The first term is the Carnot work, the most that is possible; every unit of entropy generated costs units of it.
∎
The ratio of the useful exergy delivered to the exergy supplied is the second-law efficiency . For a heat engine it is ; for heating a room it is the 6.8% and 23.9% computed above. A design with a high first-law efficiency and a low second-law efficiency is one that has energy in the right place at the wrong temperature.
The second law in professional practice
- Exergy analysis of plants. An energy balance of a coal-fired steam plant says most of the loss is in the condenser, which rejects roughly half of the fuel's energy to cooling water. An exergy balance tells a different story: the condenser's heat is at 30 to 40 °C and worth very little, while the largest destruction of exergy is in combustion and in the boiler, where heat crosses hundreds of kelvin from flame to steam. That is why efficiency gains come from hotter, higher-pressure steam and from combined cycles, not from better condensers.
- Heat integration. In chemical plants and refineries, pinch analysis, developed by Bodo Linnhoff and colleagues from the late 1970s, matches hot and cold streams so that heat crosses the smallest practical temperature differences, cutting fuel use without new technology.
- Component testing. Compressors and turbines are bought and accepted on measured isentropic (and polytropic) efficiencies, determined from pressures, temperatures and flows following procedures such as ASME PTC 10 for compressors and PTC 6 for steam turbines, or their ISO counterparts.
- Design for low entropy generation. Heat exchangers, cooling systems for electronics and building services are increasingly designed by balancing the entropy generated by heat transfer against that generated by fluid friction, an approach championed by Adrian Bejan and others. You will meet it again in heat transfer and in thermal management for computing.
A short history
Sadi Carnot, a young French military engineer, published Reflections on the Motive Power of Fire in 1824, asking why British steam engines were so much better than French ones and whether there was any limit to improvement. He reasoned with the caloric theory, in which heat was a fluid that flowed from hot to cold like water through a mill, and that theory was wrong; yet his conclusion, that the maximum work depends only on the temperatures, survived. Émile Clapeyron redrew Carnot's argument on a – diagram in 1834, which is how most engineers came to know it. William Thomson (Lord Kelvin) used it in 1848 to define an absolute temperature scale. Rudolf Clausius reconciled Carnot with Joule's equivalence of heat and work in 1850, and in 1865 coined the word entropy, from the Greek for "transformation", choosing it to sound like energy. Ludwig Boltzmann gave entropy its statistical meaning in the 1870s. Louis Georges Gouy (1889) and Aurel Stodola (1898) independently derived the lost-work theorem for engineers, and the Slovenian engineer Zoran Rant proposed the name exergy in 1956.
Common misconceptions
Misconception
"Entropy can never decrease." The entropy of an isolated system can never decrease. The entropy of anything that can lose heat — a cooling cup of tea, the inside of a freezer, a growing crystal — can and often does, provided the surroundings gain at least as much.
Misconception
"Better engineering will eventually beat the Carnot limit." The Carnot efficiency is not a technological limit but a consequence of the second law. Engineers raise real efficiencies by raising , lowering and reducing irreversibilities, and so move towards the limit; nothing moves past it.
Misconception
"A heat pump with a COP of 4 is 400% efficient, which breaks conservation of energy." It delivers 4 J of heat for 1 J of work because 3 J is moved from outdoors, not created. Energy is conserved exactly; the COP is a ratio of what you want to what you pay for, not an efficiency of conversion.
Misconception
"Adiabatic and isentropic mean the same thing." An adiabatic process has no heat transfer; an isentropic one has no change of entropy. A real, insulated compressor is adiabatic but not isentropic: friction generates entropy, so its exit entropy is higher. Only a process that is both adiabatic and reversible is isentropic.
Misconception
"Entropy is just disorder." "Disorder" is a helpful picture for a gas spreading out, and a misleading one elsewhere: when oil and water separate, or a protein folds into its precise shape, the total entropy rises even though the result looks more ordered. The precise statements are and .
Exercises
Use absolute temperatures (kelvin) in every ratio. For air, J/(kg K) and J/(kg K); for water, J/(kg K).
1. The second law and entropy
Warm-upHumanAn inventor proposes four devices, each running steadily in a cycle. Which one would violate the Kelvin–Planck statement of the second law?
2. The second law and entropy
Warm-upHumanWhat is the Carnot efficiency, in per cent, of a heat engine working between a hot reservoir at 327 °C and a cold reservoir at 27 °C?
3. The second law and entropy
CoreHumanA refrigerator keeps its cold space at 250 K in a room at 300 K. What is the largest coefficient of performance it could possibly have?
4. The second law and entropy
CoreHuman1200 J of heat flows through a wall from a reservoir at 400 K to a reservoir at 300 K. How much entropy, in J/K, is generated?
5. The second law and entropy
CoreHumanSteam enters a turbine with kJ/kg. Expanding isentropically to the exit pressure it would leave with kJ/kg; it actually leaves with kJ/kg. What is the isentropic efficiency of the turbine, in per cent?
6. The second law and entropy
CoreHumanWhich of these statements are true? Select all that apply.
7. The second law and entropy
CoreComputationalWrite mix_water(masses, temps_C, c=4180.0) for several portions of water mixed in an insulated container (constant specific heat c in J/(kg K), no heat loss, no work). masses are in kg and temps_C in °C. Return a tuple (T_final_C, S_gen): the final temperature in °C and the entropy generated in J/K.
8. The second law and entropy
StretchComputationalWrite compressor(T1, r, eta, cp=1005.0, R=287.0) for an adiabatic compressor handling an ideal gas with constant specific heats. T1 is the inlet temperature in K, r the pressure ratio and eta the isentropic efficiency. Return (T2, w, s_gen): the actual exit temperature in K, the work input in J/kg, and the entropy generated in J/(kg K).
Further reading and resources
- Réflexions sur la puissance motrice du feu · Sadi Carnot · 1824Carnot's short book, which founded the subject; it can be read on Gallica, the digital library of the Bibliothèque nationale de France.
- Efficiency of a Carnot engine at maximum power output · F. L. Curzon and B. Ahlborn · 1975American Journal of Physics 43, 22–24. The source of the 1 − √(T_L/T_H) estimate used in this lesson.
- NIST Chemistry WebBook: Thermophysical Properties of Fluid Systems · National Institute of Standards and TechnologyEntropies (as well as enthalpies) of water, refrigerants and many other fluids at any state.
- ASMEPublishes the Performance Test Codes, among them PTC 6 (steam turbines) and PTC 10 (compressors), which define how isentropic efficiencies are measured in acceptance tests.
- MIT OpenCourseWareSearch for the thermodynamics and thermal-fluids engineering courses of MIT's Department of Mechanical Engineering.