It is called a heat exchanger and works both ways although industrial ones are made for more efficient use and unidirectional