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

[Gmsh] Gmsh bump functionn..

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2017, 16:41
Default Gmsh bump functionn..
  #1
New Member
 
Flyer
Join Date: Apr 2017
Posts: 13
Rep Power: 9
OpenFoam12 is on a distinguished road
Hi,

I am trying to understand the double progression (Bump) in gmsh, but I can't wrap my head around it. I have searched on-line and came to the following code;

Code:
Point(1) = {0,0,0,1}; 
Point(2) = {1,0,0,1}; 
Point(3) = {3,0,0,1}; 
Point(4) = {7,0,0,1}; 
Point(5) = {15,0,0,1};  
n = 4; // number of intervals
r = 2; // progression  // progression using transfinite mesh  
Point(6) = {0,0.4,0,1}; 
Point(7) = {15,0.4,0,1}; 
Line(1) = {6,7}; 
Transfinite Line {1} = n+1 Using Progression r; 
 // progression using extruded mesh  
a = (r - 1) / (r^n - 1); 
one[0] = 1; 
layer[0] = a; 
For i In {1:n-1}    
one[i] = 1;   
layer[i] = layer[i-1] + a * r^i; 
EndFor 
Point(10) = {0,0.8,0,1}; 
Extrude {15,0,0} {    
Point{10}; 
Layers{one[], layer[]}; }
Ref: http://onelab.info/pipermail/gmsh/2008/003526.html

For some reason, I could not understand what they were trying to explain in the above code, which creates node map using layers to represent a transfinite line using bump. The discussion was about how to use Bump function, but it wasn't clear how to calculate it. There are so many tools for single progression on-line. However, this Bump function isn't clear. Example, if I had the same line and same number of nodes, how would we calculate bump to maintain the same cell size in different blocks.

Any help would be appreciated.

Thanks,

Last edited by OpenFoam12; July 22, 2017 at 19:37.
OpenFoam12 is offline   Reply With Quote

Old   August 8, 2017, 21:05
Default
  #2
New Member
 
Flyer
Join Date: Apr 2017
Posts: 13
Rep Power: 9
OpenFoam12 is on a distinguished road
I was wondering if anyone knows how to calculate grades when using the bump in Gmsh. I have gone through the source code but still unable to get the right grade when the number of nodes as well as the length and first cell height are knowns. So the formula in Gmsh is as follows;

Code:
    case 2: // Bump
      {
        double a;
        if(coef > 1.0) {
          a = -4. * sqrt(coef - 1.) * atan2(1., sqrt(coef - 1.)) /
            ((double)nbpt *  length);
        }
        else {
          a = 2. * sqrt(1. - coef) * log(fabs((1. + 1. / sqrt(1. - coef)) /
                                              (1. - 1. / sqrt(1. - coef))))
            / ((double)nbpt * length);
        }
        double b = -a * length * length / (4. * (coef - 1.));
        val = d / (-a * SQU(t * length - (length) * 0.5) + b);
      }
So, the above code shows the equations used when using Bump function for a specified grade. For example,

Code:
Transfinite Line {1, 3} = 10 Using Bump 0.8;
In this case, Gmsh will take 0.8, which corresponds to coef, and then calculate "a". "a" in this case supposed to be the first cell height. However, it is not according to my calculations. Anyone knows this formula could provide some insights?

Thanks,
OpenFoam12 is offline   Reply With Quote

Old   March 3, 2021, 02:49
Default
  #3
New Member
 
Ze Shao
Join Date: Apr 2019
Posts: 4
Rep Power: 7
sz617896964 is on a distinguished road
Hi,

Have you worked out how to use Bump to calculate the mesh size? I have tried to specify the first layer mesh size (a), the number of points(nbpt) and the length of the line (L). Then, the coefficient can be derived. However, it is incorrect when I use the calculated coefficient and the number of points, as the first layer size is not what I need.

If you have worked out, would you please give some hints to me.

Thanks.
sz617896964 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
[Gmsh] Converting gmsh to OpenFoam Friendly OpenFOAM Meshing & Mesh Conversion 3 June 26, 2018 05:46
[Gmsh] Using Bump with Extrude, layers in GMSH?? arieljeds OpenFOAM Meshing & Mesh Conversion 7 June 14, 2018 23:22
GMSH - Very strange effect - Mesh elements deleted when saving Araist Mesh Generation & Pre-Processing 3 July 15, 2015 06:03
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56


All times are GMT -4. The time now is 11:36.