  Irregular terrain has a pronounced effect on the propagation of seismic and
acoustic wavefields but is not straightforwardly reconciled with structured
finite-difference (FD) methods used to model such phenomena. Methods currently
detailed in the literature are generally limited in scope application-wise or
non-trivial to apply to real-world geometries. With this in mind, a general
immersed boundary treatment capable of imposing a range of boundary conditions
in a relatively equation-agnostic manner has been developed, alongside a
framework implementing this approach, intending to complement emerging
code-generation paradigms. The approach is distinguished by the use of
N-dimensional Taylor-series extrapolants constrained by boundary conditions
imposed at some suitably-distributed set of surface points. The extrapolation
process is encapsulated in modified derivative stencils applied in the vicinity
of the boundary, utilizing hyperspherical support regions. This method ensures
boundary representation is consistent with the FD discretization: both must be
considered in tandem. Furthermore, high-dimensional and vector boundary
conditions can be applied without approximation prior to discretization. A
consistent methodology can thus be applied across free and rigid surfaces with
the first and second-order acoustic wave equation formulations. Application to
both equations is demonstrated, and numerical examples based on analytic and
real-world topography implementing free and rigid surfaces in 2D and 3D are
presented.
