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

blockMesh with double grading.

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

Like Tree54Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   May 24, 2013, 06:17
Default
  #41
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi Bruno
I need it on OF 2.2.0
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 24, 2013, 06:30
Default
  #42
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Quote:
Originally Posted by immortality View Post
Hi Bruno
I need it on OF 2.2.0
Ehsan, go ahead and try the code and see if it works. There is a good chance no changes are required.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   May 24, 2013, 07:29
Default
  #43
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
OK.thanks.compiled without error.
but in conventional way we have for example:
Code:
hex (0 1 4 3 9 10 13 12) (400 40 1) simpleGrading (2 4 1)
in (2 4 1) each number is related to (positive x-direction,y-direction,z-direction)
and its clear.
but in simpleGrading how it is implemented?
I expected something like: ((1 2 3)(4 5 6)(7 8 9)) for double grading,could anyone enlighten me?
Code:
hex (0 1 2 3 4 5 6 7) (20 10 20) simpleGrading (-5 1 1)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

Last edited by immortality; May 24, 2013 at 08:35.
immortality is offline   Reply With Quote

Old   May 24, 2013, 18:15
Default
  #44
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,314
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Anton:
Quote:
Originally Posted by akidess View Post
Bruno, did you ever test it on 2.2? If so, we could add the 2.2 template to the wiki...
Nope, I only had time to build it and to fix the zip related instructions. I'll try to give it a spin tomorrow, using the case from post #25.

@Ehsan: Check the wiki: http://openfoamwiki.net/index.php/Co...ckMeshDG#Usage - and check the examples shown in this thread you're reading.

Best regards,
Bruno
Tushar@cfd likes this.
wyldckat is online now   Reply With Quote

Old   May 25, 2013, 03:47
Default
  #45
New Member
 
steve
Join Date: Sep 2012
Posts: 15
Rep Power: 4
greenleader is on a distinguished road
Quote:
Originally Posted by akidess View Post
Bruno, did you ever test it on 2.2? If so, we could add the 2.2 template to the wiki...
I've used it with OF v2.2.0 - no issues with it - it just works!
wyldckat likes this.
greenleader is offline   Reply With Quote

Old   May 25, 2013, 05:34
Default
  #46
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
its only this:
Code:
For example, simpleGrading (1 -2 1) in blockMeshDict means the created mesh has cells two times larger in the center than those at the side.
which side we are talking about in grading?if its a 3D mesh it means it has less cells in the middle of domain but we want both sided grading in each face of domain.
what we can do when we want different grading in different directions?it seems nothing!
although this work is valuable but has some defects in it.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   May 25, 2013, 07:15
Default
  #47
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,314
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings to all!

@Steve: Many thanks for the report!
@Anton: Wiki page updated.

@Ehsan:
Quote:
Originally Posted by immortality View Post
which side we are talking about in grading?if its a 3D mesh it means it has less cells in the middle of domain but we want both sided grading in each face of domain.
"simpleGrading (1 -2 1)" - The minus 2 is for the Y direction.

You might not see much with just "(1 -2 1)", because it's just an example; it implies that the person reading the instructions already has some experience with blockMesh's original grading capabilities, which are explained in the OpenFOAM User Guide, section "5.3 Mesh generation with the blockMesh utility", more specifically subsection "5.3.1.3 The blocks": http://www.openfoam.org/docs/user/blockMesh.php

Best regards,
Bruno
wyldckat is online now   Reply With Quote

Old   May 25, 2013, 07:41
Default
  #48
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
thanks.so it only do double grading.if someone likes single grading in x-direction as well as double grading in y-direction can combine blockMesh and blockMeshDG together?I still think we need a more powerful tool in meshing.
------------------------------------------------------
I tested it by a very coarse mesh:
Code:
hex (0 1 2 3 4 5 6 7) (10 8 1) simpleGrading (-2 -4 1)
and works fine as the attachment.it made me free of so many excess points and blocks!
Attached Images
File Type: jpg Mesh_coarse.jpg (13.3 KB, 79 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

Last edited by immortality; May 25, 2013 at 11:45.
immortality is offline   Reply With Quote

Old   May 27, 2013, 06:36
Default Uneven number of cells
  #49
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 166
Rep Power: 14
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Hello,

I noticed a problem when using double grading and an uneven number of cells.
Attached Images
File Type: jpg doubleGradingProblem.jpg (52.5 KB, 87 views)

Last edited by GerhardHolzinger; May 27, 2013 at 07:46.
GerhardHolzinger is offline   Reply With Quote

Old   May 27, 2013, 07:41
Default
  #50
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Please attach your blockMeshDict.

Quote:
Originally Posted by GerhardHolzinger View Post
Hello,

I noticed a problem when using double grading and an uneven number of cells.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   May 27, 2013, 07:48
Default
  #51
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 166
Rep Power: 14
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Here is my blockMeshDict.
Attached Files
File Type: txt blockMeshDictDG.txt (3.7 KB, 41 views)
GerhardHolzinger is offline   Reply With Quote

Old   May 27, 2013, 08:04
Default
  #52
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Gerhard, I think your edgeGrading is botched. Double check while referring to figure 5.5 of the user manual for the edge numbering.

Edit: I take that back for now Need to look into this a bit more carefully.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   May 27, 2013, 09:54
Default
  #53
New Member
 
steve
Join Date: Sep 2012
Posts: 15
Rep Power: 4
greenleader is on a distinguished road
Yes, I seem to recall that doublegrading does not work with an odd number of cells. I always make sure I use an even number.
greenleader is offline   Reply With Quote

Old   July 23, 2013, 08:49
Default In combination with edge Grading
  #54
New Member
 
Aditya
Join Date: May 2013
Location: Munich Germany
Posts: 27
Rep Power: 4
kingmaker is on a distinguished road
Hello

Do any one know if this utility works with edge grading also.. ?
Like if we say one of the values in edge grading to be -ve ... will that edge be graded on both sides .. ??

Thank you
kingmaker is offline   Reply With Quote

Old   July 23, 2013, 09:06
Default
  #55
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
I think Gerhard had success using edge grading. Just be sure to specify an even number of cells.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   July 23, 2013, 09:27
Default Snappy Hex Mesh and BlockMeshDG
  #56
New Member
 
Aditya
Join Date: May 2013
Location: Munich Germany
Posts: 27
Rep Power: 4
kingmaker is on a distinguished road
Quote:
Originally Posted by akidess View Post
I think Gerhard had success using edge grading. Just be sure to specify an even number of cells.
Hello Thank you for your answer. I will try and post if I have any problems.
Mean while, I have one more question, can we use snappy hex mesh after blockMeshDG with out any problems ... ??

Thank you
immortality likes this.
kingmaker is offline   Reply With Quote

Old   August 1, 2013, 04:40
Default Some problem with lineDivide.C
  #57
New Member
 
ME
Join Date: Mar 2012
Posts: 1
Rep Power: 0
roamer is on a distinguished road
Hello Everyone,

Thanks for sharing. But for some meshes using this "double grading" create high aspect ratio meshes and non-orthogonal faces.
I found that a minor editing to the file curvedEdges/lineDivide.C solves the problem.

Code:
        if ( xratio > 0 )
        {
        for (label i=1; i < ndiv; i++)
        {
            divisions_[i] = (1.0 - pow(xratio, i))/(1.0 - pow(xratio, ndiv));
        }
        }
        else
        {
            for (label i=1; i < ndiv; i++)
            {
                if ( i <= ndiv/2.0 )
                {
                    divisions_[i] = (1.0 - pow(-xratio, i))/(1.0 - pow(-xratio, ndiv/2))/2;
                }
                else
                {
                    divisions_[i] = 1.0-(1.0 - pow(-xratio, ndiv-i))/(1.0 - pow(-xratio, ndiv/2))/2;
                }
            }
        }
To this:
Code:
        if ( xratio > 0 )
        {
        for (label i=1; i < ndiv; i++)
        {
            divisions_[i] = (1.0 - pow(xratio, i))/(1.0 - pow(xratio, ndiv));
        }
        }
        else
        {
            for (label i=1; i < ndiv; i++)
            {
                if ( i <= ndiv/2.0 )
                {
                    divisions_[i] = (1.0 - pow(-xratio, i))/(1.0 - pow(-xratio,ndiv/2.0))/2.0;
                }
                else
                {
                    divisions_[i] = 1.0-(1.0 - pow(-xratio, ndiv-i))/(1.0 - pow(-xratio, ndiv/2.0))/2.0;
                }
            }
        }
I hope it helps somebody.
wyldckat and pjohannes183 like this.

Last edited by wyldckat; August 17, 2013 at 13:30. Reason: Added [CODE][/CODE]
roamer is offline   Reply With Quote

Old   August 1, 2013, 04:51
Default
  #58
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
I pushed your patch to the repository: http://code.google.com/p/blockmeshdg...a63253d80a5c93

If you would like to be acknowledged differently please let me know.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology
akidess is offline   Reply With Quote

Old   August 1, 2013, 09:55
Default
  #59
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi Anton
I can't have access to this link by this message "Request not allowed from your country That’s all we know."could you upload it anywhere else?
thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 1, 2013, 10:15
Default
  #60
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 919
Rep Power: 17
akidess will become famous soon enough
Sorry Ehsan, but I do not have the time to repackage and re-upload every commit. The code changes however are minimal and are within this thread, so you could easily make your own executable.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Help define the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oam-technology

Last edited by akidess; August 2, 2013 at 04:38.
akidess 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
New densitybased solver AeroFoam giulio_romanelli OpenFOAM Running, Solving & CFD 39 October 8, 2013 02:37
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
Parallel rasInterFoam openfoam_user OpenFOAM Running, Solving & CFD 4 November 1, 2008 05:14
what's wrong about my code for 2d burgers equation morxio Main CFD Forum 3 April 27, 2007 10:38
REAL GAS UDF brian FLUENT 6 September 11, 2006 08:23


All times are GMT -4. The time now is 17:33.