# Thermodynamics counterintuitive problem

jaumzaum
If we had an isolated system composed by two indentical containers joined by a valve (initially closed), the first one has 1 mol of hydrogen inside, pressure P, temperature T, the second one has 1 mol of oxygen, same pressure and temperature. At some moment we open the valve. What will be change in entropy? Will there be any change in temperature?

If weconsider the boltzmann equation for the entropy

ΔS (hydrogen) = k ln ((2V)/V)NA) = R ln2

ΔS (oxygen) = k ln ((2V)/V)NA) = R ln2

ΔS = 2 R ln2

But, if we consider the process to be isotermic:
ΔS (hydrogen) = R ln((2V/V)) = R ln2
ΔS (oxygen) = R ln((2V/V)) = R ln2
ΔS = 2 R ln2

So, if we consider it to be isotermic, the answer is the same, so we can conclude it is isotermic
But if it is isotermic, the ΔS we calculated is equal to Q/T = W/T, where W = RT ln(2)
So both oxygen and nytrogen do positive work. As the system is isolated: Q (system) = 0
Q (hydrogen) + Q (oxygen) = 0 -> W(H) + ΔU(H) + W(O) + ΔU(O) = 0
ΔU(H)+ΔU(O) = -(W(H) + W(O)) = -2RTln(2)
And so the temperature will reduce, violating what we had considered

What will happen so?

Mentor
So, if we consider it to be isotermic, the answer is the same, so we can conclude it is isotermic
But if it is isotermic, the ΔS we calculated is equal to Q/T = W/T, where W = RT ln(2)
So both oxygen and nytrogen do positive work.
This is not correct. The gases are not doing any work, Q=W=0. In this case, there is not an equality between ΔS and Q/T, but the inequality
$$d S \ge \frac{Q}{T}$$
There is "new" entropy being created, which is the entropy of mixing.

jaumzaum
So the temperature will remain the same? Why there is not work? The volume of each of the gases will increase, why cant we consider the work as PdV?

Mentor
Against what would the system be doing work? There is no way you could use the migration of the gas molecules to power an external process. You get the same result when you consider the expansion of a gas into a vacuum.

The take home message is to never apply equations blindly. It is not because dV≠0 that work is performed.

jaumzaum
I thought we could always use PdV for work
But if the work is zero, and we have delta S != 0, then Q != 0, so delta U is not zero and the temperature changes
Is it right?

Mentor
If the container holding both gases is a closed system and rigid, then no work is done on the combined system of the two gases, and no heat is transferred to them. So ΔU is zero. The internal energy of an ideal gas in a mixture is equal to the internal energy of the same pure gas at the temperature and partial pressure in the mixture. Since the internal energy of an ideal gas is a function only of temperature, the final temperature of the mixture must be the same as the temperature of the original pure gases. The heat of mixing of ideal gases is zero.

jaumzaum
So how could there be variation in entropy? Isn't dS = dQ/T?

Mentor
So how could there be variation in entropy? Isn't dS = dQ/T?
Only for a reversible path between the initial and final states. In any transition between initial and final equilibrium states, you need to be able to identify a reversible path to get you between these two states if you want to calculate the change in entropy.

jaumzaum
Thanks,

How could I do that in this case?

Mentor
Usually, the job of conceiving of a reversible path for a system involving a multicomponent mixture like this one involves the use of ideal semi-permeable membranes which permit passage of only one of the mixture species, but not the others. I have thought of a process for doing this which gives a Q value that satisfies Q = TΔS, where ΔS is the entropy change you calculated. The process begins by expanding each of the pure species reversibly and isothermally in separate cylinders to half the starting pressure. Can you calculate the heat load and the change in entropy for this first process step? Can you think of what to do in the second part of the process using semi-permeable membranes to get to the final state of the mixture?

Chet