Trenches, as important military defense measures, have significant practical significance in studying the impact of trench terrain on the propagation patterns of explosive shock waves. This research is based on numerical simulations and establishes six trench models with depths of 0 mm, 200 mm, 400 mm, 600 mm, 800 mm, and 1000 mm, as well as five different lengths of trenches: 400 mm, 600 mm, 800 mm, 1000 mm, and 1200 mm. The internal and front-to-back shock wave pressures within the trenches were numerically calculated. The research findings indicate that as the depth of the trench increases, the pressure at the midpoint of the trench bottom gradually decreases within a depth of 800 mm, and then slowly increases beyond 800 mm. As the length of the trench increases, the pressure on the trench bottom significantly decreases when the length does not exceed 600 mm, but steadily increases after reaching 600 mm.