For a gas in an open vessel, should the volume of gas be the volume of whole universe? In the ideal gas equation $PV=nRT$, $V$ is defined as free space available to the gas. In an open vessel in which temperature is maintained constant, shouldn't the volume $V$  of the gas be the volume of the whole universe?
I know this sounds stupid but I've read everywhere that the volume of gas will be the same as the volume of the container in the open vessel and it will remain constant. Why is that so?
 A: The ideal gas law only holds for gases in equilibrium. Processes which involve successive equilibria steps are called reversible and those which don't are irreversible. The free expansion of a gas is an irreversible process which contains many non equilibrium steps and therefore the ideal gas law is not applicable here. However we can apply it for the final and initial states if you choose to stop the expansion at point in the process.  This is because once you stop the expansion, the gas once again falls back into thermodynamic equilibrium after some time.

As a side note I suggest you go read a book called "Atkins physical chemistry" in the first chapter there is a discussion about a surface defined by the implicit function of the ideal gas law.  So, this surface may not be defined for all possible values of the state-variables and changing the parameters too violently (like done in free expansion) can drop you out of this surface.

An extra comment is that it is also very very difficult to describe thermodynamic systems which are not in equilibrium. For example, if a system is not in equilibrium then each point inside the system may have different temperatures and it would be difficult to describe without using the language of vector fields and all. For most of high-school learning, we are safe to assume that all points have same temperature, the volume is of container etc.
A: If the vessel is open, there is no well definite volume. Leaving a part non-equilibrium processes like free expansion, in equilibrium situations, working with an open vessel implies that neither $V$ nor the number of moles $n$ are known. This does not imply that the perfect gas equation of state cannot be used. It can, provided the two extensive quantities ($V$ and $n$) are combined into an intensive molar density $\frac{n}{V}$.
The intensive molar density allows to recast the equation of state in the form of a local relation between thermodynamic quantities.
A: We consider the temperature to be constant in the open container. The temperature outside the container (the vessel, being the whole Universe) isn't constant and can reside in the Earth, the CMBR, the Moon, the stars, the Sun, etc. Obviously, the Universe (container) as a whole isn't an ideal gas.
Maybe we can take the mean value of the temperature of the Universe, which stays rather constant in time. In that case, heat will be absorbed or emitted by the vessel.
So in order to keep the temperature in the vessel to be constant, we have to add/subtract heat from the vessel.
But again, the Universe isn't an ideal gas (as in your example of a vessel in a container).
This means that the ideal gas doesn't apply so neither do the consequences derived from it.
