I am not a physics person. I am a lawyer. So bear with me: I do not understand why the temperature of a gas or a liquid increases with pressure. I understand the Ideal Gas Law of PV=nRT, and I understand it mathematically, but I do not understand conceptually what is happening at the molecular level. If I have a liter of oxygen in a sealed container that cannot expand, then I have a set number of molecules with a specific, set amount of average kinetic energy, temperature. If I change the volume from a liter to a quarter liter, I understand that I have increased the frequency of collisions and therefore the pressure. But if the collisons with the walls of the container and with each other are perfectly elastic, doesn't the average kinetic energy (temperature) remain the same so that the increase in pressure does not increase the temperature? If there is to be an increase in temperature, then there must be energy added to the average kinetic energy, and that must come either from an external source or potential energy, I believe. If I am correct, then how does a diesel engine increase the temperature of the air by compression so that it and the fuel spontaneously combust under increased pressure? Is it the work of compression that imparts the additional kinetic energy to the gas molecules, or is my understanding set forth aboe wrong? This is driving me nuts trying to figure it out. Thanks so much for your help.