expansion of a perfect gas into vacuum is related with
Joule expansion The Joule expansion, treated as a thought experiment involving ideal gases, is a useful exercise in classical thermodynamics. It provides a convenient example for calculating changes in thermodynamic quantities, including the resulting increase in entropy of the universe (entropy production) that results from this inherently irreversible process. An actual Joule expansion experiment necessarily involves real gases; the temperature change in such a process provides a measure of intermolecular forces.
Thermal expansion Temperature is a monotonic function of the average molecular kinetic energy of a substance. When a substance is heated, the kinetic energy of its molecules increases. Thus, the molecules begin vibrating/moving more and usually maintain a greater average separation. Materials which contract with increasing temperature are unusual; this effect is limited in size, and only occurs within limited temperature ranges (see examples below). The relative expansion (also called strain) divided by the change in temperature is called the material's coefficient of thermal expansion and generally varies with temperature.