Two-Phase Flow in Geothermal Wells: Development and Uses of a Computer Code