Below you will find pages that utilize the taxonomy term “Physics”
Ear Canal - Part 2
In the Ear Canal - Part 1 episode we built a first ear canal model. We used a freely available cast of an ear canal and manipulated its geometry. We obtained some initial results, but it was clear that the accuracy left much to be desired. In this episode we step back: we solve an eigenproblem on a better geometry and compare the results with a benchmark problem.
Ear Canal - Part 1
It has been quite some time since I contributed a new tutorial to this website. In addition to the general lack of time, the main reason is that I was busy studying FEniCSx. My intention was to create a piece of software to solve the Helmholtz equation in heterogeneous media, with support for adiabatic absorbers boundary conditions. Whilst I was able to draft something up (see the acoupy_helmholtz
fenicsx
branch) I did not make it very far into workable code yet. This also because most of my time has been spent dealing with the Helmholtz equation itself, and the modifications required to support such simulations. Eventually all of this work will find its way into various articles in this website. But for the time being I decided to stop for a second. There are many more Elmer solvers that I have not explored yet. I decided that, while I carry on this “research” work, I can explore these solvers and write a few new episodes while doing so. This article is about a first model of the ear canal. The model is not particularly sophisticated, as it uses Elmer’s HelmholtzSolve
solver that we have learned and love. However, it deals with a realistic geometry. This allows me to show how to manipulate complicated geometries, produce initial simple results, assess whether the results are reasonable, and lay a foundation for more complicated simulations. So, let’s dive in!
Elmer vs FEniCS - Part 3
In the Elmer vs FEniCS - Part 2 episode we studied the effect of mesh size on accuracy. We largely found the same results observed in the Mesh Order and Accuracy episode. We also confirmed that the agreement between FEniCS
and Elmer
is very good. However, we noticed that FEniCS
was significantly slower than Elmer
. This because we used a MUMPS
direct method on FEniCS
and a BiCGStabl
iterative method on Elmer
. In this episode we will explore the iterative solver options for FEniCS
and attempt to optimize execution time for our simulation.
Elmer vs FEniCS - Part 2
In the Elmer vs FEniCS - Part 1 episode we solved the Pulsating Sphere problem over a fairly coarse mesh. We solved the problem both with Elmer
and acoupy_helmholtz
, our FEniCS
based Helmholtz solver. We found that Elmer
and FEniCS
produce the same solution. This solution compares well to the exact solution, but has some appreciable magnitude error. In this episode we will study how this error changes with mesh size, and whether Elmer
and FEniCS
keep on providing the same solution.
Elmer vs FEniCS - Part 1
In the Writing Your Packages - Part 1 and Writing Your Packages - Part 2 episodes we introduced the most important concepts in writing your own simulation packages. We chosen Python
as a language and implemented two simple packages, acoupy_meshutil
and acoupy_helmholtz
. In this episode we will use the Pulsating Sphere benchmark problem to compare acoupy_helmholtz
to our old trustworthy Elmer
. Since our software is little more than syntactic sugar around FEniCS
this will allow us to compare with FEniCS
directly.
Tuning Fork - Part 4
In the Tuning Fork - Part 3 episode we seen how to setup a weak vibroacoustic coupling problem. We applied an harmonic body force to our tuning fork, and used its displacement field to wake the acoustic field within a coupled volume of air. In this episode we will review the results.
Tuning Fork - Part 3
In the Tuning Fork - Part 1 and Tuning Fork - Part 2 we set up and solved an Elmer study for the modes of vibration of a tuning fork. We learned that the principal mode of the fork, the one related to the nominal frequency of the fork, is very marginally affected by boundary conditions affecting the handle of the fork. In this episode we will attempt studying the acoustic field emitted by the fork in the surrounding air. In other words, we will start exploring the coupling of vibration and acoustics.
Tuning Fork - Part 2
In the Tuning Fork - Part 1 episode we setup a new study for the determination of the elastic modes of vibration of a tuning fork. Our study made use a few meshing and solver setting ideas we learned along the way, including the use of $p$-elements. In this episode we will examine the results from the Elmer simulation.
Tuning Fork - Part 1
The very first episode in which we introduced Elmer was the Elastic Modes of a Metal Bar episode. In that episode we introduced Elmer by solving a linear elasticity eigenproblem, and mentioned how vibration is an integral part of acoustics, being vibrating bodies one of the principal causes of airborne sound radiation. In this new series of episode we will explore vibration further, integrating in it what we learned so far, and we will explore vibro-acoustic coupling with Elmer.
Frequency Responses
In the Home Studio - Part 3 and Home Studio - Part 4 episodes we referred to the results of our frequency sweep as frequency responses. In those episodes we calculated the steady state pressure disturbance in a room at different frequencies and sampled the field at a couple of locations so to be able to plot the steady state magnitude at those locations as a function of frequency. It is intuitive to refer to this result as a frequency response, in the sense that the field magnitude as a function of frequency gives us an understanding of how strong the steady state disturbance is at any given frequency in our study. However, what is typically meant by by frequency response is in reality quite a different concept. This episode is intended to provide a cursory introduction to this concept, and explain why what we calculated in the previous episodes is different, even though we called it frequency response.
Home Studio - Part 4
In the Home Studio - Part 3 episode we simulated the steady state pressure field for a realistically shaped room governed by the linear wave equation. The boundary condition for the room was that of ideally rigid walls. We seen that the effect of such a boundary condition is an extremely uneven frequency response. This due to how sharp the resonances of the room are. In this episode we will introduce slightly more realistic boundary conditions and see what the effect on the solution is.
Home Studio - Part 3
In the Home Studio - Part 1 episode we gave a first look at the response of a realistically shaped room with rigid walls. We understood how to develop and run a model with an uniform velocity sphere source placed somewhere in the room. We run the model up to $400$ $\text{Hz}$ with the help of the convergence considerations outlined in the Dealing with Convergence Issues episode. In the Home Studio - Part 2 episode instead we used Elmer’s WaveSolver
to compute the eigenmodes of the room. Not only that, but we introduced several improvements such as the use of $p$-elements and locally refined meshes. In this episode we will model in high detail the low frequency response of our room, up to $125$ $\text{Hz}$, making use of the improvements we just mentioned.
Home Studio - Part 2
In the Home Studio - Part 1 episode we computed the steady state field of a realistic, but still rigid walled, room. We put a source in the room, modelled as a flux boundary condition, and run the study at few different frequencies. The solutions that we found were reminiscent of modal patterns, which is expected as the low frequency response of a room is dominated by its resonances. However, that kind of study does not inform us on the actual resonance frequencies of the room, which are properties of great interest, as well as how the associated modal shapes (eigenmodes, or eigenfunctions) look like.
Interpreting Helmholtz Solver Solutions
In the previous episodes we obtained various numerical FEM solutions for Helmholtz problems. Although we discussed their meaning in the previous episodes it is useful to discuss that again more deeply in a single page, which can act as a quicker reference. This episode will focus on the Helmholtz solver solution fields, while other episodes will focus on the output of other solvers.
Rigid Walled Room Revisited - Part 3
In the Rigid Walled Room Revisited - Part 2 episode we reviewed the solution provided by the Elmer Wave Equation solver. In that study we solved for the eigenfrequencies and eigenmodes of a rectangular room by using a first order mesh. The results we found were very accurate already, with eigenfrequencies within $1$ $\text{Hz}$ from the exact value and eigenmodes accurate within $1.4\text{%}$. However, we seen in the Mesh Order and Accuracy episode that we can significantly increase the accuracy of results by acting on the mesh fineness and, more effectively, the order. In this episode we will solve the rigid walled room eigenproblem with a second order mesh to quantify what effects this has on the accuracy of the solution.
Rigid Walled Room Revisited - Part 2
In the Rigid Walled Room Revisited - Part 1 episode we seen how to setup an eigen system problem with Elmer by making use of the Wave Equation solver. In this episode we will review the simulation results and check the agreement with the analytical solutions in the Acoustic Modes of a Rectangular Room episode.
Rigid Walled Room Revisited - Part 1
We covered the rigid walled rectangular room previously in the Rigid Walled Room episode. In that episode we solved for the steady state field in a rectangular rigid walled room as driven by a source placed somewhere in the room. This allowed us to see how the steady state field is sustained by a modal superposition, the purer the lower the driving frequency (assuming that this driving frequency matched an eigenfrequency of the room). The study was setup the way it was in order to work around one limitation of the Elmer Helmholtz solver: the lack of an Eigensolver feature. Had an Helmholtz Eigensolver been available we would have been able to compare with the analytical solution presented in the Acoustic Modes of a Rectangular Room episode directly, in a much more straightforward and meaningful way. It turns out that Elmer does have the capability of solving for the normal modes of cavities. This capability is implemented in the Wave Equation solver. We will explore this solver in this and further episodes, and use this solver to build a new benchmark system for the Home Studio episodes, as we mentioned in the conclusion of the Mesh Order and Accuracy episode.
Mesh Order and Accuracy
In the Dealing with Convergence Issues we made use of first order meshes in order to ease convergence of our simulation at high frequency. However, the accuracy of FEM solutions is higher the higher the order of the mesh, so doing so will come at the expenses of accuracy. Still, we argued that the accuracy is mostly controlled by the mesh size, so as long as we have more than ten elements per wavelength the solution should be reasonably accurate. In this episode we will use one of our benchmark models, The Pulsating Sphere, to quantify the impact of reducing mesh order on the accuracy of a FEM solution. We will also look at the effect of parallelisation. We will discover that in reality, although it is possible to reach good accuracy with first order meshes, second order meshes allow the Helmholtz Solver to provide significantly more accurate results.
Dealing with Convergence Issues
In the Home Studio - Part 1 episode we faced convergence issues when dealing with the highest driving frequency for our room ($400$ $\text{Hz}$). This meant that we could not quite trust the solution, and so we discarded it. In this episode we will look at what to do in this cases, and how to reach convergence. Rather that dealing with the issues in abstract and general terms (which would require writing an entire book about it) we will use the Home Studio - Part 1 episode to introduce the problem and figure out how to deal with it practically.
Home Studio - Part 1
In the Rigid Walled Room episode we seen how to model a rectangular room with rigid walls. We driven the room at the modal frequencies and compared the solution field with the theoretical modal shapes, finding that the results matched single modal shapes real well until, at a frequency high enough, the contribution of multiple modes (in addition to that related to the driving modal frequency) became important. In this episode we will look at making the model more realistic. To do so, we will investigate the low frequency response of a home studio.
Rigid Walled Room
In the Acoustic Modes of a Rectangular Room episode we explored the analytical model of a rigid walled room with some Julia code. We focused on finding the resonance frequencies (or eigenfrequencies) of the room and calculating the related modal patterns (eigenfunctions). Now that, thanks to The Pulsating Sphere episode, we know how to setup Helmholtz problems with Elmer we can approach the problem with the FEM method. In this episode we will solve for the modal superposition in a rectangular rigid walled room and use the results from the Acoustic Modes of a Rectangular Room episode to check the accuracy.
Elmer Model and Solver Parameters
In the previous episodes we solved a few equations with Elmer. We did some choices when we setup the solver parameters. What those parameters do, and how should we set them? This is perhaps the trickiest part in FEM (beside making the mesh right). In this episode we will step back and look at those solver options more closely. This post is really not meant to be an exhaustive explanation. For that, refer to the Elmer documentation.
The Pulsating Sphere
In this episode we will build a model of a pulsating sphere source. The pulsating sphere source is an ideal source which forms the base for the development of point sources. In essence, a point source is a pulsating sphere in the limit of $a$, the radius of the sphere, approaching $0$. For this reason, although abstract, the pulsating sphere is a very powerful theoretical tool that enables the study of point sources which in turn, through integration and wave propagation principles, enable to study of any arbitrary acoustic field source.
Refining the Metal Bar Model
In the last episode we seen that our model solution for the modes of vibration of a metal bar wasn’t looking particularly good for the highest mode. In fact, when we clipped into the bar, we seen few bubbles of discontinuity in the displacement field that are not expected for linearly elastic homogeneous and isotropic bodies. To understand this we have to step back a little and think about FEM some more.
Elastic Modes of a Metal Bar
In the last episode we examined the analytical solution of the acoustic modes of a rectangular room and we are now ready to take steps into moving in the world of FEM modelling. Elmer is a powerful package, but it is not extremely user friendly. So, it is best to have a gentle introduction to it first before dwelling into the intricacies of FEM modelling of acoustic fields. One of the simplest problems to solve with Elmer is that of the elastic vibration modes of solids. This problem will allow us to get started with Elmer in the most gentle way possible, by only using the GUI.
Acoustic Modes of a Rectangular Room
In this episode we will look at how to make a simple Julia model of one of the simplest systems in acoustics, a rectangular room with rigid walls, assuming adiabatic wave propagation. Even if this system is among the simplest in acoustics it is actually already very complicated. As such, we will focus only on the modes, one part of the problem, without attempting impulse response simulation or other fancy things like that, for now.
FEM in a Nutshell
In the previous episodes we seen that physical systems are described by PDEs. However, PDEs are seldom solved analytically, unless for certain simple cases, the reason being that finding the solution of a PDE on a complex, realistic, domain with realistic boundary and initial conditions is extremely complicated, or downright impossible, even when the PDE is known to have analytical solutions from theoretical considerations. For this reason, numerical methods have arisen in order to handle these problems. The essence of numerical methods is that of creating a simplified problem, for which a solution can be found. Of course, the solution of the simplified problem is not the same as the solution of the original problem, but often numerical methods have convergence properties, that is, they are controlled by parameters which, the bigger they are, the close the numerical solution is to the target one. These convergence properties are often demonstrated mathematically, which is very remarkable: although the real solution of a PDE is unknown, it is still possible to handle the problem knowing that a numerical solution can approach it within a certain tolerance.
What is Acoustic Modelling
Welcome to the first actual episode of the series about acoustic modelling with open-source software. We will first try to understand what modelling acoustics means. In reality it doesn’t mean just one thing, as many phenomena of acoustic wave production and propagation can be modelled and simulated in various different ways, with higher or lower degree of accuracy. However, the core of the modelling problem resides in partial differential equations. This post will be a very, very, brief, intuitive and nonrigorous introduction to the topic, mainly to give context to those that are not accustomed to the concept. If you are experienced about physics and acoustics, you can completely skip this episode.