Let's consider the case of a compressor operating at a certain point. Hypothetically, if this compresson is not attached anywhere it will start moving backwards, as a result of the force due to the pressure difference on its 2 sides. In this occasion, the electrical energy that the compressor consumes is converted into gas energy (increase in its enthalpy) and kinetic energy of the compressor. So, if this is true there is always a big piece of the mechanical energy of the compressor converted into kinetic energy (even if it is attached on the earth, theoritecally it slightly increases earth's kinetic energy). I am very confused because I have been teached that the electricity that a compressor consumes is equal to $E=m_{\mathrm{gas}}\cdot(h_2-h_1)/h_m$ where $m_{\mathrm{gas}}$ the mass of the incoming gas, $(h_2-h_1)$ the difference in enthalpy of the gas and $h_m$ the mechanical efficiency of the machine. Where is this false?
2 Answers
An ideal compressor doesn't have to operate at any particular speed. We can imagine one that runs arbitrarily slowly, so that the kinetic energy of the parts are insignificant compared to the total energy delivered to the gas. This makes modeling easier. So to say that KE is "always a big piece" is incorrect.
You're right that a real compressor will have inefficiencies due to friction and other losses of energy. But those can be added in later if necessary and don't change the energy calculation of compressing the gas itself.
Yes the compressor experiences a force, but remember that KE = work done = force x distance moved. The compressor is heavy compared to the gas, especially if it is bolted to a planet, so the distance moved is negligible and, since F x 0 = 0, its gain in KE is equally so.