Abstract Selective laser melting (SLM) builds parts by selectively melting metallic powders layer by layer with a high-energy laser beam. It has a variety of applications in aerospace, medical device, and other low-volume manufacturing. Nevertheless, the lack of fundamental understanding of the process-structure-property relationship for better quality control inhibits wider applications of SLM. Recently, a mesoscale simulation approach, called phase field and thermal lattice Boltzmann method (PF-TLBM), was developed to simulate microstructure evolution of alloys in SLM melt pool with simultaneous consideration of solute transport, heat transfer, phase transition, and latent heat effect. In this paper, a nucleation model is introduced in the PF-TLBM framework to simulate heterogeneous nucleation at the boundary of the melt pool in SLM. A new method is also developed to estimate the thermal flux out of the SLM melt pool model given a constant cooling rate. The effects of latent heat and cooling rate on dendritic morphology and solute distribution are studied. The simulation results of AlSi10Mg alloy suggest that the inclusion of latent heat is necessary because it reveals the details of the formation of secondary arms, reduces the overestimation of microsegregation, and provides more accurate kinetics of dendritic growth.