### Using Iterative Solvers in COMSOL to Solve Large Acoustics Problems

#### by Fuyang

## The issue

So the problem finally arrives – when a COMSOL acoustic model gets very large and still we would like to perform analysis up to a relatively high frequency range (for exp. above 2000Hz), a grate number of mesh cells are needed in order to give a good representation of the system. Typically for our case, the mesh number went up to around 400K elements, and my desktop computer with 16G of RAM is simply not enough for the default direct MUMPS solver, as shown below.

So if you are new to COMSOL acoustics and encountered the same issue above, here is the “easy” solution: use a FGMRES iterative solver instead of the default direct solver, together setting a geometric multigrid as a preconditioner.

## The cure

- Expand
**Study**,**Solver Configurations**,**Solver 1**and**Stationary Solver 1** - Right-click
**Stationary Solver 1**and choose**Iterative**. (Note the default Direct solver will become disabled afterwards.) - Select the newly generated
**Iterative 1**solver, in the setting window,**General**section, select**Solver**:**FGMRES**. - Right-click
**Iterative 1**solver and choose**Multigrid**. (Note thedefault Incomplete LU node will become disabled afterwards.)

After this, the calculation can be carried out smoothly. Honestly there are lots of new jargon such as GMRES and FGMRES which are new to me as well in the process and it seems a bit confusing. But if you just simply setup up the model as mentioned above, it will probably work for you as well.

However after going through the help documentation perhaps those following tips under are worth paying attention to.

## More tips one may need

- 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. (Or in other words, use FGMRES when you are not sure about what you are doing.)
- Try to use as many multigrid levels as needed to produce a coarse mesh for which a direct method can solve the problem without using a substantial amount of memory.
- If the coarse mesh is still too fine for a direct solver, try using an iterative solver with 5–10 iterations as coarse solver.

Above words are copied from COMSOL Help Document. More details are found in the* Acoustics Module User’s Guide* under the *Modeling with the Acoustics Module* chapter. Under *Fundamentals of Acoustics Modeling* section, see *Solving Large Acoustics Problems Using Iterative Solvers*.

Also, there is a *Test Bench Car Interior* model in the COMSOL model library you can refer to. But it generally illustrates the same setting suggested above.

## Summary

In the end, by simply a few clicks here and there, the big mesh issue was easily solved. RAM usage from 8G plus reduced to around 2G and it solves fast as well. Simply amazing!

List of abbreviations

MUMPS – Multifrontal massively parallel sparse direct solver.

GMRES – Generalized Minimum RESidual iterative method.

FGMRES – Flexible Generalized Minimum RESidual iterative method.

And special thanks to the help from COMSOL by Mads J.H. Jensen and Kristian R. Jensen for their support on this topic.

Thanks Fuyang, the iterative solver can certainly help for RAM is low. But remember to do some sort of convergence study, instead of merely trusting the result you got. Also, don’t (generally) use the MUMPS solver for acoustics when RAM demands are low enough, instead change to Pardiso.

LikeLiked by 1 person

Hi Rene

Thanks for the input. However I am not so sure how to do those convergence study as you said. Mind give some more hints on this? And why use Pardiso instead of MUMPS? I thought they use MUMPS as a default solver for some good reason 🙂

Thanks

Fuyang

LikeLike