CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] GMSH 2D Airfoil with Boundary Layer Hybrid Mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree6Likes
  • 5 Post By hswales
  • 1 Post By opedrofunk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2015, 13:52
Default GMSH 2D Airfoil with Boundary Layer Hybrid Mesh
  #1
New Member
 
Henry Swales
Join Date: Oct 2015
Location: California
Posts: 2
Rep Power: 0
hswales is on a distinguished road
Hello GMSHers!

I have been trying to create a high quality quasi-2D (single layer) airfoil mesh in GMSH for use in OpenFOAM. It has a structured boundary layer and an unstructured far field region. When I try to extrude the unstructured far field region in the Z-Axis to create a single layer, GMSH creates two diagonal lines across the trailing edge of the structured boundary layers and produces two 'cannot find extruded vertex' errors. Please see the attached pic and .geo file.

Any suggestions on how to resolve this issue, better ways to create this type of hybrid mesh, or any other critiques or recommendations are greatly appreciated!

Thanks very much for your help!

Best Regards,
Henry
Attached Images
File Type: jpg BL_Trailing_Edge.jpg (176.4 KB, 406 views)
Attached Files
File Type: txt NACA_0012_coord_gmsh_hybrid_v2.txt (10.4 KB, 227 views)

Last edited by hswales; October 27, 2015 at 13:49. Reason: spelling error
hswales is offline   Reply With Quote

Old   October 27, 2015, 14:15
Default Boundary Layer Field
  #2
New Member
 
Henry Swales
Join Date: Oct 2015
Location: California
Posts: 2
Rep Power: 0
hswales is on a distinguished road
While I have not found a solution to the original issue, it does appear a high quality hybrid (structured boundary layer / unstructured far field) 2D airfoil mesh can be created much easier using the Boundary Layer Field function. See attached geo file.

If anyone has a solution to the original issue, it would be nice to know, as the surface normal extrusion technique does seem to provide more control over the form of the boundary layer mesh.

Thanks,
Henry
Attached Files
File Type: txt NACA_0012_coord_gmsh_hybrid_v3.txt (10.2 KB, 408 views)
ziad, praveen, beatlejuice and 2 others like this.
hswales is offline   Reply With Quote

Old   March 31, 2016, 00:23
Default
  #3
Member
 
Peter
Join Date: Feb 2015
Location: California
Posts: 65
Rep Power: 6
opedrofunk is on a distinguished road
Hello,

A third option would be to use Gmsh to generate the unstructured (tet) mesh, convert to OpenFOAM format with gmshToFoam, and use snapyHexMesh to add the boundary layers. This has worked for me in the past - might be worth trying for your case.

Kind regards,
Peter
fletc900 likes this.
opedrofunk is offline   Reply With Quote

Old   June 29, 2016, 10:55
Default Boundary Layer Field
  #4
New Member
 
vroembroem
Join Date: Jun 2016
Posts: 3
Rep Power: 5
vroembroem is on a distinguished road
Hey, first I want to thank you because your file helped me a lot in trying to make the same kind of mesh for turbine blades. Unfortunately I am unable to get the actual boundary layer part working. And I think it is primarily because I don't know the numeric designations that GMSH applies.

You also stated in your file that you got the numeric designations from the GUI as can be seen here below. But is there any way of getting these numeric designations without using the GUI? Because my goal is to make automatically a mesh with GMSH and run it in SU2, so this doesn't work if I have to look up the numeric designations. Since I will be using SU2, I also don't need to extrude the mesh to get a "fake" 3d mesh right?

//Define physical surfaces - numeric designations from GUI
Physical Surface("back") = {201};
Physical Surface("front") = {233};
Physical Surface("top") = {224};
Physical Surface("bottom") = {216};
Physical Surface("inlet") = {220};
Physical Surface("outlet") = {212};
Physical Surface("foil") = {228, 232};
vroembroem is offline   Reply With Quote

Old   October 12, 2016, 06:09
Default
  #5
New Member
 
Anon
Join Date: Aug 2016
Posts: 3
Rep Power: 5
tangraf is on a distinguished road
Good morning,

This is my first post so I am sorry if I am doing it wrong.
Besides, English is not my mother tongue so my apologies for any mistakes or if I seem rude, this is not the case.

Well, I am currently working on an NACA0012 and already did it with the SnappyHexMesh tool from OpenFoam.
Now, I am looking for meshing the profile with Gmsh.

Firstly, thank you for that example. It Helped me a lot.

But I am faced to some issues. I tried for a week to find a solution but didn't find yet.
When I mesh the profile with boundary layers, it works fine except at the trailing edge.
Indeed, the mesh is "blue" (means it is not correct?) but even more, I would like to have two things :
1) Is it possible to have the same refinements at the trailing edge thank all around the airfoil for the boundary layers ?
2 ) Is it possible to have the same refinement level at the trailing edge thank all around the boundary layers because if you watch the image attached, there are few cells after the boundary layers at the trailing edge.



I attached an image to help you understand.

I am sorry if you have already answer to that kind of questions several times and if the questions are stupids but I am quite lost...

Thank you very much.

Best regards,
Attached Images
File Type: png example NACA0012.png (54.9 KB, 233 views)
tangraf is offline   Reply With Quote

Old   October 13, 2016, 06:52
Default Gmsh Two boxes
  #6
New Member
 
Anon
Join Date: Aug 2016
Posts: 3
Rep Power: 5
tangraf is on a distinguished road
Greetings to you all,

Well I tried to fix my problem by creating 2 boxes which is much better.
The problem is I don't know how to extrude the surface to make the two new surfaces in one. I tried the tool Compound Surface but the back and front surfaces look very weird.

So my question is , how to create 2 boxes to have 2 different refinement levels and make it work for OpenFOAM ? ( Means have the inlet, outlet, .. just at the external box).

Thank you, everyone.

Best regards,



EDIT : I figured out to generate meshing. Looks there is 2 boxes but when I cant to create the boundary layer, the meshing is very bad. (see images attached)

Anyone has a solution?
Thanks

----------- My .geo file that I tried ---------

//Define Foil Coordinates (160pts)
Point(1) = { 1.000000, 0.001260, 0.0000000, 0.002};
Point(2) = { 0.993720, 0.002140, 0.0000000, 0.002};
Point(3) = { 0.982780, 0.003650, 0.0000000, 0.002};
Point(4) = { 0.969990, 0.005390, 0.0000000, 0.002};
Point(5) = { 0.955670, 0.007320, 0.0000000, 0.002};
Point(6) = { 0.940260, 0.009340, 0.0000000, 0.002};
Point(7) = { 0.924220, 0.011420, 0.0000000, 0.002};
Point(8) = { 0.907840, 0.013500, 0.0000000, 0.002};
Point(9) = { 0.891280, 0.015560, 0.0000000, 0.002};
Point(10) = { 0.874620, 0.017590, 0.0000000, 0.002};
Point(11) = { 0.857930, 0.019590, 0.0000000, 0.002};
Point(12) = { 0.841200, 0.021550, 0.0000000, 0.002};
Point(13) = { 0.824460, 0.023480, 0.0000000, 0.002};
Point(14) = { 0.807710, 0.025370, 0.0000000, 0.002};
Point(15) = { 0.790950, 0.027230, 0.0000000, 0.002};
Point(16) = { 0.774190, 0.029050, 0.0000000, 0.002};
Point(17) = { 0.757420, 0.030830, 0.0000000, 0.002};
Point(18) = { 0.740660, 0.032570, 0.0000000, 0.002};
Point(19) = { 0.723890, 0.034280, 0.0000000, 0.002};
Point(20) = { 0.707120, 0.035940, 0.0000000, 0.002};
Point(21) = { 0.690350, 0.037570, 0.0000000, 0.002};
Point(22) = { 0.673590, 0.039160, 0.0000000, 0.002};
Point(23) = { 0.656830, 0.040710, 0.0000000, 0.002};
Point(24) = { 0.640080, 0.042210, 0.0000000, 0.002};
Point(25) = { 0.623330, 0.043670, 0.0000000, 0.002};
Point(26) = { 0.606590, 0.045090, 0.0000000, 0.002};
Point(27) = { 0.589870, 0.046460, 0.0000000, 0.002};
Point(28) = { 0.573150, 0.047780, 0.0000000, 0.002};
Point(29) = { 0.556450, 0.049050, 0.0000000, 0.002};
Point(30) = { 0.539760, 0.050270, 0.0000000, 0.002};
Point(31) = { 0.523090, 0.051430, 0.0000000, 0.002};
Point(32) = { 0.506440, 0.052530, 0.0000000, 0.002};
Point(33) = { 0.489800, 0.053570, 0.0000000, 0.002};
Point(34) = { 0.473190, 0.054550, 0.0000000, 0.002};
Point(35) = { 0.456610, 0.055460, 0.0000000, 0.002};
Point(36) = { 0.440040, 0.056310, 0.0000000, 0.002};
Point(37) = { 0.423510, 0.057070, 0.0000000, 0.002};
Point(38) = { 0.407010, 0.057760, 0.0000000, 0.002};
Point(39) = { 0.390550, 0.058370, 0.0000000, 0.002};
Point(40) = { 0.374120, 0.058890, 0.0000000, 0.002};
Point(41) = { 0.357740, 0.059320, 0.0000000, 0.002};
Point(42) = { 0.341400, 0.059650, 0.0000000, 0.002};
Point(43) = { 0.325110, 0.059880, 0.0000000, 0.002};
Point(44) = { 0.308880, 0.060000, 0.0000000, 0.002};
Point(45) = { 0.292720, 0.060010, 0.0000000, 0.002};
Point(46) = { 0.276620, 0.059890, 0.0000000, 0.002};
Point(47) = { 0.260600, 0.059650, 0.0000000, 0.002};
Point(48) = { 0.244670, 0.059270, 0.0000000, 0.002};
Point(49) = { 0.228840, 0.058750, 0.0000000, 0.002};
Point(50) = { 0.213130, 0.058070, 0.0000000, 0.002};
Point(51) = { 0.197550, 0.057230, 0.0000000, 0.002};
Point(52) = { 0.182140, 0.056220, 0.0000000, 0.002};
Point(53) = { 0.166930, 0.055030, 0.0000000, 0.002};
Point(54) = { 0.151960, 0.053650, 0.0000000, 0.002};
Point(55) = { 0.137300, 0.052070, 0.0000000, 0.002};
Point(56) = { 0.123030, 0.050290, 0.0000000, 0.002};
Point(57) = { 0.109290, 0.048320, 0.0000000, 0.002};
Point(58) = { 0.096220, 0.046180, 0.0000000, 0.002};
Point(59) = { 0.083990, 0.043890, 0.0000000, 0.002};
Point(60) = { 0.072780, 0.041500, 0.0000000, 0.002};
Point(61) = { 0.062710, 0.039080, 0.0000000, 0.002};
Point(62) = { 0.053800, 0.036670, 0.0000000, 0.002};
Point(63) = { 0.046030, 0.034310, 0.0000000, 0.002};
Point(64) = { 0.039290, 0.032030, 0.0000000, 0.002};
Point(65) = { 0.033460, 0.029830, 0.0000000, 0.002};
Point(66) = { 0.028400, 0.027710, 0.0000000, 0.002};
Point(67) = { 0.023990, 0.025660, 0.0000000, 0.002};
Point(68) = { 0.020130, 0.023670, 0.0000000, 0.002};
Point(69) = { 0.016740, 0.021730, 0.0000000, 0.002};
Point(70) = { 0.013760, 0.019820, 0.0000000, 0.002};
Point(71) = { 0.011140, 0.017930, 0.0000000, 0.002};
Point(72) = { 0.008830, 0.016060, 0.0000000, 0.002};
Point(73) = { 0.006820, 0.014190, 0.0000000, 0.002};
Point(74) = { 0.005080, 0.012310, 0.0000000, 0.002};
Point(75) = { 0.003600, 0.010410, 0.0000000, 0.002};
Point(76) = { 0.002380, 0.008510, 0.0000000, 0.002};
Point(77) = { 0.001410, 0.006590, 0.0000000, 0.002};
Point(78) = { 0.000700, 0.004670, 0.0000000, 0.002};
Point(79) = { 0.000250, 0.002770, 0.0000000, 0.002};
Point(80) = { 0.000030, 0.000910, 0.0000000, 0.002};
Point(81) = { 0.000030, -0.000910, 0.0000000, 0.002};
Point(82) = { 0.000250, -0.002770, 0.0000000, 0.002};
Point(83) = { 0.000700, -0.004670, 0.0000000, 0.002};
Point(84) = { 0.001410, -0.006590, 0.0000000, 0.002};
Point(85) = { 0.002380, -0.008510, 0.0000000, 0.002};
Point(86) = { 0.003600, -0.010410, 0.0000000, 0.002};
Point(87) = { 0.005080, -0.012310, 0.0000000, 0.002};
Point(88) = { 0.006820, -0.014190, 0.0000000, 0.002};
Point(89) = { 0.008830, -0.016060, 0.0000000, 0.002};
Point(90) = { 0.011140, -0.017930, 0.0000000, 0.002};
Point(91) = { 0.013760, -0.019820, 0.0000000, 0.002};
Point(92) = { 0.016740, -0.021730, 0.0000000, 0.002};
Point(93) = { 0.020130, -0.023670, 0.0000000, 0.002};
Point(94) = { 0.023990, -0.025660, 0.0000000, 0.002};
Point(95) = { 0.028400, -0.027710, 0.0000000, 0.002};
Point(96) = { 0.033460, -0.029830, 0.0000000, 0.002};
Point(97) = { 0.039300, -0.032030, 0.0000000, 0.002};
Point(98) = { 0.046030, -0.034310, 0.0000000, 0.002};
Point(99) = { 0.053800, -0.036670, 0.0000000, 0.002};
Point(100) = { 0.062710, -0.039080, 0.0000000, 0.002};
Point(101) = { 0.072780, -0.041500, 0.0000000, 0.002};
Point(102) = { 0.083990, -0.043890, 0.0000000, 0.002};
Point(103) = { 0.096220, -0.046180, 0.0000000, 0.002};
Point(104) = { 0.109290, -0.048320, 0.0000000, 0.002};
Point(105) = { 0.123030, -0.050290, 0.0000000, 0.002};
Point(106) = { 0.137300, -0.052070, 0.0000000, 0.002};
Point(107) = { 0.151960, -0.053650, 0.0000000, 0.002};
Point(108) = { 0.166930, -0.055030, 0.0000000, 0.002};
Point(109) = { 0.182140, -0.056220, 0.0000000, 0.002};
Point(110) = { 0.197550, -0.057230, 0.0000000, 0.002};
Point(111) = { 0.213130, -0.058070, 0.0000000, 0.002};
Point(112) = { 0.228840, -0.058750, 0.0000000, 0.002};
Point(113) = { 0.244670, -0.059270, 0.0000000, 0.002};
Point(114) = { 0.260600, -0.059650, 0.0000000, 0.002};
Point(115) = { 0.276620, -0.059890, 0.0000000, 0.002};
Point(116) = { 0.292720, -0.060010, 0.0000000, 0.002};
Point(117) = { 0.308880, -0.060000, 0.0000000, 0.002};
Point(118) = { 0.325110, -0.059880, 0.0000000, 0.002};
Point(119) = { 0.341400, -0.059650, 0.0000000, 0.002};
Point(120) = { 0.357740, -0.059320, 0.0000000, 0.002};
Point(121) = { 0.374120, -0.058890, 0.0000000, 0.002};
Point(122) = { 0.390550, -0.058370, 0.0000000, 0.002};
Point(123) = { 0.407010, -0.057760, 0.0000000, 0.002};
Point(124) = { 0.423510, -0.057070, 0.0000000, 0.002};
Point(125) = { 0.440040, -0.056310, 0.0000000, 0.002};
Point(126) = { 0.456610, -0.055460, 0.0000000, 0.002};
Point(127) = { 0.473190, -0.054550, 0.0000000, 0.002};
Point(128) = { 0.489800, -0.053570, 0.0000000, 0.002};
Point(129) = { 0.506440, -0.052530, 0.0000000, 0.002};
Point(130) = { 0.523090, -0.051430, 0.0000000, 0.002};
Point(131) = { 0.539760, -0.050270, 0.0000000, 0.002};
Point(132) = { 0.556450, -0.049050, 0.0000000, 0.002};
Point(133) = { 0.573150, -0.047780, 0.0000000, 0.002};
Point(134) = { 0.589870, -0.046460, 0.0000000, 0.002};
Point(135) = { 0.606590, -0.045090, 0.0000000, 0.002};
Point(136) = { 0.623330, -0.043670, 0.0000000, 0.002};
Point(137) = { 0.640080, -0.042210, 0.0000000, 0.002};
Point(138) = { 0.656830, -0.040710, 0.0000000, 0.002};
Point(139) = { 0.673590, -0.039160, 0.0000000, 0.002};
Point(140) = { 0.690350, -0.037570, 0.0000000, 0.002};
Point(141) = { 0.707120, -0.035940, 0.0000000, 0.002};
Point(142) = { 0.723890, -0.034280, 0.0000000, 0.002};
Point(143) = { 0.740660, -0.032570, 0.0000000, 0.002};
Point(144) = { 0.757420, -0.030830, 0.0000000, 0.002};
Point(145) = { 0.774190, -0.029050, 0.0000000, 0.002};
Point(146) = { 0.790950, -0.027230, 0.0000000, 0.002};
Point(147) = { 0.807710, -0.025370, 0.0000000, 0.002};
Point(148) = { 0.824460, -0.023480, 0.0000000, 0.002};
Point(149) = { 0.841200, -0.021550, 0.0000000, 0.002};
Point(150) = { 0.857930, -0.019590, 0.0000000, 0.002};
Point(151) = { 0.874620, -0.017590, 0.0000000, 0.002};
Point(152) = { 0.891280, -0.015560, 0.0000000, 0.002};
Point(153) = { 0.907840, -0.013500, 0.0000000, 0.002};
Point(154) = { 0.924220, -0.011420, 0.0000000, 0.002};
Point(155) = { 0.940260, -0.009340, 0.0000000, 0.002};
Point(156) = { 0.955670, -0.007320, 0.0000000, 0.002};
Point(157) = { 0.969990, -0.005390, 0.0000000, 0.002};
Point(158) = { 0.982780, -0.003650, 0.0000000, 0.002};
Point(159) = { 0.993720, -0.002140, 0.0000000, 0.002};
Point(160) = { 1.000000, -0.001260, 0.0000000, 0.002};

//Define foil spline and trailing edge
Spline(9) = {1:160};
Line(10) = {160, 1};

//Define bounding box corners
Point(2001) = { 1.500000, 0.250000, 0.0000000, 0.01};
Point(2002) = { 1.500000, -0.150000, 0.0000000, 0.01};
Point(2003) = { -0.1500000, -0.150000, 0.0000000, 0.01};
Point(2004) = { -0.1500000, 0.250000, 0.0000000, 0.01};


//Define bounding box edges
Line(1) = {2001, 2002};
Line(2) = {2002, 2003};
Line(3) = {2003, 2004};
Line(4) = {2004, 2001};

//Define bounding box2 corners
Point(3001) = { 4.500000, 1.500000, 0.0000000, 0.1};
Point(3002) = { 4.500000, -1.500000, 0.0000000, 0.1};
Point(3003) = { -1.500000, -1.500000, 0.0000000, 0.1};
Point(3004) = { -1.500000, 1.500000, 0.0000000, 0.1};

//Define bounding box2 edges
Line(5) = {3001, 3002};
Line(6) = {3002, 3003};
Line(7) = {3003, 3004};
Line(8) = {3004, 3001};

//Define bounding box outer boundary
Line Loop(101) = {1, 2, 3, 4};

//Define bounding box2 outer boundary
Line Loop(102) = {5, 6, 7, 8};

//Define foil boundary
Line Loop(103) = {9, 10};

//Define unstructured far field mesh zone
Plane Surface(201) = {101, 102};

//Define unstructured far field mesh zone
Plane Surface(202) = {101, 103};

Compound Surface(203) = {201, 202};

//Extrude unstructured far field mesh
Extrude {0, 0, 1} {
Surface {203};
Layers{1};
Recombine;
}

//Define physical surfaces - numeric designations from GUI
Physical Surface("back") = {203};
Physical Surface("front") = {235};
Physical Surface("top") = {214};
Physical Surface("bottom") = {222};
Physical Surface("inlet") = {218};
Physical Surface("outlet") = {226};
Physical Surface("foil") = {9, 10};

//Define physical volumes - numeric designations from GUI
Physical Volume("internal") = {1};

//Define Boundary Layer
Field[1] = BoundaryLayer;
Field[1].EdgesList = {9, 229, 210, -228, 209, 10};
Field[1].NodesList = {1,3021, 3022, 160};
Field[1].FacesList = {234, 230};
Field[1].FanNodesList = {1,3021, 3022, 160};
Field[1].FansList = {9, 10};
Field[1].hfar = 0.1;
Field[1].hwall_n = 0.001;
Field[1].thickness = 0.001;
Field[1].ratio = 1.1;
Field[1].AnisoMax = 1000;
Field[1].Quads = 1;
Field[1].IntersectMetrics = 0;
BoundaryLayer Field = 1;
Attached Images
File Type: png front and back surface.png (17.9 KB, 191 views)
File Type: png BL 1.png (14.2 KB, 215 views)
File Type: png BL 2.png (128.6 KB, 257 views)

Last edited by tangraf; October 13, 2016 at 10:09.
tangraf is offline   Reply With Quote

Old   November 22, 2016, 18:04
Default
  #7
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 6
Jack001 is on a distinguished road
Has anyone figured out how to do local mesh refinement near the trailing edge of the airfoil? I have tried giving different mesh size values to the points that are used to define the trailing edge but this seems to be overwridden by the size specified for the points around the airfoil body...
Jack001 is offline   Reply With Quote

Old   November 30, 2016, 10:12
Default
  #8
New Member
 
Anon
Join Date: Aug 2016
Posts: 3
Rep Power: 5
tangraf is on a distinguished road
Good afternoon Jack001,

Sorry for my late answer.

For the trailing edge, I did not succeed to refine the circle part of the boundary layer but it was not a problem to converge all the calculs.
But I understood like you that the first and the final point of the line define the refinement of the entire line (line or spline).
Knowing that, What I did to refine several part of the boundary layer differently is to define the foil with different lines and splines as I wanted to refine

Example :
Spline(5) = {1000:1059};
Line(6) = {1059, 1060};
Spline(59) = {1060:1137};
Line(60) = {1137, 1138};
Spline(61) = {1138:1174};
Line(62) = {1174, 1175};
Spline(63) = {1175:1288};
Line(64) = {1288, 1000};

I attached an example to that message.

I hope you understood my english and I helped you a little bit.
Attached Images
File Type: png Example.png (63.4 KB, 195 views)
tangraf is offline   Reply With Quote

Old   December 28, 2018, 04:49
Default Simulation using QuickerSim
  #9
New Member
 
Trung
Join Date: Nov 2018
Posts: 1
Rep Power: 0
trieuvantrung is on a distinguished road
I need calculated and simulation an airfoil Naca 0012, using app QuickerSim in Matlab. But i have'nt license, so i hope someone can help, please!
trieuvantrung is offline   Reply With Quote

Reply

Tags
airfoil, boundary layer, extrude, gmsh, mesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Ffd_control_point_2d feiyi SU2 4 September 30, 2019 13:42
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Gmsh 3.0 - Boundary layer 3D mesh PaulBet Mesh Generation & Pre-Processing 2 April 19, 2018 17:16
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[ICEM] Hybrid mesh for 2D boundary layer Bigio ANSYS Meshing & Geometry 32 January 9, 2014 11:26


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