Calculation of temperature profile in injection wells