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

[Gmsh] Unphysical grid cell near boundary layer of the trailing edge

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2019, 05:53
Question Unphysical grid cell near boundary layer of the trailing edge
  #1
New Member
 
yuwen zhang
Join Date: Feb 2019
Posts: 2
Rep Power: 0
yuwen zhang is on a distinguished road
Hello there,

I am currently trying to use gmsh's boundary layer size field to refine the mesh near a 2d NACA0012 airfoil. It looks really nice everywhere except at the trailing edge when zoomed in. There are lines crossing over from other parts of the airfoil and connect to the same node of the first cell behind the trailing edge.
I can get around of this issue if I increase the first cell thickness a little higher. However, I need this small cell thickness for me to set a y plus value less than 1.
Please see attached photos below for the described mesh.

Thanks a lot you guys help in advance !!!


Screen Shot 2019-02-10 at 8.38.53 pm.png
Screen Shot 2019-02-10 at 8.42.39 pm.png




Here are my geo files that create this mesh.

parameters.geo:
XX = 12 ; // As in NACA00XX.
aoa = 0 ; // Angle of attack, in degrees.
lc1 = 50.00000; //characteristic lengths of elements at outer domain
lc2 = 0.00100; //characteristic lengths of elements at airfoil
lc3 = 0.10000; //characteristic lengths of elements at intermediate domain
t_firstcell = 4.6035e-06; //Cell size of the first cell coming out from the airfoil
t_total = 0.0163; //Total thickness of the boundary layer
t_r = 1.2; //Expansion ratio of the cell within the boundary layer

main.geo:
Include "parameters.geo";

Li = 500.0; Lo = 500.0; // distance of inflow and outflow boundary from origin
Li1 = 4.0; Lo1 = 4.0; // distance of intermediate inflow and outflow from origin

n = 400; // points on upper/lower surface of airfoil used to define airfoil
// These points may not appear in the mesh.


m = 2*n - 2; // total number of points on airfoil without repetition
// LE and TE points are common to upper/lower surface

nle = n; // point number of LE = no. of points on upper surface
// Point(1) is trailing edge

// NACA0012 profile: formula taken from http://turbmodels.larc.nasa.gov/naca0012_val.html

Macro NACA0012
x2 = x * x;
x3 = x * x2;
x4 = x * x3;
y = 0.594689181*(0.298222773*Sqrt(x)
- 0.127125232*x - 0.357907906*x2 + 0.291984971*x3 - 0.105174606*x4);
Return

Macro RotateAirfoilPoint
// rotates pointId about quarter-chord.
// aoa is the angle of attack in degrees.
Rotate {{0, 0, 1}, {0.25, 0, 0}, -aoa * Pi / 180.0}
{
Point{i};
}
Return

// put points on upper surface of airfoil
For i In {1:n}
theta = Pi * (i-1) / (n-1);
x = 0.5 * (Cos(theta) + 1.0);
Call NACA0012;
Point(i) = {x, y, 0.0, lc2};
Call RotateAirfoilPoint;
xx[i] = x;
yy[i] = y;
EndFor

// put points on lower surface of airfoil, use upper surface points and reflect
For i In {n+1:m}
Point(i) = {xx[2*n-i], -yy[2*n-i], 0.0, lc2};
Call RotateAirfoilPoint;
EndFor

Spline(1) = {1:n}; Spline(2) = {n:m,1};

Transfinite Line{1,2} = n ;


//Farfield domain
Point(1001) = { 0.0, Li, 0.0,lc1};
Point(1002) = { 0.0, -Li, 0.0, lc1};
Point(1003) = {Lo, -Li, 0.0, lc1};
Point(1004) = {Lo, Li, 0.0, lc1};
Point(1005) = {0,0,0};
origin = 1005;

Line(3) = {1004, 1001};
Circle(4) = {1001, origin, 1002};
Line(5) = {1002, 1003};
Line(6) = {1003, 1004};

Line Loop(1) = {1,2}; // airfoil line loop
Line Loop(2) = {3,4,5,6}; // far field line loop


//Intermediate Domain
Point(2001) = { 0.0, Li1, 0.0,lc3};
Point(2002) = { 0.0, -Li1, 0.0, lc3};
Point(2003) = {Lo1, -Li1, 0.0, lc3};
Point(2004) = {Lo1, Li1, 0.0, lc3};

Line(13) = {2004, 2001};
Circle(14) = {2001, origin, 2002};
Line(15) = {2002, 2003};
Line(16) = {2003, 2004};

Line Loop(3) = {13,14,15,16};


Plane Surface(201) = {3,1}; //intermediate and airfoil surface
Plane Surface(202) = {3,2}; //farfield and intermediate surface


Extrude {0,0,0.1} { Surface{201,202}; Layers{1}; Recombine;}

//Define Boundary Layer
Field[1] = BoundaryLayer;
Field[1].EdgesList = {1,2};
Field[1].AnisoMax = 1000000;
Field[1].FanNodesList = {1};
Field[1].hfar = 0.3;
Field[1].hwall_n = t_firstcell;
Field[1].thickness = t_total;
Field[1].ratio = t_r;
Field[1].Quads = 1;
Field[1].IntersectMetrics = 0;
BoundaryLayer Field = 1;

Physical Surface("frontAndBack") = {201,202,234,276}; //FrontAndBack
Physical Surface("Farfield") = {271, 275, 263, 267}; //Farfield
Physical Surface("Airfoil") = {233,229}; //Airfoil
Physical Volume("Volume") = {1, 2};

//+
Field[2] = Cylinder;
//+
Field[2].Radius = 0.3;
//+
Field[2].VIn = 0.01;
//+
Field[2].VOut = 20;
//+
Field[2].XAxis = 4;
//+
Field[2].XCenter = 5;
//+
Field[2].ZAxis = 0;
//+
Background Field = 2;
yuwen zhang is offline   Reply With Quote

Old   September 5, 2021, 04:49
Default
  #2
Senior Member
 
chandra shekhar pant
Join Date: Oct 2010
Posts: 220
Rep Power: 17
chandra shekhar pant is on a distinguished road
Hello,

It's been a very old post, but I am also facing a similar issue, have you found the solution to this problem?
chandra shekhar pant is offline   Reply With Quote

Reply

Tags
gmsh boundary layer


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] Error defining boundary layer around cube snappyHexMesh crizpi21 OpenFOAM Meshing & Mesh Conversion 5 October 16, 2021 11:56
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[snappyHexMesh] Creating multiple multiple cell zones with snappyHexMesh - a newbie in deep water! divergence OpenFOAM Meshing & Mesh Conversion 0 January 23, 2019 05:17
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 02:44
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 18:38


All times are GMT -4. The time now is 21:43.