Rigid surface with the 2nd-order acoustic wave equation
In this notebook, implementation of a rigid surface is demonstrated. This boundary condition is of interest for waves travelling in air, such as in infrasound modelling.
# Load the signed distance function for the boundary geometryimport pickleimport matplotlib.pyplot as pltdef read_sdf(surface, dims):"""Unpickle an sdf""" fname ='../tests/sdfs/'+ surface +'_'+str(dims) +'d.dat'withopen(fname, 'rb') as f: sdf = pickle.load(f)return sdf# Load the diagonal 2D sdfsdf = read_sdf('45', 2)plt.imshow(sdf.data.T, origin='lower')plt.title("Boundary geometry SDF")plt.colorbar()plt.show()
from schism import BoundaryGeometrybg = BoundaryGeometry(sdf)grid = bg.grid # Gets the grid from the signed distance function
Operator `normals` ran in 0.01 s
import devito as dvs_o =4p = dv.TimeFunction(name='p', grid=grid, space_order=s_o, time_order=2)
In this case, a rigid surface is imposed, setting all pressure fluxes to zero at the surface. As with the free-surface, higher-order boundary conditions can be derived.