Consider a gas expanding into a vacuum. The volume is changing and the question is, how is the internal energy changing with the change in volume. This is measured by the Internal Pressure, which is defined as follows:

As a gas expands, the molecules become further apart, and so the potential energy between them changes. Internal pressure is thus a measure of the attractive forces between the molecules.

We know that ΔU = q + w, and for free expansion, w = 0, so ΔU = q.

A man called Joule tried to measure the internal pressure by expanding a gas into a known volume vacuum with the whole apparatus in a water bath, and studying the temperature change of the water, which would be proportional to the heat supplied to the system from the water bath (q).However, he failed to notice any change in temperature. This is because a perfect gashas no internal pressure (no molecular interactions). His equipment wasn’t sensitive enough to detect the minor changes resulting from the fact that the gas being used was not ideal.