[ParallelStencil] Boundary Conditions

I was taking a look at the acoustic apps, and I was able to modify it to include a time-varying pressure source.


However, I can’t quite figure out how to prevent back reflections from the boundary. Is it possible to make the boundary absorptive?

1 Like

Great you managed to enhance the wave code with a time-varying pressure source.

how to prevent back reflections from the boundary

Modelling wave propagation often requires implementing some kind of absorptive layers in order to avoid reflection artefacts at boundaries. This is a specific domain science related issue and thus not exposed as a ready to use solution from within ParallelStencil.

Various approaches exist to implement absorptive boundaries, among those the perfectly matched layer (PML) and the less accurate/fancy “sponge” boundaries. You can find here an implementations of the latter; unfortunately no Julia code (then); CUDA C and Matlab only. The CUDA C version could though easily be ported to ParallelStencil using the @parallel_indices notation.

1 Like

Thanks, I know a popular toolbox used in my field - k-wave, uses a PML. I thought that was primary due to them using a spectral method to solve the acoustic wave equation though. I wasn’t sure if a hacky solution of just setting the pressure at the edges to zeros constantly would be feasible.

But once I include acoustic attenuation it should be relatively easy to implement a PML - hopefully :sweat_smile:

But thank you for the hints relating to “sponge” boundaries!

1 Like