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. In the frequency domain use the Narrow Region Acoustics feature or the Thermoviscous Boundary Layer Impedance 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 suggestion. 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 two direct preconditioners. This method is typically faster than 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. The method can be slow if modified to be as memory efficient as possible (see below).
Both suggestions are described below. In liquids where thermal effects can be neglected, the model can be solved in the Adiabatic formulation and DOFs saved. Choosing different shape functions can also reduce the memory consumption, for example, switching from the default P1-P2-P2 discretization to an all linear discretization, if Stabilization is enabled.
Iterative Solver with Direct Preconditioner using Hybridization
The first iterative solver suggestion (GMRES with Direct Precon.) is useful for moderate 3D problems, that only involve thermoviscous acoustics. Using this solver suggestion will save around 20% memory and can speed up the solution procedure by a factor 2 or 3.
The manual setup of the suggestion can be done as follows: 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. Set the Pivoting Perturbation to 1e-13 for the pressure-velocity group. 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 Manual 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
The second iterative solver suggestion (GMRES with DD), uses the more advanced Domain Decomposition approach, to handle large and very large 3D models. The method can be tuned depending on the hardware available. Two settings are of interest:
The Maximum number of DOFs per subdomain can be increased/decreased based on the memory available on your system.
The Recompute and clear subdomain data can be set to On (instead of the default Off) if it is necessary to run an very memory lean version of the solver. This will in turn increase the computation time. The 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. Use the default suggested Off option for an efficient solver of large problems when there is sufficient memory resources.
This type of approach should make it possible to solve large thermoviscous acoustics models, also including multiphysics interactions, using a minimum of RAM.
See the Domain Decomposition (Schwarz) section in the COMSOL Multiphysics Reference Manual 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 shape functions; 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.