Numerical investigation of the flow past a cavity