How does an axial compressor compress a flow? Axial compressors and nozzles are both incorporated in jet engines. The also share the same exterior shape, a truncated cone. However a nozzle exchanges pressure for velocity and an axial compressor does the opposite, slows the flow and increases the pressure. I am confused as to how these devices have opposite functions despite having the same shape. 
The compressor has rotors and stators so I assume this is the key difference, but why?
 A: The compressor adds energy to the flow, which in turn increases the pressure of the flow. A simple and approximate way of viewing this problem is by using the Bernoulli equation. Consider,
$$P_t = p + \frac{1}{2} \rho \left(u^2 + v^2 + w^2\right) $$
The rotor will add swirl to the flow, which effectively increases the angular momentum of the flow and associated kinetic energy in the tangential velocity component, $\frac{1}{2}\rho v^2$. The stator will remove the imparted swirl from the rotor, but will not add any additional energy to the flow. Thus, the stator can be thought of as converting the kinetic energy of swirl into internal energy of the flow, which is made evident by increase in static pressure of the flow. A conventional velocity and pressure profile across a multistage axial flow compressor looks similar to the following.

More detailed explanations can be obtained in any undergraduate level airbreathing propulsion text. The common analysis encompasses using various reference frames to analyze the true 3-dimensional nature of the flow across a single compressor stage (rotor/stator). These are generally referred to as the throughflow field, cascade field, and secondary flowfield. The analysis also requires velocity diagrams of the velocity components in each subsequent reference frame to which the stage thermodynamic parameters of interest are obtained with the Euler turbine equation. 
Also, be careful regarding the shape of a nozzle and its expected role. Depending on the Mach number of the flow entering the nozzle, the shape of the nozzle can have very different effects. A classical results of quasi one-dimensional gas dynamics is the following differential equation termed the area-velocity relation,
$$\frac{dA}{A} = (M^2-1) \frac{du}{u} $$
Major results depending on the Mach number $M$ of the gas go as follows:
1.) $M \rightarrow 0$ (incompressible subsonic limit) suggests that $Au$ = constant. Which is the conventional continuity equation for incompressible flow. 
2.) $0 \leq M \lt 1$ (subsonic flow), an increase in velocity (+$du$) is associated with a decrease in area (-$dA$). This is also consistent with the conventional continuity equation for incompressible flows. A decrease in area is accompanied by a increase in velocity, and a increase in area is accompanied by a decrease in velocity. 
3.) $M \gt 1$ (supersonic flow), an increase in velocity (+$du$) is associated with a increase in area (+$dA$). This is not consistent with the conventional continuity equation for incompressible flows. For instance, in this case, an increase in area is accompanied by an increase in velocity, and a decrease in area is accompanied by a decrease in velocity. 
4.) $M = 1$ (sonic flow), yields $dA/A = 0$, which simply means a minimum or maximum condition in area. The only realizable physical solution is the minimum area condition for which one can choke the flow to the sonic condition at the throat (minimum area) of a converging-diverging nozzle. 
Based on the above results, the shape of a nozzle can play varying roles and what sometime may appear as a nozzle actually acts a diffuser. A common schematic demonstrating the above is below.

A: As far as I understand, the main difference is an axial compressor, due to movement of its stators, transfers energy to the flow, and a nozzle does not. And I don't quite agree that a compressor "slows the flow". While the compressor's stators may slow the flow, rotors accelerate the flow.
