Principles of heat transfer in porous media