This question came up when I recently answered this question Why are compressed air tanks cold? and I found this question Why does the gas get cold when I spray it? which seemed to be related, but the given answers do not really satisfy me. Also this question Why does deodorant always feel cold? is about the cooling of a deodorant spray and doesn't address the cooling of the container. A web search gave conflicting, mostly not scientifically well explained answers.
In my opinion, there are three possible cooling effects:
(1) The adiabatic expansion of the gas involves work against the external pressure thus cooling the gas. This should already work for an ideal gas.
(2) The adiabatic expansion of the gas leads to a cooling due to the Joule-Thompson effect because the gas is not an ideal gas. This is due to a change of kinetic to potential energy of the molecules.
(3) The cooling of the container is due to evaporation cooling of the liquified gas inside the container.
ad (1) The problem with answer (1) is that the adiabatic expansion occurs outside the container against the air pressure. Thus the cooling should only occur for the outside gas not for the gas in the container.
ad (2) This problem should not occur for answer (2) because the JT cooling effect already takes place inside the container upon pressure reduction. Also the cooling outside the container should occur.
ad (3) The gas is partially liquified inside the container due to the high pressure (e.g. butane) and the cooling of the container is caused by the evaporation heat of the liquid.
In the case of the aerosol spray I am now inclined to think that my answer (3) is the dominant effect in the container cooling. This does, however, not conform with the top rated answer (work due to adiabatic expansion of gas) of the mentioned identical question.
Am I right with my suspicion that a cooling by adiabatic expansion of an ideal gas cools the gas outside but not inside the container?
Is the container indeed cooled mainly by the liquid evaporation heat effect? Or is the Joule Thompson effect more important?