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

Gmsh - a very thin boundary layer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2021, 10:25
Default Gmsh - a very thin boundary layer
  #1
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Hi everybody

I will show an excerpt from a script that I wrote after reading up on tutorial t10.geo of the gmsh user manual:


Field[1] = Distance;

.....

Field[2] = Threshold;
Field[2].IField = 1;
Field[2].LcMin = 1.0e-6;
Field[2].LcMax = .1;
Field[2].DistMin = 0.00;
Field[2].DistMax = 1.0e-5;


This is supposed to linearly interpolate cell size between Lcmin and Lcmax in the range DistMin to DistMax. The problem is that

DistMax - DistMin << LcMax

so that large cells close to LcMax of course do not fit within this range.

I am wondering about how the software handles such cases.

Regards to all
celestial is offline   Reply With Quote

Old   February 3, 2021, 14:06
Default
  #2
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
As an aside, for accuracy Field[1].NNodesByEdge should be of order LcMin but that does not answer my request. Anyhow I switched from using Field[1] = Distance to Field[1] = BoundaryLayer for a small circle inside a big box. Here is the code:


lc = .1;

Point(1) = {-0.9145, -.381, 0, lc} ;
Point(2) = { 0.9145, -.381, 0, lc} ;
Point(3) = { 0.9145, .381, 0, lc} ;
Point(4) = {-0.9145, .381, 0, lc} ;

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;

Line Loop(1) = {1, 2, 3, 4} ;


radius = .076;

Point(5) = {radius, 0, 0, lc} ;
Point(6) = {0, radius, 0, lc} ;
Point(7) = {-radius, 0, 0, lc} ;
Point(8) = {0, -radius, 0, lc} ;

//center is at origin
Point(9) = {0, 0, 0, lc} ;


// start center end arc less than 180 deg

Circle(5) = {5, 9, 6};
Circle(6) = {6, 9, 7};
Circle(7) = {7, 9, 8};
Circle(8) = {8, 9, 5};

Curve Loop(2) = {5, 6, 7, 8} ;


Plane Surface(1) = {1, 2} ; //mesh exterior of circle only

Field[1] = BoundaryLayer;
Field[1].EdgesList = {5, 6, 7,8};
Field[1].hfar = lc;
Field[1].hwall_n = 1.0e-6; // cell size 1/10 of boundary layer below
Field[1].thickness = 1.0e-5;
Background Field = 1;


Strangely enough I only get two cells generated per quarter of a circle but you can see from the above .hwall that you would expect to generate 100000's of cells ! What is going on !?

Any reply appreciated
celestial is offline   Reply With Quote

Old   February 4, 2021, 15:41
Default
  #3
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Well folks, as a tip, there are at least 9 other keywords under

Field[1] = BoundaryLayer;

to experiment with. The problem is that that there is so many mesh commands and options listed under the Gmsh manual and there are quite a few of these that are unclear to me. I wish the authors of the Gmsh software would have written a more theoretical book on meshing. (for example what is the meaning of a mesh fan ?) Maybe I will find answers when I delve into the Gmsh source code itself or maybe I should contact the authors directly.

Thanks anyways
celestial is offline   Reply With Quote

Old   February 6, 2021, 18:43
Default
  #4
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Well, I'm going to make it as simple as can be. Just a plain rectangle filled with air and the bottom edge representing a solid boundary. Of course this is where the boundary layer will be situated.

lc = .1;

Point(1) = {-0.9145, -.381, 0, lc} ;
Point(2) = { 0.9145, -.381, 0, lc} ;
Point(3) = { 0.9145, .381, 0, lc} ;
Point(4) = {-0.9145, .381, 0, lc} ;

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;

Line Loop(1) = {1, 2, 3, 4} ;

Plane Surface(1) = {1} ; //air only

Field[1] = BoundaryLayer;
Field[1].NodesList = {1, 2};
Field[1].EdgesList = {1};
Field[1].hfar = lc;
Field[1].hwall_n = 1.0e-6; // cell size 1/10 of boundary layer below
Field[1].thickness = 1.0e-5;
Background Field = 1;


Guess what ? Still does not work. No boundary layer in the generated mesh.
And up to now, I had no luck either with any extra keyword associated with BoundaryLayer that can be found in the Gmsh user manual.

!?
celestial is offline   Reply With Quote

Old   February 8, 2021, 14:44
Default
  #5
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Problem solved !

Just replace

Background Field = 1;

by

BoundaryLayer Field = 1;

and the generated mesh shows a boundary layer

That was not obvious since nowhere is it discussed in the Gmsh manual and I had to find an example elsewhere on the internet.

Also I was wrong in stating that there should be 100000's of cells because the vertical dimension is so small 1.0e-6: The horizontal dimension is unchanged (at lc = .1)

And of course, for such problems do use

Field[1] = BoundaryLayer;

and not

Field[1] = Distance;

since the latter is not suitable for thin boundary layer in viscous air (there is no stretching of cell edge length in either direction and there would be 100000's of cells generated) And to answer my very first request

DistMax - DistMin << LcMax

is of course utterly meaningless for

Field[1] = Distance;

(all cells in range (Lcmin, LcMax) must fit within (DistMin, Distmax)

I still have to get a reply from the authors about the physical meaning of the mesh fan.

That's all for now. I hope most of you learned something from this thread.
celestial 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] Holes in internal mesh when adding boundary layer snappyHex otaolafr OpenFOAM Meshing & Mesh Conversion 3 February 8, 2021 08:19
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner panpanzhong OpenFOAM Meshing & Mesh Conversion 5 July 3, 2018 05:53
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


All times are GMT -4. The time now is 05:41.