CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] BlockMesh grading calculator (https://www.cfd-online.com/Forums/openfoam-meshing/61785-blockmesh-grading-calculator.html)

hartinger April 12, 2005 07:55

BlockMesh grading calculator
 
Hi everybody,

i've written a calculator for the grading in the blockMesh format some time ago. It relates length, number of cells, total expansion ration, cell-to-cell expansion ratio, start cell size and end cell size.
Given the length and any two of the other, the remaining values are calculated.

It's a little programm, but I found it myself useful generating meshes with blockMesh.
If someone improves it, let me know

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif MeshSpace.tar.gz

regards
Markus

hjasak April 12, 2005 09:36

Actually, the grading factor i
 
Actually, the grading factor in blockMesh is defined as the ratio of the last to first cell size, which is much better behaved that defining the number of cells and the geometric expansion ratio. I suppose we have both done the same thing :-)

Hrv

msrinath80 December 19, 2006 00:09

Hi Markus, Thanks for the u
 
Hi Markus,

Thanks for the utility. I found it very useful; esp. to find out the number of cells when one knows the start and end cell sizes in addition to the length.

I had to edit the Makefile to remove the reference to the bin subdirectory which does not exist. A sample of the utility usage is shown below for those who need to know how to use it:

madhavan@karmayug:~/MeshSpace$ ./MeshSpace ds de 0.58 0.000625 0.003125

Meshspace results by Markus.Hartinger@imperial.ac.uk :
Length L : 0.58
Number of cells n : 373
Total expansion ratio r : 5
Cell-to-cell expansion k : 1.00434
Start cell size ds: 0.000625305
End cell size de: 0.00312652

madhavan@karmayug:~/MeshSpace$

armin_h February 6, 2007 04:08

Hi Markus Would you please
 
Hi Markus

Would you please tel me how your calcualtor works?
i Couldent open that.

Cheers

msrinath80 August 26, 2008 18:29

I get this error with gcc 4.3.
 
I get this error with gcc 4.3.1 when running make.

Any idea what is wrong?

g++ -g -c MeshSpace.cpp
MeshSpace.cpp: In function 'int main(int, char**)':
MeshSpace.cpp:35: error: 'exit' was not declared in this scope
MeshSpace.cpp:38: error: 'atof' was not declared in this scope
make: *** [MeshSpace.o] Error 1

msrinath80 September 1, 2008 16:25

Problem solved. It was just a
 
Problem solved. It was just a question of adding:

#include <cstdlib>

to MeshSpace.cpp and TEdgeSpace.cpp

83_Ale_83 July 21, 2010 09:36

Sorry, which is the problem??

5:45 ale@alien:~/MeshSpace$ make
g++ -g -c MeshSpace.cpp
g++ -g -c TEdgeSpace.cpp
g++ -g -o bin/MeshSpace MeshSpace.o TEdgeSpace.o
/usr/bin/ld: cannot open output file bin/MeshSpace: No such file or directory
collect2: ld returned 1 exit status
make: *** [MeshSpace] Errore 1

boger July 22, 2010 07:37

Quote:

Originally Posted by 83_Ale_83 (Post 268336)
Sorry, which is the problem??

If you read back a few posts, Srinath has already given the answer to this problem (and the next one you'll encounter). Delete bin/ from the Makefile, and include <cstdlib> in both .cpp files.

83_Ale_83 July 22, 2010 08:04

Quote:

Originally Posted by dab143psuedu (Post 268503)
If you read back a few posts, Srinath has already given the answer to this problem (and the next one you'll encounter). Delete bin/ from the Makefile, and include <cstdlib> in both .cpp files.

What a useless question I have done, I have missed the post
Thank you

nileshjrane September 4, 2010 17:40

Stupid question..
 
How to give the arguments to the program??? I didnt get it..:(

Sorry for this stupid question.;)

83_Ale_83 September 6, 2010 03:19

Quote:

Originally Posted by nileshjrane (Post 274036)
How to give the arguments to the program??? I didnt get it..:(

Sorry for this stupid question.;)


Look at the third post; it's just an example;)

nileshjrane September 6, 2010 05:44

Oh yes...i just overlooked it..i was trying meshspace value ds value de value...etc

blaise December 22, 2010 05:02

Broken Link?
 
Hi,

I cannot download the .tar.gz file. All I get is a short html file saying that the file I was looking for was not found on the server. This is saved with a .unk file extension. Using wget http://... brings the same result.

Can anybody shed some light on this? Or send me the file via email to pascal \at\ pascal-anschau \dot\ de?

Thanks in advance!

Cheers, Pascal.

la7low May 15, 2011 12:14

Quote:

Originally Posted by armin_h (Post 206220)
Hi Markus

Would you please tel me how your calcualtor works?
i Couldent open that.

Cheers

I think it solves the equations I posted there: http://www.cfd-online.com/Forums/ans...tml#post307694

Just rename the downloaded file to "MeshSpace.tar.gz", extract it, then it should work.

bigbang June 16, 2011 13:51

Quote:

Originally Posted by boger (Post 268503)
If you read back a few posts, Srinath has already given the answer to this problem (and the next one you'll encounter). Delete bin/ from the Makefile, and include <cstdlib> in both .cpp files.

Thanks. This tools is just what I was looking for to mesh my boundary layer! Good show.

prameelar August 17, 2011 12:31

Hi Srinath,

I am new to OpenFoam.
I need to create a mesh for channel with non linear mesh.
My node spacing is 12% increment for first 20 nodes near wall and 1.5 times viscous length scale and then 8% near the cwnter line and same on the otherside of the center line too..
I am confused how do I can take expansin ration?

Thanks in advance,

Prameela.

bigbang August 17, 2011 13:27

Hi Pam,

I would suggest first learning how to use blockMesh utility with openFOAM. You will need to separate the mesh into separate blocks for each grading.

First do a couple of the tutorials here to learn

Then use hartinger's tool to specify the grading based on your requirement.

Good luck.

hhh February 27, 2012 04:01

Blockmesh
 
Dear Foamers,
i have xyz coordinates(that is model have 33 coumns and 225 rows in .csv file format) how i import and create blockmesh andbody have idea please let me know.

Thanks for the answer in advance!

Slackware_user April 8, 2012 09:32

first: are these coordinates of block vertices?
second: if so u can easyli write converter that will pull vertices of that file and create blocks, faces and edges.

if not that is not so easy.

Hint: remember that spline edges use mirror of last point for approxymation of y' in last point.

hhh April 9, 2012 02:10

blockmesh-flapping wing
 
Dear Slackware_user,
thanks for your reply

first: these are the 3Dmodel coordinates generated in matlab,i have xyz coordinates of that model.for example generally people goes for cad model, same thing of that cad model but thing is i have coordinates, in matlab(that is model have 33 coumns and 225 rows xyz coordinates in .csv file format)how i can go for blockmesh.


Thanks for the answer in advance!

Slackware_user April 9, 2012 12:21

I mean if these coordinates represent lines or smth else or just points on surface in random locations.

generally the question is is it possible to split model into blocks by splines, arks or just lines with coordinates at these points.

kev4573 October 10, 2012 13:55

I find myself using this tool quite a bit. Can we get this put in a repo somewhere and maintained?

Kind regards,
Kevin

EFoster2 February 14, 2014 12:10

Great Post and great utility!

In some sections of my block mesh I want the start to be fine then become gradually more coarse by the mid point then become fine again at the end? The only way I can think this can be done is by splitting the original block in two. Is there any way this can be done with out having to split it?

Euan Foster

gschaider August 13, 2014 18:13

Inspired by the original utility I implemented a calculator for the mesh grading and put it onto the Wiki: http://openfoamwiki.net/index.php/Sc...ng_calculation.

It is a WebApp so no need to install it (browser is all you need). If you want to do so anyway or improve it you find the sources at https://bitbucket.org/bgschaid/blockmeshgradingweb

gschaider August 14, 2014 06:45

Quote:

Originally Posted by gschaider (Post 505854)
Inspired by the original utility I implemented a calculator for the mesh grading and put it onto the Wiki: http://openfoamwiki.net/index.php/Sc...ng_calculation.

It is a WebApp so no need to install it (browser is all you need). If you want to do so anyway or improve it you find the sources at https://bitbucket.org/bgschaid/blockmeshgradingweb

There are still some issues which are related to the Wiki-Software (Caching etc). Working on it.

HPE November 23, 2020 07:49

Hello,

Is the utility repository still alive?

https://bitbucket.org/bgschaid/blockmeshgradingweb

Seems to be lost at the time of writing.

Thanks.

gschaider November 23, 2020 08:54

1 Attachment(s)
Quote:

Originally Posted by HPE (Post 788564)
Hello,

Is the utility repository still alive?

https://bitbucket.org/bgschaid/blockmeshgradingweb

Seems to be lost at the time of writing.

Thanks.


Problem is that BitBucket cancelled the only thing that made it worthwhile: support for Mercurial repositories and at the time I didn't bother to set up the repo anywhere else


If you're really interested I attached a bundle with the repo. To use it you've got to extract it into a Mercurial repo. In the directory where you stored it

Code:

gunzip blockMeshGradingWeb.bundle.gz
mkdir blockMeshGrading
cd blockMeshGrading
hg init .
hg unbundle ../blockMeshGradingWeb.bundle --update


HPE November 23, 2020 12:18

Thank you very much for this contribution.

I will push a public git repo somewhere when I get some time off.

gschaider November 23, 2020 17:04

Quote:

Originally Posted by HPE (Post 788603)
Thank you very much for this contribution.

I will push a public git repo somewhere when I get some time off.


Go ahead.


Although part of me says "Had I known that it will end up in the 'Windows of version control systems' I would have thought twice". But that way I don't feel responsible for it anymore (didn't touch the code since 2014 anyway. From what I remember the coding is .... interesting)

HPE November 28, 2020 11:15

Thank you very very much for your code and contributions in all aspects of OpenFOAM.

Please see the public repo in GitLab: https://gitlab.com/herpes-free-engin...meshgradingweb


All times are GMT -4. The time now is 14:34.