## Modeling with the Thermoacoustic Interface in COMSOL

##### Mads Herring Jensen | February 28, 2014

Previously, we introduced the theory behind thermoacoustics. Here, I will go deeper into modeling acoustics with the Thermoacoustic interface in COMSOL Multiphysics and show you some tips and tricks on how to do this.

### Modeling Thermoacoustics

When modeling acoustics phenomena using the *Thermoacoustics* interface, there are several things to be aware of. First off, the physics have to be set up correctly and the mesh has to resolve the viscous and thermal boundary layers. It is also important to note that solving a thermoacoustic model involves solving for the pressure, velocity field (for example, 3 components in 3D), and temperature. This means that the model can become computationally expensive and involve many degrees of freedom (DOFs).

#### Compressibility and Thermal Expansion

Erroneous specifications of the coefficients of thermal expansion and compressibility is a problem that I often see in support cases. If these coefficients are wrong or even evaluate to zero, the result is a model where acoustic waves (pressure or compressibility waves) propagate at the wrong speed of sound or do not propagate at all. The speed of sound relates to both of these coefficients.

A detailed description of both of these coefficients and on how to define them is given in the Acoustics Module’s *User’s Guide* (under The *Thermoacoustics, Frequency Domain* Interface in the section *Thermoacoustics Model*). The model Vibrating Particle in Water: Correct Thermoacoustic Material Parameters, which can be found in the Model Library, also discusses these issues. A simple check is to plot the parameters `ta.betaT`

(isothermal compressibility) and `ta.alpha0`

(thermal expansion) after solving the model to ensure that they have the correct values.

#### Meshing a Thermoacoustics Model

When meshing a thermoacoustics model, it is important to properly resolve the acoustic boundary layer to capture the physics correctly. In order to do this and avoid too many mesh elements, there are a few tricks you can use:

*Create parameters to control your mesh.*For example, create a parameter for the analysis frequency, say`f0`

, and then also create a parameter for the viscous (or thermal) boundary layer thickness at this frequency. In air, we know that the viscous boundary layer thickness at 100 Hz is 0.22 mm, and, in general, you can write the thickness as`dvisc = 0.22[mm]*sqrt(100[Hz]/f0)`

. If you perform a frequency sweep, you can create parameters for the thickest and thinnest value of the boundary layer. Having these parameters at hand can help you build a good mesh.*Use Boundary Layers.*This will keep the number of mesh elements constant for all studied frequencies. This is especially important in 3D. If you simply prescribe a maximum element size on the walls, the number of mesh elements will explode as the boundary layer thickness decreases.*Use logic expressions when defining the mesh.*For example, use`min(,)`

when defining the maximum element size or the thickness of a boundary layer. In the figure below, an example is given of a circular duct with a diameter 2a = 2 mm. The overall “Maximum element size” is set to a/3. A boundary layer mesh is used with five layers and a thickness of`min(a/30,0.3*dvisc)`

. This ensures a constant mesh thickness up to around 500 Hz (keeping the mesh in the middle of the pipe of good quality) and then the thickness decreases with`dvisc`

as the frequency parameter`f0`

increases.

In general, when solving a model using the Frequency Domain study step, it is not possible to have the mesh depend on the frequency variable `freq`

. This is what you would like for this type of models. However, it is possible to achieve this when performing a parametric sweep. Therefore, one workaround is to use a Parametric Sweep around the Frequency Domain study step. Sweep the parameter over `f0`

and set `f0`

to be the frequency in the Frequency Domain step.

Note that when doing this, the COMSOL software will re-mesh every time a parameter in the mesh changes, which may slow down the computation a bit. On the other hand, you can set up a more intelligent mesh in this way and still save time.

A final option is to prepare several meshes, maybe one mesh for each chunk of 1000 Hz, and then use several studies with these meshes selected for a restricted frequency range.

*Example of a mesh that captures the effects in the acoustic boundary layer, here shown at four different frequencies. The color represents the RMS velocity for a wave traveling in an infinite circular duct with a diameter of 2 mm.*

#### Apply Where Relevant

In that it is computationally expensive to solve thermoacoustics models, it is often advantageous to do so only in the parts of your system where thermoacoustics is relevant. These simulations can then be combined with simulations based on less-complex physics that describe the rest of your system. Here are some ideas on how this can be done:

*Couple the thermoacoustics model to pressure acoustics where relevant.*In models where large differences exist in the geometry scale, only use thermoacoustics in the narrow regions and pressure acoustics in the larger domains. The*Thermoacoustics*interface is a multiphysics interface that has the ability to be automatically coupled to the*Pressure Acoustics*interface. This is exemplified in the Generic 711 Coupler model (located in both the Model Library within the software and the Model Gallery on our website).*Use submodels and lumped models.*For instance, extract a transfer impedance from a detailed thermoacoustic model and use it in a pressure acoustics model. A nice example model of this is seen in the Acoustic Muffler with Thermoacoustic Impedance Lumping model. In this example, the transfer impedance of a perforated plate is analyzed and used in a pressure acoustics model.*As frequency increases, the acoustic boundary layer decreases in size and relevance.*This means that at a certain frequency, the boundary layer losses can be considered to become negligible, and you can switch to solving the modeling as a pressure acoustics problem.- In structures of constant cross section you can use the Narrow Region Acoustics models of the
*Pressure Acoustics*interface. These are homogenized fluid models where the boundary layer losses are smeared over the fluid domain. These models provide a first good approximate response of a system without the cost of solving a full thermoacoustic model.

#### Solvers

The documentation for the *Thermoacoustics* interface contains some tips and tricks on how to use different solver approaches if the model becomes very large. See: Acoustics Module User’s Guide > The Thermoacoustics Branch > Theory Background for the Thermoacoustics Branch > Solver Suggestions for Large Thermoacoustic Models.

#### In Summary

The most important points when modeling acoustics using the *Thermoacoustics* interface are:

- Solve only for thermoacoustics where and when necessary; investigate if the viscous and/or thermal boundary layer thickness are comparable to the geometrical scale or not (depending on the frequency range and geometry scales).
- Check material parameters to be sure that both compressibility and thermal expansion are non-zero.
- Check the mesh size at boundaries and compare it to the viscous and thermal boundary layer thickness.

### Application Examples

Examples of systems where the use of thermoacoustics is important are listed below.

#### Condenser Microphones

Electroacoustic transducers are a good example of true multiphysics models where it is essential to include both thermal and viscous losses:

- Blog post: Thermoacoustics Simulation for More Robust Microphone Analysis
- Model downloads:
- B&K 4134 Condenser Microphone, results compared with measurements
- Tutorial model on a simplified 2D axisymmetric condenser microphone model

#### Hearing Aids

- COMSOL News article about the use of COMSOL Multiphysics to model hearing aids, “Simulation-Based Design of New Implantable Hearing Device“

#### MEMS Microphone

- Blog post about using COMSOL Multiphysics to model MEMS microphones

#### Vibrating MEMS structures (a Micromirror)

- An example of a vibrating micromirror, which solves for thermoacoustics in order to model Fluid Structure Interaction (FSI) in the frequency domain

#### Perforated Plates Impedance

The solution of a Thermoacoustics sub-model to find the transfer impedance of a perforated plate in a muffler system. The impedance is subsequently used as a transfer impedance condition in a Pressure Acoustics model:

- Model download: Acoustic Muffler with Thermoacoustic Impedance Lumping

#### Acoustic Couplers (Ear Canal Simulators)

Modeling the response of an Ear Canal Simulator, the so-called 711 coupler. The model results are compared to IEC standard curves and to a lossless model. The results clearly show the necessity to include thermal and viscous losses.

- Model download: Generic 711 Coupler an Occluded Ear Canal Simulator

#### Photoacoustics

Advanced application using the *Thermoacoustic* interface to model photoacoustic applications.

- Model download: Photoacoustic Resonator

#### Setting up the Fluid Model

- A thermoacoustic tutorial model describing the importance of setting up the compressibility and thermal expansion material parameters correctly

### Further Reading and References

- COMSOL Documentation: Acoustics Module User’s Guide.
- COMSOL Documentation: Acoustics Module User’s Guide > The Thermoacoustics Branch.

- Applications 27
- Certified Consultants 32
- Chemical 66
- COMSOL Now 149
- Conference 108
- Core Functionality 104
- Equation-Based Modeling 15
- Geometry 5
- HPC 4
- Meshing 20
- Postprocessing 26
- Solvers 16
- UI 4

- Electrical 172
- AC/DC 53
- MEMS 24
- Plasma 7
- Ray Optics 10
- RF 47
- Semiconductor 5
- Wave Optics 14

- Fluid 113
- CFD 52
- Microfluidics 15
- Mixer 4
- Molecular Flow 11
- Pipe Flow 9
- Subsurface Flow 10

- Interfacing 44
- Mechanical 201
- Multipurpose 20
- Tips & Tricks 14
- Trending Topics 61
- User Perspectives 91
- Video 72