Wellbore pressure and temperature distribution are important parameters for productivity evaluation and production optimization of gas wells. In order to improve the accuracy of pressure and temperature calculation, the coupling of pressure, temperature, density and flow rate is considered comprehensively. On the basis of analysing the deficiency of previous literatures, the coupled field equations with wellhead as origin (downward as positive) and bottom hole as origin (upward as positive) are established, and the variation of total heat transfer coefficient of wellbore with well depth is considered. Compared with the measured data, the theoretical calculation results have high accuracy, and the temperature distribution of oil and casing string is also obtained, which can provide support for the analysis of pipe string stress or fatigue related to temperature.