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 Excluded Face in Gmsh (https://www.cfd-online.com/Forums/openfoam-meshing/227053-boundary-layer-excluded-face-gmsh.html)

cfdoruk May 15, 2020 12:55

Boundary Layer Excluded Face in Gmsh
 
3 Attachment(s)
Hi everybody,

I'm trying to have boundary layer for a very simple geometry by using Gmsh. I can construct the layers; however, I want to exclude one of the faces from the boundary layer list. Although I tried ExcludedFaceList, it still produces layer there.

My surface and curve tags are shown in "Tags.png".
What I want to have is shown in "Desired.png".
What I get in Gmsh is shown in "Result.png".

The script is as follows:

// Gmsh project created on Fri May 15 18:00:20 2020
SetFactory("OpenCASCADE");
//+
Point(1) = {0.5, 0.5, 0, 1.0};
//+
Point(2) = {0, 1, 0, 1.0};
//+
Point(3) = {0.5, 1, 0, 1.0};
//+
Point(4) = {0, 0.5, 0, 1.0};
//+
Line(1) = {2, 3};
//+
Line(2) = {3, 1};
//+
Line(3) = {1, 4};
//+
Line(4) = {4, 2};
//+
Curve Loop(1) = {1, 2, 3, 4};
//+
Plane Surface(1) = {1};
//+
Extrude {0, 0, 0.1} {
Surface{1}; Layers{5}; Recombine;
}

Field[1] = BoundaryLayer;
//+
Field[1].AnisoMax = 1000;
//+
Field[1].EdgesList = {1, 2, 3, 4};
//+
Field[1].ExcludedFaceList = {4};

//+
Field[1].IntersectMetrics = 0;
//+
Field[1].Quads = 1;
//+
Field[1].hfar = 0.75;
//+
Field[1].hwall_n = 0.001;
//+
Field[1].ratio = 1.300000;
//+
Field[1].thickness = 0.025;

BoundaryLayer Field = 1;

Thank you.

Flowkersma May 19, 2020 05:01

Hi Doruk,

The boundary layers in GMSH are not working very well in 3D. So I would first create a 2D mesh with the boundary layer and then extrude that. Here is an example:
Code:

SetFactory("OpenCASCADE");
Rectangle(1) = {0, 0, 0, 1, 1, 0};

Field[1] = BoundaryLayer;
Field[1].EdgesList = {2, 3, 4};
Field[1].NodesList = {1, 2, 3, 4};
Field[1].hwall_n = 0.01;
Field[1].thickness = 0.1;
Field[1].ratio = 1.2;
Field[1].Quads = 1;
BoundaryLayer Field = 1;
Extrude {0, 0, 0.1} { Surface{1}; Layers{10}; Recombine; }

Best, Mikko

cfdoruk May 19, 2020 06:27

Hi Mikko,

This works, thank you.

Regards
Doruk

ari003 March 3, 2022 03:47

Quote:

Originally Posted by Flowkersma (Post 771067)
Hi Doruk,

The boundary layers in GMSH are not working very well in 3D. So I would first create a 2D mesh with the boundary layer and then extrude that. Here is an example:
Code:

SetFactory("OpenCASCADE");
Rectangle(1) = {0, 0, 0, 1, 1, 0};

Field[1] = BoundaryLayer;
Field[1].EdgesList = {2, 3, 4};
Field[1].NodesList = {1, 2, 3, 4};
Field[1].hwall_n = 0.01;
Field[1].thickness = 0.1;
Field[1].ratio = 1.2;
Field[1].Quads = 1;
BoundaryLayer Field = 1;
Extrude {0, 0, 0.1} { Surface{1}; Layers{10}; Recombine; }

Best, Mikko

I have a small question and that is why you didnt include hfar or farfield size? Does it become redundant?

Flowkersma March 7, 2022 05:12

Indeed it becomes redundant. You can calculate the number of cells and largest cell size from geometric series.

ari003 March 7, 2022 12:16

Quote:

Originally Posted by Flowkersma (Post 823671)
Indeed it becomes redundant. You can calculate the number of cells and largest cell size from geometric series.

Thanks for your response. Maybe it is a very lame question to ask atm but is it that hfar is the last boundary cell or the very adjacent region outside the boundary layer?


All times are GMT -4. The time now is 23:30.