Molecular simulation of methane adsorption in micro- and mesoporous carbons with applications to coal and gas shale systems