Lesson 9: Thermodynamics

Introduction

In the preceding lessons you followed the motion of particles, rigid bodies, and continuous media, and you watched electromagnetic fields carry energy and momentum across space. Throughout those developments one quantity—energy—kept reappearing as a conserved scalar. Thermodynamics elevates that observation into a systematic science of energy, heat, work, and the irreversible tendency of natural processes.

You will begin by clarifying what constitutes a thermodynamic system and how it exchanges energy with its surroundings. From there the four laws of thermodynamics emerge as the fundamental postulates. Internal energy, heat, and work are distinguished with care, and the thermodynamic potentials (enthalpy, Helmholtz and Gibbs free energies) are introduced as the natural functions for different experimental constraints. Entropy—the quantity that measures both the dispersal of energy and the direction of time—receives a thorough treatment, first in its classical Clausius form and later in its statistical interpretation. The ideal gas serves as the simplest concrete arena in which all of these ideas can be calculated explicitly. Energy-balance equations for open and closed systems are derived, the distinction between reversible and irreversible processes is made precise, and the entire apparatus is implemented in Mathematica so that you can compute, plot, and explore thermodynamic relations with the same fluency you already possess for mechanics and electromagnetism.

Thermodynamics is the bridge between the microscopic world of atoms and the macroscopic world of engines, atmospheres, living cells, and stars. It tells you not only what is possible, but what is inevitable.

Temperature

The first property we will discuss is one we are completely used to, temperature. In most treatments of thermodynamics temperature is a fundamental variable and not really defined in any way that helps you understand it. To begin with we will assume that objects are made up of atoms and molecules. We will adopt the statistical mechanics definition that temperature is the average kinetic energy of the molecules (or atoms) comprising an object. This is true for a solid, a liquid, a gas cloud, etc. If we state that the position vector has components l9_1.png, then velocity is l9_2.png. We can now write the kinetic energy, for a mass m as, l9_3.png.  We can say that for a given number of degrees of freedom f, the temperature T (not to be confused with kinetic energy), is,

l9_4.png

(9.1)

where l9_5.png, and is called Boltzmann’s constant. This is called the equipartition relation. We will measure temperature using the Kelvin scale, where the freezing point of water is 273.15 K. The degrees of freedom here are the number of variables that are required to completely describe the system. For example, a single particle on a line has one degree of freedom, the same particle on a plane has two degrees of freedom. A particle on a specific track on a plane has only one degree of freedom and is said to be constrained to the path of the track. A system of ten particles in three dimensional space will have 30 degrees of freedom.

Volume of a System

Another property of thermodynamic systems is volume. In thermodynamics, volume takes the place of generalized coordinates. We are considering the physical volume of the system. We denote volume by the symbol V.

Pressure of a System

Still another property of thermodynamic systems is the quantity of force exerted on a unit area, this is called pressure and is denoted P. We can formulate this,

l9_6.png

(9.2)

The Mole and The Nature of Thermodynamic Variables

A measure of the quantity of a substance that is equivalent to the number of atoms in 12 grams of carbon-12 is called one mole of a substance. A mole is designated by 1 mol.

Variables that depend on the amount of material being studied are called extensive variables; volume is an example of an extensive variable. Variables that do not depend on the amount of substance are intensive variables; temperature is an example of an intensive variable.

Thermodynamic Systems

Before any law can be stated, you must decide what portion of the world you are going to study. That portion is called a thermodynamic system. Everything else—the rest of the universe that can exchange energy or matter with the system—is called the surroundings. The imaginary surface that separates the two is the boundary.

The choice of system is entirely yours, but once made it must be respected consistently. A cylinder of gas, a living cell, a star, or the entire atmosphere of a planet can each be regarded as a thermodynamic system; the usefulness of the subsequent analysis depends only on how wisely the boundary is drawn.

Classification by Exchange

Systems are classified according to what is allowed to cross the boundary:

An isolated system exchanges neither matter nor energy with its surroundings. Its total energy and its particle number are strictly constant.

A closed system may exchange energy (as heat or work) but not matter. A sealed bottle of gas that can be heated or compressed is the classic example.  

An open system may exchange both energy and matter. A turbine, a living organism, or a control volume in a flowing fluid are open systems.

Definition 9.1 A Thermodynamic System: Any region of space (or collection of matter) deliberately selected for study; its boundary determines whether matter, energy, or both may pass to or from the surroundings.

Macroscopic Description

Once the system is chosen, its condition is described by a small set of macroscopic variables—pressure P, volume V, temperature T, chemical composition, magnetic field, and so on. These variables are called state variables (or thermodynamic coordinates). A set of values for all independent state variables defines a thermodynamic state.

If the system is left undisturbed for a sufficiently long time, the state variables cease to change; the system is then said to be in thermodynamic equilibrium. In equilibrium the intensive variables (pressure, temperature, chemical potential) are uniform throughout the system, and the system can be characterized by a single point in the abstract space whose axes are the independent state variables.

Processes and Paths

A thermodynamic process is a change from one equilibrium state to another. The continuous sequence of states through which the system passes is called the path. Some paths are especially simple:

An isothermal process occurs at constant temperature.

An isobaric process occurs at constant pressure.

An isochoric process occurs at constant volume.

An adiabatic process exchanges no heat with the surroundings.

When every intermediate state along the path is itself an equilibrium state, the process is called quasi-static. Quasi-static processes can be drawn as continuous curves on a thermodynamic diagram; real processes that pass through non-equilibrium states cannot.

The Continuum Idealization

In keeping with the continuum viewpoint developed in earlier lessons, we treat the system as a continuous distribution of matter. Density, energy density, and entropy density are regarded as smooth fields. The continuum idealization is excellent whenever the mean free path of the microscopic constituents is much smaller than the characteristic size of the system—an assumption that holds for ordinary gases, liquids, and solids under everyday conditions.

With the notions of system, surroundings, boundary, state, and process clearly in place, you are ready to examine the universal laws that govern the exchanges of energy and the direction of natural change. Those laws are independent of the particular material that constitutes the system; they are the common foundation of every subsequent thermodynamic calculation.

Thermodynamic Laws

The entire structure of thermodynamics rests on four fundamental postulates. They are called “laws” because they have never been observed to fail, and because every successful prediction of the theory can be traced back to them. You will meet them in the traditional order—zeroth, first, second, and third—each one introducing a new physical concept that the previous laws did not contain.

The Zeroth Law — Thermal Equilibrium and Temperature

Imagine two systems placed in thermal contact through a rigid, impermeable, diathermic wall (a wall that allows heat to flow but nothing else). After a sufficient time the macroscopic properties of each system stop changing. The systems are then said to be in thermal equilibrium with each other.

The zeroth law asserts a transitive relation: “If system (A) is in thermal equilibrium with system (C), and system (B) is also in thermal equilibrium with system (C), then (A) and (B) are in thermal equilibrium with each other.”

This seemingly modest statement permits the introduction of an empirical temperature scale. Any system (C) can serve as a thermometer: when (A) and (B) each reach equilibrium with the same thermometer reading, they are at the same temperature and will be in equilibrium with one another if brought into contact. Temperature is therefore the state variable that labels the equivalence classes of thermal equilibrium.

Principle 9.1: Thermal equilibrium is an equivalence relation; temperature is the label of each equivalence class.

The First Law — Conservation of Energy

When a closed system is carried around a closed cycle, the algebraic sum of the work done on the system and the heat absorbed by the system is always zero. Equivalently, there exists a state function U, the internal energy, such that the infinitesimal change in any process is

l9_7.png

(9.3)

where D Q is the heat absorbed by the system and D W is the work done on the system. (The inexact differentials remind you that Q and W are not themselves state functions.)

In the common convention of continuum mechanics the work done on the system by compression is written D W=−P dV (plus other possible work terms). The first law is simply the continuum expression of the conservation of energy you already met in mechanics and electrodynamics; heat is merely an additional channel through which energy can cross the boundary.

Principle 9.2: Energy is conserved. Heat and work are two interchangeable forms of energy transfer.

What is Heat?

Here is a dirty little secret. Ready? In thermodynamics heat is called enthalpy. This is an almost useless definition, as enthalpy is heat and heat is enthalpy, clear as mud, right?

In thermodynamics we can relate three quantities: the enthalpy (considered to be a measure of the total internal energy of a system) we write this with the symbol Q, temperature—we will adopt the statistical viewpoint here and consider this to be the average kinetic energy of a system of atoms/ions/molecules—we will write this T, and the entropy—we will cover that below. This relation is:

l9_8.png

(9.4)

or, the variation in enthalpy is numerically equivalent to the product of the temperature and the differential of the entropy. What does this mean? It means that to get a change in enthalpy, we need a corresponding change in entropy. If energy flows out of a system, the entropy changes. If the entropy changes, the energy changes.

Why the variation, instead of the differential of enthalpy? It is partly because we are considering the overall change in enthalpy rather than infinitesimal changes. Mostly it is because if we have a net flux of enthalpy into a system, we cannot reduce the entropy and get work out of the system. Thus enthalpy changes are not necessarily reversible.

In thermodynamics we consider matter in the large-scale. At the scale of ordinary objects we will try to understand how energy behaves. Here we will not be considering any object as a particle, but as an unbroken region where the material of the object occupies a given volume in space. This volume will be the physical extent of the object under study, what we will call our thermodynamic system. Such a system can be simple, composed of a single whole exhibiting simple behavior, or it can be made up of several smaller volumes each having different properties. Systems have some sort of boundary that separate them from their environment. As we will see, thermodynamic systems have properties that are different from what we are used to.

The Second Law — Entropy and the Direction of Processes

The first law permits any process that conserves energy, including the spontaneous flow of heat from a cold body to a hot body or the complete conversion of heat into work without residue. Neither of these processes is ever observed. The second law codifies that experimental fact.

One of its classic statements (due to Kelvin and Planck) reads: “It is impossible to construct a device that, operating in a cycle, produces no effect other than the extraction of heat from a single reservoir and the performance of an equivalent amount of work.”

An equivalent statement (due to Clausius) is: “It is impossible for heat to flow spontaneously from a colder body to a hotter body without leaving any other change in the universe.”

Both statements imply the existence of a second state function, the entropy S, defined so that for a reversible process

l9_9.png

(9.5)

For any real (possibly irreversible) process that takes a closed system from one equilibrium state to another,

l9_10.png

(9.6)

with equality only for reversible paths. When the system is isolated (δ Q=0) the inequality collapses to the celebrated statement

l9_11.png

(9.7)

Entropy never decreases in an isolated system; it is the quantitative measure of the irreversibility of natural processes and of the “arrow of time.”

Principle 9.3: The entropy of an isolated system never decreases. Natural processes have a preferred direction.

The Third Law — The Unattainability of Absolute Zero

The third law (due to Nernst–Planck) concerns the behavior of entropy as the temperature approaches absolute zero: “The entropy of a perfect crystal at absolute zero is equal to zero (or, more weakly, the entropy change associated with any isothermal reversible process approaches zero as T0).”

A direct consequence is that absolute zero is unattainable in a finite number of thermodynamic operations. The third law also supplies the absolute reference point needed to convert the entropy differences furnished by the second law into absolute entropies that can be tabulated and compared across different substances.

Principle 9.4: Absolute zero is an asymptotic limit; entropy tends to a universal constant (conventionally zero) as that limit is approached.

Summary

The zeroth law defines temperature.  

The first law defines internal energy and asserts its conservation.  

The second law defines entropy and asserts that it never decreases in an isolated system.  

The third law fixes the absolute scale of entropy and declares absolute zero unattainable.

Together the four laws form a closed logical structure. Every subsequent thermodynamic potential, every efficiency limit of a heat engine, and every criterion of equilibrium is a direct corollary of these four statements. You are now ready to explore the concrete state functions that the laws guarantee must exist.

Internal Energy, Heat, and Work

The first law introduced you to three quantities that are easily confused: internal energy, heat, and work. Clarifying their distinct roles is essential before any concrete calculation can be performed.

Internal Energy — A State Function

The internal energy U is a thermodynamic state function. Its value depends only on the current equilibrium state of the system, not on the history by which that state was reached. For a simple compressible substance the natural variables of U are entropy and volume, U=U(S,V), although any other convenient pair of independent state variables may be used once the equation of state is known.

Because U is a state function, the change Δ U between two states is independent of path

l9_12.png

(9.8)

In an infinitesimal process one therefore writes the exact differential dU.

Definition 9.2 The Internal Energy of a System: The thermodynamic state function whose differential appears in the first law; it represents the total microscopic energy stored within the system (kinetic, potential, chemical, ...) once the macroscopic kinetic and potential energies of the system as a whole have been subtracted.

Heat and Work — Path-Dependent Transfers

Heat D Q and work D W are not state functions. They are modes of energy transfer across the boundary of the system. The amount of heat absorbed or the amount of work performed depends on the particular process that connects two states; different paths yield different values of Q and W even when Δ U remains the same.

The infinitesimal first law therefore reads

l9_13.png

where the inexact differentials D Q and D W warn you that neither Q nor W can be written as the difference of a state function.

Sign convention. Throughout these lessons D Q is positive when heat enters the system and D W is positive when work is done on the system. (The opposite convention for work is common in engineering texts; consistency is more important than which convention is chosen.)

Mechanical Work

For a simple compressible system the only macroscopic work mode is compression or expansion against an external pressure. In a quasi-static process the work done on the system is

l9_14.png

(9.9)

(The minus sign appears because an increase in volume, dV>0 , corresponds to work done by the system.) Other work modes—electrical, magnetic, surface-tension, etc.—may be added when the corresponding intensive and extensive variables are relevant

l9_15.png

(9.10)

More About Heat

Heat is the energy transferred solely by virtue of a temperature difference. When two systems at different temperatures are placed in thermal contact, energy flows spontaneously from the hotter to the colder; that energy is heat. There is no mechanical coordinate whose change accounts for the transfer; heat is the residual energy flow once all recognized work modes have been subtracted.

In a reversible process the heat absorbed is related to the entropy change by

l9_16.png

(9.11)

For irreversible processes no such simple equality holds, although the inequality D Q≤T dS remains valid for a closed system.

Exact and Inexact Differentials

In thermodynamics you constantly meet expressions of the form dU, D Q and D W. The different symbols are not decorative; they mark a profound mathematical distinction that determines what you may and may not integrate.

Exact Differentials

A differential expression

l9_17.png

(9.12)

defined on a simply-connected region is called exact if there exists a scalar function F(x,y) whose total differential is precisely that expression. Equivalently, the line integral of dF between any two points is independent of path and equals the difference l9_18.png.

If we write

l9_19.png

(9.13)

and

l9_20.png

(9.14)

By Clairaut’s theorem (equality of mixed partials) these two are equal whenever F is twice continuously differentiable. Consequently the practical test  

l9_21.png

(9.15)

When the test is satisfied, F is a state function and the symbol dF is written with an ordinary “d”.

Internal energy, enthalpy, entropy, and all of the thermodynamic potentials are state functions; their differentials are exact.

Inexact Differentials

Heat and work are different. There do not exist functions Q or W of the state variables such that

l9_22.png

(9.16)

is the total differential of a state function. The amount of heat absorbed, or the work performed, depends on the particular path taken between two states. Their differentials are therefore written with a D (or sometimes a crossed d) to remind you that they are inexact.

The classic illustration is the first law itself

l9_23.png

The left-hand side is exact; the two terms on the right-hand side are separately inexact. Only their sum is path-independent.

Integrating Factors

An inexact differential can sometimes be rendered exact by multiplication with a suitable function. The most famous example is the second law where D Q is inexact, yet

l9_24.png

is exact. The absolute temperature T is an integrating factor for the reversible heat. The existence of that integrating factor is equivalent to the existence of the state function called entropy.

Practical Consequences

You may always write l9_25.png, l9_26.png, etc.

You may never write l9_27.png or l9_28.png; the symbols l9_29.png and l9_30.png are not unique.

When you integrate an inexact differential you must specify the path; when you integrate an exact differential the path is irrelevant.

This single mathematical distinction—exact versus inexact—underpins every subsequent manipulation of thermodynamic identities, Maxwell relations, and potential functions. Once you are comfortable with it, the formal structure of the theory becomes transparent.

Heat Capacities

Were we to consider the change in heat, DQ, with respect to a given change in an arbitrary state variable, f, then the heat capacity holding another state variable, g, as constant is

l9_31.png

(9.17)

From this we have,

l9_32.png

(9.18)

So, if we want to find the specific heat, the heat change, with respect to a change in temperature holding the volume constant we arrive at expressions for temperature and volume,

l9_33.png

(9.19)

since the volume is constant,

l9_34.png

(9.20)

giving us,

l9_35.png

(9.21)

so,

l9_36.png

(9.22)

In a similar way we can find

l9_37.png

(9.23)

We can now rewrite (9.18)

l9_38.png

(9.24)

So,

l9_39.png

(9.25)

We can rewrite the first law of thermodynamics,

l9_40.png

(9.26)

Thermodynamic Potentials

The internal energy U is a perfectly good state function, yet it is not always the most convenient one. In the laboratory you often control temperature and pressure rather than entropy and volume. Thermodynamic potentials are simply alternative state functions, each constructed so that its natural variables match the quantities you can hold fixed in a given experiment. Once the right potential is chosen, equilibrium conditions, stability criteria, and maximum available work become almost automatic.

The Mathematical Device: Legendre Transforms

Recall that the first law for a simple compressible system reads

l9_41.png

(9.27)

The natural variables of U are therefore entropy and volume U=U(S,V). To change an independent variable we use a Legendre transform. Given a function f(x) whose derivative is u=df/dx, the Legendre transform replaces x by u and produces the new function

l9_42.png

(9.28)

(The original variable x is eliminated by solving u=df/dx for x(u). Each thermodynamic potential is obtained by applying one or more Legendre transforms to U.

The Four Principal Potentials

1. Internal Energy (U(S,V))

l9_43.png

The natural variables are S and V. No transform has been performed.

2. Enthalpy (H(S,P))

We wish to replace the independent variable V by its conjugate l9_44.png.

In general a Legendre transformation has the structure of a relationship between the generic functions F and G,

l9_45.png

The Legendre transform with respect to V is

l9_46.png

(9.29)

Differentiating and substituting dU immediately yields

l9_47.png

(9.30)

The natural variables are S and P. Enthalpy is the natural potential for constant-pressure processes. The heat absorbed at constant pressure is exactly Δ H.

3. Helmholtz Free Energy (F(T,V))

We now replace S by its conjugate l9_48.png. The Legendre transform with respect to S is

l9_49.png

(9.31)

Differentiation produces

l9_50.png

(9.32)

The natural variables are T and V. F measures the maximum work available from a system held at constant temperature and volume. At fixed T and V, spontaneous processes decrease F; equilibrium is the minimum of F.

4. Gibbs Free Energy (G(T,P))

Two successive Legendre transforms (or one transform of either H or F) replace both S and V

l9_51.png

(9.33)

The differential is

l9_52.png

(9.34)

The natural variables are T and P. This is the potential most often used in chemistry and materials science. At constant temperature and pressure, spontaneous processes decrease G; equilibrium is the minimum of G. Phase equilibria and chemical-reaction equilibria are statements that G is stationary.

5. Chemical Potential, Reservoirs, and the Grand Canonical Potential

The Gibbs free energy of a closed system, composed of a single substance, per unit mole is a thermodynamic function called the chemical potential, or—where n is the number of moles:

l9_53.png

(9.35)

It turns out that an open system also has a chemical potential, assuming we hold the volume and entropy constant,

l9_54.png

(9.36)

Lets assume that our system has a large volume at a uniform temperature, that volume is called a heat reservoir. Likewise a large volume at a uniform chemical potential is called a particle reservoir.

When a system having a definite volume is in thermal equilibrium with both a heat reservoir and a particle reservoir, it also has a thermodynamic function Ψ, also a double Legendre transformation, called the grand canonical potential,

l9_55.png

(9.37)

Maxwell Relations

Because each potential is an exact differential, its mixed second derivatives are equal. These equalities are the Maxwell relations. For example, from dG=−S dT+V dP one obtains

l9_56.png

(9.38)

There are three further Maxwell relations, one from each of the other potentials. They allow you to replace an experimentally difficult derivative by an easier one.

Entropy

The first law tells you that energy is conserved; it does not tell you which processes actually occur. A cup of hot coffee left on the table cools, it never spontaneously grows hotter. A gas expands into vacuum, it never contracts back by itself. The second law elevates these everyday observations into a precise statement by introducing a new state function—entropy.

The Classical Definition

For a reversible process that exchanges heat l9_57.png with a reservoir at temperature T, the infinitesimal change in entropy is defined by

l9_58.png

Because the right-hand side is an exact differential (the temperature T is an integrating factor for l9_59.png), entropy itself is a state function. Between any two equilibrium states the change in entropy is therefore path-independent

l9_60.png

(9.39)

You may compute the integral along any convenient reversible path that connects the same two states.

Definition 9.3 The entropy of a system: The state function whose differential in a reversible process is the reversible heat divided by the absolute temperature.

The Second-Law Inequality

Real processes are irreversible. For any process that takes a closed system from one equilibrium state to another the inequality

l9_61.png

(9.40)

holds, with equality if and only if the process is reversible. When the system is thermally isolated (D Q=0) the inequality collapses to the most famous statement of the second law

l9_62.png

The entropy of an isolated system never decreases. It remains constant only for reversible processes and increases for every irreversible process. This is the quantitative expression of the “arrow of time.”

Principle 9.5: In an isolated system entropy is non-decreasing; natural processes produce entropy.

Entropy as a Measure of Energy Dispersal

Entropy measures how widely energy is dispersed among the available degrees of freedom of a system. When a hot object cools by heating its cooler surroundings, the same quantity of energy becomes spread over a larger set of microscopic motions; the total entropy rises. When a gas expands freely, the energy of its molecules is distributed over a larger volume; again entropy rises. In both cases the process is irreversible precisely because the energy has become more dispersed and cannot spontaneously reconcentrate.

The Statistical Interpretation

Boltzmann made the connection to the microscopic world quantitative. If Ω is the number of microscopic states consistent with a given macroscopic equilibrium state, then

l9_63.png

(9.41)

where k is Boltzmann’s constant. The second law becomes the statement that an isolated system evolves toward the macroscopic state that can be realized in the greatest number of ways. The classical thermodynamic entropy and the statistical entropy are the same quantity; they differ only in the language used to describe it.

Absolute Entropy and the Third Law

The second law supplies only entropy differences. The third law fixes the absolute scale, where the entropy of a perfect crystal approaches zero as the temperature approaches absolute zero. With that reference point one can tabulate absolute entropies and compute equilibrium constants, reaction affinities, and phase diagrams from first principles.

The Ideal Gas

The ideal gas is the simplest thermodynamic system that still illustrates every major idea you have met: equation of state, internal energy, enthalpy, entropy, and all four thermodynamic potentials. Because its microscopic constituents are assumed to be point particles that interact only through elastic collisions, the macroscopic relations close in closed form and can be written down exactly.

Equation of State

An ideal gas obeys the Ideal Gas Law

l9_64.png

(9.42)

(or P V=R T on a molar basis), where R is the universal gas constant (l9_65.png) and n is the number of moles. The equation already implies that the product P V depends only on temperature; this single fact determines most of the thermodynamic properties.

From this we can draw a surface that exposes the behavior of an ideal gas.

l9_66.gif

Figure 9.1: The ideal gas visualized.

Internal Energy and Enthalpy

Joule’s free-expansion experiments (and the microscopic picture) show that the internal energy of an ideal gas is independent of volume

l9_67.png

(9.43)

Theorem 9.1: The Equipartition Theorem: Each quadratic term that appears in the energy of a molecule contributes, on average, l9_68.png of energy per molecule (or l9_69.png per mole), where k is Boltzmann’s constant (l9_70.png) and T is the absolute temperature.

For a monoatomic gas the equipartition theorem supplies the explicit form

l9_71.png

(9.44)

(more generally l9_72.png with l9_73.png constant). The enthalpy then follows at once from its definition

l9_74.png

(9.45)

Thus H is likewise a function of temperature alone, and the molar heat capacities are related by the familiar identity

l9_75.png

(9.46)

Entropy

Because dU=T dS−P dV and l9_76.png, the entropy differential of an ideal gas is

l9_77.png

(9.47)

Integration between two states yields the standard expression you met earlier

l9_78.png

(9.48)

Equivalently, in terms of pressure and temperature,

l9_79.png

(9.49)

Both formulae confirm that entropy increases when the gas expands isothermally or is heated at constant volume—precisely the dispersal of energy required by the second law.

Thermodynamic Potentials

All four potentials can now be written explicitly. Taking the zero of energy and entropy at a reference state l9_80.png) one has (per mole, for simplicity)

l9_81.png

(9.50)

l9_82.png

(9.51)

l9_83.png

(9.52)

l9_84.png

(9.53)

l9_85.png

(9.54)

(The absolute entropy of a monoatomic ideal gas is given by the Sackur–Tetrode equation, which fixes the reference value from statistical mechanics and thereby satisfies the third law in the appropriate classical limit.)

l9_86.png

(9.55)

with m is the mass of a single particle, U is the internal energy, and h is Planck’s constant.

Reversible Processes

Because the equation of state and the energy are so simple, every classic reversible process can be integrated in closed form

Isothermal (T=const): Δ U=0, l9_87.png.

Isobaric (P=const): l9_88.png, W=−P Δ V.

Isochoric (V=const): l9_89.png, W=0.

Adiabatic reversible (Q=0): l9_90.png, l9_91.png, where l9_92.png.

These explicit results serve as the benchmark against which the behavior of real gases is compared.

Irreversible Processes

The same equations of state still hold in the initial and final equilibrium states of an irreversible process (free expansion, irreversible adiabatic compression, ...). Only the path functions Q and W change; Δ U and Δ S remain calculable from the state functions alone. The classic free expansion into vacuum, for example, gives Δ U=0 and

l9_93.png

(9.55)

illustrating the irreversible increase of entropy in an isolated system.

Why the Ideal Gas Matters

The ideal-gas model is the thermodynamic analogue of the free particle in mechanics or the vacuum Maxwell equations in electrodynamics: it is simple enough to solve completely, yet rich enough to exhibit every structural feature of the general theory. Once you can move fluently among P V=n R T, U(T), the entropy formulae, and the four potentials, the corresponding calculations for real substances become straightforward extensions—equations of state are more complicated, heat capacities depend on temperature, residual entropies appear, but the underlying thermodynamic logic remains exactly the same.

You now possess a fully worked laboratory in which every abstract relation of the preceding sections can be tested by direct computation. The ideal gas will remain your principal example as we turn to energy balances, reversible and irreversible processes, and the practical implementation of thermodynamics in Mathematica.

Energy Balance

The first law is a statement of energy conservation. When it is written for a concrete system—closed or open—it becomes an energy-balance equation that accounts for every way energy can enter, leave, or accumulate inside the system. Mastering these balances is the practical heart of engineering thermodynamics.

Closed Systems

For a closed system (no mass crosses the boundary) the first law integrated between two states is simply

l9_94.png

(9.57)

where Q is the net heat absorbed by the system and W is the net work done on the system. In differential form,

l9_95.png

If the only work mode is compression, D W=−P dV and the balance becomes the familiar expression you have already used. When additional work modes (electrical, shaft, ...) are present they are simply added to D W.

Because U is a state function, Δ U can be computed from any convenient path once the end states are known; Q and W themselves remain path-dependent.

Open Systems — The Control-Volume Formulation

Most practical devices (turbines, compressors, nozzles, heat exchangers) continuously exchange mass with their surroundings. One therefore draws an imaginary control surface around the device and writes the balance for the control volume C V enclosed by that surface.

Mass can enter and leave, carrying its own internal energy, kinetic energy, and potential energy. In addition, the fluid that enters or leaves does flow work P V on the control volume. The combination U + P V is precisely the specific enthalpy H, so the energy balance for an open system reads, in rate form,

l9_96.png

(9.58)

Here

l9_97.png is the total energy inside the control volume,

l9_98.png and l9_99.png are the rates of heat and work transfer to the control volume,

l9_100.png denotes mass-flow rates,

the sums run over all inlet and output ports.

Steady-Flow Devices

In the great majority of engineering applications the control volume operates in steady state

l9_101.png

(9.59)

and

l9_102.png

(9.60)

The balance then collapses to an algebraic relation among the inlet and outlet enthalpies, kinetic and potential energies, and the heat and work rates. For a single-stream device (one inlet, one outlet) it becomes

l9_103.png

(9.61)

Several special cases follow at once:

Nozzle (no work, negligible heat, horizontal) l9_104.png.

Turbine (adiabatic, negligible kinetic and potential changes) l9_105.png.

Throttling valve (no work, no heat, negligible kinetic and potential changes) l9_106.png.

Reversible and Irreversible Processes

Every real process generates entropy and is therefore irreversible. Yet the idealized limit of a reversible process—one that produces zero entropy—remains indispensable since it supplies the theoretical maximum performance against which every real device is measured.

What “Reversible” Means

A process that takes a system from state 1 to state 2 is reversible if both the system and its surroundings can be restored to their initial states without producing any net change in the universe. Equivalently, a reversible process is one that can be traversed in either direction by an infinitesimal change in the external conditions, and for which the equality

l9_107.png

holds at every step.

In practice a process is reversible only when

it is quasi-static (the system passes solely through equilibrium states),

there is no friction, viscosity, or inelastic deformation,  

heat is transferred across an infinitesimal temperature difference,  

and no unrestrained expansion or mixing occurs.

Irreversible Processes

Any process that fails one or more of the above conditions is irreversible. Common sources of irreversibility include

finite-temperature-difference heat transfer,  

fluid friction and turbulence,  

free expansion into vacuum,  

inelastic deformation or hysteresis,  

mixing of dissimilar substances,  

and chemical reactions proceeding at finite rates.

For an irreversible process the second law supplies only the inequality

l9_108.png

The entropy generated by the irreversibilities is a direct measure of the lost opportunity to perform work.

Work and the Reversible Limit

For a closed system the work done by the system between two states is maximized when the process is reversible. In particular, for a simple compressible substance

l9_109.png

(9.62)

is the largest possible work output (or the smallest work input) compatible with the given end states. Any irreversibility reduces the work output (or increases the work input) by an amount l9_110.png, where l9_111.png is the temperature of the surroundings and l9_112.png is the total entropy generated.

The same principle appears in open systems as the exergy (or availability) balance: the maximum useful work that can be extracted from a stream as it is brought to equilibrium with the environment is diminished exactly by the irreversibilities that occur inside the device.

Practical Consequences

Efficiency limits. The Carnot efficiency l9_113.png is the reversible limit for a heat engine operating between two thermal reservoirs. Every real engine falls short of this value by an amount proportional to the entropy it generates.  

Lost work. In any irreversible process the quantity l9_114.png is the work that could have been obtained (or the extra work that had to be supplied) had the process been executed reversibly.  

Calculation strategy. One still uses the reversible path to compute changes in state functions (Δ U, Δ H, Δ S, ...). The actual heat and work of the irreversible process are then found from the first law once Δ U is known, or from an energy balance once the entropy generation has been estimated.

The Ideal-Gas Illustration

Consider the free expansion of an ideal gas into vacuum (the Joule expansion). The end states are connected by Δ U=0 and

l9_115.png

(9.63)

No work is performed and no heat is exchanged, yet entropy rises. The same two states could have been linked by a reversible isothermal expansion that produces work l9_116.png. The difference between that reversible work and the zero work of the free expansion is precisely the “lost work” T Δ S.

Equilibrium and Non-Equilibrium Processes

In what we have studied so far we have not been too concerned with the underlying structure of thermodynamics, only its facts. Now we take a step back and look at what we have done. It is important to realize that in each established principle above we are dealing with isolated systems that have a particular type of boundary. This type of thermodynamics is called equilibrium thermodynamics and falls into two broad categories named after the individuals who promoted them. If we restrict the boundary to one that is either adiabatic or diathermal then we are dealing with the Carathéodory treatment (Cara-thee-oh-door-ee), a very axiomatic and mathematically rigorous treatment. The second uses both the adiabatic and diathermic boundaries, and adds the semipermeable (allowing specific types of matter to cross), and permeable boundaries (those that allow matter to freely cross); these form Gibbsian thermodynamics (named for J. Willard Gibbs). In either case the system must attain thermal equilibrium and they usually assume that there is no change in thermodynamic state variables with time.

One can ask, “Is equilibrium thermodynamics realistic?” The answer is that it depends on the thermodynamic system you are looking at. Sometimes things can attain, or at least come very close to attaining, thermal equilibrium pretty fast; once they do then equilibrium thermodynamics is a good model. In other cases there is too much time dependence in the variables, then we need something else.

Most natural systems do not conform to equilibrium thermodynamics. One solution is a set of thermodynamic theories that can be lumped together under the label non-equilibrium thermodynamics. One of the central problems in nonequilibrium thermodynamics is how to define entropy for a system not in equilibrium. One approach is to adopt a coarse-graining type of argument where each small volume is assumed in thermal equilibrium, this is called classical irreversible thermodynamics. Systems that exhibit mass transport (flows of material) and/or the production of entropy, but have no significant time dependence are called steady states. Other things to consider are the rate of the production of entropy and the rate of dissipation of energy.

To some extent these ideas have been addressed in the more accurate theory of statistical mechanics, where we consider not volumes of a given density, but the averaged behavior of vast numbers of individual particles. This is well beyond the scope of the current lesson, and we will get to this in due time. Until then, we will have to think of thermodynamics when we need to consider the internal energy of an object.

Doing This in Mathematica

We can practice doing a couple of things. First, we can play with Legendre transformations.

To begin with we can try to write a Mathematica function to calculate a Legendre transformation. Recall that generically,

l9_117.png

also recall form calculus that

l9_118.png

so we can write:

l9_119.png

This is the generic function for calculating the Legendre transformation of the function f and the variable a. For a function of one variable, say G(a),

l9_120.png

l9_121.png

For a function of two variables, say G(a,b)

l9_122.png

l9_123.png

where l9_124.png represents the first derivative with respect to the first variable, in this case a. So, this is the same as l9_125.png.

l9_126.png

l9_127.png

where l9_128.png represents the first derivative with respect to the second variable, in this case b. Here is a simple example, if we substitute l9_129.png

l9_130.png

let’s make sure Mathematica can do this:

l9_131.png

l9_132.png

It can! A more complicated example,

l9_133.png

l9_134.png

l9_135.png

l9_136.png

Invent an internal energy function, and calculate the various Legendre transformations we covered above. Make whatever assumptions you need to, but list them.

For Further Study

Enrico Fermi, (1936), Thermodynamics. General Publishing Company, reprinted by Dover Publications in 1956.

B. H. Lavenda, (1978), Thermodynamics of Irreversible Processes. MacMillan Press, reprinted in 1993 by Dover Publications.

Created with the Wolfram Language