In this article, a fluid flow and heat transfer model which consist of the mass, momentum, and energy conservation equations together with the level set equation and Rolie‐Poly constitution equation is proposed and applied to simulate the rheological behaviors of viscoelastic polystyrene melt in the filling process of injection molding. The macroscopic velocity, pressure, temperature, stress, and mesoscopic molecular conformation of polystyrene melt are shown and analyzed detailedly during the mold filling process. The single‐mode Rolie‐Poly model is employed to describe the stress–strain relationship of polystyrene melt, and the level set method is used to capture the evolution of melt front interface. The governing equations for polymer melt are discretized by the finite volume method on collocated mesh, and solved by the SIMPLE algorithm. Numerical simulations have been implemented based on rectangular cavities with different gate locations, and rectangular and circular inserts. Numerical results indicate that the gate locations, gate numbers, insert size and shape are major factors that affect the rheological behaviors of polystyrene melt in the filling stage of injection molding, and polymer chains experienced higher shear and extension effects in the regions near to mold walls and obstacle. In addition, the length and position of weld lines are discussed in the current study.