The reactive Navier–Stokes equations with adaptive mesh refinement and a detailed chemical reactive mechanism (11 species, 27 steps) were adopted to investigate a detonation engine considering the injection and supersonic mixing processes. Flame acceleration and deflagration-to-detonation transition (DDT) in a premixed/inhomogeneous supersonic hydrogen–air mixture with and without transverse jet obstacles were addressed. Results demonstrate the difficulty in undergoing DDT in the premixed/inhomogeneous supersonic mixture within a smooth chamber. By contrast, multiple transverse jets injected into the chamber aid detonation transition by introducing perturbed vortices, shock waves and a suitable blockage ratio. Increasing distance between the leading shock and the flame tip impedes detonation transition due to an insufficient blockage ratio. The extremely perturbed distributions of fuel-lean and fuel-rich mixtures lead to more complicated flame structures. Also, a larger flame thickness appears in the inhomogeneous mixture compared with the premixed mixture, resulting in a lower combustion temperature. The key findings are that the DDT, detonation quenching and reinitiation are generated in the inhomogeneous supersonic mixture, but both DDT mechanisms are ascribed to a strong Mach stem with the Zel'dovich gradient mechanism. Additionally, the obtained results demonstrate that an intensely fuel-lean mixture (equivalence ratio = 0.15) results in a partially decoupled flame front. However, detonation reinitiation and subsequent self-sustained detonation occur when a fierce shock wave propagates through a highly sensitive mixture, even within a smaller and elongated area. Moreover, the inhomogeneous mixture also augments the propagation speed and detonation cell structure instabilities and delays the sonic point resulting from the extending non-equilibrium reaction.