[Gmsh] Question about Progression and Bump

Ruth Vazquez Sabariego ruth.sabariego at kuleuven.be
Wed Oct 24 16:27:41 CEST 2018

Dear Nathan,

As you have noticed, the Bump does not do a double geometrical progression.
The formula used is a bit more complicated, you can see what it actually does in the code (meshGEdge.cpp).

A double progression is not (yet?) available.
Work around by dividing your second region in two?


Prof. Ruth V. Sabariego
KU Leuven
Dept. Electrical Engineering ESAT/Electa, EnergyVille

Free software: http://gmsh.info | http://getdp.info | http://onelab.info

On 23 Oct 2018, at 22:07, Nathan J. Neeteson <nneeteson at rglinc.com<mailto:nneeteson at rglinc.com>> wrote:


I have a question about using Progression and Bump in neighboring blocks in a block-structured mesh. What I want is for the two blocks to have cells of the same height where they meet. I know the thickness of the first cell from the wall (dx0), the length of each line (L), and the progression I want (r), so when I’m using Progression I can calculate the number of nodes to use as N = log(1+(L*(r-1))/(dx0)) / log(r) – 1. Then I can set the appropriate lines to Transfinite and assign them N Using Progression r and it works as expected.

However, in one of my blocks I want to refine towards both the top and bottom, so I need to use the Bump option. The problem is that I have no idea what “r” value to use after Bump (using the same r value as is used for Progression does not give me the results I want) and I also have no idea how to calculate the number of points to use along this line. MY first instinct was to calculate the number of points needed as double the number of points for a single progression with half of the length (two progressions end to end). I think this is right, but when I use r after Bump I get no refinement. What value am I supposed to use for number of points and the rate of growth when using the Bump function so that I get the equivalent of the product of two Progressions end to end?

Here is a zoomed in look at where I want the first cells to match heights:

The bottom block uses single progression and the upper block you are seeing the lower end of the double progression.

Here is my .geo file:
// orifice properties
orificeLength = 0.03;
orificeRadius = 0.002;

// pipe properties
pipeRadius = 0.05;

// distance from orifice to inlet
inletDist = 5*pipeRadius;

// distance from orifice to outlet
outletDist = 5*pipeRadius;

// grid size parameters
r = 1.1; // growth parameter
dx0 = 1*10^(-4); // first wall dist for y+=1

upstreamNx = (Log(1 + ((inletDist*(r-1))/(dx0))) / Log(r)) - 1; // number of elements in x direction upstream
downstreamNx = (Log(1 + ((outletDist*(r-1))/(dx0))) / Log(r)) - 1; // number of elements in x direction upstream
orificeNx = orificeLength/dx0; // number of elements in x direction inside orifice

upstreamOrificeNy = orificeRadius/dx0;
upstreamPipeNy = 2*((Log(1 + ((((pipeRadius-orificeRadius)/2)*(r-1))/(dx0))) / Log(r)) - 1);

// element index
i = 1;

// ~~-------------------------~~ POINTS ~~-------------------------~~
// order of point definition doesn't matter, just give descriptive names

inletCenterPoint = i;
Point(i) = {-orificeLength-inletDist,0,0,1};

inletPipeWallPoint = i;
Point(i) = {-orificeLength-inletDist,pipeRadius,0,1};

inletOrificeWallPoint = i;
Point(i) = {-orificeLength-inletDist,orificeRadius,0,1};

upOrificeCenterPoint = i;
Point(i) = {-orificeLength,0,0,1};

upOrificePipeWallPoint = i;
Point(i) = {-orificeLength,pipeRadius,0,1};

upOrificeOrificeWallPoint = i;
Point(i) = {-orificeLength,orificeRadius,0,1};

// ~~-------------------------~~ LINES ~~-------------------------~~
// all lines should be defined going up and/or to the right for consistency

inletOrificeLine = i;
Line(i) = {inletCenterPoint,inletOrificeWallPoint};

inletPipeLine = i;
Line(i) = {inletOrificeWallPoint,inletPipeWallPoint};

upstreamPipeWallLine = i;
Line(i) = {inletPipeWallPoint,upOrificePipeWallPoint};

upstreamCenterLine = i;
Line(i) = {inletCenterPoint,upOrificeCenterPoint};

upstreamOrificeLine = i;
Line(i) = {inletOrificeWallPoint,upOrificeOrificeWallPoint};

upstreamOrificePlateLine = i;
Line(i) = {upOrificeOrificeWallPoint,upOrificePipeWallPoint};

upstreamOrificeEntryLine = i;
Line(i) = {upOrificeCenterPoint,upOrificeOrificeWallPoint};

// ~~-------------------------~~ LINE LOOPS ~~-------------------------~~
// all line loops should be oriented clockwise

upstreamPipeLoop = i;
Line Loop(i) = {inletPipeLine,upstreamPipeWallLine,-upstreamOrificePlateLine,-upstreamOrificeLine};

upstreamOrificeLoop = i;
Line Loop(i) = {inletOrificeLine,upstreamOrificeLine,-upstreamOrificeEntryLine,-upstreamCenterLine};

// ~~-------------------------~~ PLANE SURFACES ~~-------------------------~~

upstreamPipePlane = i;
Plane Surface(i) = upstreamPipeLoop;

upstreamOrificePlane = i;
Plane Surface(i) = upstreamOrificeLoop;

// ~~-------------------------~~ MAKE STRUCTURED ~~-------------------------~~

// the x-oriented lines upstream of the orifice
Transfinite Line{-upstreamCenterLine,-upstreamOrificeLine,-upstreamPipeWallLine} = upstreamNx Using Progression r;

// the x-oriented lines in the orifice

// the x-oriented lines downstream of the orifice

// the y-oriented lines from the centerline to the orifice radius
Transfinite Line{inletOrificeLine,upstreamOrificeEntryLine} = upstreamOrificeNy;

// the y-oriented lines from the orifice radius to the pipe radius
Transfinite Line{inletPipeLine,upstreamOrificePlateLine} = upstreamPipeNy Using Bump 0.05;

Transfinite Surface{upstreamOrificePlane};
Recombine Surface{upstreamOrificePlane};

Transfinite Surface{upstreamPipePlane};
Recombine Surface{upstreamPipePlane};


Nathan J. Neeteson, M.Sc.
Flow Control Research Engineer
RGL Reservoir Management Inc.
Engineering & Design Group
P. 403.930.0371 (ext. 8371)<tel:403.930.0371;8371> | C. 613.929.6283<tel:613.929.6283>
nneeteson at rglinc.com<mailto:nneeteson at rglinc.com> | rglinc.com<http://rglinc.com/>
API Q1™ and ISO 9001:2015 certified facilities.
NOTE: Email and URL addresses have recently changed

Email disclaimer located at http://rglinc.com/disclaimer _______________________________________________
gmsh mailing list
gmsh at onelab.info<mailto:gmsh at onelab.info>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20181024/020f23dc/attachment-0001.html>

More information about the gmsh mailing list