Predicting the thermal conductivity of Si and Ge nanowires