To model the adsorption mechanism on graphene and Pt surface, self-consistent DFT calculations are carried out using the Bayesian error estimation function with van der Waals correlation (BEEF-vdW) exchange-correlation functional owing to its accuracy for describing adsorption energies and van der Waals interaction between graphene layers, as implemented in the open-source package GPAW. All simulations are carried out with the help of a python package BASIC developed by Jiankun Pu.