The effects of grain size and porosity on the elastic modulus of nanocrystalline materials