CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] No 3D-elements found (https://www.cfd-online.com/Forums/openfoam-meshing/218645-no-3d-elements-found.html)

AtoHM June 28, 2019 04:00

No 3D-elements found
 
Hi guys,
I am well aware that there are at least a dozen threads asking the same thing. I am deperately trying to get a valid 3d mesh out of gmsh to use with openfoam. I went through the first 3 pages of google results on this topic but no "solution" that worked for others seem to work for me. Maybe something is wrong with my overall process or I dont know.

Ok here is what I'm doing: I use professional CAD software (Solidworks) to create the geometry. This can be quite complex, but for now I used a very simple geometry: a cube with sides 500mm and 3 pipes coming 200mm out of it. Then export this to .stp. Creating the geometry in gmsh is not really an option for me.
Anyway, then I go and use
Code:

SetFactory("OpenCASCADE");
Merge "Geometry.step";

in the .geo file. It is loaded just fine without errors or warnings. I can see all the edges, faces and one volume. I add each surface to a physical patch and the one volume I have to a physical volume:
Code:

Physical Surface("INLET") = {11};
Physical Surface("OUTLET1") = {12};
Physical Surface("OUTLET2") = {15};
Physical Surface("WALLS") = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 14};
Physical Volume("CUBE") = {1};

(Not assigning a physical volume seems to be the mistake 99% of the people having the same issue are doing)
Then I use the GUI to create a 3D mesh (Delauney algorithms, converting to hexas). The mesh is created without any error or warning message. I can see the 3D elements, they are also listed under Tools->Statistics-> 150k Hexahedra.

I then go to export the .msh file using the Export with "Mesh - Gmsh MSH (*.msh)" format. In the following dialog I use "Version 2 ASCII" which seems to be the format supported by OpenFOAM. I also check "save all elements". -> .msh file is generated.
I put this file in an open foam case and run "gmshToFoam Geometry.msh" which complains about some unhandled elements (error can be ignored from what I found with my research?) and finally tells me that there are not 3D elements.
Any idea what could be wrong will be very appreciated. I also tried exporting the mesh in other formats and tried to import to CFX which tells me the same thing: no 3D elements found. So I figured something must be wrong in my gmsh process but I cant figure out what.

Thanks in advance!

AtoHM July 9, 2019 02:32

I was missing the
Code:

Physical Volume("CUBE") = {1}
When I was trying to get my mesh to CFX. With that included, one can export it as a .bdf file which is readily known by CFX Pre as "Nastran" mesh file.

However it is still unresolved how to get the mesh to OpenFoam.


All times are GMT -4. The time now is 19:34.