Using non-equilibrium molecular dynamics method, we have studied the thermal rectification of heterojunction nanotubes (HCNTs). All of these HCNTs, composed of two 4 nm long carbon nanotubes (CNTs), only have a pentagon-heptagon defects pair. Here the positive direction is defined as the direction where the heat flux flows from the large diameter CNTs to the small diameter CNTs. We have found that the thermal rectification depends on the diameter, the chirality and the temperature.#br#Diameter effect: We fix the diameter on one side and changed it on another side, i.e., the left side of the HCNTs is (3, 3) while the right side of the HCNTs is (n, n), in which n changes from 4 to 9. It is found that the thermal rectification efficiency of HCNTs increases with n (also with the diameter difference). If considering the temperature field of (3, 3)-(4, 4) HCNTs, one can find that there exists a region near the HCNT where the temperature changes sharply. This region when the flux is positive is similar to that when the flux is negative. However, if taking into consideration the (3, 3)-(9, 9) HCNTs, we find that the distribution of temperature field shows different behaviors when the directions of the heat flux are different, and the length of this region becomes longer than (3, 3)-(4, 4). It can be explained that the thermal rectification is caused by different temperature distributions in HCNTs.#br#Chirality effect: We keep the chirality unchanged on one side of HCNTs and change the chirality of the other side, namely, the chirality of the left side of HCNTs are (3, 3) and the right side are (9, 9), (11, 7), (13, 4) and (15, 1), all of their diameters are close to 4.1 Å. We can find that the intersection angle between two CNTs decreases when the right side of HCNTs changes from (9, 9) to (15, 1), and the thermal rectification efficiency will be enhanced. It can be explained that the phonon is scattered and absorbed more effectively at the hetero-junction as the intersection angle decreases.#br#Temperature effect: We have constructed a HCNT (3, 3)-(9, 9) and changed its average temperature from 200 to 400 K. Our results show that the thermal rectification efficiency will be weakened with the rise in average temperature because of increasing heat flux in the negative direction.#br#This research may be helpful to the research in nanoscale thermal diodes, thermal logical gates and controlling heat flux.