<div dir="ltr"><div><div><div><div><div>Hello All,<br><br></div>I am new at using gmsh. I want to generate a mesh (unstructured) around 2D airfoil with sharp trailing edge. When I use Boundary Layer field in gmsh, it generates boundary layer but with undesirable intersections. I have attached my .geo file here. Currently, I have commented Boundary Layer field lines in the script. <br><br></div>Please share idea how can I make it work correctly.<br></div>Thank you.<br><br>------------------------------------<br>Mesh.RecombineAll = 1;<br><br>Li = 50.0; // distance of inflow boundary from origin<br>Lo = 50.0; // distance of outflow boundary from origin<br><br>n  = 50; // points on upper/lower surface of airfoil used to define airfoil<br>         // These points may not appear in the mesh.<br><br>lc1 = 10.0;<br>lc2 = 0.05;<br><br>m = 2*n - 2; // total number of points on airfoil without repetition<br>             // LE and TE points are common to upper/lower surface<br><br>nle = n; // point number of LE = no. of points on upper surface<br>         // Point(1) is trailing edge<br><br>// NACA0012 profile<br>// formula taken from <a href="http://turbmodels.larc.nasa.gov/naca0012_val.html">http://turbmodels.larc.nasa.gov/naca0012_val.html</a><br>Macro NACA0012<br>   x2 = x * x;<br>   x3 = x * x2;<br>   x4 = x * x3;<br>   y = 0.594689181*(0.298222773*Sqrt(x) <br>       - 0.127125232*x - 0.357907906*x2 + 0.291984971*x3 - 0.105174606*x4);<br>Return<br><br>// put points on upper surface of airfoil<br>For i In {1:n}<br>   theta = Pi * (i-1) / (n-1);<br>   x = 0.5 * (Cos(theta) + 1.0);<br>   Call NACA0012;<br>   Point(i) = {x, y, 0.0, lc2};<br>   xx[i] = x;<br>   yy[i] = y;<br>EndFor<br><br>// put points on lower surface of airfoil, use upper surface points and reflect<br>For i In {n+1:m}<br>   Point(i) = {xx[2*n-i], -yy[2*n-i], 0.0, lc2};<br>EndFor<br><br>Spline(1) = {1:n};<br>Spline(2) = {n:m, 1};<br><br>Point(1000) = {1.0, Li, 0.0,lc1};<br>Point(1001) = {0.0, Li, 0.0,lc1};<br>Point(1002) = {-Li, 0.0, 0.0,lc1};<br>Point(1003) = {0.0, -Li, 0.0,lc1};<br>Point(1004) = {1.0, -Li, 0.0,lc1};<br><br>Point(1005) = {Lo, 0.0, 0.0,lc1};<br>Point(1006) = {Lo, Li, 0.0,lc1};<br>Point(1007) = {Lo, -Li, 0.0,lc1};<br><br>Line(5) = {1000, 1001};<br>Circle(6) = {1001, nle, 1002};<br>Circle(7) = {1002, nle, 1003};<br>Line(8) = {1003, 1004};<br>Line(13) = {1005, 1006};<br>Line(14) = {1005, 1007};<br>Line(15) = {1006, 1000};<br>Line(16) = {1007, 1004};<br><br>Line Loop(1) = {1,2};<br>Line Loop(2) = {5,6,7,8,-16,-14,13,15};<br><br>Plane Surface(201) = {2,1};<br><br>/*<br>//Define Boundary Layer<br>Field[1] = BoundaryLayer;<br>Field[1].EdgesList = {1,2};<br>Field[1].NodesList = {1,m};<br>Field[1].hfar = 0.05;<br>Field[1].hwall_n = 0.009;<br>Field[1].thickness = 0.2;<br>Field[1].ratio = 1.1;<br>Field[1].AnisoMax = 10;<br>Field[1].Quads = 1;<br>Field[1].IntersectMetrics = 0;<br>BoundaryLayer Field = 1;<br>*/<br>------------------------------------<br><br><br></div>-- With Reagrds<br></div>Ashish Bhole  <br></div>