In this work, the two dimensional transition of H2-O2 deflagration-to-detonation was examined in some porous closed-ducts by an in-house high speed reacting flow solver in OpenFoam package—a pressure-based/density-based hybrid solver coupled with Godunov-type schemes, including advection Upstream Splitting Method, Roe, Roe and Pike, and Harten-Lax-van-Leer-contact. Initially, the results of different reaction mechanisms were compared with experimental data. Then, some porous zones and wall roughness of porous duct as well as porous obstacles and their blockage ratio are applied to evaluate the DDT process in different working conditions. The results revealed that the addition of a porous zone could decrease the flame tip velocity and increase the maximum temperature of the process by up to 20.74%. Furthermore, the ratio of the wall roughness height to the channel width of 0.03 was found to be the optimal value to control the time and length of deflagration-to-detonation transition. Also, changes in the interval between the porous obstacles and their blockage ratio led to significant variations in the detonation flow structure. Finally, using a porous zone and porous obstacles have proved to be an advanced method to control the deflagration-to-detonation transition process.