In order to determine the sound produced by an object, you must know all of the structural qualities of that object. Conversely, in order to understand the structural behavior of an object, you must take into consideration the properties of the fluid (such as air or water) surrounding the object and the sound waves produced in that fluid. The load (or pressure) of the air on the structure will also affect the ability of the structure to vibrate. That’s where COMSOL comes in, making such a coupling between the structural mechanics and acoustic aspects of an object easy to simulate and analyze.
One application where this acoustic-structural interaction analysis is applicable in music is in the design of a tuning fork. A tuning fork is used to tune instruments in an orchestra to a pitch of exactly 440 Hz, which is the note A above middle C, in musical terms. When a tuning fork is struck against an object or surface, its two prongs, or tines, vibrate at their resonant frequencies and create sound waves that should correspond exactly to 440 Hz. An incorrectly designed tuning fork would cause instruments tuned with the device to be out of tune with other instruments, creating unwanted clashes in the harmonies you hear during a concert.
Vibrating tuning fork geometry showing the acoustic pressure field and displacement of the fork’s prongs.
Let’s take a look at an example of an analysis of a tuning fork in COMSOL (note that you can download this tuning fork model file below). This model has two basic steps of analysis:
The left figure shows the fundamental vibrating frequency of the tuning fork as a function of the prong length L. The right figure depicts the sound pressure level measured in the proximity of the tuning fork (blue line) and measured at 1 m away from the fork (green line) at 440 Hz. Only the relative value is of interest as the fork is actuated by a unit load (right). Click to view larger images.
Note that a theoretical solution exists that relates the resonate frequency of an “ideal” tuning fork to the other parameters of the fork, such as the fork material’s Young’s modulus, the material’s density, the radius of the prong cross sections, and the length of the two prongs. However, this theoretical solution assumes that the prongs of the fork are perfect cantilever beams, where in reality the bending stiffness of the prongs increases near the base of the fork where the prongs meet. Therefore, you should use COMSOL Multiphysics to explicitly model applications like the tuning fork where the real device you want to model doesn’t match up perfectly with the assumptions made by known theoretical solutions.
We find in this model that using theory alone we would arrive at a tuning fork with prongs of length 7.8 cm, but our COMSOL model has shown us that the real length needed for this particular tuning fork design is 7.906 cm. If we would have designed this tuning fork with the theoretically-determined prong length, our tuning fork would create a tone at about 430 Hz, which is nearly a quartertone away from the desired note A at 440 Hz. This difference would be very noticeable to the average listener and would create quite an undesirable clash of harmonies within the orchestra.
A couple of weeks ago, I led a webinar on postprocessing and visualization features in COMSOL Multiphysics. This webinar was very popular among COMSOL users, so I wanted to follow up with a blog post to highlight one of the important topics we covered — performing a mesh refinement study in COMSOL Multiphysics.
COMSOL primarily uses the finite element method (FEM) to compute single- and multiphysics simulations. Whenever you use the finite element method, it is important to remember that the accuracy of your solution is linked to the mesh size. As mesh size decreases towards zero (leading to a model of infinite size), you move toward the exact solution for the equations you are solving. However, since we are limited by finite computational resources and time, you will have to rely on an approximation of the real solution. The goal of simulation, therefore, is to minimize the difference (“error”) between the exact and the approximated solution, and to ensure that the error is below some accepted tolerance level that will vary from project to project based on your design and analysis goals.
You will need to track a characteristic output parameter from your simulation as you vary the mesh size and determine at which mesh size the parameter has “converged” on the correct value. Note that “converged” is used in quotation marks because the convergence criteria will depend on your design and analysis goals.
You can read the step-by-step instructions below to learn how to perform a mesh refinement study. You can also watch the archived Postprocessing and Visualization webinar below to see how the steps are carried out on a megaphone geometry.
In order to implement a mesh refinement study in COMSOL Multiphysics, you must first decide what output parameter you will use for your convergence criteria. This must be a numerical value evaluated over some, or all, of the nodes in your mesh. You can track a variable or mathematical expression of variables at a single point of interest, or you can use some operation (integral, average, minimum, maximum, etc.) performed over one or more domains, boundaries, or edges. If you choose the latter option, you can define the integral, average, minimum, or maximum operator by right-clicking Model 1 > Definitions and choosing the appropriate option in the Model Couplings menu, then selecting which geometric entity or entities to apply the operation to. Note that this should be added to your model before running your simulation. This should take care of setting up your output parameter.
Now you need to set up your mesh size by applying a user-defined parameter. Define a parameter under Global Definitions > Parameters and then use that parameter in the relevant Size feature in the Mesh node of your model to define a maximum element size.
Next, right-click your Study node and add a Parametric Sweep. In the Settings window, add your dummy mesh size parameter to the Parameter names list and enter the range of values to sweep your parameter over. Be sure you sweep through a wide enough range of maximum mesh sizes so you can fully capture the convergence effect in your analysis. This range will depend on your geometry and the nature of the physics equations you are solving. For example, for wave radiation problems, we recommend you use at least 5 elements per wavelength for a 3D problem and at least 8 elements per wavelength for a 2D problem, but you may still need to verify the best mesh size for your model using a mesh refinement study.
After computing the simulation, you will need to first set up a Join data set that compares the tracking parameter at each mesh size with the value of the tracking parameter that is considered to be the reliable solution; the solution at our finest mesh size will be chosen as that reliable solution here. Right-click Results > Data Sets and choose Join. Then in the Settings window, choose the solution containing your parametric sweep results (usually Solution 2) and select All solutions for Data 1, and click on the solution you want to compare your Parametric Sweep results to for Data 2 (Data: Solution 2, Solutions: One, etc.). Since we want to subtract these values, keep the Combination method as the default Difference option.
Once you’ve completed all of these steps, you are ready to create your plot. Add a 1D Plot Group with a Global or Point plot (depending on which parameter you are tracking for your convergence criteria, as described above), and make sure you specify the Data set as Join 1. Then type in the expression for the tracking parameter you are monitoring the convergence of and from the x-Axis Data > Axis source data drop-down menu, choose Outer solutions if you are running a Frequency Domain simulation (because your frequency range is considered your inner solution). Finally, click the Plot icon above the Settings window and you will see your convergence plot.
You can download the megaphone model file used in the Postprocessing and Visualization webinar below, which includes the completed mesh refinement study I demonstrated.
Below are a couple of key things that you’ll notice in the final model:
Mesh Refinement Study in the process of being implemented in an acoustic megaphone geometry
First, the audio content to be played enters the loudspeaker as an oscillating voltage difference applied to the voice coil, which creates a corresponding oscillating (alternating) current to flow through the coil based on Ohm’s Law. This current flow creates a magnetic field around the wire, according to Ampere’s Law, which changes orientation with the change in current direction.
The permanent magnet surrounding the voice coil creates a surrounding magnetic field that has a permanent orientation. As the magnetic field from the electromagnet flips its polarization direction, the positive pole of one magnet attracts the negative pole of the other, the positive pole of one magnet repels the negative pole of the other, and vice versa. This creates a force on the voice coil that causes it to move up and down, again based on the original input signal, and therefore to push the cone itself up and down accordingly.
As the cone moves, it is constrained by the spider, which provides damping for the cone and connects it to the surrounding baffle, and it “pushes” and “pulls” the air directly in front of it. This creates a miniscule fluctuation of air pressure from standard absolute pressure, which propagates outward from the cone to the listener.
The size and shape of the loudspeaker will determine how loud the resulting sound will be for any given frequency of oscillation and at any given point in space. These results, along with many other electrical, structural, and acoustic parameters of the loudspeaker, can be calculated during postprocessing in COMSOL Multiphysics.
In the following video I demonstrate how you can use COMSOL Multiphysics together with the Acoustics Module and AC/DC Module to simulate the electromagnetics, structural mechanics, and acoustics aspects of a loudspeaker design.
Utilizing symmetry inevitably involves simulating only a portion of your geometry, but you will likely want to see what the solution looks like on your full geometry to get a more intuitive feel for “what’s going on” in the model. To facilitate this, COMSOL offers many different visualization options in postprocessing that will allow you to plot your results on a “recreated” version of your full geometry. Below I have created three videos explaining how to take advantage of some of the most popular visualization options available to you in COMSOL Multiphysics.
The first video demonstrates how to use a Revolution data set to visualize results from an axisymmetric model. It shows you how plotting with this data set type is the same as plotting on a full 3D geometry:
The second video demonstrates how to use a Mirror or Sector data set to view results from a model with reflection or rotational symmetry, respectively. This video also includes a demonstration of the Extrusion data set, showing how you can better visualize the evolution of your results over time in a transient model:
In the final video I show you a neat trick for visualizing your results in a periodic model:
In one of our knowledge base entries, you can find some tips on utilizing your symmetries in COMSOL. Similarly, you can find guidance on implementing periodic conditions in your model by consulting one of our sample models in this area. One example models the propagation of an electromagnetic wave through a plasmonic wire grating and another simulates the propagation of an acoustic wave through an elastic panel.
]]>
The measure tool provides you with useful information about your geometry that can help you when setting up your model or postprocessing. For example, use this tool to retrieve information such as the coordinates of a point, the distance between two points, the length of a line, the surface area of a boundary, and even the number assigned to a geometric entity (Boundary 5, Point 112, etc.).
Hiding parts of your geometry is a particularly useful technique when you have features on the interior of your model that you’d like to view more clearly without being hidden behind the outer features. Also, you can choose to plot only part of your data so that you can focus on the results from the regions of most interest. There are two ways to do this, and both will be explained in the videos below.
Enjoy!
Chapter 1
Chapter 2
Three example graphs are generated, each demonstrating the versatility of COMSOL’s 1D plotting capabilities, including:
Enjoy the videos below on how to Create 1D Plots in COMSOL and stay tuned — more postprocessing videos are on the horizon!
Chapter 1
Chapter 2
We have many more tips and tricks to share with you, so stay tuned for upcoming postprocessing tutorial videos!
]]>
The very first video in the series summarizes the different types of available postprocessing features and gives an overview of how these can be implemented. Watch the video below, and stay tuned for more tutorial videos in this new postprocessing series!
]]>