One of the earliest scientists to be intrigued by heat engines was a French engineer named Sadi Carnot (1796-1832). A heat engine uses heat transfer to do work in a cyclical process. After each cycle the engine returns to its original state and is ready to repeat the conversion process (disordered --> ordered energy) again.

Carnot assumed that an ideal engine, converting the maximum amount of thermal
energy into ordered energy, would be a frictionless engine. It would also be a
**reversible engine**. By itself, heat always flows from an object of
higher temperature to an object with lower temperature. A reversible engine is
an engine in which the heat transfer can change direction, if the temperature of
one of the objects is changed by a tiny (infinitesimal) amount. When a
reversible engine causes heat to flow into a system, it flows as the result of
infinitesimally small temperature differences, or because there is an
infinitesimal amount of work done on the system. If such a process could be
actually realized, it would be characterized by a continuous state of
equilibrium (i.e. no pressure or temperature differentials) and would
occur at a rate so slow as to require an infinite time. The momentum of
any component of a reversible engine never changes abruptly in an inelastic
collision, since this would result in an irreversible, sudden increase of
disordered energy of that component. A real engine always involves at
least a small amount of irreversibility. Heat will not flow without a
temperature differential and friction cannot be entirely eliminated.

Carnot showed that if an ideal reversible engine, called a **Carnot engine**, picks up the
amount of heat Q_{1} from a reservoir at temperature T_{1},
converts some of it into useful work, and delivers the amount of heat Q_{2}
to a reservoir at temperature T_{2}, then Q_{1}/T_{1 }=
Q_{2}/T_{2}. Here T is the absolute temperature, measured in
Kelvin and a heat reservoir is a system, such as a lake, that is so large that
its temperature does not change when the heat involved in the process considered
flows into or out of the reservoir. To convert heat into work, you need at
least two places with different temperatures. If you take in Q_{1} at
temperature T_{1} you must dump at least Q_{2} at temperature T_{2}.

An example of an idealized, frictionless engine in which all the processes
are reversible is an ideal gas in a cylinder equipped with a frictionless
piston. The cylinder alternates in making contact with one of two heat
reservoirs at temperatures T_{1 }and T_{2} respectively, with T_{1}
higher than T_{2}.

- We start at point a in the PV diagram. Let us put the cylinder in
contact with the reservoir at T
_{1}and_{ }heat the gas and at the same time expand it following the curve marked (1). To make the process reversible we pull the piston out very slowly as heat flows into the gas and we make sure that the temperature of the gas stays nearly equal to T_{1}. If we would push the piston back in slowly, then the temperature would only be infinitesimally higher than T_{1}**isothermal**expansion, when done slowly enough, can be a reversible process. Once we reach point b in the diagram an amount of heat Q_{1}has been transferred from the reservoir into the gas. Since the expansion is isothermal, the temperature of the gas has not changed. - Let us take the cylinder away from the reservoir at point b and continue
a slow, reversible expansion without permitting heat to enter the cylinder.
The expansion now
**is adiabatic**. As the gas expands the temperature falls, since there is no heat entering the cylinder. We let the gas expand, following the curve marked (2), until the temperature falls to T_{2 }at the point marked*c*. The adiabatic curve has a more negative slope than the isothermal curve. - When the gas has reached the temperature T
_{2}_{2}. Now we slowly compress the gas**isothermally**while it is in contact with the reservoir at T_{2},_{2}flows from the cylinder into the reservoir at the temperature T_{2}. - At the
_{2 }and compress it still further, without letting any heat flow out. During this**adiabatic**process the temperature rises, and the pressure follows the curve marked (4). If we carry out each step properly, we can return to the point a at temperature T_{1 }where we started, and repeat the cycle.

During one cycle we have put an amount of heat Q_{1} into the gas at
temperature T_{1}* *and have removed an amount of heat Q_{2}
at temperature T_{2}*.* Using the relationships between ΔU, ΔQ,
and ΔW for the different thermodynamic processes,
we can show that Q_{1}/T_{1 }= Q_{2}/T_{2}.

Link: Mathematical details using Calculus

The useful work done by a heat engine is W = Q_{1 }- Q_{2}
(energy conservation). An ideal reversible engine does the maximum amount
of work.

Any real engine delivers more heat Q_{2} at the reservoir at T_{2}
than a reversible one and therefore does less useful work.

The **maximum amount of work** you can
therefore get out of a heat engine is the amount you get from an ideal,
reversible engine.

W_{max} = Q_{1} - Q_{2} = Q_{1}
- Q_{1} T_{2}/T_{1} = Q_{1 }(1 - T_{2}/
_{1}).

W is positive if T_{1} is greater than T_{2}.

The **efficiency** of a heat engine is the
ratio of the work obtained to the heat energy put in at the high temperature, e
= W/Q_{high}. The maximum possible efficiency e_{max} of such
an engine is

e_{max} = W_{max}/Q_{high} = (1 - T_{low}/T_{high}) = (T_{high} - T_{low})/T_{high}.

Assume you have a reservoir of hot water at temperature T_{1}.
Can you take an amount of heat Q_{1} out of this reservoir and convert
it into work? No! You can convert a fraction of the heat into work if
you have a place at a lower temperature T_{2} where you can dump some of
the heat. An engine that does work by removing heat from a reservoir at a
single temperature cannot exist.

Heat cannot be taken in at a certain temperature with no other change in the system and converted into work. This is one way of stating the second law of thermodynamics.

Heat cannot, of itself, flow from a cold to a hot object is another way of stating the second law of thermodynamics.

If it could, then heat dumped at T_{2} could just flow back to the
reservoir at T_{1} and the net effect would be an amount of heat
ΔQ = Q_{1} - Q_{2} taken at
a T_{1} and converted into heat with no other changes in the system.

A certain gasoline engine has an efficiency of 30.0%. What would the
hot reservoir temperature be for a Carnot engine having that efficiency, if it
operates with a cold reservoir temperature of 200 ^{o}C?

Solution:

A Carnot engine has maximum efficiency e_{max} = (T_{high} - T_{low})/T_{high}.

If e_{max} = 0.3, then 0.3 = 1 - (473 K)/T_{high}. T_{high}
= 473/0.7 = 675.7 K = 402.7 ^{o}C.

An inventor is marketing a device and claims that it takes 25 kJ of heat at
600 K, transfers heat to the environment at 300 K, and does 12 kJ of work.
Should you invest in this device?

Solution:

A Carnot engine taking in 25 kJ of heat and operating between 600 K an 300 K
can do a maximum amount of work

W_{max} = Q_{high }(1 - T_{low}
/ T_{high}) = 25 kJ*( 1 - 300/600) = 25 kJ/2 = 12.5 kJ.

The device's efficiency is claimed to be 96% of e_{max}. No
known engine comes this close to e_{max}. Friction and other
losses reduce the efficiency. So while not forbidden by the second
law, the device is very unlikely to perform as claimed.

Note:

Disordered energy cannot be completely converted back to ordered energy.

The maximum efficiency of a heat engine converting thermal to ordered energy is
100%*(T_{high} - T_{low})/T_{high}.

Here T_{high} and T_{low} are the highest and lowest temperature
accessible to the engine.

Ordered energy, on the other hand, can be completely converted into other forms of energy. The maximum efficiency of an engine using ordered energy is 100%.