Dynamical studies and product analysis of O(1D) + H2/D2 reactions