This paper presents a numerical simulation of the developing flow and heat transfer of a viscoelastic fluid in a rectangular duct. In fully developed flow of a viscoelastic fluid in a non-circular duct, secondary flows normal to the flow direction are expected to enhance the rate of heat and mass transfer. On the other hand, properties such as viscosity, thermal conductivity, specific heat and relaxation time of the fluid are a function of temperature. Therefore, we developed a numerical model which solves the flow and energy equation simultaneously in three dimensional form. We included several equations of state to model the temperature dependency of the fluid parameters. The current paper is one of the first studies which present a 3D numerical simulation for developing viscoelastic duct flow that takes the dependency of flow parameters to the temperature into account. The rheological constitutive equation of the fluid is a common form of the Phan-Thien Tanner (PTT) model, which embodies both influences of elasticity and shear thinning in viscosity. The governing equations are discretized using the FTCS finite difference method on a staggered mesh. The marker-and-cell method is also employed to allocate the parameters on the staggered mesh, and static pressure is calculated using the artificial compressibility approach during the numerical simulation. In addition to report the results of flow and heat transfer in the developing region, the effect of some dimensionless parameters on the flow and heat transfer has also been investigated. The results are in a good agreement with the results reported by others in this field.