Example problem: The spatially-adaptive solution of the azimuthally Fourier-decomposed 3D Helmholtz equation
In this document we discuss the spatially-adaptive finite-element-based solution of the 3D Helmholtz equation in cylindrical polar coordinates, using a Fourier-decomposition of the solution in the azimuthal direction.
The driver code is very similar to the one discussed in another tutorial – the main purpose of the current tutorial is to demonstrate the use of spatial adaptivity on unstructured meshes.
A specific example
We will solve the azimuthally Fourier-decomposed Helmholtz equation
where is the azimuthal wavenumber, in the finite domain . We impose the Sommerfeld radiation condition at the outer boundary of the computational domain at , using a Dirichlet-to-Neumann mapping, and apply flux boundary condition on the surface of the unit-sphere (where ) such that the exact solution is given by
This solution corresponds to the superposition of several outgoing waves that emerge from the unit sphere.
The two plots below show a comparison between the exact and computed solutions for , a Fourier wavenumber of , and a (squared) Helmholtz wavenumber of .
Plot of the exact (green) and computed (red) real parts of the solution of the Fourier-decomposed Helmholtz equation for N=1 and a wavenumber of k^2 = 10.
Plot of the exact (green) and computed (red) imaginary parts of the solution of the Fourier-decomposed Helmholtz equation for N=1 and a wavenumber of k^2 = 10.
The numerical solution
The driver code for this problem is very similar to the one discussed in another tutorial.
shows the main differences required to discretise the computational domain with an adaptive, unstructured mesh:
The provision of the functions actions_before/after_adapt() to detach/re-attach the FaceElements that are used to enforce the Neumann boundary conditions before and after every spatial adaptation, and to pass the physical parameters to the newly created bulk elements.
The generation of an unstructured mesh whose curvilinear boundaries are represented by GeomObjects – this ensures that the domain boundaries become increasingly well resolved under mesh refinement.