Gmsh + Elmer - Strange result depending on mesh type

Numerical methods and mathematical models of Elmer
sabrina
Posts: 27
Joined: 16 Sep 2019, 14:26
Antispam: Yes

Gmsh + Elmer - Strange result depending on mesh type

Post by sabrina »

Dear all,

I am currently using Gmsh to construct a 2D model that I later import into Elmer to solve the electrostatic field. The problem I am facing is that depending on which type of mesh I use in Gmsh (either 2nd order triangles or 8-node quadrangles) the result I get from ElmerSolver is either right or
wrong (in terms that not even the boundary conditions have the values that they should). With the triangles the result is fine but with the quadrangles it is not, and unfortunately, this one is the one that I must use.

Has anyone experienced something like this before? I've already asked in the Gmsh mailing list as well since it is not clear for me where the error is coming from.

I would appreciate any help or suggestion that you may have.

Cheers,

Sabrina
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by kevinarden »

If you post the geo files and the sif, I can take a look.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by raback »

Hi Sabrina,

If you visualize the element edges in Paraview and see that they are tangled then there could be an issue with local element numbering. Maybe you could sent also minimal .msh file.

-Peter
sabrina
Posts: 27
Joined: 16 Sep 2019, 14:26
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by sabrina »

Hello again,

Thank you for your fast replies. Unfortunately, I am not able to reproduce the problem, but now neither of the meshes work properly. I cannot tell what is the issue since the boundary conditions and bodies are set correctly. I attached the sif file, and here are both the triangular and quadrangular meshes. https://ikpcloud.ikp.physik.tu-darmstad ... IpaM6zT4Iz
I would be really grateful if you could please take a short look (the triangular mesh, for instance, converges super fast ) to check that you get the same output as me (see image).

Thank you again,

Sabrina
Attachments
triangular_mesh_wrong_field.png
triangular_mesh_wrong_field.png (43.43 KiB) Viewed 3796 times
2d_main.sif
(2.63 KiB) Downloaded 216 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by raback »

Hi

So what is the problem? Perhaps you would like to have a continuous potential? I think your mesh might not be properly set. The internal interfaces mush be shared by the left/right parts.

Also, note that the infinity BCs are really simple. They assume geometry centered roughly at around origin and spherically decaying field. If this is not the case better to use just zero potentials at the externals BCs.

-Peter
sabrina
Posts: 27
Joined: 16 Sep 2019, 14:26
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by sabrina »

Hi Peter,

Thank you for your reply. The issue is that ideally the boundary conditions should be (see image attached for references): 0V in what I called anode, 6000 V in the rectangle I called cathode, some other potentials in what I called 'other electrodes' and zero everywhere else. I am using the axisymmetric coordinate system. This method has always been working so far, I am not being able to pinpoint where it is going wrong now.

Cheers,

Sabrina
Attachments
Wrong_boundaryConditions.jpeg
(141.04 KiB) Not downloaded yet
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by kevinarden »

When I translate the mesh files to Elmer mesh files the boundaries do not match up with the sif and described conditions in the picture. You may want to look at the actual boundary definitions in the Elmer mesh files.
sabrina
Posts: 27
Joined: 16 Sep 2019, 14:26
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by sabrina »

Hi again,

Thank you for your reply, Kevin. You are indeed right, there is something strange regarding the boundaries renumbering from Gmsh to Elmer: ElmerGrid shows one boundary with a negative index that does not exist in Gmsh (see screenshots). Does anyone know where this error might be coming from? I am trying to retrieve what it might be but I was not lucky so far.

Thank you in advance for your advice,

Sabrina
Attachments
ElmerGrid_renumbering.png
ElmerGrid_renumbering.png (180.69 KiB) Viewed 3766 times
gmsh_physical_groups.png
(131.38 KiB) Not downloaded yet
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by kevinarden »

in gmsh how are you saving the msh file? The default in the new gmsh is format 10. Format 1 works better with elmer, format 2 is a unv file.

in gmsh go to help, current options and workspace, and then serach for mesh.format.

Also do you use ElmerGrid to convert with -autoclean, or do you open the mesh file in ElmerGUI?
sabrina
Posts: 27
Joined: 16 Sep 2019, 14:26
Antispam: Yes

Re: Gmsh + Elmer - Strange result depending on mesh type

Post by sabrina »

Hi, Kevin

I have just changed to format 1 but I still get the same output. And yes, I am using ElmerGrid with -autoclean .
Post Reply