This paper uses Large Eddy Simulation (LES) technology to study the dynamic behavior of flame acceleration (FA) and deflagration-to-detonation transition (DDT) in a duct with different obstacle layouts in non-homogeneous concentration fields. A turbulent premixed combustion model with three additional source terms was established using the OpenFoam code library. It was found that the predicted results of the coupled model were in good agreement with the measured values of the experiment. Numerical results show that turbulent combustion and self-ignition effects are the main factors affecting flame acceleration. Still, self-ignition effects are a necessary and sufficient condition for inducing DDT phenomena. Detonation flames have around-flow and diffraction effects and do not evolve into jet and vortex flames, which differ from deflagration flames. Two initiation mechanisms were found under different obstacle layouts: hotspots were generated in the area swept by the Mach stem at the flame front, triggering detonation near the turbulent flame through the reactive gradient mechanism; focusing of sufficiently strong reflected waves deposited enough energy in a particular area near the flame brush and directly triggered detonation. In addition, the central obstacle layout is most conducive to FA and DDT, while the symmetrical layout is the least favorable.