Solving Large Acoustics Problems Using Iterative Solvers
This section has some guidance for solving large acoustics problems. For smaller problems using a direct solver like MUMPS is often the best choice. For larger problems, especially in 3D, the only option is often to use an iterative method such as multigrid.
Direct Solver Tuning
When using the default direct solver MUMPS, one option to reduce computation time and decrease the memory consumption, is to enable the option Block low rank factorization on the Direct solver node. This can for many pressure acoustics problems reduce both memory and computation time by about 20 % to 25 %. This option is not default, as it is not efficient for all types and combinations of boundary conditions.
For further details see the Direct section in the in the COMSOL Multiphysics Reference Manual.
Automatically Generated Iterative Solver Suggestions
If the direct solver runs out of memory a simple first approach is to enable and use one of the auto generated iterative solver suggestions. A good starting point for this is to right-click the study node and select Show Default Solver, then expand the Solver Configuration tree under Stationary Solver or Time-Dependent Solver. Predefined iterative solver suggestions are automatically generated. Per default a direct solver is used and two iterative solvers are suggested and disabled. To turn on one of these right-click the solver and select Enable (or press F4). The first suggestion (GMRES with GMG) uses the GMRES iterative solver with a geometric multigrid (GMG) preconditioner. This method is typically faster than the direct solver and uses less memory for large 3D models. The second suggestion (FGMRES with GMG) uses the FGMRES iterative solver with a geometric multigrid (GMG) preconditioner. This method is more robust than GMRES, especially for problems that exhibit sharp resonances. If the GMRES suggestion does not converge try the FGMRES suggestion instead. Both suggestions along with more details are described below.
For an example that solves a pressure acoustics model using an iterative solver see: Test Bench Car Interior: Application Library path Acoustics_Module/Automotive/test_bench_car_interior
If PMLs are present in the model solved with an iterative method, it is necessary to use the Polynomial scaling option (the default) and the recommended 8 mesh layers. This option will ensure proper convergence of the iterative methods. See the Perfectly Matched Layers (PMLs) section for further details.
Complex Shifted Laplacian for Very Large Frequency Domain Models
When the frequency in the solved problem increases, the default suggested iterative solvers, described above, will eventually stop converging. One solution is to use the complex shifted Laplacian (CSL or SL) method for the multigrid preconditioner.
To set this up, expand the solve tree and select the Multigrid node under the first iterative suggestion (enable the solver). Select the Prefer the free matrix format and then select the Shifted Laplace contribution. Now select the Physics (a pressure acoustics interface present in the list) and select the Manual option for the Add weak contributions. In the edit field Weak expression the following term should be entered:
shift*acpr.p_t*test(p)*(-i*abs(acpr.k[m])^1.5)*acpr.delta/acpr.rho_c
where shift is a parameter between -1 and 1 (start with 0.5). This parameter acts as a relaxation factor. If the physics interface tag is different from acpr, update the expression. The added weak term does not modify the solution of the original problem. It is only used on the multigrid levels to help with convergence.
The same should be done by selecting the option Shifted Laplace contribution on multigrid levels. The Manual option should be selected and the same term has to be added as Weak expression. Select the multigrid levels where the SL terms should be used.
The first option Shifted Laplace contribution adds the SL contribution only on the fine level used for the smoothers. The second option Shifted Laplace contribution on multigrid levels adds the SL contributions also on all multigrid levels.
To further improve the method at very high frequencies the Hierarchy generation method option (on the multigrid mode) can be changed from the default Lover element order first (any) to Coarsen mesh, and an appropriate coarsening factor chosen. For acoustics models meshed with λ/N the coarsening can be up to about N (typically use N = 5 and a coarsening factor between 2 and 4).
The default iterative solver is GMRES which can become memory consuming for large problems. When the problem requires many iterations to be solved, it is typically necessary to increase the Number of iterates before restare to say 1000. In this case the iterative solver can be changed to TFQMR. This solver will typically require more iterations to reach convergence, but it is more memory lean.
Another memory saving option is to use the Block low rank factorization option for the Direct solver (when using MUMPS) under the Coarse Solver node. Expand the multigrid solver node to locate it.
For further details see Complex Shifted Laplacian for Large Helmholtz Problems section in the in the COMSOL Multiphysics Reference Manual.
Domain Decomposition for Helmholtz on Clusters
For very large models that can be solved on clusters with many nodes you can set up a special version of domain decomposition for Helmholtz equation. The method ca be set up to uses multigrid with the complex shifted Laplacian (CSL or SL) as well as absorbing boundaries for the domains.
For further details see Complex Shifted Laplacian for Large Helmholtz Problems section in the in the COMSOL Multiphysics Reference Manual.
Further Manual Suggestions and Theory
The underlying equation for many of the problems within acoustics is the Helmholtz equation. For high frequencies (or wave numbers) the matrix resulting from a finite-element discretization becomes highly indefinite. In such situations, it can be problematic to use geometric multigrid (GMG) with simple smoothers such as Jacobi or SOR (the default smoother). Fortunately, there exist robust and memory-efficient approaches that circumvent many of the difficulties associated with solving the Helmholtz equation using geometric multigrid.
When using a geometric multigrid as a linear system solver together with simple smoothers, the Nyquist criterion must be fulfilled on the coarsest mesh. If the Nyquist criterion is not satisfied, the geometric multigrid solver might not converge. One way to get around this problem is to use GMRES or FGMRES as a linear system solver with geometric multigrid as a preconditioner.
As a good starting point for modifying the solver is to select Show Default Solver on the main study node and expand the tree. Go to the Stationary Solver and add an Iterative solver node, per default it uses the GMRES method. The default preconditioner is the incomplete LU (see the subnode to the Iterative node), right-click the Iterative solver node and select Multigrid. Even if the Nyquist criterion is not fulfilled for the coarse meshes of the multigrid preconditioner, such a scheme is more likely to converge. For problems with high frequencies this approach might, however, lead to a large number of iterations. Then it might be advantageous to use either:
Geometric multigrid as a linear system solver (set the Solver selection to Use preconditioner) with GMRES as a smoother. Under the Multigrid node right-click the Presmoother and Postsmoother nodes and select the Krylov Preconditioner with the Solver selection to GMRES.
FGMRES as a linear system solver (set the Solver selection to FGMRES) with geometric multigrid as a preconditioner (where GMRES is used as a smoother, as above).
Using GMRES or FGMRES as an outer iteration and smoother removes the requirements on the coarsest mesh. When GMRES is used as a smoother for the multigrid preconditioner, FGMRES must be used for the outer iterations because such a preconditioner is not constant (see Ref. 34).
Use GMRES as a smoother only if necessary because GMRES smoothing is very time- and memory-consuming on fine meshes, especially for many smoothing steps.
When solving large acoustics problems, the following options, in increasing order of robustness and memory requirements, can be of use:
If the Nyquist criterion is fulfilled on the coarsest mesh, try to use geometric multigrid as a linear system solver (set Multigrid as preconditioner and set the linear system solver to Use preconditioner) with default smoothers. The default smoothers are fast and have small memory requirements.
Studies and Solvers and Multigrid in the COMSOL Multiphysics Reference Manual