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 example, it is not suited for models with non-local couplings, like models with periodic conditions.
For further details see the Direct section in the in the COMSOL Multiphysics Reference Manual.
For an example that uses the Block low rank factorization see: Test Bench Car Interior. Application Library path: Acoustics_Module/Automotive/test_bench_car_interior
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, for a pure Pressure Acoustics, Frequency Domain model, a direct solver is used and four iterative solvers are suggested (disabled). To turn on one of these, right-click the solver and select Enable (or press F4). The four suggestions are:
1
Suggested Iterative Solver (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 medium to large 3D models. For details see Manual Setup of GMG Solver Suggestions and Theory.
2
Suggested Iterative Solver (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. For details see Manual Setup of GMG Solver Suggestions and Theory.
3
Suggested Iterative Solver (Shifted Laplace): For increasing frequencies, the first two 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. The SL method will in general speed up convergence for larger models. For details see Complex Shifted Laplacian for Very Large Frequency Domain Models.
4
Suggested Iterative Solver (Domain Decomposition): This last suggestion is for solving very large models that need to run in a cluster (using a distributed architecture). The performance of the method will be best when used on several nodes. For details see Domain Decomposition for Helmholtz on Clusters.
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.
For models that run with a very fine frequency step (with a linear frequency distribution) the Reuse solution from previous step option is good. The default Auto (or Yes) options will help convergence by providing a good initial guess for the iterative solvers. However, in models with large spacing in the solved frequencies and where frequencies are given on a logarithmic axis the option should be set to Off. This will speed up convergence.
For an example that solves a model using an iterative solver see: Headphone on an Artificial Ear. Application Library path: Acoustics_Module/Electroacoustic_Transducers/headphone_artificial_ear
Complex Shifted Laplacian for Very Large Frequency Domain Models
When the frequency in the solved problem increases, the first two 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. The SL method will in general speed up convergence for larger models. One exception, where the SL method will not help, is in models solved near resonances with low damping from the boundaries. Here, the default GMG suggestion described above will most likely work better. For a pure Pressure Acoustics model the SL solver suggestion is set up automatically with appropriate settings.
Manual Setup of the SL Solver
To set up the SL method manually, expand the solver tree and select the Multigrid node under the first iterative suggestion (enable the suggestion). Select the Prefer the free matrix format check box and then select the Shifted Laplace contribution check box. Now select the Physics (a pressure acoustics interface present in the list) and select the Manual option for the Add weak contributions. In the Weak expression field, enter the following term:
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 to match the physics interface tag. 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 Shifted Laplace contribution on multigrid levels check box. Then select the Manual option and add the same term as Weak expression.
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 Lower element order first (any) to Coarsen mesh. Then enter an appropriate Mesh coarsening factor. For acoustics models meshed with λ/N the coarsening can be up to about N. Typically use N = 5 and set 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 restart 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 can be set up to use multigrid with the complex shifted Laplacian method 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.
Manual Setup of GMG Solver Suggestions and Theory
The underlying equation the problems solved in pressure 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. This is the strategy used in the default iterative solver suggestions.
As a good starting point for setting up the solver manually 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 can 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