Work done by gases on each other in the process of mixing them

I was wondering if gases, which are in the process of mixing, do any work on each other. I haven’t found many resources on this.


We all know that gases, which have a higher pressure than their surroundings, expand. For example, suppose a (approx. massless) piston divides an ideal gas and the ambient $\pu{1 atm}$ pressure. If we heat the ideal gas, the pressure rises, and the piston gets displaced so that the ideal gas can re-equilibriate to $\pu{1 atm}$ pressure, so outside pressure and inside pressure are the same.


But what is up with the case when two gases at different pressure mix? For example, an ideal gas is in a closed container at $p\_1 (\lt p\_2), V\_1 (\gt V\_2),$ and $\pu{273 K}$. Now this container is connected to a smaller one, inside is a different ideal gas at $V\_2$, $p\_2$, and $\pu{273 K}$. Now, of course the gases will mix with each other, to maximize entropy by mixing.


But does the higher pressure gas perform work against the lower pressure gas while expanding into the other container, like the first example I gave? Or is it like a free expansion (a.k.a no work done), because ideal gases don't occupy volume by themselves? And how would we calculate the work?




Consider what happens to just the gas at higher pressure, if allowed to expand to a lower pressure -- what happens to its temperature? Then consider the gas at lower pressure, and the converse.


As an example, consider two containers at 300 K, one with helium at 10,000 kPa (~100 bar), another, of the same volume, with He at 100 kPa (~1 bar). When a valve opens between them, the equalized pressure would be ~5,000.5 kPa, with far more gas (by mass) expanding than being compressed. Would you expect the final temperature to be lower or higher?


Of course, this is a *highly* simplified example. One would need to take in to account the heat capacity of differing gases, the volumes of the containers, the mass of gas in each, initial temperature of each and, to be closer to a "real life" answer, departure from ideal gas laws, and thermal storage in the containers themselves. Oh... and if the gas expand through a venturi or through a [turboexpander](http://www.ijsrd.com/articles/IJSRDV1I11049.pdf).


 4