|
[Sponsors] |
November 8, 2021, 22:02 |
How to create a 2D boundary layer in gmsh?
|
#1 |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Hi, I am wondering if anyone can help?
I am not very experienced with gmsh and I am trying to figure out how to use the 2D boundary layer function, but I am struggling. I have made a .geo file for a simple square geometry with a boundary layer on the lower face, as follows: Code:
Point(1) = {0.0000, 0.0000, 0.0000}; Point(2) = {40.0000, 0.0000, 0.0000}; Point(3) = {40.0000, 40.0000, 0.0000}; Point(4) = {0.0000, 40.0000, 0.0000}; Line(5) = {1,2}; Line(6) = {2,3}; Line(7) = {3,4}; Line(8) = {4,1}; Curve Loop(1) = {5,6,7,8}; Plane Surface(1) = {1}; Field[1] = BoundaryLayer; Field[1].AnisoMax = 1000; Field[1].Quads = 1; Field[1].Thickness = 5; Field[1].CurvesList = {5}; Field[1].Thickness = 3; Field[1].NbLayers = 10; Field[1].PointsList = {1,2}; Field[1].Quads = 1; Field[1].Ratio = 1.1; Field[1].Size = 0.2; Field[1].SizeFar = 2; Background Field = 1; Does anyone have any idea why it is not working? |
|
November 9, 2021, 04:30 |
|
#2 |
Senior Member
Join Date: Oct 2011
Posts: 242
Rep Power: 17 |
Hello,
Try to replace : Background Field = 1; by BoundaryLayer Field = 1; seems to work for me with v4.8.4, I followed this thread: http://onelab.info/pipermail/gmsh/2019/013093.html Good luck |
|
November 9, 2021, 09:57 |
|
#3 | |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Quote:
Hi, thanks for your reply. I did as you suggested and replaced 'Background Field = 1' with 'BoundaryLayer Field = 1' and it is now making the boundary layer mesh. However, the results don't look great. Using the following .geo script: Code:
SetFactory("OpenCASCADE"); Point(1) = {0.0000, 0.0000, 0.0000,0.5}; Point(2) = {40.0000, 0.0000, 0.0000,0.5}; Point(3) = {40.0000, 40.0000, 0.0000,3}; Point(4) = {0.0000, 40.0000, 0.0000,3}; Line(5) = {1,2}; Line(6) = {2,3}; Line(7) = {3,4}; Line(8) = {4,1}; Line Loop(1) = {5,6,7,8}; Plane Surface(1) = {1}; //Boundary Layer Field[1] = BoundaryLayer; Field[1].Quads = 1; Field[1].Thickness = 2; Field[1].EdgesList = {5}; Field[1].NbLayers = 6; Field[1].NodesList = {1,2}; Field[1].Ratio = 1.2; Field[1].hwall_n = 0.1; Field[1].hfar = 1.5; Field[1].IntersectMetrics = 1; BoundaryLayer Field = 1; Mesh.Algorithm = 6; Recombine Surface {1}; i.e. there seems to be some strange behavior going on at the edges. However, in the example shown at the link you posted, that isn't happening. Do you have any idea what is wrong? |
||
November 9, 2021, 10:05 |
|
#4 |
Senior Member
Join Date: Oct 2011
Posts: 242
Rep Power: 17 |
Weird, your script works as expected on my machine, see attachment
I am using linux binaries from version 4.8.4 By the way, I guess this geometry is just for testing purposes otherwise if you just need to quad-mesh a square with refinement on one boundary, tranfinite tools are a way simpler approach |
|
November 9, 2021, 10:34 |
|
#5 | |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Quote:
Hmm ... yes that is very strange. What you are getting there is pretty close to what I had hoped to achieve. The version I am using seems to be 4.8.4, which I downloaded and compiled directly from the git repository. I might submit this as a bug report and see if the developers have any idea what might be causing it. Thanks again for your help! P.S. yes, that simple geometry is just a test case to try to get the boundary layer feature working. The real cases I want to analyze are also 2D but a bit more complex - they are rectangular, with a curved boundary re-entrant in one corner (which is where I want to apply the boundary layer). |
||
November 9, 2021, 11:12 |
|
#6 |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Unless it could be down to different default settings you are using (e.g. meshing algorithm)?
|
|
November 9, 2021, 11:15 |
|
#7 |
Senior Member
Join Date: Oct 2011
Posts: 242
Rep Power: 17 |
I downloaded 4.8.4 specifically to run your script, so I did not modify any defaults and ran the script as is. Have you tried to use the precompiled binaries instead of compiling from source ?
|
|
November 9, 2021, 11:23 |
|
#8 | |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Quote:
Ok. No, I haven't tried the precompiled binaries, but thanks for the suggestion. I will download and give them a try |
||
November 9, 2021, 11:31 |
|
#9 | |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
Quote:
I just downloaded the 4.8.4 binary directly from gmsh.info and it seems to be doing exactly the same thing, giving the odd behavior at the edges. Perhaps the issue is with one of the libraries that gmsh depends on (opencascade perhaps)? |
||
November 9, 2021, 11:37 |
|
#10 |
Senior Member
Join Date: Oct 2011
Posts: 242
Rep Power: 17 |
are you running on a linux system ? Sorry I do not have any idea what the reason may be
|
|
November 9, 2021, 12:02 |
|
#11 |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
||
November 10, 2021, 09:36 |
|
#12 |
Senior Member
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 10 |
So, I downloaded the MacOS version of gmsh and with that the boundary layer meshing seems to work fine. So, it must be some sort of bug with the Linux version.
I also applied to join the gmsh gitlab group, so I could report the bug; however, I received an e-mail back saying the request had been denied. Has anyone else reported problems joining their gitlab? |
|
Tags |
gmsh, mesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] layer not added | Rasmusiwersen | OpenFOAM Meshing & Mesh Conversion | 1 | January 2, 2020 10:43 |
My radial inflow turbine | Abo Anas | CFX | 27 | May 11, 2018 02:44 |
[Gmsh] Gmsh Boundary Layer - Wing | bcorr | OpenFOAM Meshing & Mesh Conversion | 0 | April 18, 2012 14:38 |
[snappyHexMesh] Boundary layer generation problems | ivan_cozza | OpenFOAM Meshing & Mesh Conversion | 0 | October 6, 2010 14:47 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |