Heat transfer modelling and stability analysis of selective laser melting