Molecular simulation and experimental characterization of the nanoporous structures of coal and gas shale