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?