Free Expansion (Joule Expansion) and Entropy of Mixing

A casual walkthrough of Joule (free) expansion and entropy of mixing, showing why both processes increase entropy even though the internal energy does not change.

Joule expansion

So what is Joule expansion?

I think you can just think of it as free expansion. Let’s take a look at free expansion!!!

Hand-drawn free-expansion setup: two containers joined by a tube with a pin in it; the left one, shaded yellow, holds the gas (pressure P_i, volume V_0) and the right one is empty

Let’s think about the gas spreading out into double the volume, with the two containers thermally insulated. So we pull out the pin like this, and the gas goes pwoosh~~~~ and spreads out.

The same two containers with the pin pulled out: the gas now fills both, each shaded yellow and labeled with pressure P_f and volume V_0

It definitely doesn’t look like the gas would be gaining or losing any energy. That is,

Free expansion in equations: dU = TdS − pdV = 0, so TdS = pdV and dS = (p/T)dV = (n_m R/V)dV; integrating from state 1 to state 2 (volume V_0 to 2V_0) gives ΔS = n_m R ln 2

The change in entropy is not equal to zero…. That is, free expansion is an irreversible process.

What the heck…. T_T The fact that entropy increases while $dU = 0$ means the pressure decreases!!!

We’ll work through some practice problems on Joule expansion in the next post. And going further on, related stuff to think about will come up. T_T It’s hard to follow, I know. Ahh…. T_T

Entropy of mixing

Two containers joined by a tube with a pin: the left one (green) holds gas 1 in volume xV, the right one (cyan) holds gas 2 in volume (1−x)V, and both are labeled P, V

Let’s say two containers are connected, one with volume $xV$ and the other with $(1-x)V$. And let’s say the two containers were in the same $p$ and $T$ state. That $p$ and $T$ are the same is also something we learn in chemistry class. It means there’s gas in proportion to the volume ratio.

If you write down the ideal gas equation of state, you can see that $n$ is proportional to $V$. Actually, this is also taught as Avogadro’s law.

That is, since the volume ratio is $x : (1-x)$, the mole ratio of the gases will also be $x : (1-x)$. Let’s say there’s $Nx$ mol and $N(1-x)$ mol, respectively.

OK so now, let’s pull out the pin!!!

There won’t be any great revolutionary who claims the gases won’t mix, right? Because gas 1, which had been in $xV$, also wants to be in the total $V$, and gas 2, which had been in $(1-x)V$, also wants to be in the total volume $V$…

Let’s think of each gas as undergoing a reversible isothermal expansion. That is, $dU = 0$. Therefore $TdS = pdV$. Let’s look at the entropy change with this equation.

The entropy change of each gas expanding to the full volume V: ΔS of gas 1 = xNR times the integral of dV/V from x to 1 = −NxR ln x, and ΔS of gas 2 = (1−x)NR times the integral of dV/V from 1−x to 1 = −(1−x)NR ln(1−x); the total entropy change is −NR(x ln x + (1−x) ln(1−x)) = −k_B N(x ln x + (1−x) ln(1−x))

Oho, so the ratio the volume was split into at the start affects the entropy change. So I tried plotting $y = -\left[x\ln x + (1-x)\ln(1-x)\right]$ in Matlab.

MATLAB screenshot: x=(0:0.0001:1); y=−1*(x.*log(x) + (1−x).*log(1−x)); plot(x,y). The curve is a dome that is 0 at x = 0 and x = 1 and peaks at about 0.69 at x = 0.5

The conclusion is that it’s largest when $x = 1/2$.

Let’s interpret it. When $x = 0$ or $x = 1$, it means the volume of the other side is “none,” so it makes sense that the total entropy change is zero. And if we plug in $x = 1/2$

Plugging in x = 1/2: ΔS_total = −k_B N (1/2 ln 1/2 + 1/2 ln 1/2) = −k_B N ln 1/2 = k_B ln 2^N

Oh!!! This also makes sense. Because, by the statistical mechanical definition of entropy,

S = k_B ln Ω

$\Omega$ is the number of microstates, and the fact that at $x = 1/2$ the number of microstates grew by a factor of $2^N$ (with $N$ now counting molecules, not moles) must be because

Two ellipses joined by a tube, each labeled 1/2 V, with the handwritten notes here (under the left one), or (between them) and there (under the right one)

the number of ways to put the gas in

2 × 2 × 2 × ⋯ × 2 = 2^N

grows in this janky way.

Earlier in Joule expansion, when we did free expansion to double the volume, this kind of number came out, right? I think we can think about it in the same context.

OK so now, it’s time for your brain to hurt. Let’s rack our brains.

“What if the gases that had been in the two containers were the same gas?!?!?!”

$x = 1/2$. All the $p$, $T$ conditions stay just as they were. After we remove the pin, the total entropy change would come out just like above, \Delta S_{total} = k_B \ln 2^N…

But, common-sense-wise, if they were the same gas, the number of microstates wouldn’t be affected at all, so it should be \Delta S_{total} = 0, right?!?!?!

What went wrong….

The answer: what was wrong was that we developed the equations treating $S_1$, $S_2$ — that is, gas 1 and gas 2 — as strictly different.

The assumption quietly built into our equations was that “the gases are distinguishable.”

So if they’re not distinguishable, it doesn’t work, they say. Sigh… how could gases possibly be distinguishable? This concept will be dealt with more profoundly in chapter 29, supposedly.

For now, just for fun, let’s listen to the story of “Maxwell’s demon” (a thought experiment).


Heads-up. The figures here are the original notes, slips and all. A few things to watch for:

  • In the two-container picture, the blue labels on both sides read $P, V$; as the text says, they mean the same $p$ and $T$ on both sides. The volumes are the $xV$ and $(1-x)V$ at the bottom.
  • In the entropy-of-mixing picture, $N$ counts moles in the first lines, so the total is $-NR\left[x\ln x + (1-x)\ln(1-x)\right]$. In the last line, written with $k_B$, $N$ has to be the number of molecules ($N N_A$ for $N$ mol), because $R = N_A k_B$.

Comments

Discussion happens via GitHub Discussions. You'll need a GitHub account to comment.