Solver Suggestions for Large Thermoviscous Acoustics Models
Solving thermoviscous acoustic problems can easily involve solving for many degrees of freedom (DOFs) as the model solves for the acoustic variations in both pressure, velocity field (2 or 3 components), and temperature. First of all, it is important to restrict the use of the thermoviscous acoustics model to domains and regions of the model where it is necessary. Couple to Pressure Acoustics using the multiphysics coupling or use the Narrow Region Acoustics feature of Pressure Acoustics to reduce the number of DOFs. Secondly, care should be taken when meshing the computational domain. If these two things have been carefully considered, the solver can be changed from its default Direct setting to use an Iterative solver. Depending on the model size and involved physics two options are described below.
In both cases, a good starting point for setting up a new solver configuration 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 approaches, right-click the solver and select Enable (or press F4). The first suggestion (GMRES with Direct Precon.) uses an iterative solver with a direct preconditioner. This method is typically faster then the direct solver and uses 20% less memory. The second suggestion (GMRES with DD) uses an iterative solver with the domain decomposition method. This method is very robust (also for multiphysics applications) and very memory efficient, but it can be slow. Both suggestions are described below as well as how to set them up manually (in most cases the default suggestions should be used). In liquids where thermal effects can be neglected, the model can be solved in the adiabatic case and DOFs saved. Finally, choosing different shape functions can also reduce the memory consumption.
Iterative Solver with Direct Preconditioner using Hybridization
For large 2D problems and 3D problems, that only involve thermoviscous acoustics, using the following approach will save around 20% memory and can speed up the solution procedure by a factor 2 or 3. Under the Stationary Solver node take the following steps: Add an Iterative solver with the GMRES solver. As preconditioner add the Direct Preconditioner and switch the solver to PARDISO. Expand the Hybridization section and select Multi preconditioner in the Preconditioner variables list add the Pressure and Velocity field. Add a second direct preconditioner with the same settings but now select only the Temperature as preconditioner variables. The reason for splitting the equations up in this manner is that the energy equation is only loosely coupled to the momentum and continuity equations.
See the Direct Preconditioner section in the COMSOL Multiphysics Reference Guide for more details.
The direct preconditioner approach is used in the model: Transfer Impedance of a Perforate. Application Library path Acoustics_Module/Tutorials/transfer_impedance_perforate
Iterative Solver with Domain Decomposition
A more advanced approach, to handle very large 3D models, is again to use the GMRES iterative solver but now with the domain decomposition preconditioner. This approach can also be used for multiphysics problems involving several physics.
Start by adding an Iterative solver and select GMRES as the solver. Then right-click the iterative node and select Domain Decomposition. A good starting point for this solver, is to use the default settings with only a few changes:
If you set Recompute and clear subdomain data to On you will get a very memory lean solver (but the solution may take longer). Recompute and clear subdomain data is a list with the options Automatic, Off, and On. If the option Automatic is chosen, the recompute and clear mechanism is activated if there is an out-of-memory-error during the domain decomposition setup phase. The setup is then repeated with recompute and clear activated (which can be costly in terms of time, but is better than failure). A warning is given in this case.
In the Coarse Level section change the Use coarse level to Aggregation.
In the direct solver under the Coarse Solver and Domain Solvers subnodes use the PARDISO solver.
This type of approach should allow you to solve large thermoviscous acoustics models, also including multiphysics interactions, using a minimum of RAM. Possibly increase the value of the Maximum number of DOFs per subdomain option to use a larger amount of the RAM at your disposition.
See the Domain Decomposition (Schwarz) section in the COMSOL Multiphysics Reference Guide for more details
Solving in the Adiabatic Case
In certain cases, it is a good assumption to not include thermal conduction in the model and treat all processes as adiabatic (isentropic). This is, for example, relevant for fluids where the thermal boundary layer is much thinner than the viscous, like in water. Not solving for the temperature field T also saves some degrees of freedom (DOFs).
This is achieved by selecting the Adiabatic formulation option under the Thermoviscous Acoustics Equation Settings section. When Adiabatic formulation is selected, all temperature options and conditions are disabled in the user interface.
Choosing Shape Functions
In models with a structured mesh, it can be advantageous to switch to the serendipity shape functions instead of the default Lagrange, see Lagrange and Serendipity Shape Functions below. In general, if a boundary layer mesh is used (to resolve the thermal and viscous boundary layers) or if a PML is used in the model, the mesh contains structured mesh regions.