The method of fundamental solutions for the scattering problem of an open cavity