Turbine is the device in which fluid expands. During the expansion work will be done by the fluid to drive, for example, electric generation. In this case, power output occurs.

Compressor is the device which is used to compress the fluid and increase its pressure. That means power input is required.

The 1^{st} law of thermodynamics:

The change of kinetic energy and potential energy of fluid flowing into and out of turbines and compressors are very small that can usually be neglected:

(e_{kin})_{out }– (e_{kin})_{in}≈0 → c^{2}_{out }– c^{2}_{in}≈0

(e_{pot})_{out }– (e_{pot})_{in}≈0 → g•(z_{out }– z_{in})≈0

Turbine and compressors are also regarded as steady-flow engineering device, so the term at the right-hand side equals zero:

Furthermore, m_{out}=m_{in} because of conservation of mass.

So now we obtain a simplified expression for turbine and compressor:

#### q+w+ h_{in }– h_{out}=0

where:

- q=heat transferred per unit mass

- w=work done by turbine or on compressor per unit mass

- h
_{in}= specific enthalpy of inlet fluid

- h
_{out}= specific enthalpy of outlet fluid

As discussed above,

- w>0 → compressor

- w<0 → turbine