2d simulation of acoustic wave propagation

Numerical methods and mathematical models of Elmer
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

Another source for sign changes to be necessary in the equations could be that a different exponential ansatz [either exp(iwt) or exp(iwt)] is used in different software. Elmer employs the alternate exp(iwt).
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

mika wrote: 26 Jan 2020, 15:07 Another source for sign changes to be necessary in the equations could be that a different exponential ansatz [either exp(iwt) or exp(iwt)] is used in different software. Elmer employs the alternate exp(iwt).
What is the alternate formula that Elmer employs?
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

I made a mistake, the intention was to write "either exp(iwt) or exp(-iwt)]". So Elmer assumes the representation p(x,t) = P(x)exp(iwt) and this is the sole option.
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

mika wrote: 26 Jan 2020, 18:23 I made a mistake, the intention was to write "either exp(iwt) or exp(-iwt)]". So Elmer assumes the representation p(x,t) = P(x)exp(iwt) and this is the sole option.
In my matlab code, the source is represented by exp(1j*k*r), where k is the wavenumber and r is the coordinate vector.
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

Also, with lower frequencies (like 1kHz) I see some basic expected output, like if I emit a pressure wave from the bottom middle transducer, which is not the case for 40kHz. So, we come back to the suggestion that either my mesh is not good, or Elmer solver is just not enough for higher frequencies. As for the first, I've also tried the .mphtxt mesh file from Comsol and it didn't work well either, and the mesh I'm using right now is the finer mesh it can be done in Salome. And it still doesn't work.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 2d simulation of acoustic wave propagation

Post by raback »

Hi

At 40 kHz the wavelength is around 8.5 mm. On the other hand, with standard nodal FEs you need at least ~10 elements per wave. Hence, your mesh size, h, should be smaller than 1 mm in order to capture the phenomena.

Could the insufficient mesh density be a problem?

-Peter
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

raback wrote: 28 Jan 2020, 01:07 Hi

At 40 kHz the wavelength is around 8.5 mm. On the other hand, with standard nodal FEs you need at least ~10 elements per wave. Hence, your mesh size, h, should be smaller than 1 mm in order to capture the phenomena.

Could the insufficient mesh density be a problem?

-Peter
I'm meshing in Salome. Salome doesn't use units, so I consider that all my dimensions are in mm, I put everything based on that and I mesh with maximum size = 0.5. Then, I import to Elmer and use

Code: Select all

Coordinate Scaling = Real 0.001
. I uploaded the project along with the mesh, so feel free to experiment if you want. For now, I'm just testing the top middle transducer on 40kHz and Direct method. I get pretty weird results.
Run the test.sif file to see the results.

https://mega.nz/#!iehDGIqB (couldn't upload here because of the file size)
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

Hi,

The description
panosvar wrote: 27 Jan 2020, 13:22 the source is represented by exp(1j*k*r)
is not complete, there has to be an additional time-dependent part. Well, I now try to be quite specific since this appears to be necessary in order to make progress.

If each transducer is supposed to create a plane wave (that is, a wave front) over its surface (Question I: is this the case or should we allow the amplitude to change over each transducer face?) which starts to propagate into a direction u (u is a unit vector), the most general real-valued representation of the source can be put into the form

p(r,t) = A cos(k u.r + w t + phi)

where A is the amplitude, the scalar k is the wave number, r is the position vector for the transducer points, w is the angular frequency and phi is the phase. If we assume further that u = ey, with ey being the unit vector along the positive y-axis (Question II: is this the right assumption or should we select u = -ey in the upper array, or use some other choices depending on the array), then u.r = y. Since all transducers are on lines y = constant, then k u.r must be a constant.

As the third question (Question III), in the Elmer implementation, does your phase vector definition include the constant part k u.r + phi or just phi? After we can agree on the real-valued representation p(r,t), we can convert back to complex variables and hopefully make your simulations to agree with other software.

If the resolution of the mesh is sufficient for some problem setup at 40 kHz, it should be so also other setups, with only phases being altered. Therefore I still doubt there is some inconsistency in setting BCs for Elmer.

Best regards,
Mika
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

mika wrote: 28 Jan 2020, 17:27 Hi,

The description
panosvar wrote: 27 Jan 2020, 13:22 the source is represented by exp(1j*k*r)
is not complete, there has to be an additional time-dependent part. Well, I now try to be quite specific since this appears to be necessary in order to make progress.

If each transducer is supposed to create a plane wave (that is, a wave front) over its surface (Question I: is this the case or should we allow the amplitude to change over each transducer face?) which starts to propagate into a direction u (u is a unit vector), the most general real-valued representation of the source can be put into the form

p(r,t) = A cos(k u.r + w t + phi)

where A is the amplitude, the scalar k is the wave number, r is the position vector for the transducer points, w is the angular frequency and phi is the phase. If we assume further that u = ey, with ey being the unit vector along the positive y-axis (Question II: is this the right assumption or should we select u = -ey in the upper array, or use some other choices depending on the array), then u.r = y. Since all transducers are on lines y = constant, then k u.r must be a constant.

As the third question (Question III), in the Elmer implementation, does your phase vector definition include the constant part k u.r + phi or just phi? After we can agree on the real-valued representation p(r,t), we can convert back to complex variables and hopefully make your simulations to agree with other software.

If the resolution of the mesh is sufficient for some problem setup at 40 kHz, it should be so also other setups, with only phases being altered. Therefore I still doubt there is some inconsistency in setting BCs for Elmer.

Best regards,
Mika
Thanks for the response,

I don't quite understand why there has to be a time dependent part, as we are solving Helmholtz in the frequency domain. Now answering your questions:

1) Let's assume that amplitude equals to 1 for all transducers.
2) It depends on how Elmer works. If +- sign represents the direction of the source then yes, in Matlab it doesn't really matter as it is approximated with a piston model and each source can be represented as a dipole. (I think in Elmer as well)
3) It should be k u.r + phi.

Also, do you get normal results for 40kHz by just applying a pressure 1 to only one of the transducers?

I know that my explanations may sound insufficient to you, as I'm not really experienced in acoustics and FEM analysis, however I'm trying to explain it as good as I can. Sorry for that, and thanks again for your time.

Panos
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

To be more specific, in COMSOL every transducer surface is assigned a Normal Acceleration with the equation

Code: Select all

1*accel*exp(-1j*(phase[i]))
and

Code: Select all

accel = 5.6849E5 1/s²
, where

Code: Select all

phase[i]
is the phase of the ith transducer that is required in order to produce a specific trap in space.
Then, by running the BEM method (we only need to mesh the boundaries, thus it's faster in 3d than FEM) we get something like the picture below, for a focus in the center. I know that Elmer only uses FEM, that's why I'm trying to implement it in 2d (where meshing the area between the two boards of transducers is required, and is easier in 2d).
Attachments
normal_mesh_better_resolution.PNG
(371.62 KiB) Not downloaded yet
Post Reply