When drilling and completing a deep water well, the cemented top is usually several hundred meters below the mudline because of the multi-layer technical casing technology, so quite a portion of completion fluid would be entrapped in the technical casing annulus between wellhead sealing washer and the top of cement mantle. And when being in production, the temperature field of immediate vicinity of wellbore would be redistributed by thermal fluid. At the same time, the high temperature of trapped completion fluid would trigger high thermal stress, and it is proved to be a great threat to the safety of deepwater wellbore. In this paper, we build a heat transfer model for trapped wellbore under the condition of different production outputs and fluid properties, and it is based on the structural features of high temperature and high pressure well in YQ deepwater oil field of South China Sea. Following this modelling, trapped pressure of casing was predicted and a numerical simulation of temperature field in trapped wellbore was conducted in ANSYS. Based on the results of modelling and numerical simulation, we designed a suit of casing tool which can eliminate the fatal influence caused by thermal stress of trapped pressure accompanying with high temperature. The application of this anti-thermal-stress tools showed that it is effective in protecting casing, and it also reduces the risk of casing deformation accident such as deformation caused by trapped thermal stress and wellhead sealing damages.