2d simulation of acoustic wave propagation

Numerical methods and mathematical models of Elmer
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 2d simulation of acoustic wave propagation

Post by raback »

Hi

I tried to open the file on mega.nz but it requires a key.

I would still think that you might have a too coarse mesh. Looking at the Comsol picture it has wave number of ~50. To accurately reproduce that would requires 50*(10 to 20) elements in that direction. Hence you should at least have 1e5 elements in 2D, or perhaps more like 1e6. How many elements do you have now?

This kind of case may not converge that fast as it is difficult to precondition. Preconditioning of wave equations is still a topic of active research in numerics. MUMPS is probably no easy remedy as the case becomes already quite big and direct solvers require quite a bit of memory.

Elmer actually does have a version of BEM. However, that has only Poisson equation implemented. It is also noteworthy that in order to get any reasonable performance and scaling out of BEM you need to employ multipole expansions and never actually create the full matrix. Actually this machinery is the most work and not having the multipole methods in Elmer has meant that we don't see our future in BEM computations.

The formulations really do matter. BEM is by construction well suited for large wavenumbers. Actually many years ago when Elmer was used to study the small scale acoustic phenomena with Nokia the larger scale phenomena were studied with a different BEM code. There are also alternate formulations in FEM for wave equations. However, they are very specialized methods and would require significant effort to implement. One possibility is to enrich the basis functions in each element by plane waves (google for "ultra weak helmholtz", for example).

Hence, I would test the code by gradually increasing the frequency to have a feeling how much resources is needed. You can tune the procedure in an easier case. Then you will also get a feeling how much resources your true case would require.

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

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

Hi Peter,

I've corrected the link you can try now: https://mega.nz/#!ySoymCLA!J7qImB2au1E2 ... OiIrfmYD0Y . This is supposed to produce a trap somewhere on the top right area between the two arrays of transducers. Run test.sif to run the simulation.
Also, I uploaded the model summary and as you can see the number of elements is high enough I think.

Thanks for your time,
Panos
Attachments
model_summary.PNG
model_summary.PNG (3.53 KiB) Viewed 3995 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 2d simulation of acoustic wave propagation

Post by raback »

Hi

Yes, indeed you do have quite a few elements. I run the case. Got some more speed by changing "BiCGStab" to "Idrs".

Now I don't know much about your case. However, it seems you're using degrees for your phases. the trigonometric functions (sin and cos) in MATC use radians. Multiply the phases by PI/180 and maybe you get what you want.

Trigonometric functions with large argument is a known way to produce random numbers...

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

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

My phases are in radians indeed. Do you mind uploading a picture of your results?
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

I altered the signs of all phase values and got the solution of the attached figure.

-- Mika
Attachments
with_negative_phases.png
(529.88 KiB) Not downloaded yet
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

I've attached how the same focus looks in Comsol. Doesn't look the same at all. In Comsol what I use, is the Normal Acceleration setting as I stated above.
Attachments
focus_top_right.png
(728.91 KiB) Not downloaded yet
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

To have the same sources Elmer definitions should be written as BCs for the normal pressure gradient. This should be easy to do. I guess the Comsol model has PML BCs on the edges x = const. This is difficult to mimic with Elmer. The simple impedance BC of Elmer is best suited for cases where the wave propagates in the direction of the boundary normal. This is not the case here for the edges x = const.

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

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

To have the same sources Elmer definitions should be written as BCs for the normal pressure gradient.
Could you give me an example of how I should have written such an equation?
I guess the Comsol model has PML BCs on the edges x = const.
Yes it has.
The simple impedance BC of Elmer is best suited for cases where the wave propagates in the direction of the boundary normal
You can't have both an impedance BC and a pressure BC or am I wrong?

Panos
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

If the normal acceleration has units L/T^2 (you however wrote 1/s^2, was a missing length just a typo or am I missing something?), in view of the equation of motion I'd define BCs for example as

$ a0 = 5.6849e5 * rho0
Wave Flux 1 = Real MATC "a0*cos(-phases(0))"
Wave Flux 2 = Real MATC "a0*sin(-phases(0))"

etc.

Here a0 should be in units L/T^2 in order to be consistent.

I tried the case with such BCs but it wasn't any good to get a better agreement. A basic pressure constraint cannot be given when the impedance is specified at the same point.

-- Mika
Post Reply