A cavity, subject to gravity, is filled with a fluid initially at uniform temperature. Initially all boundaries are adiabatic surfaces; at time $t=0$ two opposite boundaries (shown in red and blue) start injecting/extracting thermal energy into/from the system at the same exact rate ($Q_\text{source} = – Q_\text{sink}$). A turbine extracts energy from the system, converting into electricity the kinetic energy of the buoyancy-drive flow created by the heat injection and extraction.
The original question was: How will the average temperature of this system evolve over time?
ANSWERS SO FAR (coming from other sources): A simplistic analysis would suggest the average temperature remains the same, as heat injection and extraction are identical. This would (wrongly) imply that the energy extracted by the turbine is magically appearing in the systems as result of the buoyant flow.
A proper answer, based on the second law of thermodynamics, indicates that in such case the energy must come from the internal energy of the fluid. It is curious that the fluid inside this system will see a drop in the average temperature, proportional to the electrical energy extracted, in spite of the identical heat injection/extraction. In fact, when the cold fluid drops to the bottom of the system, dragged by gravity, it converts its potential energy into kinetic, which is then dissipated into heat (i.e. an increase in the internal energy as temperature and pressure), showing proper conservation of energy in the flow. When the turbine converts part of the kinetic energy into electricity and extracts it from the system, it is in fact reducing the internal energy of the fluid, hence the reduction in the average temperature.
Any additional thoughts?