<div dir="ltr">Sir<div>I am trying to generate an unstructured hybrid grid over a nac0012 airfoil using a boundary layer field. However, near the trailing edge, I don't seem to have any control over the number of  grid lines at the edge. Is there any way to control the mesh generation in this fan region?  The geo script is given below</div><div><br></div><div><br></div><div>//Scirpt</div><div><br></div><div><div>Li  = 50.0; Lo  = 50.0; // distance of inflow and outflow boundary from origin</div><div>Li1 = 2.0; Lo1 = 2.0;   // distance of intermediate inflow and outflow from origin</div><div><br></div><div>n  = 100; // points on upper/lower surface of airfoil used to define airfoil</div><div>         // These points may not appear in the mesh.</div><div><br></div><div>lc1 = 10.0; lc2 = 0.00001; // characteristic lengths of elements on airfoil and at farfield</div><div>lc3 = 0.1; //characteristic length for the inetrmediate domain</div><div>m = 2*n - 2; // total number of points on airfoil without repetition</div><div>             // LE and TE points are common to upper/lower surface</div><div><br></div><div>nle = n; // point number of LE = no. of points on upper surface</div><div>         // Point(1) is trailing edge</div><div><br></div><div>// NACA0012 profile: formula taken from <a href="http://turbmodels.larc.nasa.gov/naca0012_val.html">http://turbmodels.larc.nasa.gov/naca0012_val.html</a></div><div>Macro NACA0012</div><div>   x2 = x * x;</div><div>   x3 = x * x2;</div><div>   x4 = x * x3;</div><div>   y = 0.594689181*(0.298222773*Sqrt(x)</div><div>       - 0.127125232*x - 0.357907906*x2 + 0.291984971*x3 - 0.105174606*x4);</div><div>Return</div><div><br></div><div>// put points on upper surface of airfoil</div><div>For i In {1:n}</div><div>   theta = Pi * (i-1) / (n-1);</div><div>   x = 0.5 * (Cos(theta) + 1.0);</div><div>   Call NACA0012;</div><div>   Point(i) = {x, y, 0.0, lc2};</div><div>   xx[i] = x;</div><div>   yy[i] = y;</div><div>EndFor</div><div><br></div><div>// put points on lower surface of airfoil, use upper surface points and reflect</div><div>For i In {n+1:m}</div><div>   Point(i) = {xx[2*n-i], -yy[2*n-i], 0.0, lc2};</div><div>EndFor</div><div><br></div><div>Spline(1) = {1:n}; Spline(2) = {n:m,1};</div><div><br></div><div>Transfinite Line{1,2} = n Using Bump 0.2;</div><div><br></div><div>Point(1001) = { 0.0, Li, 0.0,lc1};</div><div>Point(1002) = { 0.0, -Li, 0.0, lc1};</div><div>Point(1003) = {Lo, -Li, 0.0, lc1};</div><div>Point(1004) = {Lo, Li, 0.0, lc1};</div><div><br></div><div>Line(3) = {1004, 1001};</div><div>Circle(4) = {1001, nle, 1002};</div><div>Line(5) = {1002, 1003};</div><div>Line(6) = {1003, 1004};</div><div><br></div><div>Line Loop(1) = {1,2};</div><div>Line Loop(2) = {3,4,5,6};</div><div><br></div><div>//Intermediate Domain</div><div>Point(2001) = { 0.0, Li1, 0.0,lc3};</div><div>Point(2002) = { 0.0, -Li1, 0.0, lc3};</div><div>Point(2003) = {Lo1, -Li1, 0.0, lc3};</div><div>Point(2004) = {Lo1, Li1, 0.0, lc3};</div><div><br></div><div>Line(13) = {2004, 2001};</div><div>Circle(14) = {2001, nle, 2002};</div><div>Line(15) = {2002, 2003};</div><div>Line(16) = {2003, 2004};</div><div><br></div><div>Line Loop(3) = {13,14,15,16};</div><div><br></div><div>Plane Surface(201) = {3,1};</div><div>Plane Surface(202) = {3,2};</div><div><br></div><div>Extrude {0,0,lc1} { Surface{201,202}; Layers{1}; Recombine;}</div><div><br></div><div>//Define Boundary Layer</div><div>Field[1] = BoundaryLayer;</div><div>Field[1].EdgesList = {1,2};</div><div>Field[1].AnisoMax = 1.0;</div><div>Field[1].FanNodesList = {1};</div><div>Field[1].hfar = 0.03;</div><div>Field[1].hwall_n = 0.001;</div><div>Field[1].thickness = 0.05;</div><div>Field[1].ratio = 1.1;</div><div>Field[1].Quads = 1;</div><div>Field[1].IntersectMetrics = 0;</div><div>BoundaryLayer Field = 1;</div><div><br></div><div>Physical Surface(201) = {201,202};  //Periodic at z = 0</div><div>Physical Surface(202) = {276, 234}; //Periodic at z = lc1</div><div>Physical Surface(203) = {271, 275, 263, 267}; //Farfield</div><div>Physical Volume(1)    = {1, 2};</div></div><div><br></div></div>