# Homemade salad dressing separates into layers after it sits for a while. Why doesn't this violate the 2nd law of thermodynamics?

The oil, vinegar and other liquids in homemade salad dressing separate into layers after sitting for a while, making the mixture become more organized as time evolves. Why doesn't this violate the 2nd law of thermodynamics?

I assume that the answer is that since the separation is due to gravity, the effect is due to an external force and so the system isn't closed which is necessary for the 2nd law, but I'm not sure.

If that's the answer, then what happens if I consider the whole system include the salad dressing, gravitational field and whatever mass is generating the gravitational field? The entropy of the salad dressing seems to decrease and so the entropy of some other component of this system must be increasing, but it's hard to see what this other component would be.

• It should be noted that even in a weightless environment the mixture would separate into globules of the different components. At its simplest the separated condition is the lowest energy state. Energy had to be expended to homogenize the mixture, leaving it in a sort of quasi-stable condition that slowly degenerates. (There was an interesting Amateur Scientist article about this in Scientific American about 50 years ago.) – Hot Licks May 9 '14 at 19:54
• You get a big metal bowl and you throw a bunch of ball-bearings into the bowl, all rolling around at different speeds, banging into each other chaotically. Less than 100 years later, all the balls are sitting still at the bottom of the bowl. The new state is highly ordered compared to the chaotic state we had before; does this violate the 2nd law? – Eric Lippert May 9 '14 at 21:43
• I think this could also happen without friction. The selfgravity of the balls would make them clump together , if their initial speed is not too high (see en.wikipedia.org/wiki/Jeans_instability). Does that mean that for a selfgravitating system a clumped/ordered state can be the one with the highest entropy? – asmaier Jul 20 '14 at 20:07
• I am very fond of the treatment of entropy in section 2.4–2.6 of Dan Styer's draft of a stat mech book. Section 2.6 address this class of questions fairly directly. – dmckee --- ex-moderator kitten Aug 11 '18 at 16:50

The separation does not violate the 2nd law of thermodynamics, because the oil and water phases being separate is a lower energy state.

The water molecules strongly interact with each other, forming hydrogen bonds. The protons of water are shared between two oxygen atoms of two different water molecules, forming a constantly changing network of molecules. Water molecules do not have strong intermolecular interactions with oil molecules.

The more the two phrases are mixed, the more water molecules are at an interface surface. The water molecules at an interface surface can not fully participate in intermolecular interactions with other water molecules, so this is a higher energy state.

For a process to spontaneously occur, the Gibbs free energy (G) must decrease.

$\Delta G = \Delta H-T\Delta S$

So entropy (S) is only part of the consideration. Enthalpy (H) and temperature (T) must also be considered. In this case the decrease in enthalpy (H) due to energy of intermolecular interactions makes up for the decrease in entropy (S). The process is an exothermic process.

Even absent gravity, it is still thermodynamically favorable for the phases to separate, to minimize the interfacial surface area, just like a spherical drop of water being the lowest energy state absent gravity.

I would predict that absent any gravity, the lowest energy state of the salad dressing would be a sphere of water phase surrounded by a spherical shell of oil phase.

• Worth noting that the separation into layers is incomplete: if you used a straw to remove water from under the oil layer, you'd get slightly oily water out. This is usually attributed to "entropy of mixing." – rob May 9 '14 at 13:40
• you mean exothermic – Steve Byrnes May 9 '14 at 13:58
• To give an analogous (maybe easier to picture) example: if you had a bunch of magnets strewn all over a frictionless floor, they'd eventually attract each other and all form one big clump, which seems like it's gone from less order to more order. But like he said, it's about the free energy of the different states. – YungHummmma May 9 '14 at 14:20
• regarding your last statement, i would expect a sphere of water with a nearby, out-of-contact sphere of oil. what would lead the oil and water to stay in contact at all if they are seeking less boundary with each other? – Matthew Najmon May 9 '14 at 20:16
• @MatthewNajmon I'm seeing values of 20-30 mN/m for vegetable oil/water surface tension as well as for vegetable oil/air surface tension, and 72 mN/m for water air. So water would much rather be in contact with oil than air. I still think water sphere in the center surrounded by oil spherical shell. repository.lib.ncsu.edu/ir/bitstream/1840.16/8150/1/etd.pdf – DavePhD May 9 '14 at 20:50

DavePhD's answer explains the specifics. The separation decreases the enthalpy of the oil-water mixture. But there's one more step:

When the enthalphy of the dressing decreases by $\Delta H$, it causes the entropy of the dressing and its surrounding environment to increase by $\Delta H / T$.

The reason is: The decrease in enthalpy releases heat, which (slightly) increases the temperature of the dressing, and its container, and the room its in. Higher temperature means more entropy.

So in the bigger picture, it really is increasing the entropy.

• If the oil and vinegar combination is just suspended in vacuum (say we turn off gravity), then how does that work? What is the environment that has an increase in entropy? – user26866 May 12 '14 at 16:32
• The process creates heat. Wherever the heat goes, that's where the entropy increases. If the salad dressing is thermally insulated, the heat stays there, increasing the temperature and (thus) entropy. That's what user26866 is imagining. In the opposite extreme, the salad dressing might have negligible heat capacity compared to the surroundings, in which case all the heat spreads into the surroundings, so the entropy increase would occur in the surroundings. That's what Art Brown is imagining. – Steve Byrnes May 12 '14 at 17:08
• Thank you, but I guess I'm still unsure what's going on microscopically that increases the entropy in the vacuum scenario. I think of entropy as a measure of the uncertainty of the state. Initially, there's a large uncertainty in the positions of the oil and vinegar droplets. After the mixture separates, there's less uncertainty in their positions. However, as you say, the mixture heats after separating. Does the increase in entropy come from the increased uncertainty in the velocities of the individual oil and vingegar droplets? Thank you again for the helpful answers. – user26866 May 13 '14 at 18:09
• Yes, heating a system increases its entropy largely because the velocity of each molecule has a greater range of possible values. There are other effects too: At higher temperatures, there is more uncertainty in how fast each molecule is rotating, and how much it is stretching or contorting... – Steve Byrnes May 13 '14 at 18:27
• After way too much time, I see that my criticism was incorrect. Apologies for my confusion... – Art Brown Oct 23 '14 at 5:42

The short answer is that the transition from mixed salad dressing to two layers is exothermic, and this heat release creates an entropy increase. For all intents and purposes, the process is analogous to an exothermic chemical reaction, like combustion.

Similarly, a container filled with ball bearings can spontaneously settle into a hexagonal close-packing arrangement. Like the salad-dressing case, this gives the visual appearance of greater order, but in fact it is not a violation of the law $\Delta S_\text{univ}\geq 0$, as energy is released upon settling, which is converted into disordered heat.

I'm terrible at thermodynamics so there may be several corrections needed to make the following rigorous, but you can try to make things explicit as follows: let the salad dressing be contained in a rigid, thermally-conducting container under the influence of gravity. The total energy of the system can be written as $$U=m_\text{w}\overline{U}_\text{w,bulk}+m_\text{o}\overline{U}_\text{o,bulk}+\int_V\rho(\mathbf{r})V(\mathbf{r})\,d\mathbf{r}+\int_{S_d}\gamma_\text{w,o}\,dS+\int_{S_c}\gamma(S)\,dS$$ where $\overline{U}_\text{w,bulk}$ is the total bulk internal energy per mass of the water (and similar for $U_\text{o,bulk})$, $m_\text{w}$ and $m_\text{o}$ are the total water and oil masses, $\rho(\mathbf{r})$ is the liquid density at location $\mathbf{r}$ in the container, $V(\mathbf{r})$ is the gravitational potential, $S_d$ is the set of oil-water interfaces, $\gamma_\text{w,o}$ is the oil-water surface tension, $S_c$ is the boundary of the container walls, and $\gamma(S)$ is the liquid-wall surface tension of the type of liquid at boundary location $S$.

In essence, the first and second terms describe the bulk (volumetric) energy of the water and oil, the third considers the gravitational energy of the system, the fourth considers the energy due to the oil-water interfaces, and the fifth considers the energy due to the liquid-container interface.

Linearizing gravity as $V(\mathbf{r})\approx g|\mathbf{r}|$, $U$ can be rewritten as $$U=m_\text{w}\overline{U}_\text{w,bulk}+m_\text{o}\overline{U}_\text{o,bulk}+\rho_\text{w}m_\text{w}\langle h_\text{w}\rangle+\rho_\text{o}m_\text{o}\langle h_\text{o}\rangle\\+\gamma_\text{w,o}A_d+\gamma_\text{w,c}A_{\text{w,c}}+\gamma_\text{o,c}A_{\text{o,c}}$$ where $\langle h_\text{w}\rangle$ and $\langle h_\text{o}\rangle$ are the expectation values of the water and oil height inside the container, $A_d$ is the total oil-water droplet interface area, and $A_{\text{o,c}}$ and $A_{\text{w,c}}$ are the total areas of contact the oil and water make with the container walls and $\gamma_\text{w,c}$ and $\gamma_\text{o,c}$ are the water-container and oil-container surface tensions.

A change of configuration creates a change in internal energy $$\Delta U=\rho_\text{w}m_\text{w}\langle \Delta h_\text{w}\rangle+\rho_\text{o}m_\text{o}\langle \Delta h_\text{o}\rangle+\gamma_\text{w,o}\Delta A_d+\gamma_\text{w,c}\Delta A_{\text{w,c}}+\gamma_\text{o,c}\Delta A_{\text{o,c}}.$$ Note that $\Delta U<0$ for a transition from mixed salad dressing into two separated layers.

The excess energy is converted into heat, ie $\Delta U=\Delta q$, which is then lost to the surroundings through the container walls. The entropy change is then $$\Delta S=\Delta S_\text{sys}+\Delta S_\text{surr}=-\frac{\Delta U}{T_\text{sys}}+\frac{\Delta U}{T_\text{surr}}>0$$ since $T_\text{sys}>T_\text{surr}$ for heat transfer to occur.

(Apologies if I botched up the fundamental thermodynamic relations in the previous paragraph).

• each interface has a different surface tension, water/container, oil/container, water/oil and, if there is air, container/air, water/air, oil/air. – DavePhD May 9 '14 at 15:28
• @DavePhD: Whoops, I mistakenly thought that the oil-water interface tension was the sum of the oil-vacuum and water-vacuum tensions, corrected it. – DumpsterDoofus May 9 '14 at 15:37
• I like you answer. Probably Laplace pressure would have to be considered to be any more rigorous. Pressure inside very small dropets can be much greater than atmospheric pressure. – DavePhD May 9 '14 at 16:41

Here is an attempt to connect two of the other answers:

The system is the salad dressing, which is in contact with air that forms a heat reservoir at constant temperature $T$ (isothermal). Everything is also at constant pressure $P$ (isobaric). We're comparing the initial, mixed with the final, separated states of the system.

DavePhD states that the demixing occurs because the result has lower energy, which sounds definitive. However, the dressing's loss of energy is the reservoir's gain (by conservation of energy), so the total energy is unchanged, and one might start to feel a bit uncertain.

He then states (correctly) that the change in Gibbs free energy: $$\Delta G_{sys} = \Delta H_{sys} - T \Delta S_{sys}$$ must be negative for the reaction to proceed spontaneously, noting that "entropy (S) is only part of the consideration". I have added subscripts to indicate that these quantities are the Gibbs free energy, enthalpy, and entropy of the system.

At this point, someone trained to believe that entropy must always increase may be rather befuddled.

Recognizing this potential confusion, SteveB connects this result to the total entropy of the system plus reservoir. For an isothermal, isobaric process, whether or not the system performs work, $\Delta H_{sys}$ is the amount of heat added to the system from the reservoir. Therefore, the change in entropy of the reservoir (not of the system + reservoir) is: $$\Delta S_{res} = - \frac{\Delta H_{sys}}{T}$$

The change in total entropy $S_{tot}$ is then: $$\Delta S_{tot} = \Delta S_{sys} + \Delta S_{res} = \Delta S_{sys} - \frac{\Delta H_{sys}}{T} = - \frac{\Delta G_{sys}}{T}$$

So, for an isothermal, isobaric reaction, a decrease in Gibbs free energy of the system is equivalent to an increase in total (system + reservoir) entropy. As expected (hoped for?), spontaneous reactions do indeed increase (total) entropy!

Note that de-mixing is not necessarily spontaneous: the de-mixing process must generate sufficient heat to raise the entropy of the reservoir by more than the decrease in entropy of the system.

Finally, if the process is isobaric but not isothermal, some of the emitted heat raises the temperature (and hence entropy) of the system (as stated by SteveB), so the calculation is no longer so simple. In fact, $\Delta G_{sys} = 0$ is no longer the threshold for spontaneous reactions in this condition, because for an infinitesimal, reversible process:

$$dG = -S \, dT + V \, dP$$

so $dG \ne 0$ if $dT \ne 0$. Instead, the change in total entropy must be calculated to determine spontaneity.

My view is simpler, on the lines you already quote of the mixture in the container not being an isolated system.

The same as with crystals coming out of solution one has to consider the whole system when quoting the second law. In this case there will be heat exchanged with the environment as well as radiation, as molecules fall into the lower energy state that characterizes the separation, thus not closed.

• But even if the salad dressing is contained in a perfectly rigid, perfectly insulating container, shouldn't it still separate into layers over time? Or am I oversimplifying things? – DumpsterDoofus May 9 '14 at 15:23
• @DumpsterDoofus Because of the difference in specific weight, if these two liquids are put together they become layered ( Archimedes principle). Shaking them introduces disorder due to kinetic energy supplied. This decays back when motion stops, releasing the energy, and energy goes to radiation and heat in general, environment and the two liquids. Yes, it will separate over time because the excited states it reaches with shaking decay. I am answering the second law statement after it had reached the higher state. – anna v May 9 '14 at 18:49

The counterintuitive part here is the mistaken assumption that the state of seperation with "pure" vinegar and "pure" oil represents the higher energy or more "ordered state" than the blended vinegar and oil.

That's backwards. The "pure" states are the lowest energy states and mixed the highest.

You add energy to the vinegar/water and oil system when you whisk the the components together. The mechanical impact of the whisk actually crams the water and oil components together into highly complex structures.

By analogy, the seperated state is like having a bunch of rocks laying on the ground. The whisk picks the rocks up and piles them into structures. Since entropy causes the rocks to seek a lower energy state (the ground) the rock structure eventually falls apart.

These structures are on the microscopic level (size of living cells) instead of the nanoscopic (molecular) level but they function like springs storing the energy imparted by the whisk. The structures don't pop apart immediately because friction like forces of the opposing attractions of water trying to stick to water while repealing oil and the oil trying to stick to oil while repealing water.

You can think of it like a keystone arch with water-water attraction being the rock resisting compression and the oil-oil attraction being gravity. (Except it all occurs in three dimensions.) In the arch, the balance of gravity and compression make the arch stable. The salad dressing "arches" are likewise stable for a short time.

Molecular motion eventually causes the structures to move out of alignment, like shifting a stone in an arch, and the structures collapse releasing their stored energy. That stored energy then moves the water and oil back to their separate layers.

So the system goes separated(low energy)-->whisked(high energy)-->separated(low energy.)

Gravity doesn't add much to the process because the separation process is driven by the energy added by the whisk in the blending. Gravity just causes denser of the two to the bottom of the container. If you made salad dressing in zero gravity, it would still separate into two blobs its just that they would orientated to each other more less randomly instead of top to bottom. (They studied just this effect, because of its chemical importance on the Space Shuttle and International Space station back in the 90s.)

Bottled salad dressing don't seperate because they use emulsifier, usually lecithin, which act like a glue (or mortar in the arch analogy) making it hard for the microscopic spring structures to pop apart. However, given enough time, even those will separate.

Energy stored in hydrophilic-hydrophobic combination systems plays a big role in biochemistry e.g. it is the foundational dynamics of all biological membranes. Back in college we calculated how much energy would be released if you could magically cause all your bodies membranes to collapse at once. Don't remember the exact number but I do remember it was a surprisingly big boom. Oil consolidates in water because that increases entropy $S$. It rises to the top because that decreases enthalpy $H$. When both actions happen together, it reduces the Gibbs free energy $G$. $$\Delta G = \Delta H - T \Delta S$$

As DavePhD noted, hydrogen bonds form between pairs of water molecules. As Aaron Stevens commented in a duplicate question, "polar water molecules have more configurations to make hydrogen bonds with their neighbors." In particular, if there are $N$ water molecules in the container, a given molecule has $N$ possible ways (thermodynamic states) to make one hydrogen bond. (Technically, $N-1$ because a molecule can't bond with itself, but with a large number of molecules, the distinction isn't important).

If a water molecule makes two hydrogen bonds, there are now $N^2$ ways to do it. With three hydrogen bonds, $N^3$ ways. You can see that as more hydrogen bonds form in the container, more thermodynamic states are possible. This increases the entropy.

Hydrogen bonds don't form between oil and water, nor between two oil molecules. When a water molecule is surrounded by oil, it makes fewer hydrogen bonds and the total entropy goes decreases. Thus, the entropy is maximized by consolidating (gathering) the oil together into a contiguous mass, so the water makes the minimal amount of contact with it.

This is illustrated in the following pictures, from a simulation I wrote to answer this question. The hexes are molecules, 90 water (cyan) and 10 oil (yellow). The border between the molecules are drawn in blue if it forms a hydrogen bond, and white if not. The total number of hydrogen bonds are displayed at the bottom of the simulation.

Examine the picture at the top of this answer. The oil is mixed well with water, and the water forms 201 hydrogen bonds.

As the oil begins to consolidate, water molecules can form more hydrogen bonds (now 212) with each other: When the oil is fully consolidated, the maximum number of hydrogen bonds (233) can form: You can see that the number of hydrogen bonds -- and thus the entropy -- is maximized when the oil is consolidated.

Oil floats (rises to the top) because of enthalpy. Specifically, the potential energy of the mixture is the combined gravitational potential energy of the molecules. This is minimized by putting the oil above the water.

In the absence of gravity, oil will consolidate but not float. However, when gravity is present, both effects will happen in order to minimize the Gibbs free energy.

Addendum: "In the absence of gravity, oil will consolidate but not float." International Space Station experiments bear this out:

Colloid-polymer mixtures: The results from the ISS experiments studied the spinodal decomposition, or phase separation near the critical point, unencumbered by density differences of the phases. The growth of the phase separation was studied using both light scattering and imaging. Without gravity, the phase separation took 30 times longer than on Earth. The sample was mixed, then phase separation began, gradually coarsening until the container walls interacted with the mixture (at 42 hours) and the colloid-rich phase wet the container wall, completely coating it after 60 hours.

Colloid-polymer critical point: Immediately after mixing, the colloid-polymer critical point sample began to separate into two phases?one that resembled a gas and one that resembled a liquid, except that the particles were colloids and not atoms. The colloid-poor regions (the colloidal ?gas? phase) grew bigger until, finally, complete phase separation was achieved and there was just one region of each?a colloid-rich phase and a colloid-poor phase. None of this behavior can be observed in the sample on Earth because sedimentation would cause the colloids to fall to the bottom of the cell faster than the de-mixing process could occur. Knowledge gained from these runs was used to develop the BCAT-3 later operated on ISS.

EXPRESS Physics of Colloids in Space

I think most of these explanations are wrong.

Fluids stratification isn't driven by bonding interactions - these simply govern the rate and lossiness of the process. In principle, the stratification could be loss-free - an inviscid emulsion would still stratify, so the lovely Wikipedia formulae above would become trivial and uninstructive. I think the answer is actually a lot simpler.

Stratification is just Archimedes' principle. Houses get messy since there are more ways of them being messy than tidy. Imagine a house littered by toys and pans. If a human comes along and links all the toys to a point in the playroom with elastic ropes, and too with all the pans with the kitchen, letting the ropes go and all the toys fly roughly into the playroom, and all the pans skid along the floor into the kitchen. The house is technically tidier since there are fewer ways of arranging items in their correct room than in the whole house. Of course, the human who wound the ropes has to degrade their muscular sugars to do this, as did the process which mixed the said emulsion (think pushing a balloon underwater). Stratification is just the release of stored potential energy which originated in the mixing process, which itself originally required work. Any mess can be tidied by applying work - it's just this ultimately creates more mess.