Basically, to harness the energy of air, you have to force it into a smaller space. At that time, the nitrogen and oxygen molecules the air contains are brought closer together and move more rapidly.
The energy that gets released when expanding the air again equals the energy that was needed to force the air into the smaller space. In other words, the energy is stored for future use.
While this may sound complicated or overly scientific, you have probably done this many times yourself.
When you blow up a balloon, you have to exert an effort to force the air from your body into the small opening of the balloon. As it inflates, the air inside of it is compressed – along with the energy that you have exerted to force it in there.
Once you let go of the opening, the air (and the energy) is released and the balloon zips around the room at a high speed.
Essentially, that is what a compressor does. It forces the ambient air that is all around us into a smaller space. There, the air is either stored to be used later or released right away to perform a wide range of tasks, such as powering a jackhammer or operating the brakes of a train.
Generally speaking, there are two methods to compress air: Positive displacement compression and dynamic compression. The former includes most compressors being used today, such as piston and rotary screw compressors.
A displacement compressor encloses a volume of gas or air and then increases the pressure by reducing the enclosed volume through the displacement of one or more moving members. When the pressure has reached the designed pressure ratio, a port or valve is opened and the air is discharged into the outlet system.
In dynamic compression, the air is drawn between the blades of a rapidly rotating compression impeller and accelerates to a high velocity. It is then discharged through a diffuser, where the kinetic energy is transformed into static pressure.