There is a great influence of the melt filling process on the quality of castings. Smoothed particle hydrodynamics (SPH) that materials are approximated by free particles rather than by fixed grids is applied to accurately predict fluid flows involving complex free surfaces. In this paper we present a mathematical model of melt flow and heat transfer by using SPH method. A novel approach is used in the governing equations to ensure stable numerical schemes and homogeneous particle distributions. The SPH heat equation takes into account the thermal release during phase transition and is more suitable for alloy solidification. The solid wall boundary conditions are slightly modified to satisfy the filling simulations. Several case studies are carried out to predict significant details about the filling order and flow structures in the mold cavity. The velocity and temperature distributions during different stages of melt filling are also given. The results show that this proposed model allows us to understand the predisposition of defects such as gas porosity and weld lines in the castings. These predictions can be used as inputs for improving process parameters, venting and cooling systems design.