There exists two-phase flow in the heat transfer tube of the steam generator, in which the density wave oscillation (DWO) phenomenon plays a vital role in the safe operation of the nuclear reactor. This paper studies the DWO phenomenon in the tubes under bilateral convection by numerical calculation. Firstly, comparing the results of the numerical model with Babcock & Wilcox Once-Through Steam Generation (OTSG) experiment, the numerical model is verified. Secondly, the DWO boundary in different boundary heating conditions (bilateral convection and traditionally electric heating on the wall) is compared. Lastly, the movement of DWO boundary is analyzed by changing the height of the heating section and flow directions. It is found that increasing the length of the heating section and appropriately reducing the level inclination (within the range of 50 to 90 degree) of the tubes can expand the stable interval in the system. The main purpose of this paper is to provide reference and guidance for the safe operation of the steam generator.