Analytical and computational description of effect of grain size on yield stress of metals