CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

GMSH - Boundary Layer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2020, 19:16
Default GMSH - Boundary Layer
  #1
New Member
 
Alexandre Cardoso
Join Date: Sep 2020
Posts: 4
Rep Power: 6
a_cardoso is on a distinguished road
Hi, I'm trying to simulate a 2D flow around a rectangular plate using GMSH.

I couldn't figure out how to do the boundary mesh using fields. I also tryed to subdivide and add transfinite surfaces without succes.

Using fields I got a different beahavior for vertical boundaries.

Code:
Field[1] = BoundaryLayer;
Field[1].EdgesList = {14,15,16,17};
Field[1].NodesList = {6,7,8,9};
Field[1].FanNodesList = {6,7,8,9};
Field[1].hfar = 0.05;
Field[1].hwall_n = 0.0005;
Field[1].thickness = 0.01;
Field[1].ratio = 1.1;
Field[1].AnisoMax = 1;
Field[1].Quads = 1;
Field[1].IntersectMetrics = 0;
BoundaryLayer Field = 1;
I tryed isolated fields, in addition to the strange behavior the mesh stops before the end of the face.

Code:
Field[1] = BoundaryLayer;
Field[1].EdgesList = {14,15};
Field[1].NodesList = {6,7};
Field[1].FanNodesList = {6,7};
Field[1].hfar = 0.05;
Field[1].hwall_n = 0.0005;
Field[1].thickness = 0.01;
Field[1].ratio = 1.1;
Field[1].AnisoMax = 1;
Field[1].Quads = 1;
Field[1].IntersectMetrics = 0;
BoundaryLayer Field = 1;
At last I tryed by force, using transfinite surfaces. But I got no matching meshes between the transfinite and the regular triangular meshes.

Code:
//inputs
B = 10;
H= 1;
gsmax = B/2;
gsmed = B/10;
gsmin = B/80;


hDom = 15;
lDom = 30;
l1Dom = 8;
rMed = 2;
rMax = 2;


divH = 160;
divV = 20;
nCam = 10;
camadaLimite = H/5;

tRec = Atan(H/B);
d = Sqrt(B*B+H*H);

//Printf(%f tRec);
//Printf(%f d);


a = 0.0;


//dominio
Point(1) = {0,0,0,gsmax};
Point(2) = {lDom*B,0,0,gsmax};
Point(3) = {lDom*B,hDom*B,0,gsmax};
Point(4) = {0,hDom*B,0,gsmax};
//centro
Point(5) = {l1Dom*B,hDom/2*B,0,gsmax};

//retangulo
Point(6) = {l1Dom*B+Cos(tRec+a+Pi)*d,hDom/2*B+Sin(tRec+a+Pi)*d,0,gsmin};
Point(7) = {l1Dom*B+Cos(-tRec+a)*d,hDom/2*B+Sin(-tRec+a)*d,0,gsmin};
Point(8) = {l1Dom*B+Cos(tRec+a)*d,hDom/2*B+Sin(tRec+a)*d,0,gsmin};
Point(9) = {l1Dom*B+Cos(-tRec+a+Pi)*d,hDom/2*B+Sin(-tRec+a+Pi)*d,0,gsmin};




//retangulo ref
Point(10) = {0,hDom/2*B-rMax*B,0,gsmed};
Point(11) = {lDom*B,hDom/2*B-rMax*B,0,gsmed};
Point(12) = {lDom*B,hDom/2*B+rMax*B,0,gsmed};
Point(13) = {0,hDom/2*B+rMax*B,0,gsmed};

//obstacle
Line(14) = {6,7};
Line(15) = {7,8};
Line(16) = {8,9};
Line(17) = {9,6};

//ref
Line(18) = {10,11};
Line(19) = {11,12};
Line(20) = {12,13};
Line(21) = {13,10};

//inf
Line(22) = {1,2};
Line(23) = {2,11};
Line(24) = {11,10};
Line(25) = {10,1};

//sup
Line(26) = {13,12};
Line(27) = {12,3};
Line(28) = {3,4};
Line(29) = {4,13};

Line Loop(30) = {14,15,16,17};
Line Loop(31) = {18,19,20,21};
Line Loop(32) = {22,23,24,25};
Line Loop(33) = {26,27,28,29};



//retangulo2
dc = Sqrt((B)*(B)+(H+2*camadaLimite)*(H+2*camadaLimite));
tRecC = Atan((H+2*camadaLimite)/(B));

Point(34) = {l1Dom*B+Cos(tRecC+a+Pi)*dc,hDom/2*B+Sin(tRecC+a+Pi)*dc,0,gsmin};
Point(35) = {l1Dom*B+Cos(-tRecC+a)*dc,hDom/2*B+Sin(-tRecC+a)*dc,0,gsmin};
Point(36) = {l1Dom*B+Cos(tRecC+a)*dc,hDom/2*B+Sin(tRecC+a)*dc,0,gsmin};
Point(37) = {l1Dom*B+Cos(-tRecC+a+Pi)*dc,hDom/2*B+Sin(-tRecC+a+Pi)*dc,0,gsmin};


dc = Sqrt((B+2*camadaLimite)*(B+2*camadaLimite)+(H)*(H));
tRecC = Atan((H)/(B+2*camadaLimite));

Point(38) = {l1Dom*B+Cos(tRecC+a+Pi)*dc,hDom/2*B+Sin(tRecC+a+Pi)*dc,0,gsmin};
Point(39) = {l1Dom*B+Cos(-tRecC+a)*dc,hDom/2*B+Sin(-tRecC+a)*dc,0,gsmin};
Point(40) = {l1Dom*B+Cos(tRecC+a)*dc,hDom/2*B+Sin(tRecC+a)*dc,0,gsmin};
Point(41) = {l1Dom*B+Cos(-tRecC+a+Pi)*dc,hDom/2*B+Sin(-tRecC+a+Pi)*dc,0,gsmin};


dc = Sqrt((B+2*camadaLimite)*(B+2*camadaLimite)+(H+2*camadaLimite)*(H+2*camadaLimite));
tRecC = Atan((H+2*camadaLimite)/(B+2*camadaLimite));

Point(42) = {l1Dom*B+Cos(tRecC+a+Pi)*dc,hDom/2*B+Sin(tRecC+a+Pi)*dc,0,gsmin};
Point(43) = {l1Dom*B+Cos(-tRecC+a)*dc,hDom/2*B+Sin(-tRecC+a)*dc,0,gsmin};
Point(44) = {l1Dom*B+Cos(tRecC+a)*dc,hDom/2*B+Sin(tRecC+a)*dc,0,gsmin};
Point(45) = {l1Dom*B+Cos(-tRecC+a+Pi)*dc,hDom/2*B+Sin(-tRecC+a+Pi)*dc,0,gsmin};


//1
Line(46) = {42,34};
Line(47) = {34,6};
Line(48) = {6,38};
Line(49) = {38,42};
Line Loop(50) = {46,47,48,49};

//2
Line(51) = {34,35};
Line(52) = {35,7};
Line(53) = {7,6};
Line(54) = {6,34};
Line Loop(55) = {51,52,53,54};

//3
Line(56) = {35,43};
Line(57) = {43,39};
Line(58) = {39,7};
Line(59) = {7,35};
Line Loop(60) = {56,57,58,59};

//4
Line(61) = {7,39};
Line(62) = {39,40};
Line(63) = {40,8};
Line(64) = {8,7};
Line Loop(65) = {61,62,63,64};

//5
Line(66) = {8,40};
Line(67) = {40,44};
Line(68) = {44,36};
Line(69) = {36,8};
Line Loop(70) = {66,67,68,69};

//6
Line(71) = {9,8};
Line(72) = {8,36};
Line(73) = {36,37};
Line(74) = {37,9};
Line Loop(75) = {71,72,73,74};

//7
Line(76) = {41,9};
Line(77) = {9,37};
Line(78) = {37,45};
Line(79) = {45,41};
Line Loop(80) = {76,77,78,79};


//8
Line(81) = {38,6};
Line(82) = {6,9};
Line(83) = {9,41};
Line(84) = {41,38};
Line Loop(85) = {81,82,83,84};

//externo
Line(97) = {42,43};
Line(98) = {43,44};
Line(99) = {44,45};
Line(100) = {45,42};
Line Loop(101) = {97,98,99,100};



Surface(86) = {31,101};
Surface(87) = {32};
Surface(88) = {33};

Transfinite Curve {51,53} = divH;
Transfinite Curve {52,54} = nCam;


Transfinite Curve {61,63} = nCam;
Transfinite Curve {62,64} = divV;

Transfinite Curve {71,73} = divH;
Transfinite Curve {72,74} = nCam;

Transfinite Curve {81,83} = nCam;
Transfinite Curve {82,84} = divV;


Transfinite Curve {46,48} = nCam;
Transfinite Curve {47,49} = nCam;
Transfinite Curve {56,58} = nCam;
Transfinite Curve {57,59} = nCam;
Transfinite Curve {66,68} = nCam;
Transfinite Curve {67,69} = nCam;
Transfinite Curve {76,78} = nCam;
Transfinite Curve {77,79} = nCam;

Surface(89) = {50};
Surface(90) = {55};
Surface(91) = {60};
Surface(92) = {65};
Surface(93) = {70};
Surface(94) = {75};
Surface(95) = {80};
Surface(96) = {85};

Transfinite Surface{90} = {34,35,7,6};
Transfinite Surface{92} = {7,39,40,8};
Transfinite Surface{94} = {9,8,36,37};
Transfinite Surface{96} = {38,6,9,41};

Transfinite Surface{89} = {42,34,6,38};
Transfinite Surface{91} = {35,43,39,7};
Transfinite Surface{93} = {8,40,44,36};
Transfinite Surface{95} = {41,9,37,45};

Recombine Surface{90,91,92,93,94,95,96};
Any ideas?
Attached Images
File Type: jpg weird aspect.jpg (199.7 KB, 40 views)
File Type: png isolated faces.PNG (35.9 KB, 36 views)
File Type: png no matching mesh.PNG (42.8 KB, 38 views)
a_cardoso is offline   Reply With Quote

Old   December 18, 2020, 12:14
Default
  #2
New Member
 
Join Date: Aug 2016
Location: USA
Posts: 5
Rep Power: 10
edsaac is on a distinguished road
Is there a particular reason to have a transfinite grid near the hole? If not, I'd go for changing the meshing algorithm to just get better quads (Mesh.Algorithm = 8)

(ps. check attachments (: )
Attached Files
File Type: zip quadsMesh.zip (23.0 KB, 15 views)
edsaac is offline   Reply With Quote

Old   January 17, 2021, 22:45
Default
  #3
New Member
 
Alexandre Cardoso
Join Date: Sep 2020
Posts: 4
Rep Power: 6
a_cardoso is on a distinguished road
The idea is to get a regular mesh perpendicular to the surface to get better convergence, Isaw it in many foil examples.

I'll try this suggestion,

Thanks edsaak
a_cardoso is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[snappyHexMesh] layer not added Rasmusiwersen OpenFOAM Meshing & Mesh Conversion 1 January 2, 2020 10:43
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner panpanzhong OpenFOAM Meshing & Mesh Conversion 5 July 3, 2018 06:53
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 09:44
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 05:39
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00


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