A theoretical study of hydrogen chemisorption on Ni(111) and Co(0001) surfaces