My own work includes modelling of scattering (impact of) 3D inclusions and deformations on elastic waves in stratified domain (see link below).
In your case the incident field would be a Rayleigh wave (air-solid interface mode), and the inclusion/deformation would be the foam injected trench (presumably a cut-away or inclusion at the upper interface of a stratified soil model, filled with the elastic properties of the foam-injection).
The method is formidable. Its advantage is its treatment of fields in large unbounded domains (only surface meshes, no volume meshes). Application to your problem would constitute MSc or even PhD research project.
A quick look at Plaxis finite element looks easier (? uncertain). But you would still need to give the element mesh a Rayleigh wave excitation, presumably in time domain.That means giving a pre-computed Rayleigh wave arrival stress/strain driving excitation a one side of the mesh, which is not too hard to compute for homogeneous soils (no stratification), but faces more challenges with stratification. i would use a normal mode or a (windowed) wave-number integration method to compute the excitation for stratified media..