If you had a refrigerator in a closed, well-insulated room and you left the fridge door open for a long time, what would happen to the temperature in the room?
In the long run the room would get warmer. When you first open the fridge door and the cold air comes out, the room cools down a little temporarily. The fridge would then work to cool the inside of the fridge. As we will see, more heat is transferred from the cooling coils of the fridge to the room than is removed from inside the fridge - this would ultimately warm the room.
Any device, like a refrigerator or air conditioner, that removes heat from a cold region and transfers it to a hot region is basically a heat engine in reverse. Work W is done on the system, causing heat QL to be transferred from the lower-temperature region. Heat QH is transferred from the system at a higher temperature.
By conservation of energy:
W + |QL| = |QH|
A refrigerator or air conditioner consists of a fluid pumped through a closed system. Four steps are involved in the cycle.
A refrigerator is rated by its coefficient of performance K, the ratio of the heat removed from the fridge to the work required to remove it:
K = |QL|/W
The P-V diagram shown above is over-simplified, showing two adiabatic processes and two isobaric (constant pressure) processes but neglecting the two changes of state that occur. This gives you the general flavor of the cycle, however.
If you heat your home using electric heat, 1000 J of electrical energy is transformed into 1000 J of heat. You can do much better than this with a heat pump. This is also a heat engine running backwards, extracting heat from a lower-temperature region (outside the house) and transferring it to a higher-temperature region (inside the house).
Let's say the work done in the process is 1000 J, and the temperatures are TH = 17°C = 290 K and TL = -23 °C = 250 K. What is the maximum amount of heat that can be transferred into the house?
The best we can do is determined by the Carnot relationship:
TL/TH =|QL|/|QH|
Therefore:
|QL| = (TL/TH) |QH|
Using this in the energy equation gives:
|QH| = |QL| + W
|QH| = (TL/TH) |QH| + W
|QH| [1 -(TL/TH)] = W
|QH| = W TH /(TH - TL )
For our numerical example this gives:
|QH| = 1000 * 290/(290-250) = 1000 * 7.25 = 7250 J
This is why heat pumps are much better than electric heaters.