Review of Thermodynamics

 

The first law

The first law of thermodynamics is a statement of the conservation of energy. Specifically, the first law addresses the interconvertability of work and heat as forms of energy.

In words the law is

Internal energy = heat + work

This can be expressed symbolically as

dU = dq + dw

or in integral form as

DU = q + w

The Delta indicates that U is a state function. This means that the change in internal energy depends only on variables of state T, V, etc. and not on the path taken from one state to another. Heat and work, on the other hand, do depend on the path taken.

Calculating the work is possible starting with the definition

work = force x distance

dw = -F dr

This can be recast by dividing the work by an area and by multiplying the displacement by an area

dw = -(F/A) d(rA) or dw = -P dV

We can see immediately that pressure volume work follows from the standard definition of a force operating through a distance. Note the thermodynamic sign convention that states that the work done by the system is negative and the work done on the system is positive.

The heat can be calculated using the constant volume heat capacity.

heat = heat capacity x temperature change

dq = Cv dT

 

The second law

The second law of thermodynamics tells us that the entropy of system is

dS = dq/T

for a reversible process. Note that this definition only applies to a reversible process, but that is consistent because the entropy of the system will always be calculated along a reversible path. In general, if we consider the system and the surroundings the second law states that the entropy of both (i.e. the universe) tends toward a maximum. If a change is reversible the heat exchanged between the system and surrounds dqrev will have a magnitude such that dqrev/T exactly is equal to the entropy change in the system dS. For an irreversible process the heat exhanged between the system and surroundings, dqirr will be less than TdS such that

dS > dqirr/T

For a reversible process we can write a combined expression for the first and second laws of thermodynamics

dU £ TdS - PdV

where the < applies for irreversible processes and the = sign applies for reversible processes.

 

Free energy functions

At constant volume, dV = 0, and we have

dU £ TdS

or

dU - TdS £ 0

Since T and V are held constant, we can write this expression as

d(U - TS) £ 0

Thus, we can define a new state function, A = U - TS.

dA £ 0

The quantity A is called the Helmholtz free energy. In a system held at constant T and V, the Helmholtz energy will decrease until all possible spontaneous processes have occurred at which time the system will be in equilibrium.

The internal energy is a natural function of entropy and volume, U(S,V). The Helmholtz free energy is a natural function of temperature and volume, A(T,V). We can also consider the enthalpy, H as a natural function of entropy and pressure and the Gibbs free energy as a natural function of temperature and pressure, G(T,P). The transformation of variables between these two sets of functions is known as a LeGendre transform.

H = U + PV

G = A + PV

In differential form we have

dH = dU + PdV + VdP = TdS + VdP

dG = dA + PdV + VdP = -SdT + VdP

Free energy functions are at the heart of chemical thermodynamics. They describe the spontaneous direction for a process in terms of the heat released by a reaction (DH) and the entropy change in the system (DS). If the heat exchanged with the surroundings creates a greater disorder in the surroundings than the order in the system created during the process, then it will be spontaneous. Understanding free energy is important in the context of molecular dynamics simulations. The potential energy surface defined by the individual terms (i.e. bond stretching, angle bending, torsions, and van der Waals) gives the contribution to the internal energy, but does not say anything about the entropy. The entropy is proportional to the number of states accessible to the system, and by the ergodic hypothesis that can be sampled by allowing a simulation to run for an infinitely long period of time and counting the states. Thus, our estimate of the entropy will be the weakest aspect of a computer simulation.

 

Statistical entropy and the third law

Entropy has a microscopic interpretation in terms of the number of conformations or arrangements accessible to a system. This statistical view of entropy was first proposed by Ludwig Boltzmann. It is simply,

S = k ln W

where W is the thermodynamic probability. W can be thought of as the number of ways that molecules can be oriented or arranged. The best way to illustrate this is to consider the third law of thermodynamics; all perfect crystalline substances have an entropy of zero and a temperature of absolute zero Kelvin. The classic example is HCl. HCl forms a perfect crystal because it has a large dipole moment and the HCl molecules have a strong tendency to align with one another. This means that there is only one form of the HCl crystal and W = 1. Since W = 1, the entropy, S = 0. Now consider carbon monoxide, CO. The dipole moment is very small and there is little penalty for changing one orientation, CO for another OC. Each of N CO molecules in a crystal can have one of two orientations. Therefore, the total number of configurations is W = 2N. The entropy of CO (an imperfect crystal!) at T = 0 K is S = k ln(2N) = Nk ln(2) = nR ln(2). We call this residual entropy.

Although we have used the entropy at T = 0 K as our example, the concept of statistical entropy is applicable at any temperature. The quantity W is the number of isoenergetic or degenerate states that exists in a system at a given temperature. This number could be counted by comparing a large number of systems with the same energy or by observing one system as it fluctuates among various configurations. The ergodic hypothesis states that both of these types of measurement should give the same result.

 

Equations of state

An equation of state relates the number or particles, temperature, pressure, and volume of the system. The ideal gas equation of state is

PV = nRT or PV = NkT.

n = number of moles.

N = number of molecules.

These two expressions are equivalent since nR = Nk. The universal gas constant R has units of Joules/mole-K and the Boltzmann constant k has units of Joules/molecule-K. Thus, R = NAk where NA is Avagradro's number.

An equation of state is required to apply any of the thermodynamic formulae above. For example, to calculate the reversible work, dw = - PdV, we need an expression for the pressure, which we obtain from the ideal gas law as P = nRT/V. Thus, dw = - (nRT/V)dV or in integrated form w = -nRT ln(Vf/Vi).

Deviations from ideality can be included in the equation of state. The most famous example of this is the van der Waals equation of state.

P = nRT(V-nb) - n2a/V2

In this equation of state b represents the finite volume of a gas molecule and a represents forces of attraction between gas molecules. The van der Waals equation of state predicts a phase transition between liquid and vapor and critical point above which there is no phase transition. These aspects are very realistic. However, the above equation of state is not well-suited for most molecular liquids. We shall see that it is relevant to simulations of liquid argon in a qualitative sense. Later in this course we shall demonstrate the application of statistical mechanical perturbation theory to the derivation of the van der Waals equation of state.

It has been a goal of many MD simulations to find an equation of state for a liquid (starting with liquids as simple as argon). The deviations from ideal behavior are enormous in liquids. Because of large number of possible solvent configurations computer modeling of liquids has become a very important means of obtaining information on the properties of liquids and further developing theories of liquids.

 

Thermodynamic relations

The Maxwell relations provide the basis for deriving a number of thermodynamic relations. The Maxwell relations are obtained from our four basic equations of thermodynamics

dU = TdS - PdV

dH = TdS + VdP

dA = -SdT - PdV

dG = -SdT + VdP.

Each of these is an exact differential which means that the second cross derivatives are equal.

(2U/SV) = (2U/VS)

Note that the expression for a total derivative is

dU = (U/S)VdS + (U/V)SdV

This latter expression implies that

(U/S)V = T

(U/V)S = -P

Thus we can form the cross derivative using T and -P on the right hand side of the above equations.

(T/V)S = -(P/S)V Maxwell relation

The above Maxwell relation and the others from the equations for dH, dA, and dG can be used to derive thermodynamic equations of state.

For example, suppose we wish to calculate (U/V)T. Note that this is not equal to -P since the variable that is held constant is temperature, not entropy as in the above expression from the total derivative. We take the derivative of dU with respect to V and constant T

(U/V)T = (U/S)V(S/V)T + (U/V)S

(U/V)T =T(S/V)T - P

and from the Maxwell relation for dA we have

(S/V)T = (P/T)V.

so

(U/V)T =T(P/T)V - P.

This expression gives the dependence of the internal energy on volume in terms of T and P at constant V. The latter can be obtained from an equation of state such as the ideal gas law or the van der Waal's equation.

 

Systems with more than one component

In general, U, H, A, and G depend upon the number of moles or molecules of each component. If we let Nj be the number of moles of component j we have

dU = TdS - PdV + SjU/Nj)S,V,Nk dNj

dU = TdS - PdV + Sj mj dNj.

Adding PV (Legendre transform) gives dH

dH = TdS +VdP + Sj mj dNj.

Subtracting TS (another Legendre transform) gives dA

dA = -SdT - PdV + Sj mj dNj

and dG

dG = -SdT +VdP + Sj mj dNj.

These equations show that

mj = (U/Nj)S,V,Nk = (H/Nj)S,P,Nk = (A/Nj)V,T,Nk = (G/Nj)P,T,Nk.

The quantity mj is called the chemical potential. We can apply Euler's theorem to obtain an expression for the Gibbs energy.

G = Sj NjG/Nj)P,T,Nk = Sj mj Nj

which can be reexpressed as

dG = Sj mj dNj + Sj dmj Nj.

Using the above relations that defined the chemical potential we have

0 = Sj dmj Nj. Gibbs-Duhem Equation

This equation can be used to relate the chemical potential of one component to that of another in a solution. This is very useful in cases where one of the chemical potentials is difficult to measure.

 

Phase equilibria

The chemical potential of a single component is just the molar free energy

dm = -SmdT +VmdP.

This expression can be used to describe phase equilibria for a single substance. A phase boundary occurs when the chemical potential is equal in the two phases (solid, liquid, or vapor).

dma = dmb

-Sm,adT + Vm,adP = -Sm,bdT + Vm,bdP

dP/dT = (Sm,b - Sm,a)/(Vm,b - Vm,a) ,
giving rise to the Clapeyron equation

dP/dT = DSm/DVm.

At the phase boundary a state of chemical equilibrium is maintained. Thus,

DGm = DHm - TDSm = 0,

DSm = DHm/T,

and

dP/dT = DHm/TDVm.

In practice this equation has two forms.

For solid-liquid phase equilibria the integrated form is

P = P* + DfusHm/DVmln(T/T*)

where DfusHm is the molar heat of fusion.

For liquid-vapor phase equilibria the integrated form is

P = P*exp{ DvapHm/R[1/T*-1/T]}

where DvapHm is the molar heat of vaporization.

 

Application to chemical equilibria

The chemical potential can be expressed a concentration (or partial pressure) dependent term referenced to the standard state of 1 bar of presure, Po = 1 bar.

dG = VdP

dG = (NkT/P)dP

G - Go = NkT ln (P/Po)

If we take N to be one mole, for the jth component we have

mj - mj o = RT ln (Pj/Pjo)

In a gas phase reaction

nAA + nBB + …. ß à nDD + nEE + …

The nj are the stoichiometric coefficients of the reaction. This can also be reexpressed as

nAA + nBB + …. - nDD - nEE + … = 0.

If we define the extent of reaction as l so that dNj = njdl for all the n's in the reactants and products.

At constant T and P we have

dG = Sj mj dNj = Sj (dmj nj)dl.

At equilibrium, G must be a minimum with respect to l, so we write

Sj mj nj = DrG.

The total free energy is obtained by substituting in the concentration dependent terms.

DrG = DrGo + RT ln Q

where

Q = (PD)nD(PE)nE …./(PA)nA(PB)nB…..,

and Q is known as the reaction quotient.

Note that the definition of the free energy of reaction is

DrG = (G/¶l)T,P.

At equilibrium DrG = 0 and so

0 = DrGo + RT ln K

Leading to the two widely used relations between the equilibrium constant and the standard free energy of reaction

DrGo = -RT ln K

and

K = exp{- DrGo/RT}.

 

Thermodynamics of solids

We can understand the forces between molecules in a liquid by analogy with the forces in a solid. Solids are easier to characterize because the lattice defines the positions of the molecules, ions, or atoms with respect to one another. Solid-state forces vary from extremely strong to relatively weak. Ionic crystals are examples of strongly bound solids. Organic solids usually have weak intermolecular interactions. Consideration of these interactions is useful since these exemplify non-bonding or van der Waals interactions of the type used in molecular force fields. In fact, enthalpies of sublimation are important data used to obtain parameters for force fields.

Coulombic forces between charged particles are responsible for the binding in ionic crystals. The Coulombic potential is

U(r) = - q1q2/4per

The terms for dipolar interactions have a 1/r6 distance dependence. This is much faster fall-off than the 1/r dependence of the Coulombic potential. Interestingly, dipole-dipole, dipole-induced-dipole, and induced-dipole-induced-dipole interactions all have a 1/r6 distance dependence. The latter is a force that arises due to molecular polarizability. There is a force of attraction between all molecules due to fluctuations in their electronic clouds. The attractive force is also known as the London dispersion force.

Repulsive potential wall due to the nuclear size of a given element (or atom type in a simulation force field). Typically this repulsive potential is represented by a 1/r12 fall-off. The combination of these terms with appropriate signs is

U(r) = 4e[(s/r)12 - (s/r)6].

These terms combine to provide the cohesive force that holds solids and liquids together. The internal energy vaporization of liquid or sublimation of a solid is nothing more than the sum of all non-bonding interactions (Coulombic and Lennard-Jones). The enthalpy can be obtained from
H = U + PV

The PV term is obtained from the appropriate equation of state for the gaseous form of the molecule.

The energies and enthalpies of ionic solids are dominated by Coulombic interactions. The lattice enthalpy can be calculated from Coulombic interactions. Using the calculated lattice enthalpy and experimental data one can obtain the enthalpy of formation of an ionic solid by means of the Born-Haber cycle. This is illustrated below for a generic salt of a monovalent ion M+X-.

The reactions needed to obtain M+X- in the solid phase to M+ + X- in the vapor phase are given below. The overall process of separating the ions in an ionic solid into the constituent ions is written as

M+X- (s) à M+ (g) + X- (g)

Lattice enthalpy

 

This reaction is composed of the following steps

M+X- (s) à M (s) + 1/2 X2 (g)

Dissociation enthalpy

M (s) à M (g)

Enthalpy of vaporization

1/2 X2 (g) à X (g)

Bond dissociation

M à M+ + e-

Ionization potential

X + e- à X-

Electron affinity

 

Thus, we can express the above in terms of a thermodynamic cycle that allows us to determine the dissociation energy using known experimental quantities. This is necessary for ionic solids because it is essentially impossible to directly measure the dissociation enthalpy. The dissociation enthalpy is equal to the enthalpy of formation (but opposite in sign). The above cycle and the reasoning applied will allow us to determine with some accuracy the forces between ions due to Coulombic interactions. Most liquids of interest are not ionic, although there may be ions in solution. The principle that the sum of all Coulombic terms and Lennard-Jones terms over all pair of particles is operative for liquids as well as solids. A discussion of how a computer can be used to calculate the potential energy is given in Allen & Tildesley (Chapter 1, page 18).

 

The link between microscopic and macroscopic quantities

In MD simulations there is a link between experimental data and the parameter set chosen to represent the internal energy of the system. A forcefield in a simulation represents the application of the potential terms (microscopic) that we have described above to a finite (typically from 100 to 1,000) number of molecules in a small cell. The force field consists of a choice of functions (Coulombic, Lennard-Jones or other) and the parameters used in those potential functions. For an ionic crystal it is clear that the charges q1 = 1, 2 or some integer and the same is true of q1. In a molecular liquid or polymer the charge set is a set of parameters for each nucleus (atom type) in the calculation. In addition to charge parameters each atom in the simulation is also associated with a set of e and s parameters for the non-bonded Lennard-Jones potential. The energy that results from a summation over all of the potential terms between all of the pairs of atoms in the system provides a means to calibrate parameters. Since the potential energy is equal to the internal energy we can compare the calculation directly with the experimental enthalpy of sublimation of a crystal.

Statistical mechanics provides other links between the form of the microscopic potential and macroscopically observable quantities. During the course we shall use the machinery of statistical mechanics to obtain thermodynamic quantities. This can be done precisely for gases for example in the relationship between the second virial coefficient and the potential:

(derived Chapter 12 in McQuarrie)

The potential can be related to the radial distribution function

(derived Chapter 13 in McQuarrie)

The classical configuration integral is the multi-dimensional integral over all coordinates in the system of the Boltzmann term in the potential e-u(r)/kT (derived in Chapter 7). The configuration integral cannot be calculated directly and this is the origin of the difficulty in describing condensed phases by means of analytical solutions of the equations of motion. Since an analytic solution is not available, a solution for the equations of motion can be obtained by sampling the motions of the entire system in a simulation under the force of the potential energy function with appropriate parameters