# Materials Science and Engineering/Derivations/Models of Micro and Nanoscale Processing/Thermodynamics
## Thermodynamics: A Quick Review of the Fundamentals
### Review of Fundamentals
#### Chemical Potentials and Solution Theory
##### Ideal Solution

In chemistry, an ideal solution or ideal mixture is a solution in which the enthalpy of solution is zero; the closer to zero the enthalpy of solution, the more "ideal" the behavior of the solution becomes. Equivalently, an ideal mixture is one in which the activity coefficients (which measure deviation from ideality) are equal to one.
More formally, for a mix of molecules of A and B, the interactions between unlike neighbors (UAB) and like neighbors UAA and UBB must be of the same average strength i.e. 2UAB=UAA+ UBB and the longer-range interactions must be nil (or at least indistinguishable). If the molecular forces are the same between AA, AB and BB, i.e. UAB=UAA=UBB, then the solution is automatically ideal.

##### Non-Ideal Solution

Deviations from ideality can be described by the use of Margules functions or activity coefficients. A single Margules parameter may be sufficient to describe the properties of the solution if the deviations from ideality are modest; such solutions are termed regular.
In contrast to ideal solutions, where volumes are strictly additive and mixing is always complete, the volume of a non-ideal solution is not, in general, the simple sum of the volumes of the component pure liquids and solubility is not guaranteed over the whole composition range.
An activity coefficient is a factor used in thermodynamics to account for deviations from ideal behaviour in a mixture of chemical substances. In an ideal mixture the interactions between each pair of chemical species are the same (or more formally, the enthalpy of mixing is zero) and, as a result, properties of the mixtures can be be expressed directly in terms of simple concentrations or partial pressures of the substances present e.g. Raoult's law. Deviations from ideality are accommodated by modifying the concentration by an activity coefficient. Analogously, expressions involved gases can be adjusted for non-ideality by scaling partial pressures by a fugacity coefficient.

##### Raoultion Solutions

As $x_{i}$ approaches 1, the activity coefficient, $\gamma _{i}=1$ approaches 1

##### Henrien Solutions

As $x_{i}$ approaches 0, the activity coefficient, $\gamma _{i}$, approaches a constant

##### Regular Solution

A regular solution is a solution that diverges from the behavior of an ideal solution only moderately.
More precisely it can be described by Raoult's law modified with a Margules function with only one parameter α:
A regular solution is both Raoltion and Henrien

##### Calculating Thermodynamic Quantities

Free energy of transition of a pure material

##### Chemical Equilibria

$aA+bB\leftarrow \rightarrow cC+dD$

##### Elingham Diagram

In metallurgy, the Ellingham diagram is used to predict the equilibrium temperature between a metal, its oxide and oxygen.
Ellingham diagrams follow from the Second Law of Thermodynamics [ΔG = ΔH - TΔS] and are a particular graphical form of it. ΔG is the Gibbs Free Energy Change,ΔH is the Enthalpy Change and ΔS is the Entropy Change
The Ellingham diagram plots the Gibbs free energy change (ΔG) for the oxidation reaction versus the temperature. In the temperature ranges commonly used, the metal and the oxide are in a condensed state (liquid or solid) with the oxygen gaseous, the reactions may be exothermic or endothermic, but the ΔG of the oxidation always becomes more negative with higher temperature, and thus the reaction becomes more probable statistically. At a sufficiently high temperature, the sign of ΔG may invert (becoming negative) and the oxide can spontaneously reduce to the metal.
As with any chemical reaction prediction based on purely energetic grounds the reaction may or may not take place spontaneously on kinetic grounds if one or more stages in the reaction pathway have very high Activation Energies EA.
If two metals are present, two equilibriums have to be considered, so that the metal with the more negative ΔG reduces, the other oxidizes.
In industrial processes, the reduction of metal oxides is obtained using carbon, which is available cheaply in reduced form (as coal).
Moreover, when carbon reacts with oxygen it forms gaseous composts carbon monoxide and carbon dioxide, therefore the dynamics of its oxidation is different from that for metals: its oxidation has a more negative ΔG with higher temperatures. Using this property, reduction of metals may be performed as a double redox reaction at relatively low temperature.

#### Equilibrium Between a Binary Solid and Liquid

B-rich solid and liquid solutions
$\mu _{B}^{s,0}+RT\ln(\gamma _{B}^{s}x_{B}^{s})=\mu _{B}^{l,0}+RT\ln(\gamma _{B}^{l}x_{B}^{l})$
$\Delta \mu _{B}^{l\rightarrow s,0}=\mu _{B}^{s,0}-\mu _{B}^{l,0}$
$\Delta \mu _{B}^{l\rightarrow s,0}=RT\ln \left({\frac {\gamma _{B}^{s}x_{B}^{s}}{\gamma _{B}^{l}x_{B}^{l}}}\right)$
$\Delta g_{B}^{l\rightarrow s,0}=\Delta \mu _{B}^{l\rightarrow s,0}$
$\Delta g_{B}^{l\rightarrow s,0}=\Delta s_{f,B}^{l\rightarrow s,0}(T_{m,B}-T)$
$\Delta g_{B}^{l\rightarrow s,0}=\Delta s_{f,B}^{l\rightarrow s,0}\Delta T_{B}$
$\Delta s_{f,B}^{l\rightarrow s,0}\Delta T_{m,B}\approx RT\ln \left({\frac {\gamma _{B}^{s}x_{B}^{s}}{\gamma _{B}^{l}x_{B}^{l}}}\right)$
Ideal liquid solution and pure solid
$\Delta s_{f,B}\Delta T=RT\ln(x_{B}^{l})$
$\Delta s_{f,B}\Delta T\approx RT\left({\frac {\gamma _{B}^{l}x_{B}^{l}}{\gamma _{B}^{s}x_{B}^{s}}}\right)$
$\Delta s_{f,B}=RT\left(\ln \left({\frac {\gamma _{B}^{l}}{\gamma _{B}^{s}}}\right)+\ln \left({\frac {\gamma _{B}^{l}}{\gamma _{B}^{s}}}\right)\right)$
With $\Delta s_{f,B}$ and the phase diagram, the ratio $\gamma _{B}^{l}/\gamma _{B}^{s}$