Gmsh: Structured variation in gridsize
Greetings!
While I have a rudimentary understanding of how to use the Transfinite Surface and Recombine Surface functions to make a structured mesh, I'm more confused on getting them to make a structured mesh whos mesh density varies. Problem description: I have a channel. Inside, on the bottom of the channel, there is a series of complex geometries. I want to make the inlet, outle, and both sides cyclic. As such, I need to make those (perfectly rectangular) surfaces structured (the kind of structure is irrelevant, as long as it matches the opposing side). I manage to do this when I use the same gridsize everywhere on the surface, but I want to make the bottom part much denser than the top. Anyone know how to do this or can link me to a good tutorial for this? I can seem to find any that deal with this issue. 
Hi Anders,
There are basically two different stretching functions available for a line in GMSH. One applies the stretching to one end of the line and another to both ends of the line (Progression and Bump). The GMSH documentation has a tutorial which shows how to use them. Regards, Mikko 
How to calculate grid size when Progression or Bump is used?
Dear Mikko and other Gmsh users.
Is there formulation to calculate grid size when progression or bump is used in gmsh? Thank you in advance :) 

Thank you for your link, Mikko.
I need to scrutinize the page and search for other resources. I’ll post when I get some info. 
Quote:
Did you find your answer about progression and Bump? I am also looking for a clarity of progression and Bump in Gmsh. If you got it, Can you please share it for me? Cheers Razon 
1 Attachment(s)
Quote:
Sorry for late reply. Actually I didn't think about this problem so much. But I studied to reply to your question and I have the answer for 'progression' for now. The progression is geometric sequence(https://www.mathsisfun.com/algebra/s...geometric.html) For a given curve, let the length of it as 'l' and this is the sum of a geometric series. When you transfinite the curve with the number of points(np) and progression(r). Then the relationship among the first distance(a), total curve length(l), number of points(np) and progression(r) in the viewpoint of geometric series, np is to be replaced with number of 1D elements(n = np1, ex: if there is 11 points then number of 1D elements are 10) Then, according to the formula for the sum of geometric series... Code:
l=a(r^n  1)/(r1) Code:
a=l*(r1)/(r^n  1) simple code is as below Code:
Point(1) = {0, 10, 0, 1e1}; Actually you can find a explantion for progress in gmsh guide Code:
(Progression 2 meaning for example that each line element in the series will be twice as long as the preceding one). https://gitlab.onelab.info/gmsh/gmsh.../meshGEdge.cpp It's not easy to understand but you might calculate the first point with your setting at least. Good luck 
3 Attachment(s)
Quote:
Fantastic explanation. It does make sense to me. First of all, sorry for my late reply as I was not at my office. I understood your explanation about progression. Now lets be a bit more realistic about whats happening in the Gmsh screen when playing with progression. Please have a look at the attachment. I made a simple square cube with 10x10 cells using Gmsh. Lets say, I would like to keep more dense cells close to the left wall (line 1) using progression. I played with changing progression value but no luck so far. Could you please tell how can I do that? Cheers Razon 
Quote:
you have to choose 2 curves for transfinite. The left and the right. if the grids are not even after transfinite, then Probably you can fix it just change the sign for one side of the curves If the curve numbers are 1 ,2 then From Transfinite curve {1, 2} To Transfinite curve {1, 2} Good luck~ 
All times are GMT 4. The time now is 17:23. 