I was going through a review of rotary compressor and i understood that the stagnation pressure and stagnation temperature both change in the rotor stage (as energy is being added).I also read that in the stator stage the stagnation temperature remains a constant but there is loss of stagnation pressure. If there is a loss in stagnation pressure shouldn't the stagnation temperature increase (I am guessing here that the loss is converted into heat)? (I am guessing this has to do something with expansion but I am not sure)
If the total temperature increased, energy would need to have been added to the flow via work or heat transfer. A change in stagnation temperature is directly related to work being taken or added to the flow (see energy equation/Euler work equation). Since the stator does not put work into the flow or extract work out, the total temperature will stay the same. Things become more nuanced when phenomena such as friction or secondary flows are involved. However, unless you have a crazy amount of friction, the total temperature of the flow will remain essentially the same in the stator. I am assuming you believe the temperature will increase from decreasing pressure because of the Ideal Gas Law. However, remember in compressible flow that the density is a variable and changes with pressure. Hopefully my answer is helpful for you.