The trapping of sound in a rectangular enclosure, such as a corridor or street, and the noise disturbance caused by trapping, can be a serious problem to understanding speech or other acoustic events. In contrast to confined systems that sustain so‐called trapped modes, the behavior in a partially open enclosure is associated with leaky modes of the system that are “nearly” trapped but are still radiating some energy out of the system. This paper presents numerical modeling that has been developed to calculate the sound that can be nearly trapped in an open rectangular cavity such as the rectangular cross‐section of a street canyon that is excited by a number of sources switching on and off. The cavity is surrounded by an elastic half space, i.e., surrounded on three sides by absorbing walls, for which it is necessary to implement a set of numerical grids that are staggered in space and in time. Results are shown for combinations of different walls and different shaped geometries that minimize the radiation losses out of the cavity. The results are used to comment on the problems that can be caused by the trapping of sound in acoustic systems.