Degenerate 2D elements, GMSH mesh
-
- Posts: 14
- Joined: 07 Jan 2017, 02:05
- Antispam: Yes
Degenerate 2D elements, GMSH mesh
Hello!
I am solving a problem which needs significantly small characteristic mesh size at the apex of a conical geometry that has been approximated to 2D. The calculated mass flux at the apex is significantly lower for larger characteristic mesh sizes so it is essential for the accuracy of my results. However I am getting lots of degenerate 2D elements for certain conical geometries (smaller contact angles, less than 11 degrees).
The meshes were made in GMSH then imported into ElmerGUI. In GMSH I apply optimise 3D, netgen and smooth 2D.
When I run the solver the log is filled with degenerate elements near the apex, and I have to kill the solver. The case attached is for a contact angle of 5 degrees.
Please find the .sif and .geo file attached, I couldn't attach the mesh as it is larger than 1 MB.
Many thanks,
Mustafa.
I am solving a problem which needs significantly small characteristic mesh size at the apex of a conical geometry that has been approximated to 2D. The calculated mass flux at the apex is significantly lower for larger characteristic mesh sizes so it is essential for the accuracy of my results. However I am getting lots of degenerate 2D elements for certain conical geometries (smaller contact angles, less than 11 degrees).
The meshes were made in GMSH then imported into ElmerGUI. In GMSH I apply optimise 3D, netgen and smooth 2D.
When I run the solver the log is filled with degenerate elements near the apex, and I have to kill the solver. The case attached is for a contact angle of 5 degrees.
Please find the .sif and .geo file attached, I couldn't attach the mesh as it is larger than 1 MB.
Many thanks,
Mustafa.
Re: Degenerate 2D elements, GMSH mesh
Hi,
I am not sure, but isn't there a possibility to increase the accuracy of gmsh and/or Elmer?
You seem to work in m in gmsh. Maybe it could help to use mm in gmsh and
Coordinate Scaling = 0.001
in the Simulation section of Elmer (free text field in ElmerGUI).
Did you examine the degenerate elements? You may convert the Elmer mesh back to gmsh format using commandline Elmergrid, see Elmergrid manual. Then you can view the element in gmsh and see what happens.
HTH,
Matthias
I am not sure, but isn't there a possibility to increase the accuracy of gmsh and/or Elmer?
You seem to work in m in gmsh. Maybe it could help to use mm in gmsh and
Coordinate Scaling = 0.001
in the Simulation section of Elmer (free text field in ElmerGUI).
Did you examine the degenerate elements? You may convert the Elmer mesh back to gmsh format using commandline Elmergrid, see Elmergrid manual. Then you can view the element in gmsh and see what happens.
HTH,
Matthias
-
- Posts: 14
- Joined: 07 Jan 2017, 02:05
- Antispam: Yes
Re: Degenerate 2D elements, GMSH mesh
Thanks for the reply mzenker!
I tried to change the GMSH .geo and .msh to mm by increasing the coordinates and mesh characteristic size by a factor of 1000 (m to mm), then applying Coordinate Scaling = 0.001, unfortunately I still get the same issue with degenerate elements?
I have left the solver running, it solves a few iterations then freezes, with the log full of degenerate elements as before. Because of this I can't view the output .vtu file in Paraview obviously to see how the mesh was processed.
When I open ElmerGrid I get a command prompt that instantly closes so I wasn't able to convert the mesh back to GMSH.
Is there anything else I can try? I heard that the autoclean function of ElmerGrid was meant to help this, but I think ElmerGUI does this automatically when I import the mesh?
Thanks,
Mustafa.
I tried to change the GMSH .geo and .msh to mm by increasing the coordinates and mesh characteristic size by a factor of 1000 (m to mm), then applying Coordinate Scaling = 0.001, unfortunately I still get the same issue with degenerate elements?
I have left the solver running, it solves a few iterations then freezes, with the log full of degenerate elements as before. Because of this I can't view the output .vtu file in Paraview obviously to see how the mesh was processed.
When I open ElmerGrid I get a command prompt that instantly closes so I wasn't able to convert the mesh back to GMSH.
Is there anything else I can try? I heard that the autoclean function of ElmerGrid was meant to help this, but I think ElmerGUI does this automatically when I import the mesh?
Thanks,
Mustafa.
-
- Posts: 215
- Joined: 26 Aug 2009, 18:20
- Location: Peterborough, England
Re: Degenerate 2D elements, GMSH mesh
Hi Mustafa,
Have you tried using only linear elements, set order 1 in gmsh?
Mark
Have you tried using only linear elements, set order 1 in gmsh?
Mark
-
- Posts: 14
- Joined: 07 Jan 2017, 02:05
- Antispam: Yes
Re: Degenerate 2D elements, GMSH mesh
Hi Mark!
I think it does that by default? I tried setting it to order 1 but it still doesn't work.
Thanks,
Mustafa.
I think it does that by default? I tried setting it to order 1 but it still doesn't work.
Thanks,
Mustafa.
Re: Degenerate 2D elements, GMSH mesh
Have a look at the Elmergrid manual. The syntax ismustafaiqbal wrote: When I open ElmerGrid I get a command prompt that instantly closes so I wasn't able to convert the mesh back to GMSH.
elmergrid [input format] [output format] [input file name]
where [input format] and [output format] are numbers, e.g. elmergrid 2 5 mesh
There is a list of imput and output formats in the manual.
No it doesn't. You can also convert the mesh using the commandline elmergrid (e.g. elmergrid 4 2 mymesh.msh -autoclean) and load that mesh directly with ElmerGUI.mustafaiqbal wrote: I heard that the autoclean function of ElmerGrid was meant to help this, but I think ElmerGUI does this automatically when I import the mesh?
HTH,
Matthias
-
- Posts: 14
- Joined: 07 Jan 2017, 02:05
- Antispam: Yes
Re: Degenerate 2D elements, GMSH mesh
Matthias,
I successfully generated the mesh using ElmerGrid with -autoclean, but I still get the same problem with the solver?
Here's the code:
Thanks,
Mustafa.
I successfully generated the mesh using ElmerGrid with -autoclean, but I still get the same problem with the solver?
Here's the code:
Code: Select all
C:\Users\Mus\OneDrive\Documents\Year 4\Thesis\Elmer\Cases\a\5\meshes>elmergrid 14 2 1_5.msh -autoclean
Starting program Elmergrid
Elmergrid reading in-line arguments
Lower dimensional boundaries will be removed
Materials and boundaries will be renumbered
Nodes that do not appear in any element will be removed
Output will be saved to file 1_5.
Elmergrid loading data:
-----------------------
Format chosen using the first line: $MeshFormat
Loading mesh in Gmsh format 2.0 from file 1_5.msh
Allocating for 37726 knots and 75450 elements.
Moving bulk elements to boundary elements
Leading bulk elementtype is 303
Trailing bulk elementtype is 202
There are 2351 (out of 75450) lower dimensional elements.
Node 2834 belongs to maximum of 9 elements
Found correctly 2351 side elements.
Parent elements were reordered up to indx 73099.
Moved 73099 elements (out of 75450) to new positions
Successfully read the mesh from the Gmsh input file.
Elmergrid creating and manipulating meshes:
-------------------------------------------
Removing lower dimensional boundaries
Maximum elementtype is 303 and dimension 2
Removed 0 (out of 2351) less than 2D boundary elements
All 37726 nodes were used by the mesh elements
Initial boundary interval [11,15]
boundary index changed 11 -> 1 in 1055 elements
boundary index changed 12 -> 2 in 8 elements
boundary index changed 13 -> 3 in 229 elements
boundary index changed 14 -> 4 in 3 elements
boundary index changed 15 -> 5 in 1056 elements
Mapping boundary types from [11 15] to [1 5]
Initial body interval [16,16]
body index changed 16 -> 1 in 73099 elements
Mapping material types from [16 16] to [1 1]
Elmergrid saving data with method 2:
-------------------------------------
Saving mesh in ElmerSolver format to directory 1_5.
Saving 37726 coordinates to mesh.nodes.
Saving 73099 element topologies to mesh.elements.
Saving boundary elements to mesh.boundary.
Saving header info to mesh.header.
Thank you for using Elmergrid!
Send bug reports and feature wishes to elmeradm@csc.fi
Mustafa.
Re: Degenerate 2D elements, GMSH mesh
OK, next step would be to convert the Elmer mesh back to gmsh (to get the same numbering as in Elmer) and to examine the elements the solver complains about.
Oh, and I just did a quick search in the forum to refresh my memory - I once had a problem with a 2D case which was caused by a "wrong" mesh orientation, see here. A mesh in the yz plane gave errors, the same mesh in the xy plane worked. So you should make sure that your 2D mesh is in the xy plane.
HTH,
Matthias
Oh, and I just did a quick search in the forum to refresh my memory - I once had a problem with a 2D case which was caused by a "wrong" mesh orientation, see here. A mesh in the yz plane gave errors, the same mesh in the xy plane worked. So you should make sure that your 2D mesh is in the xy plane.
HTH,
Matthias
-
- Posts: 14
- Joined: 07 Jan 2017, 02:05
- Antispam: Yes
Re: Degenerate 2D elements, GMSH mesh
Matthias,
I successfully converted the Elmer mesh (used -autoclean) back to .msh and looked at it in GMSH, and can see the degenerate elements as you can also see in the attached picture. What can I do to resolve this issue?
Many thanks,
Mustafa.
I successfully converted the Elmer mesh (used -autoclean) back to .msh and looked at it in GMSH, and can see the degenerate elements as you can also see in the attached picture. What can I do to resolve this issue?
Many thanks,
Mustafa.
- Attachments
-
- salaam.png
- (189.53 KiB) Not downloaded yet
Re: Degenerate 2D elements, GMSH mesh
Hi Mustafa,
try to zoom in to examine one of them, and look at the coordinates of the edge nodes to check if the element is degenerate (e.g. two nodes are on top of each other) or not. What about the orientation of your mesh, is it in the xy plane or not? (Although Peter wrote that this problem should be fixed ...)
HTH,
Matthias
try to zoom in to examine one of them, and look at the coordinates of the edge nodes to check if the element is degenerate (e.g. two nodes are on top of each other) or not. What about the orientation of your mesh, is it in the xy plane or not? (Although Peter wrote that this problem should be fixed ...)
HTH,
Matthias