Consider a car going down a large mountain. Instead of braking continuously, the driver shifts down and the car is able to maintain velocity on just engine braking. No fuel is injected into the engine, but the engine is still spinning (assume a manual transmission).
Now, look at a cylinder. Instead of a Diesel or Otto cycle, I would imagine something opposite would happen. Air is compressed, and as such heated up. Usually, we model this as adiabatic compression - however, this is of course not the case in reality; some heat is transferred to the engine block, where it is carried away by the usual means of cooling an engine. Then, the air expands again, but since some energy was carried away by the engine block, the air will inevitably be colder than how it started. Basically, we have created some kind of air cycle machine.
Is this actually the case? Will a Diesel or Otto engine work as ain air cycle machine when it's driven from an external source (i.e., no fuel injected), or am I missing someting in this analysis?