From: Rabbi Moshe Sofer
To: Rabbi Yaakov Baruch Frenkel
The Chasam Sofer permits Torah study in a room containing a covered mikveh pit filled with hot water, provided the pit is covered and no women are present. He distinguishes between the mikveh pit itself, which may have bathhouse status due to steam and filth, and the surrounding clean room, which constitutes its own halachic domain. As a commendable practice, he recommends placing a movable partition between the scholar and the covered pit.
Source: Shu"t Chasam Sofer YD §207