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

[blockMesh] Grading calculation equations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2023, 09:52
Default Grading calculation equations
  #1
Member
 
ishan
Join Date: Oct 2017
Posts: 77
Rep Power: 8
ishan_ae is on a distinguished road
I am trying to understand the equations behind the total expansion ratio calculation and simpleGrading in general. I know that the grading is based on geometric progression.

The following quantities are of interest to us:
L = edge length
\delta_s = length of the start cell
N = number of cells
\delta_e = length of the end/last cell
r = common ratio or cell-to-cell expansion ratio(i think so)
e_r = total expansion ratio

The common ratio is:
r = \frac{\delta_e}{\delta_s} ^{\frac{1}{N-1}}

In the above equation, e_r = \delta_e/\delta_s is the the total expansion ratio which we need to use in simpleGrading input.

The summation of all the geometric terms( cell lengths in this case) is the length of the edge L:
L = \frac  {\delta_s (1 - r^N)} {1 -r}

If we know \delta_s , L and N, we can re-formulate the above equation into a polynomial in terms of r:
\delta_s \cdot r^{N} - r\cdot L + L = 0

We can numerically find the root of the above polynomial which will give us the value of r. Once we know the know the common ratio, the calculation of \delta_e and finally the much needed e_r is straightforward.

Now the issue is that when I tried to solve the above polynomial equation numerically(Newton's method), it finds the root but it's values does not match with the grading calculator script here https://openfoamwiki.net/index.php/S...ng_calculation.I tried to dig deeper into the code of the calculator but I understood very little.


The reason why I want to know more about this is because I want to automate a portion of my grading using a Python script since I have a lot of blocks to generate the grading for.

Can someone please point me in the right direction ?
ishan_ae is offline   Reply With Quote

Old   April 7, 2023, 10:34
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Sure. My old friend Cedo says the most human way to define the grading is the size ration of the first to last cell. This, grading ratio of 5 means that the last cell is 5 times larger than the first. For the opposite effect, you would use 0.2
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   April 7, 2023, 17:57
Default
  #3
Member
 
ishan
Join Date: Oct 2017
Posts: 77
Rep Power: 8
ishan_ae is on a distinguished road
I just checked the user guide and this explanation matches with the definition of the total expansion ratio. Thank you !

How would we approach the problem if we have the first cell height , the edge length and the number of cells? Mathematically, I don't see any other way other than solving for the root which, would be the common ratio.
ishan_ae is offline   Reply With Quote

Old   January 8, 2024, 00:42
Default
  #4
New Member
 
Join Date: Jan 2024
Posts: 1
Rep Power: 0
William_Sewell is on a distinguished road
The grading calculation formulae employed by educational institutions can differ depending on the grading system and the specific criteria applied.

https://www.calculatorcube.com/
William_Sewell is offline   Reply With Quote

Reply

Tags
blockmesh simplegrading


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
Calculation diverges, Liquid behavior around a rotating object toru OpenFOAM Running, Solving & CFD 0 December 1, 2016 10:54
Favre averaged Navier-Stokes equations help siw Main CFD Forum 3 June 24, 2016 11:26
Dynamic mesh adaption in parallel calculation xh110120 FLUENT 1 March 12, 2016 08:05
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
? fluctuating equations for homogenous shear turb. ff_fan Main CFD Forum 1 September 20, 2002 07:39


All times are GMT -4. The time now is 15:23.