## Acoustics Simulation (from Comsol to Elmer)?

Numerical methods and mathematical models of Elmer
panosvar
Posts: 74
Joined: 29 Oct 2019, 16:02
Antispam: Yes

### Re: Acoustics Simulation (from Comsol to Elmer)?

raback wrote:
07 Nov 2019, 21:26
Hi

If you want to describe a sinusoidal wave with polynomial basis functions you need easily around ten elements for each wave.

I checked that the size of your system was ~4 x 8 m^2, and you had 16 k triangles. Just counted in my head that it rougly equates in having 250 rectangles per m^2 and hence 1/16 m edge length. Ball park figure.

If Comsol can solve the exact problem with same dimensions then it could, for example
1) Use some formulation where basis functions are enriches with plane waves
2) Solve different ansatz, I know for optics they have "wave envolope"

Haven't looked at Comsol myself.

-Peter
Sorry, I'm new to Elmer and FEM analysis in general. How did you check the size of the system to be ~4 x 8 m^2? I mean the model is exported as a step file from Autodesk Inventor with a length of ~8 mm, is there any chance that the units are lost during the import from Inventor to Comsol? Then I just created the mesh in Comsol and exported it to Elmer.

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

It worked! The problem was indeed that Elmer somehow lost the information of units (which I didn't expect to) and I had to put this command in my sif file:

Coordinate Scaling = Real 0.001

Now, I have to confirm that the results are the same as in Comsol. Thank you!

Regards,
Panos

raback
Posts: 3624
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi Panos,

CAD drawings are often in units of mm. Hence if you otherwise work with SI units this will cause problems. Scaling indeed fixes this.

-Peter

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi Peter,

Do you know if there is such thing as PML in Elmer?

Panos

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

Also is it possible to measure pressure in a particular point in space, at a distance above the brick? My model looks like in the attached picture at the moment.
Attachments
without.PNG

raback
Posts: 3624
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi

Currently no PML. Its on the waiting list...

For values at specific point (line) look at SaveScalars (SaveLine) module.

-Peter

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

I think my problem is more complicated than that. See 'brick_with_air.PNG' attached, this is my model in comsol. This is the same brick as before, but now I have an additional body above and below the brick which I define as void (in Comsol) so I can measure the pressure everywhere (inside and outside the brick at specific distance). However, with the same model in Elmer it doesn't work ('brick_with_air_paraview.PNG'). I've also attached my sif file.

Panos
Attachments
brick_with_air_comsol.PNG (60.37 KiB) Viewed 615 times
brick_with_air_paraview.PNG
case_final.sif

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi,

It worked finally, if provided with the Comsol mesh grid as is! However, I still have to figure out how to create a proper mesh in gmsh/Salome and make it work in Elmer, cause for now it doesn't seem to do so. My final aim is to completely get rid of Comsol and create a pipeline where I can automatically create different variations of the same model and create its corresponding mesh with a script (that shouldn't be that hard), then call ElmerSolver via console and run the simulation for each model, and finally plot the pressure field with ParaView. If I come up with a solution, I will definitely come back with a tutorial for everyone on how to implement this.

Panos

mzenker
Posts: 1987
Joined: 07 Dec 2009, 11:49
Location: Germany

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi,

what kind of problems do you have for meshing with gmsh / Salomé?
Both can be scripted, so normally it should be possible to do what you outline.

Matthias

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

### Re: Acoustics Simulation (from Comsol to Elmer)?

Hi Matthias,

The problem basically is that I cannot export the geometry from Comsol (already implemented) to a suitable format (like .step), so I can import it to gmsh/Salome and mesh it. So, what I'm trying is to recreate the geometry in Inventor and then export as a .step file to gmsh/Salome. The only way I'm doing this is so I can dump to a Python script (there is an option in Salome), so I can parameterize the model and create different versions of it. Apologies, I know this could be made a lot faster, but actually I'm working on this only for 4 weeks now and never had any experience with FEM or CAD software. If you have anything more functional to suggest I'd be happy to hear it.

Panos