A model for the effect of grain size on the yield stress of metals