At the present time, the main method of developing highly viscous and bituminous oil reservoirs is the injection of hot water or steam into such reservoirs. When injecting heat-transfer agent into a porous reservoir, its characteristics at the wellhead are known. It is important to know the parameters of a heat-transfer agent (pressure, temperature, mass content of steam in a two-phase mixture “water-steam”, etc.) directly at the reservoir entrance. In order to calculate various parameters of a heat-transfer agent along the injection well depth (including the bottomhole), we propose a mathematical model of the downward flow of a hot “water-steam” mixture in a vertical channel. The model takes into account phase transitions occurring in a two-phase “water-steam” mixture, and external heat exchange of the well product with surrounding rocks (including permafrost). Based on the proposed mathematical model, we develop an algorithm to solve a quasistationary problem. In this case, we use the Runge–Kutta method in order to solve the system of differential equations describing the stationary flow of a heat-transfer agent in a well. Also, in order to solve the non-stationary problem of temperature distribution in the rocks that surround the well (including permafrost), we use the author enthalpy method with implicit scheme. For each time moment, the developed software allows to find the distributions along the well depth of various parameters of the downward two-phase flow, taking into account external heat exchange, as well as the temperature distribution in the rocks that surround the well and the permafrost thawing radius. © 2019 South Ural State University. All rights reserved.