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] Boundary layer not created during gmshToFoam for Gmsh4.0 (https://www.cfd-online.com/Forums/openfoam-meshing/211094-boundary-layer-not-created-during-gmshtofoam-gmsh4-0-a.html)

hasankhan November 12, 2018 17:55

Boundary layer not created during gmshToFoam for Gmsh4.0
 
I am trying to create a mesh of a cube (box) with multiple empty spheres (boolean difference) located inside the box using Gmsh4.0. I am successful in making the mesh (*.msh v2.0 ascii) and importing it in OF using gmshToFoam. The boundaries that are labeled in Gmsh are not created in OF, instead only one zone (patch0) is created and everything is grouped there.


I tried to simplify the problem and created a box using the OpenCASCADE kernel. I create boundaries using the physical surface tab. I create a mesh, export it as v2.0 and convert it to OF using gmshToFoam, but get the same problem. The code used is:


Code:

SetFactory("OpenCASCADE");
Box(1) = {-0.6, -0.5, 0, 1, 1, 1};
Physical Surface("inlet") = {1};
Physical Surface("outlet") = {2};
Physical Surface("walls") = {3, 4, 5,6};

On the other hand, I did the same by defining points, creating lines, surface, and volumes in Gmsh v2.10 (code below) and used it to create a mesh and convert it for OF using gmshToFoam. This works perfectly well.
Code:

cl1 = 0.05;
Point(1) = {-1, -1, -1, cl1};
Point(2) = {1, -1, -1, cl1};
Point(3) = {1, 1, -1, cl1};
Point(4) = {-1, 1, -1, cl1};
Point(5) = {-1, -1, 1, cl1};
Point(6) = {1, -1, 1, cl1};
Point(7) = {1, 1, 1, cl1};
Point(8) = {-1, 1, 1, cl1};
Line(1) = {8, 7};
Line(2) = {8, 5};
Line(3) = {5, 6};
Line(4) = {6, 7};
Line(5) = {6, 2};
Line(6) = {7, 3};
Line(7) = {3, 4};
Line(8) = {3, 2};
Line(9) = {2, 1};
Line(10) = {1, 4};
Line(11) = {1, 5};
Line(12) = {8, 4};
Line Loop(14) = {12, -10, 11, -2};
Plane Surface(14) = {14};
Line Loop(16) = {9, 10, -7, 8};
Plane Surface(16) = {16};
Line Loop(18) = {1, 6, 7, -12};
Plane Surface(18) = {18};
Line Loop(20) = {2, 3, 4, -1};
Plane Surface(20) = {20};
Line Loop(22) = {4, 6, 8, -5};
Plane Surface(22) = {22};
Line Loop(24) = {11, 3, 5, 9};
Plane Surface(24) = {24};
Surface Loop(26) = {14, 16, 18, 20, 22, 24};
Volume(26) = {26};
Physical Surface("inlet") = {14};
Physical Surface("outlet") = {22};
Physical Surface("walls") = {16, 18, 20, 24};
Physical Volume(33) = {26};

My question is, am I doing something wrong when using Gmsh4.0 (using the OpenCASCADE approach)?

openfoamtutorials November 24, 2018 23:29

I've never used OpenCASCADE, but if you are able to see your geometry in the GUI, you can see if you are assigning IDs correctly by going to the Tools > Visibility window, and selecting Physical Groups in the dropdown menu.


All times are GMT -4. The time now is 01:42.