Heat flow in closed systems