One of my favorite things about the JT effect is how gases not being “perfect” is actually “better” than if they were. What I mean is, if gases all behaved as some kind of perfect, platonic* ideal of a gas and followed the ideal game law exactly, there would be no temperature change. But because they don’t, the Joules-Thomson effect is what allows for refrigeration. *Helium is probably the closest to some platonic id…
Why wouldn't there be any temperature change in ideal gases? When I compress an ideal gas in a bike pump, it heats up; when I expand it through a nozzle, it cools down. Often I can approximate these processes as isentropic, and then the temperatures are uniquely determined by the expansion as either a function of pressure ratio T2 = T1 (p2/p1)^(g-1/g) or volume ratio; T2 = T1 (V2/V1)^g, where g is gamma, the ratio of…
Expansion through a nozzle is extremely chaotic and generates entropy. You can’t model JT that way.
When you compress air in an air pump you are doing work against the system and increasing its internal energy u = q - w, which can be explained using ideal gases by knowing that u = u(T). But this is not because the pressure increases but because of your work.