How does oil on the surface of water prevent rust?

I distinctly remember a side-by-side comparison from a book where there are two nails submerged in water, in two beakers: one nail had a layer of oil on top of the water, and that nail didn't rust; the other did. 


It seems that oiling iron/steel products is supposed to prevent them from rusting: 
<http://www.justanswer.com/home-improvement/0n1r2-does-olive-oil-prevent-rust.html>
<https://outdoors.stackexchange.com/questions/1404/can-oiling-keep-tools-from-rusting>


The explanation given, I think, is that the oil somehow prevents oxygen from reacting with the metal. 


Can't help but wonder why. Oxygen is a non-polar molecule, so it should actually dissolve better in oils (which are also non-polar) than in water (which is highly polar) and therefore allow more oxygen molecules to contact the iron (metal) surface in some sort of equilibrium. 


Let's say that the conductivity of water and its ability to form electrochemical chains between metals is irrelevant in this thought experiment (i.e., a nail submerged in water in a glass). From what I understand, the other key item that has an effect on the formation of rust in water is that the oxygen molecules have better contact with the iron surface. 


This is supported by data: the concentration of oxygen in air is *far* higher than that in water. We know from experience, though, that wet iron rusts way quicker than dry iron does. 


If I am reading it correctly, the same data shows higher oxygen concentrations in non-polar solvents than in water. 


Here is the data: <http://www.nist.gov/data/PDFfiles/jpcrd219.pdf> 


Please correct me if I am reading it wrong. 


My question is:


**How does oiling prevent rust?** 


Edit: For the sake of clarity, let's say we use deionized water in a vacuum, drop in the nail, then put some oil (let's say it's caprylic acid) on it, and expose it to standard conditions. 




Well, I went and searched for the solubility of oxygen in water and oil, and found this summary paper on the NIST web site: ["The Solubility of Oxygen and Ozone in Liquids"](http://www.nist.gov/data/PDFfiles/jpcrd219.pdf) by Battino, Rettich and Tominaga, *J. Phys. Chem.Ref. Data.*, vol 12, no. 2, 1983.


Conveniently, the paper gives solubility data for oxygen in both water and olive oil. The solubility is given both as molar fractions, and also as the Ostwald coefficient $L$, defined as the volume of gas absorbed per volume of absorbing liquid.


Given the very different molar volumes of water and olive oil, I believe the latter provides a much more useful comparison here. Comparing tables 1 (water; note the $10^2$ factor in the header) and 25 (olive oil) in the paper, we see that the Ostwald solubility coefficient for oxygen in water is about 2,000 times higher than in olive oil:



```
 Temp. (K) | Temp. (°C) | L (water) | L (olive oil)
-----------+------------+-----------+---------------
    298.15 |         25 |     310.4 |        0.1269
    308.15 |         35 |     276.6 |        0.1326
    318.15 |         45 |     254.5 |        0.1383
    328.15 |         55 |     240.9 |        0.1441

```

So, yes, oxygen is a *lot* more soluble in water than in oil. But why?


Well, if [this web site](http://antoine.frostburg.edu/chem/senese/101/solutions/faq/predicting-DO.shtml) is to be believed, it's because of the strong hydrogen bonding between water molecules, which causes even liquid water to maintain some degree of an ice-like lattice structure, with gaps that small gas molecules like $\ce{O2}$ can easily slip into. Once there, the gas becomes [solvated](http://pubs.acs.org/doi/abs/10.1021/j150651a018), with the strongly polar water molecules inducing a temporary dipole in the $\ce{O2}$ molecule and thus creating an attractive [Debye interaction](https://en.wikipedia.org/wiki/Intermolecular_force#Debye_.28permanent-induced_dipoles.29_force). The overall solvation process is exothermic (i.e. releases heat), explaining why the solubility of oxygen in water decreases with temperature.


 16

Before you read this answer, please read the [ChemWiki article on the corrosion of iron](http://chemwiki.ucdavis.edu/Analytical_Chemistry/Electrochemistry/Case_Studies/Corrosion/Corrosion). This explains the normal (Earth-surface) process for iron rusting, which involves *both* oxygen and water. The water is a catalyst, but the oxygen is a reactant: the reaction consumes oxygen and will stop if it becomes unavailable.


Now, if you put a nail in a beaker, add enough water to completely cover the nail, and then add enough oil to completely cover the surface of the water, there won't be enough oxygen dissolved in the water to rust the nail more than a little bit. The only way for more oxygen to get into the water is by diffusing through the oil. We can model this as a chain of equilibria:


$$
\text{O}\_2\,\text{(air)} \rightleftharpoons \text{O}\_2\,\text{(oil)} \rightleftharpoons \text{O}\_2\,\text{(water)} + \text{Fe}\,\text{(nail)} \rightleftharpoons \text{Fe}\_2\text{O}\_3\,\text{(rust)}
$$


Thermodynamically, the equilibrium lies all the way to the right: completely rusted nail, having soaked up as much oxygen as possible, ultimately from the air. But, as described in [Ilmari's answer to this question](https://chemistry.stackexchange.com/a/34732/4921), oxygen is much less soluble in oil than in water. Therefore, oxygen will diffuse through the oil layer very slowly, and that will be the rate-limiting step. The rate constants for the air⇌oil and oil⇌water steps will depend on which oil is used and how thick the oil layer is.


So what happens is, after most of the oxygen that was initially dissolved in the water has been consumed by the rust, the nail does continue to rust, but very slowly — only as fast as additional oxygen molecules can get through the oil layer.


 7

Oil does two things.


1. Prevents oxygen molecules from colliding with the surface of the metal.
2. More importantly, oil drives away water. Water promotes rust by creating miniature electrochemical cells on the surface of iron objects. A cartoon of one of these cells can be seen here:
[Electrochemical cell promoting rust](http://chemwiki.ucdavis.edu/Analytical_Chemistry/Electrochemistry/Case_Studies/Corrosion/Corrosion)


Another point. While I am unaware of how well oxygen dissolves in oil, I'd be interested to know how the higher viscosity of oil reduces the mobility of the oxygen dissolved in it, and possibly reduces the rate of rusting.


 3

It is likely that the water was boiled, removing any carbon dioxide and excess oxygen. The oil on one of the beakers acts as a protective layer and prevents any carbon dioxide or oxygen dissolving into the water of that beaker, which prevents rust. The other beaker however was exposed to the carbon dioxide and oxygen in the atmosphere, which would have dissolved, allowing rust.


For an iron nail to rust, there must be several things present. these include: oxygen, an anode (a metal that readily gives electrons, in this case iron), an electrolyte (a liquid that assists the flow of electrons), oxygen, and a cathode( a metal that readily receives electrons – this can be a less reactive metal nearby or in this case, another part of the iron itself) 


The reason that iron is readily able to accept and give electrons is because it is in the transition metal group of the periodic table, meaning it has an outer valency of two or 3, (max valency 8, min valency 1) meaning it is able to both give OR take electrons to fill its outer shell.


When the iron nail comes into contact with the water that is exposed to carbon dioxide (beaker without oil) the carbon dioxide begins to dissolve, forming a weak carbonic acid. This carbonic acid is a good electrolyte and provides acidic conditions.(iron rusts faster in acidic conditions, due to the increased concentration of h+ atoms present, which draw electrons from the iron, due to their positive charge.) This begins dissolving the iron, while the water breaks down into hydrogen and oxygen(the hydrogen is slightly positive and the oxygen is slightly negative, due to the unequal sharing of electrons in water molecules). The oxygen bonds with the dissolved iron, forming iron oxide (rust – balanced scientific equation – $4 \text{Fe} + 3\text{O}\_2 = 2 \text{Fe}\_2\text{O}\_3$). When this happens, electrons are freed from the anode portion of the iron and flow to the cathode portion.


This is a redox reaction. A redox reaction involves reduction and oxidation. reduction is the gaining of electrons and the loss of oxygen. 
Oxidation is the loss of electrons and the gain of oxygen. 
In this situation, the iron is oxidised and the $\text{O}\_2$ is reduced.


Other ways to stop the rusting or iron include:


* electroplating, coating iron in a less reactive metal
* using a sacrificial anode
* attaching a more reactive metal that will preferentially oxidise (in this case the sacrificial anode would be the anode, and the iron would act solely as the cathode)
* galvanizing, coating in zinc (which acts almost the same way as a sacrificial anode)
* coating the iron in metal oil or plastic to prevent it coming into contact with oxygen and electrolytes
* putting it in an environment that is missing one of the components needed for rust (e.g the beaker covered in oil was missing excess oxygen, so the nail could not oxidize = *rust*)
* alloying, this is when iron is mixed with other metals that help stabilize it


To speed the rusting of iron you can


* put it in a more acidic environment as this increases the number of h+ ions, making the iron more susceptible to rust
* connect a less reactive metal, so that the iron acts solely as an anode in the oxidation process, losing its electrons and corroding, while the less reactive metal which was harder to remove electrons from, acts as the cathode, receiving the electrons lost by the iron.


Note: metals that are more reactive than iron include magnesium and zinc (slow rusting), and metals that are less reactive include copper and tin (speed rusting).


 0