Numerical simulations of detonations in hydrogen-air and methane-air mixtures