Gas adsorption in the inside and outside of single-walled carbon nanotubes