CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (
-   -   .stl from GMSH in SnappyHexMesh (

vainilreb November 27, 2012 12:56

.stl from GMSH in SnappyHexMesh

is it possible to use a 2D-Mesh from GMSH which is saved in the .stl-format as stl-input for snappyHexMesh?

Or is there any other way to extract an stl-File from a geometry which was modelled in GMSH?

Thank you very much!


mturcios777 November 27, 2012 13:27

Hi Robert,

Do you mean a 2D geometry to make a 2D case in snappyHexMesh? I've never heard of doing a 2D case in snappy, but I guess you could do it.

As long as you have an STL file, snappyHexMesh will read it. As to what happens after that, there is only one way to find out...

vainilreb November 27, 2012 13:41

No, I mean a 3D-geometry created in gmsh. I want to save it as .stl to mesh it with snappyHexMesh. But I don't know how to get an .stl from a .geo! :/
I tried simply 2D-meshing the 3D-geometry and then saving the mesh in the stl format, but so far that does not work at all.

mturcios777 November 27, 2012 14:11

Ah, I see now. You should be able to mesh as long as you get the STL. Have you checked that the STL is watertight? You can inspect the STL in paraview, have a look and see if there are any serious problems, maybe post a picture somewhere.

vainilreb November 29, 2012 04:42

Well, the stl looks good. Unfortunately gmsh did not save the physical groups to the file? The stl is a simple desk with an inlet patch where I want ammonia to be added to the system.

Could it be a problem that the stl contains surfaces which intersect the walls of the blockMesh geometry? I'm talking about the lower surfaces of the desk's legs. :o Maybe I should leave them away?

vainilreb November 29, 2012 06:52

Snappy finally did it! Once I have figured out how to divide the surfaces into different physical groups I will be happy. :D

mturcios777 November 29, 2012 15:12

Glad to hear it worked well; please be sure to post your solution so that future users can benefit from it. There are many threads on splitting geometry up into patches. I personally prefer splitting the surface into multiple files, as it makes it easier to isolate a problem patch.

I use blender for when I need to see the geometry to manipulate it, or write an octave/matlab script to separate out the triangles based on certain criteria.

All times are GMT -4. The time now is 16:20.