Temperature rise resulting from compression
Anyone who has pumped up a bicycle tyre knows that the lower part of the pump barrel may become quite warm. Erroneously, this is often attributed to work done against friction. On reflection, however, one must come to the conclusion that the friction of an oiled plunger against the smooth barrel wall is far too small to do any appreciable amount of work. The increase in internal energy which raises the temperature comes, of course, from the work done in compressing the air.
Conversely, if compressed air or any other gas is allowed to expand it performs external work, and the energy required comes from the internal energy of the gas itself. Consequently, the gas cools. See also page 181.