Supersonic turbulent non-reacting flow through a cavity-type flameholder employed in scramjet engines with and without subcavities is numerically investigated. The governing equations describing the flow are solved by employing a density-based solver i.e., rhoCentralFoam which is an open-source computational fluid dynamics (CFD) code in OpenFOAM. The turbulence is modeled using the two-equation k-ω SST (shear stress transport) turbulence model. In the present study implication of subcavity types (i.e., extrusive and intrusive) on recirculation patterns and their strength at different subcavity aspect ratios (l/d) and subcavity locations at different inflow Mach numbers is investigated. A significant increase in the strength of the primary recirculation zone is observed for modified rectangle cavity 2 (MRC2) compared to the base rectangle cavity (BRC) and modified rectangle cavity 1 (MRC1). Results show a significant decrease in the size of the secondary recirculation zone for modified angle cavity 2 (MAC2) for all the subcavity aspect ratios and subcavity leading-edge distances (SLDs) at Mach 2. Results also indicate that at a fixed Mach number, the strength of the primary recirculation decreases with the increase in base cavity aspect ratio (L/D) for all the cavity types. Results show a substantial decrease in the velocity magnitude of cavity fluid with the decrease in cavity aft wall angle from 90° to 30°, which shows that the strength of the primary recirculation zone for BRC and MRC2 is higher compared to base angle cavity (BAC) and MAC2. Results show a 20.4776 % and 7.3822 % increase in the peak values of streamwise and normal velocities for MRC2 compared to BRC and MRC1 at Mach 2, and the corresponding increase in velocities for Mach 3 are 14.7979% and 5.6693% respectively for all the aspect rations and SLDs. Present results are validated with the experimental results available in the literature. © 2021 Elsevier Ltd