A diffusion‐equation‐based kernel function (called the diffusive kernel) is proposed for flow and heat transfer simulation by the smoothed‐particle‐hydrodynamics (SPH) method. This new diffusive function has basic features of physics‐based, intrinsically conservative, and mathematically smoothing, because of a general solution of the diffusion equation. Three cases have been employed for method validation. One is the SOD's problem (a one‐dimensional case of the Riemann problem). The SPH simulation with the new kernel is compared to both analytical solutions and the SPH simulation by the third‐order B‐spline kernel. The second one is the dam‐break case to compare the performance of the cubic‐spline kernel, the quintic‐spline kernel, and the Wendland C2 kernel with the current diffusive kernel. The present kernel seems to perform as well as the well‐known Wendland C2 and the quintic kernels. The last case is natural convection in a concentric circular domain with temperature differences between the inner and outer concentric walls. Both the Gaussian kernel and the diffusive kernel were used for comparison and validation. Good consistency between numerical and analytical results, as well as experimental results, validates the good performance of the current diffusive kernel. After validation, it is clear that the diffusive kernel can simulate both the shock wave and natural convective heat transfer very well, and is much better than the conventional Gaussian kernel except for computational efficiency. The kernel profiles, together with their derivatives and integrals, are explored to explain why the diffusive kernel's performance is much better. Finally, to increase numerical efficiency, a fitted expression of the diffusive kernel is also given. The fitted diffusive kernel can reach the same level of computational efficiency as the Gaussian kernel while maintaining the basic advantages of the current diffusive kernel, which gives a choice for practical application.