2d simulation of acoustic wave propagation

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

Re: 2d simulation of acoustic wave propagation

Post by mika »

I don't still understand the purpose of the term k*y in the underlying expression of the phase. What does it represent?
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

As far as I know, I think it represents the direction of the wave. It was suggested by raback in another thread. Take a look here:
http://elmerfem.org/forum/viewtopic.php ... s&start=40
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

UPDATE: I've managed to install the virtual machine for Elmer, and run the same sif file with MUMPS. Results are exactly the same. So, either there is something wrong with my code, or Elmer is uncapable of producing reliable results for such high frequencies as 40kHz. I've ran out of ideas at the moment, any help would be appreciated.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by kevinarden »

The fundamental theory of finite elements is that the elements are small enough that the results do not vary across the element. I would say that Elmer is incapable of producing reliable results for such high frequencies as 40kHz, at the the same mesh density. Same is true for time step size if it is a transient. I would expect that Elmer would eventually converge at smaller mesh sizes and/or time sizes. The differences you are seeing is likely due to the efficiency at arriving to a solution, not the incapability of arriving to a solution. The most common difference between codes is element types and formulation, commercial codes specifically keep their element formulation code under wraps.
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

kevinarden wrote: 23 Jan 2020, 22:24 The fundamental theory of finite elements is that the elements are small enough that the results do not vary across the element. I would say that Elmer is incapable of producing reliable results for such high frequencies as 40kHz, at the the same mesh density. Same is true for time step size if it is a transient. I would expect that Elmer would eventually converge at smaller mesh sizes and/or time sizes. The differences you are seeing is likely due to the efficiency at arriving to a solution, not the incapability of arriving to a solution. The most common difference between codes is element types and formulation, commercial codes specifically keep their element formulation code under wraps.
I've used the same mesh size and types (tetrahedrals) as in Comsol (but created in Salome). Other than that, I totally agree with you.
mika
Posts: 231
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

It seems to me that some facts about the model may have been misunderstood. Since the problem relates to sound, the wave motion is longitudinal so that the field variations are in the same direction as the direction of the wave propagation. As the solution (pressure) is not a vector, no direction is associated with the pressure wave. The field variations are thus described by the pressure gradient grad p which is related to the fluid velocity v by the equation of motion

i w rho_0 v - grap p = 0

One may consider the direction of the velocity as an associated direction variable, but this is obtained as a part of the solution of the problem.

If the wave motion would be transverse (for example electromagnetic wave), the solution could be associated with a direction which should be distinguished from the direction of the wave propagation.

I think you might have misunderstood how BCs should be set. I'd remove the term depending on the coordinate completely (at least this is not needed to define the direction) and give just suitable phases. If you want to create a BC which is connected with the vector v, Elmer has flux BCs for that purpose.

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

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

As it seems you're right. The coordinates don't affect the solution at all. As for the phases, I'm pretty sure that they're the correct ones as I get the expected results in Matlab & Comsol. Still, I cannot understand why zero phases and phases that correspond to a focus in the center (between the 2 arrays) give me the correct results in Elmer.
mika
Posts: 231
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

Do you have some explicit mathematical formula how the values of phases are generated?
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

Re: 2d simulation of acoustic wave propagation

Post by panosvar »

mika wrote: 24 Jan 2020, 18:52 Do you have some explicit mathematical formula how the values of phases are generated?
Yes, that's how I do the simulations in Matlab. I have a script that given a point (x, y) in space, it returns an array of 32 phases that create a trap on that point. And I'm pretty sure that this is correct, as all my Matlab numerical solutions match Comsol simulations.
mika
Posts: 231
Joined: 15 Sep 2009, 07:44

Re: 2d simulation of acoustic wave propagation

Post by mika »

There has to be some inconsistency. Any chance that there could be a +/- issue between the top and bottom array BCs, which could arise for example from different conventions to define positive normal directions? Does the boundary normal direction or similar appear somehow in the phase calculation?
Post Reply