Meshing, Discretization, and Solvers
The Convected Wave Equation, Time Explicit Interface (CWE) is based on the discontinuous Galerkin method also known as dG-FEM or simply dG. The method is very memory efficient and is based on a time explicit formulation. This means that it is not necessary to invert a full system matrix when stepping forward in time. Inversion of this matrix is necessary in time implicit methods and is very memory consuming for large problems. Because the CWE interface is not based on the classical FEM formulation, used in most of the other acoustics interfaces, other strategies apply for meshing and discretization.
The internal time stepping size of a time explicit method is strictly controlled by the CFL condition and thus the mesh size. Meaning that the smallest mesh elements will restrict the time steps (see Optimizing the Mesh for DG below). It turns out that the dG formulation has a sweet spot for speed and efficiency for wave problems. This is achieved by using fourth order (quartic) shape functions (the default in the interface) and a mesh with the element size of about half the wavelength of the highest frequency component that needs to be resolved. In practice a mesh with size set to λmin/2 to λmin/1.5 can usually be used.
The interface is supported on all mesh types and for all combinations of mesh. The internal time step, used by the solver, is automatically calculated based on mesh size (inscribed circle metric), the wave speed and background mean flow speed, and the specifics of the solver selected. By default the time explicit solver uses the Runge-Kutta 4th order the method (RK4). This method is good as long as the mesh has a uniform mesh element size. If a mesh includes a large distribution of mesh element sizes (in particular in cases with only a few small elements) it can be advantageous to switch to the Adam-Bashforth 3 (local) method (AB3loc). This method uses intermediate local time steps in the region where there are small mesh elements. It is not expected that AB3loc will outperform RK4 for problems with a relatively uniform distribution of elements. For these cases RK4 is be the best choice.
Optimizing the Mesh for DG
As mentioned above, the internal time step, used by the solver, is controlled by the smallest mesh element in the model (relative to the speed of sound in the domain). So when meshing care should be taken to avoid small elements.
To visualize a metric for the time step used in elements, plot the variable cwe.wtc. The variable is known as the cell wave time scale and is proportional to the solver time step. The actual time step depends on the solver chosen. The global minimal value exists as the variable cwe.wtc_min. When plotting this variable set the Resolution to No refinement and the Smoothing to None, both settings in the Quality section of the plot. This can help identify problematic mesh element in the model. To filter out elements with the large add a Filter subnode to the plot and add a logic expression of the type: cwe.wtc<1.1*cwe.wtc_min.
Some important meshing and geometry strategies apply:
1
In 3D mesh, always use the Avoid too small elements option in the Element Quality Optimization settings on the Free Tetrahedral nodes in the mesh. The Optimization Level can be set to different degrees Basic, Medium, or High. Using this option can greatly improve the mesh for dG applications and thus speed up the computation significantly. It is recommended to avoid mesh elements with short edges, since these are bad for the dG method
2
In 2D mesh, a possible strategy is to create a mapped mesh. This will give a uniform mesh distribution. This however only works if a mapped mesh can be constructed. In general the mesh can be optimized by adding an Adapt node after meshing (one for each region with a given mesh size). In the Adaptation section set Solution to None, Type of expression to Absolute size, and then in the Size expression enter the mesh size for the domain. Then set the Maximum number of refinements to 0. This operation will move mesh nodes around to try to maximize the mesh size and try to remove small mesh elements.
3
4
Curved surfaces and boundaries need to be resolved adequately to ensure numerical stability. Typically using a Curvature factor of 0.3 to 0.4 will work well. If a curved boundary is not adequately resolved it may result in too large internal time-steps. At the same time too small elements should of course be avoided.