## Elementary concepts of thermodynamics

### Thermodynamic States, Processes, and State Variables

Geologic systems parts of the universe set aside in our mind for investigation are commonly more complex than, for example, the systems of a laboratory chemist. Geologic systems can be as large as the entire Earth and may endure for millions of years; they tend to be poorly definable and ever changing. Ideal end member systems in figure below are as follows:
1. Isolated system: No matter or energy can be transferred across the boundary of the system and no work can be done on or by the system. Considering the span of time over which most identifiable geologic systems operate, no part of the Earth, nor even all of it, can be considered perfectly isolated because transfers of energy and movement of matter typify the dynamic Earth.
2. Open system: The opposite of an isolated system. Matter and energy can flow across the boundary and work can be done on and by the system. Most geologic systems are open, at least in the context of their long lifetimes.
3. Closed system: Energy, such as heat, can flow across the boundary of the system, but matter cannot. The composition of the system remains exactly constant. Because movement of matter is slow across boundaries of, for example, a rapidly cooling thin dike, it can be considered to be virtually closed. On the other hand, a large intrusion of magma that remains molten for tens of thousands of years while various fluids move across the wall rock contact is not a closed system.
4. Adiabatic system: A special category of an isolated system is one in which no heat can be exchanged between the system and the surroundings. It is thermally insulated, but energy can be transferred across the system boundary through work done on or by it. Thus, an ascending, decompressing mantle plume or magma body cools as it expands against and does PV work on the surroundings, into which little heat is conducted because the rate of conduction is so slow. End-member thermodynamic systems. Classification is according to flows of matter and energy across their boundary with the surroundings.
Any thermodynamic state of a system can be characterized by its state properties, or state variables.
Some state properties are extensive in that they depend on the amount of material, such as the mass and volume of some chemicals constituting a system. Other state properties are intensive and are independent of the amount of material present; they have a definite value at each point within the system, such as T, P, and concentration of a particular chemical species. Density (mass/volume) is also an intensive property. For example, at T 25°C and P 1 atm, the density of stable graphite anywhere within a crystal is 2.23 g/cm3 whereas that of diamond is 3.51 g/cm3.
P and T are extremely important intensive variables whose change in rock-forming systems is responsible for changes in their state; for example, increasing T causes solid rock to melt. Values of the geobaric and geothermal gradients in the Earth can be used to approximate P and T at a particular depth, assuming these gradients to be uniform. Otherwise uniform gradients can locally be perturbed, such as the geothermal gradient around a shallow crustal magma intrusion.
Rock-forming geologic processes can be thought of as thermodynamic processes: those that affect a thermodynamic system as it changes from one state to another.. In a thermodynamic process there could be all kinds of work done on or by the system, flows of heat in or out, chemical reactions and movement of matter, tortuous paths taken, and so forth. However, two ideal, end-member thermodynamic processes can be recognized: irreversible and reversible. In an irreversible thermodynamic process the initial state is metastable, and the spontaneous change in the system leads to a more stable, lower-energy final state. The conversion of metastable volcanic glass into more stable crystals a process called devitrification under near-atmospheric conditions is one example of an irreversible process. The energy trough in which metastable glass is stuck has to be surmounted, overcoming the activation energy, before it can move to a lower energy state. The atomic bonds in the glass must be broken or reformed into more stable crystalline structures. Devitrification of glass occurs spontaneously in the direction of diminishing energy, never in reverse (Figure below). Spontaneous, irreversible thermodynamic process. A system in an initial higher-energy metastable state moves spontaneously to a lower-energy, stable state. The reverse never happens spontaneously.
In a reversible process, both initial and final states are stable equilibrium states and the path between them is a continuous sequence of equilibrium states. A reversible process is never actually realized in nature; it is a hypothetical concept that is used to make the mathematical models of thermodynamics work, and that’s all that can be said without an extended discussion.

### First Law of Thermodynamics

Suppose that a change in the internal energy, dEi of a rock system, such as a mineral grain, is produced by adding some amount of heat to it, dq. As a result of absorbing heat, the mineral grain expands by an increment in volume, dV, doing an increment of PV work, dw PdV, on the surrounding mineral grains. According to the first law of thermodynamics, or law of conservation of energy, the increase in internal energy due to heat absorbed is diminished by the amount of work done on the surroundings, or
(1) dEi = dq - dw = dq - PdV
In the “scientific” convention, heat added to (or work done on) a system, as in this formulation, is positive and work done by (or heat withdrawn from) the system on its surroundings is negative.

### Enthalpy

A new state property, the enthalpy, H, is defined here as
(2) H = Ei + PV
Upon differentiation, this equation becomes dH = dEi + PdV + VdP. Combining with equation (1) gives
(3) dH = dq + VdP
For isobaric (constant-pressure) changes, dP = 0, equation (3) becomes
(4) dHp = dqp
Although H may appear to be simply another and unnecessary label for q, the enthalpy is significant in providing a measure at constant P of how much heat is gained or lost from a system. Three possible changes in a system are accompanied by a gain or loss of heat, as follows:
1. 1. Chemical reactions, such as the reaction of quartz plus calcite creating wollastonite plus CO2.
2. 2. A change in state, such as crystals melting to liquid, that occurs at a fixed T once that T is reached in heating a system.
3. 3. A change in T of the system where no change in state occurs, such as simply heating crystals below their melting T.
The last two changes can be illustrated by a plot of enthalpy versus T for the diopside CaMgSi2O6 system as it is heated at constant P (Figure below). As diopside crystals absorb heat up to their melting point, T increases proportionally with the heat capacity, Cp. The slope of this line is (dH/dT)p Cp. At the melting T absorbed heat does not increase T, but is consumed in breaking the atomic bonds of the crystalline structure to produce the more random liquid array. This relatively large amount of absorbed heat at the constant T of melting, is the latent heat of melting, or enthalpy of melting, Hm. Once melting is complete, additional input of heat into the system raises the T of the melt proportional to its heat capacity. The slopes of the T-H lines above and below the
melting point are the heat capacities of the melt and the
crystals, respectively.
Note in Figure below that the latent heat involved in changing the state of the system from liquid to crystal, or vice versa, is similar to the heat absorbed in changing the T of the crystals or liquid by hundreds of degrees. Thus, melting of rock in the Earth to generate magma absorbs a vast amount of thermal energy, which moderates changes in T in the system. Enthalpy-T relations for CaMgSi2O6 at 1 atm.
They are either exothermic or endothermic, respectively. If catalyzed by a spark, the reaction between hydrogen and oxygen releases a burst of heat a rapid exothermic reaction, or explosion. Solidification of magma exothermically releases the latent heat of crystallization. In contrast, dissolution of potassium nitrate in water endothermically absorbs heat so that the container becomes cold. Thus, whether heat is released or absorbed in a chemical reaction provides no consistent clue as to the direction a reaction moves spontaneously.

### Entropy and the Second and Third Laws of Thermodynamics

Another way to look at spontaneity is in changes in the distribution or concentration of energy. Spontaneous thermal processes lead to a more even concentration of heat. A bowl of hot soup on the table eventually reaches the same T as the room. Heat flows spontaneously from a hot body to a cold, eliminating the difference in T. Without an uneven concentration of thermal energy, or the opportunity for heat flow, no work can be done. As heat flows from an intrusion of hotter magma into the cooler wall rocks, PV work of volumetric expansion is performed on them. The heat also drives endothermic chemical reactions of wall rock metamorphism. Water in an enclosed lake on a high plateau has gravitational potential energy relative to sea level, but so long as it is isolated from sea level and cannot flow, the concentration of energy is uniform and no work can be done. However, in the natural course of events, a river drains the lake into the sea, forming a process path along the potential energy gradient between the high- and low potential-energy levels. Work can then be done, driving turbines to generate electricity, eroding the river channel, transporting sediment, and so on.
One statement of the second law of thermodynamics is that spontaneous natural processes tend to even out the concentration of some form of energy, smoothing the energy gradient. A hot lava flow extruded from a lofty volcano cools to atmospheric T as it descends down slope, thereby reducing differences in thermal and gravitational potential energy between initial and final states in accordance with the second law.
Eventually, billions of years from now, all of the thermal energy in the Earth will be consumed in tectonism, volcanism, and other processes and dispersed into outer space. No mountains or volcanoes will be erected and erosion in the solar-powered hydrologic system will wear everything down to some common level (assuming the Sun does not run out of nuclear energy!). Without differences in the concentration of thermal and gravitational potential energy no geologic work can be accomplished and the planet will be geologically dead!.
The measure of the uniformity in concentration of energy in a system is called the entropy, S. The more uniform the concentration of some form of energy, the greater the entropy. The geologically dead planet will have maximal entropy.
Another, more useful, way to define entropy is to relate it to the internal disorder in the system. This provides an alternate statement of the second law: In any spontaneous process in an isolated system there is an increase in entropy, that is, an increase in disorder. The law in this form is illustrated by Figure 3.4, where white and black balls in the boxes represent molecules of two different gases. The spontaneous mixing of the two gas molecules results in an increase in “mixedupness,” disorder, randomness, or entropy. Note that there is no accompanying change in energy in this mixing process. Thus, another driving “force” for a spontaneous process is an increase in entropy, even though there may be no change in the energy.
At decreasing T, crystals become increasingly ordered, less atomic substitution is possible, and their entropy decreases. The third law of thermodynamics states that at absolute zero, where the Kelvin temperature is zero (0K = - 273.15°C), crystals are perfectly ordered and all atoms are fixed in space so that the entropy is zero.
A convenient way to think of relative entropies is that a gas made of high-speed molecules in random trajectories has a greater entropy than the compositionally equivalent liquid array, which, though still somewhat disordered, has linked atoms. The compositionally equivalent crystalline solid has still lower entropy, because its atoms form an ordered array. As an example, for water,
Ssteam > Sliquid water > Sice

### Gibbs Free Energy

The boulder-on-the-hill example has two major flaws as an analogy for the way natural systems, in general, change spontaneously from a higher to a lower energy state. First, it isn’t always gravitational potential energy that is minimized. Second, the analogy does not take into account the fact that in an isolated system a process can proceed spontaneously without any change in energy, but it does proceed with increasing entropy figure below. To overcome these two flaws, a new extensive property of a system is defined in such a way as to serve as a universal directionality pointer for spontaneous reactions. Entropy increases in a spontaneous, irreversible process in an isolated system. Bottom left, a hypothetical isolated system a box filled with atoms of two gases (black and white balls) separated by an impermeable wall. Bottom right, the wall has been removed in the box, and the atoms of the two gases have mixed spontaneously and irreversibly as a result of their motion (kinetic energy). An increase in disorder or randomness of the atoms in the system and an increase in entropy, S > 0. No change in energy has occurred.

This new property is called the Gibbs free energy, G, and is defined by the expression
G = H + TS. Combining with equation (2)
(6) G = Ei + PV - TS
In differential form this becomes
(7) dG = dEi + PdV + VdP - TdS - SdT
Remembering the work-pressure-volume relation (dW = PdV), we can write a parallel expression for the heat temperature-entropy relation
(8) dq = TdS
Equation 97) can be simplified by substituting this equality and also by making a substitution from equation (2) to obtain
(9) dG = VdP - SdT
Equation (9) is a useful thermodynamic expression that allows us to make powerful statements regarding the direction of changes in geologic systems as the independent intensive variables of state, T and P, change. The extensive entropy and volume properties of the system are also relevant factors.
If P and T remain the same through any spontaneous change in state, that is, dP = dT = 0, then, from
equation (9)
(10) dGP,T = 0
This is simply the condition for a minimum (or maximum) in G in P-T space where the slope of the tangent to the energy function is zero, or horizontal. Figure below shows a system that has moved to a state of minimal energy and stable equilibrium from a higher-energy, metastable state at constant P and T in a closed (constant composition) system. Note that the energy change,  GP,T, between the initial metastable state and the final stable state is negative: GP,T < 0.
In some spontaneously changing systems, increasing entropy is the dominant factor, whereas in  thers, decreasing energy is the dominant factor. The Gibbs free energy is formulated in such a way that it always decreases in a spontaneous change in the state of a system.
In other words, the Gibbs free energy of the final stable state is lower than that of the initial metastable state in figure below. The Gibbs free energy is a thermodynamic potential energy that, like gravitational potential energy for the hypothetical boulders, is the lowest possible in a state of stable equilibrium for a changing system. Gibbs free energy decreases in a spontaneous change in a closed system where the initial and final states are at the same P and T. In this example, the energy of diamond is greater than that of graphite at the same P and T, or Gdiamond > Ggraphite, so the change in energy, GP,T, in the spontaneous process is negative, or Gdiamond - Ggraphite = GP,T < 0. Note the activation energy barrier, Ea , that must be surmounted in order for the change to occur.

1. 1. 