Free expansion of ideal gas into a vacuum I was thinking about free expansion and the consequences of it.
An ideal gas is placed inside a closed container; the walls have the same temperature as the gas. We are dealing with a closed system. A massless piston is dividing the gas on the left from the vacuum on the right. As the ideal gas expands, it doesn't do any work on the massless piston, so $W=0$ in the system.
So the work is zero, and as there aren't any intermolecular forces (we are only dealing with kinetic energy here), the temperature should remain constant as the particles are not slowed down in any way. The temperature should remain constant as $W=0$.
Why is it still a necessary condition that the container is thermically insulated so that $Q=0$ as well? Imagine for example, the gas is at room temperature, the walls of the container as well, and outside as well. The expansion by itself shouldn't lower the temperature of the gas should it?
Thanks in advance, if you can clear this up.
 A: If you want to consider the case where there is no thermal isolation then that's perfectly ok; it just would not be called the "Joule expansion" or the standard "free expansion". It would be another type of free expansion.
The standard free expansion (Joule expansion) does not need to be quasistatic. So during the Joule expansion the temperature in the gas need not be uniform. The reasoning that internal energy $U$ is constant would still apply, and the final temperature, after equilibrium is established, would reflect that.
If the system were not thermally insulated and there is a variation in temperature across the gas during the expansion, then there may be heat flow between system and surroundings. In this case it is hard to predict whether more heat will flow in or out. Presumably either case could happen, depending on the nature of the non-equilibrium states the gas passes through. It would not be surprising if the part of the gas at the back cooled a little at first as it pushed the gas ahead of it, while the gas at the front rushes into the vacuum.
