About Simple Grading in blockMesh
I understand simple grading is the ratio between the size of the end cell and the size of initial cell.
How about the cell size in between, what kind of changes they follow to reach the final cell? Like constant changes? For instane, the first cell is size 10 and the last cell is size 5, the middle cells will have a size 10-dx*(N-1) ? where the dx is the constant changes between cells, N is the number of cells in that direction. This is how i understand it, not sure if thats right. I am writing a small code to output the cell ID by just inputting the x,y coordinates, however i realised that it only work fine for uniform distributed mesh, not the one with gradings. Hence i came out with this question. Any one have any suggestions? (Or if anyone has faster way to output cell ID (in paraview) and dont mind share with me) Many Thanks. |
Hi,
The expansion is geometric, not arithmetic. Here is a useful tool that gives you an idea about the expansion from the start cell to the end cell: https://openfoamwiki.net/index.php/S...ng_calculation |
Apologies, I did not try to debug your maths above, but for simplicity I will give you the correct expressions below in a simpler and more standard terminology.
For a set of cells, with vertices , where varies from 0 to , then the cell width is the gap between the vertices. If we define a constant stretching rate of then: Armed with this, you can get to the following: now , the ratio of the last to the first cell width, so: The 's form a geometric progression, the sum of which is: So, the coord of vertex is: Finally, the cell centre is defined as so you can then calculate the cell coords using . This is probably what you are outputing from OpenFOAM when you are doing the comparison. Here's a worked example: n = 5 beta = 1.3 r = 2.8561 i, x, dx, xc 0 0.000 0.100 0.050 1 0.100 0.130 0.165 2 0.230 0.169 0.315 3 0.399 0.220 0.509 4 0.619 0.286 0.762 5 0.904 Hope this helps - good luck! (PS - can someone tell me how to format a table in a post, to get the spacing right?) |
Thanks for your reply, your formula gets me very close. Given a length , the width of the start cell and the end cell one can compute the number of cells using the equations
Solving yields such that For I then get and (rounded from ) Comparing this to the "Scripts/blockMesh grading calculation"-tool we have Ps. I do not think it is possible to create tables here considering the lacking response on this post https://www.cfd-online.com/Forums/vi...t-example.html |
All times are GMT -4. The time now is 09:13. |