CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

Where can we find more details about blockMesh's algoritms?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   November 3, 2015, 03:07
Default Where can we find more details about blockMesh's algoritms?
  #1
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Dear Santos,

Thanks for the page on blockMesh. You have introduced me to the world of m4 programming. ;-)

I have a question for you: what is the algorithm used by blockMesh? I am trying to mesh a varying cross-section nozzle and the current code does not perform well when I use a spline along the length.

I found out that it is long standing problem in blockMesh. So, I want to try to correct it but I am lost at the code found in 'blockCreate.C'. It uses weights, importance factors, correction vectors, etc. I do not quite understand it. Do you know of any source (website/paper) that describes the principles behind blockMesh?

Once again, many thanks!
usv001 is offline   Reply With Quote

Old   November 7, 2015, 13:16
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,021
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
@usv001 - Quick answer: I'm not aware of any document that explains how do the internal systems work in blockMesh. But the code is open source and it should be just a matter of inspecting the source code.

If you feel that this is really a bug, then open a bug report on the bug tracker, but please provide more details for the problem itself. If you offer to help with fixing this issue, Henry might be able to provide you with some description of the current limitation that algorithm has got... at least beyond the ones that are already described on the bug tracker. You can find several if you Google:
Code:
site:openfoam.org/mantisbt blockMesh
But AFAIK and remember from a previous analysis I did on it: http://www.openfoam.org/mantisbt/view.php?id=1396 - the algorithm is pretty straight forward: after the points along an edge are calculated, using the standard position along a straight line, they are then transformed with a single transformation if applicable. One limitation with this is that it doesn't take into account multiple space transformations.
wyldckat is offline   Reply With Quote

Old   November 9, 2015, 07:35
Default
  #3
Member
 
Join Date: Sep 2015
Location: Singapore
Posts: 58
Rep Power: 4
usv001 is on a distinguished road
Dear Santos,

Once again, thanks for the reply. Here is what I have done up to now:

I tried to mesh a nozzle of varying cross-section. The current blockMesh algorithm does not scale/propagate the arcs properly along the length of the nozzle. You can see the pictures attached (mesh_before_correction_1 & 2). It is the same bug that was raised earlier.

I tried using the patch provided by Henry (Thanks to Henry!). It seems much better now (mesh_after_correction_1 & 2). But I want to make sure that it really does what it looks like it's doing - that is, it really scales the arc properly.

Earlier I have been trying to mesh just a quarter of the nozzle and using mirrorMesh to obtain the full nozzle. The fix by Henry does not seem to work for that case.

- - -

I have gone through the code in blockCreate.C. I understand that the process starts with identifying the a point on each of the 12 edges which corresponds to the (i,j,k) of the internal point we would like to find. But after that, I am not sure what exactly happens with importance factors, correction vectors, etc.

Thanks for all the help!
Attached Images
File Type: png mesh_before_correction_1.png (44.1 KB, 17 views)
File Type: png mesh_before_correction_2.png (63.1 KB, 13 views)
File Type: png mesh_after_correction_1.png (44.7 KB, 13 views)
File Type: png mesh_after_correction_2.png (53.7 KB, 13 views)
usv001 is offline   Reply With Quote

Old   November 15, 2015, 16:36
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,021
Blog Entries: 39
Rep Power: 109
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answers:
Quote:
Originally Posted by usv001 View Post
I tried using the patch provided by Henry (Thanks to Henry!).
You might want to double-check who posted what in the "Issue History" section of the bug report: http://www.openfoam.org/mantisbt/vie...d=1396#history

Quote:
Originally Posted by usv001 View Post
I have gone through the code in blockCreate.C. I understand that the process starts with identifying the a point on each of the 12 edges which corresponds to the (i,j,k) of the internal point we would like to find. But after that, I am not sure what exactly happens with importance factors, correction vectors, etc.
Back then when I was trying to diagnose what was going on, I had to have the simplest geometry possible, so that I could manually calculate the desired mesh points and then compare the manual calculations with the ones made by the method "Foam::block::createPoints()". And in order to see the values calculated by that method, I used Info calls to output the values. For example:
Code:
Info << "k:" << k << " -> corz4: " << corz4 << endl;
Beyond this, as discussed in the bug report, it's possibly easier to use dynamic meshing, instead of relying on blockMesh. The other possibility is to do the calculations for all points with an outside application and then use an utility to replace the existing points that are created by blockMesh, with the ones created by the other application.
Such an example already exists in OpenFOAM... let me see if I can find the thread... ah the utility is datToFoam and the thread is this one: http://www.cfd-online.com/Forums/ope...rmat-help.html
wyldckat is offline   Reply With Quote

Old   November 17, 2015, 08:45
Default
  #5
Senior Member
 
Karl-Johan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 275
Rep Power: 14
kalle is on a distinguished road
This might be an alternative:
http://www.cfd-online.com/Forums/ope...blockmesh.html

Or look at extBlockMesh as discussed in the bug report. extBlockMesh may not handle grading, though.
kalle is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFoam171: error /usr/bin/ld: cannot find -llduSolvers Schipper OpenFOAM Programming & Development 5 November 15, 2012 15:13
Ways to find Mass transfer coefficient using CFD? tuks_123 CFX 10 April 15, 2011 11:20
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31
user defined function cfduser CFX 0 April 29, 2006 10:58
Fluent 5.5. What the differences with fluent 5.3?? confused FLUENT 2 July 29, 2001 21:58


All times are GMT -4. The time now is 04:22.