Acoustics Simulation (from Comsol to Elmer)?
Acoustics Simulation (from Comsol to Elmer)?
I have a model in Comsol that can be seen in "model_comsol.PNG".
The top and bottom hexahedrals are PLMs that simulate some kind of absorption and their corresponding very top and very bottom layers are hard wall boundaries. The "labyrinth" lookalike is some kind of plastic and everything between this and the PLMs is supposed to be air. Also, the path that is created by this labyrinth is air as well, and the material that creates this path is made of plastic. The plane wave is propagating along the y direction.
And the pressure field can be seen in "pressure_field.PNG".
Then I converted it with ElmerGrid and in Elmer the mesh can be seen in "model_grid_elmer.PNG".
I want to simulate the whole process in Elmer and confirm that it's the same. I have defined all properties for air & plastic. I already know from another post the there is no such thing as PLM in Elmer so I just put boundary conditions equal to -c. For the plastic "walls" I've set real and imag part of the flux to 0. However, I don't know how to tune the other settings to make this happen, and my first question is: Where should I apply this boundary condition supposing the wave is propagating from bottom to up in the y axis?
The top and bottom hexahedrals are PLMs that simulate some kind of absorption and their corresponding very top and very bottom layers are hard wall boundaries. The "labyrinth" lookalike is some kind of plastic and everything between this and the PLMs is supposed to be air. Also, the path that is created by this labyrinth is air as well, and the material that creates this path is made of plastic. The plane wave is propagating along the y direction.
And the pressure field can be seen in "pressure_field.PNG".
Then I converted it with ElmerGrid and in Elmer the mesh can be seen in "model_grid_elmer.PNG".
I want to simulate the whole process in Elmer and confirm that it's the same. I have defined all properties for air & plastic. I already know from another post the there is no such thing as PLM in Elmer so I just put boundary conditions equal to -c. For the plastic "walls" I've set real and imag part of the flux to 0. However, I don't know how to tune the other settings to make this happen, and my first question is: Where should I apply this boundary condition supposing the wave is propagating from bottom to up in the y axis?
- Attachments
-
- pressure_field.PNG
- (135.05 KiB) Not downloaded yet
-
- model_grid_elmer.PNG
- (57.34 KiB) Not downloaded yet
-
- model_comsol.PNG
- (27.42 KiB) Not downloaded yet
Last edited by panosvar on 30 Oct 2019, 18:17, edited 1 time in total.
Re: Acoustics Simulation (from Comsol to Elmer)
What I tried so far, but didn't work:
Maybe I'm putting this boundary condition in the wrong boundary?
Code: Select all
Boundary Condition 2
Target Boundaries(1) = 10
Name = "Source"
$p0=1.0
$k1=0.0
$k2=1.0
$k3=0.0
Pressure 1 = Variable Coordinate
Real MATC "p0*cos(k1*tx(0)+k2*tx(1)+k3*tx(2))"
Pressure 2 = Variable Coordinate
Real MATC "p0*sin(k1*tx(0)+k2*tx(1)+k3*tx(2))"
End
Re: Acoustics Simulation (from Comsol to Elmer)?
Hi,
I'd try to set
Wave Impedance 1 = $c
Wave Impedance 2 = 0
on the top face and to define a plane wave profile on the bottom face by setting for example
Pressure 1 = 1
Pressure 2 = 0
Changing the sign as
Wave Impedance 1 = $-c
should make the waves to propagate in the opposite direction.
-- Mika
I'd try to set
Wave Impedance 1 = $c
Wave Impedance 2 = 0
on the top face and to define a plane wave profile on the bottom face by setting for example
Pressure 1 = 1
Pressure 2 = 0
Changing the sign as
Wave Impedance 1 = $-c
should make the waves to propagate in the opposite direction.
-- Mika
Re: Acoustics Simulation (from Comsol to Elmer)?
Hi,
I think the problem lies basically to the fact that I don't have a layer at the entrance of the brick, so I can define a boundary condition for a wave perpendicular to that surface (like the "Simple Pipe Acoustics" example where the mesh of the pipe is "closed" from both sides). For now, I tried to neglect the fact that I have any PLM so I just got rid of everything in the model except my brick ("brick_view_2.jpg"). Then, I applied a plastic material on all parts of the brick and I set a boundary condition as it can be seen in "brick_bc.jpg" (highlighted with red) on the entrance. The boundary condition for the input wave is the following (I want the wave to propagate along y-axis):
Finally, I applied the following boundary condition on the other side, where it is basically "air":
The pressure field in ParaView can be seen in "without_layer.png". I've also attached my sif file.
I think the problem lies basically to the fact that I don't have a layer at the entrance of the brick, so I can define a boundary condition for a wave perpendicular to that surface (like the "Simple Pipe Acoustics" example where the mesh of the pipe is "closed" from both sides). For now, I tried to neglect the fact that I have any PLM so I just got rid of everything in the model except my brick ("brick_view_2.jpg"). Then, I applied a plastic material on all parts of the brick and I set a boundary condition as it can be seen in "brick_bc.jpg" (highlighted with red) on the entrance. The boundary condition for the input wave is the following (I want the wave to propagate along y-axis):
Code: Select all
Boundary Condition 1
Target Boundaries(1) = 2
Name = "In"
Plane Wave BC = True
$p0=1.0
$k1=0.0
$k2=1.0
$k3=0.0
Pressure Wave 1 = Variable Coordinate
Real MATC "p0*cos(k1*tx(0)+k2*tx(1)+k3*tx(2))"
Pressure Wave 2 = Variable Coordinate
Real MATC "p0*sin(k1*tx(0)+k2*tx(1)+k3*tx(2))"
End
Finally, I applied the following boundary condition on the other side, where it is basically "air":
Code: Select all
Boundary Condition 3
Target Boundaries(1) = 5
Name = "Out"
Wave impedance 1 = $ c
End
- Attachments
-
- case.sif
- (2.53 KiB) Downloaded 214 times
-
- brick_view_2.PNG (87.4 KiB) Viewed 4092 times
-
- brick_bc.PNG (83.74 KiB) Viewed 4092 times
Last edited by panosvar on 31 Oct 2019, 18:42, edited 1 time in total.
Re: Acoustics Simulation (from Comsol to Elmer)?
I've also attached an image from ParaView. As you can see my equation that describes wave propagation is correct indeed, the wave propagates in the y-axis which is exactly what I want.
- Attachments
-
- without_layer.PNG
- (71.97 KiB) Not downloaded yet
Re: Acoustics Simulation (from Comsol to Elmer)?
As for now, I've only managed to produce something like the picture I have attached below. How is to possible to visualize the acoustic pressure through the medium?
- Attachments
-
- Capture.PNG
- (125.86 KiB) Not downloaded yet
-
- Posts: 2302
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: Acoustics Simulation (from Comsol to Elmer)?
clip planes and slice planes in paraview. I found it helpful to run through the paraview tutorial from paraview.
Re: Acoustics Simulation (from Comsol to Elmer)?
As you can see on the attached picture below the problem is not the viewing option in ParaView indeed. The solution you suggested unfortunately didn't help. There is something wrong with the simulation, I think Elmer runs an equation only for the "meshed" parts. So for example in my case, the air inside the brick is not "meshed" and ElmerSolver has nothing to calculate on that location for Helmholtz equation, correct me if I'm wrong. What if I want to simulate how sound passes through my brick and visualize the air pressure inside that brick at different locations? For now I just have meshed the two openings of the brick (up & down, with 2 mesh surfaces) and applied the two boundary conditions at these two mesh surfaces, but this only gives me the acoustic pressure on the entrance of the brick as seen in the pictures above.
- Attachments
-
- Capture.PNG
- (97.79 KiB) Not downloaded yet
-
- Posts: 2302
- Joined: 25 Jan 2019, 01:28
- Antispam: Yes
Re: Acoustics Simulation (from Comsol to Elmer)?
Elmer does only operate on the meshed parts, or more to the point it only operates on elements. You would have to have a mesh of elements for the air.
Re: Acoustics Simulation (from Comsol to Elmer)?
Thank you, that's what I thought as well, I'm gonna try it.