CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Contribution a new utility: refine wall layer mesh based on yPlus field

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

Like Tree22Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 9, 2013, 14:16
Default
  #21
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 for good clarification!
then it splits only the first cell.
how does it calculates the number of splitts?
and if I change the mesh by blockMesh I have to use refine tool again?
Quote:
Note: add the option "-overwrite" is you want it to override the existing mesh.
do you mean writing in boundary,faces,cells,...files in blockMeshDict?
__________________
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   June 9, 2013, 14:31
Default
  #22
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quote:
Originally Posted by immortality View Post
how does it calculates the number of splitts?
With this:
Code:
refineLevelValue = ceil
            (
                std::log(YpMax/targetYPlusValue)/std::log(scalar(2.0))
            );
Note: "targetYPlusValue" is 1.0 by default, unless specified from the command line.

Quote:
Originally Posted by immortality View Post
and if I change the mesh by blockMesh I have to use refine tool again?
Yes.

Quote:
Originally Posted by immortality View Post
do you mean writing in boundary,faces,cells,...files in blockMeshDict?
Only affects the actual mesh files.
It does not affect the "blockMeshDict" file, because it's used for creating a mesh, it's not "the mesh" .
immortality likes this.
wyldckat is offline   Reply With Quote

Old   June 9, 2013, 15:49
Default
  #23
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
and another question.if y+ be 1 for example and we want to increase it to 30 this tool can't be used,can?
__________________
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   June 9, 2013, 15:53
Default
  #24
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Quote:
Originally Posted by immortality View Post
and another question.if y+ be 1 for example and we want to increase it to 30 this tool can't be used,can?
Nope. That goes in the wrong direction You have to create the mesh first, then refine it.

You can check post #14 for more ideas: Contribution a new utility: refine wall layer mesh based on yPlus field
wyldckat is offline   Reply With Quote

Old   June 10, 2013, 07:28
Default
  #25
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
why the first cell height after refining is bigger than second one?
I used
Code:
refineWallLayerSmart -basedOnYPlus -targetYPlus .7 -overwrite walls 1.5
Attached Images
File Type: jpg y.jpg (15.6 KB, 74 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.
immortality is offline   Reply With Quote

Old   June 11, 2013, 05:45
Default
  #26
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
in this version
1) it works on yPMax instead of yPMean.so the maximum y+ in the domain will be lower than specified -targetYPlus that leads more accurate results than the average.
2)also the modification of first cell that was bigger than second cell has done according to Bernhard proposed .C file.
3)also it now accepts float numbers for -targetYPlus like -targetYPlus .5
Hope it be useful.
Attached Files
File Type: gz refineWallLayerSmart_MaxY_stretching.tar.gz (4.2 KB, 52 views)
FrankFlow likes this.
__________________
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   June 18, 2013, 14:11
Default
  #27
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
in what it used to be till now we wanted to maximum yPlus be lower
than targetYPlus (as above post)
now I want minimum yPlus be bigger than
targetYplus.it refines mesh still(when for example minimum of y+ is 200) but min(yPlus)>=30(that uses in high-Re mesh's)
it seems an equation should be changed from max(yPlus)<=target to
min(yPlus)>=target.
I'm using average version now but if anyone could have a look into it too
it will be more accurate.
its nice to modify above post file.
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   July 8, 2013, 07:56
Default
  #28
New Member
 
Join Date: Mar 2013
Posts: 9
Rep Power: 4
mezomatic is on a distinguished road
Quote:
Originally Posted by immortality View Post
in this version
1) it works on yPMax instead of yPMean.so the maximum y+ in the domain will be lower than specified -targetYPlus that leads more accurate results than the average.
2)also the modification of first cell that was bigger than second cell has done according to Bernhard proposed .C file.
3)also it now accepts float numbers for -targetYPlus like -targetYPlus .5
Hope it be useful.
Hello there!
I used your Version of the tool on my mesh but the first cell height ist still larger than the second, just like in your post.

I used
Code:
refineWallLayerSmart -basedOnYPlus -targetYPlus 1 Wall 1.15 -overwrite
Did you get different results?
mezomatic is offline   Reply With Quote

Old   July 8, 2013, 11:14
Default
  #29
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
in my case it works right.
send your mesh to me.
__________________
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   July 9, 2013, 01:56
Default
  #30
New Member
 
Join Date: Mar 2013
Posts: 9
Rep Power: 4
mezomatic is on a distinguished road
Hi!
This is my case, it's just a simple 2D BlockMesh...
Attached Files
File Type: gz SmartRefine.tar.gz (5.0 KB, 22 views)
mezomatic is offline   Reply With Quote

Old   July 9, 2013, 10:37
Default
  #31
Senior Member
 
lakeat's Avatar
 
Daniel WEI (老魏)
Join Date: Mar 2009
Location: South Bend, IN, USA
Posts: 688
Blog Entries: 9
Rep Power: 12
lakeat is on a distinguished road
Send a message via Skype™ to lakeat
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

Attached is a modification as requested by Ehsan. It's based on Daniel's original modifications and I changed the following
Thanks Bruno!

Using YpMax seems to me too cruel.
__________________
~
Daniel WEI
-------------
NatHaz Modeling Laboratory
Department of Civil & Environmental Engineering & Earth Sciences
University of Notre Dame, USA
Email || My Personal CFD Blog
lakeat is offline   Reply With Quote

Old   July 9, 2013, 11:48
Default
  #32
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Quote:
Hi!
This is my case, it's just a simple 2D BlockMesh...
this is somewhat strange!why you have set number of cells in y-direction to 1!
then you expect what to be refined in y-direction?!
__________________
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; July 9, 2013 at 14:24.
immortality is offline   Reply With Quote

Old   July 9, 2013, 11:51
Default
  #33
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Quote:
Thanks Bruno!

Using YpMax seems to me too cruel.
thanks for original utility,
in cases we want for example y+<1 its more accurate that maximum value of y+ on cells be lower than 1 too at least I think so if you want to correct my understanding I welcome!
__________________
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   July 9, 2013, 14:02
Default
  #34
New Member
 
Join Date: Mar 2013
Posts: 9
Rep Power: 4
mezomatic is on a distinguished road
Quote:
Originally Posted by immortality View Post
it works in y-direction.
What do you mean by that? Why would it work in only one direction?
I expect nothing to be refined in the y-direction, it's a 2D mesh and it lies in the x-z-plane...
I'm sorry but I didn't understand your concerns about that, the refinement works just fine (see attached screenshot). Only "problem" is the first cell being larger than the second...
Attached Images
File Type: jpg SmartRefine.jpg (53.2 KB, 69 views)
mezomatic is offline   Reply With Quote

Old   July 9, 2013, 14:39
Default
  #35
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
I had forgotten how it was working.I don't know whats wrong with your case.it ends with a crash.
have you set faces correct?I think maybe there is an issue in blockMeshDict.
__________________
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   July 13, 2013, 15:32
Default
  #36
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
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!

@mezomatic:
Quote:
Originally Posted by mezomatic View Post
Hi!
This is my case, it's just a simple 2D BlockMesh...
I was not able to reproduce the same error

I ran blockMesh, then yPlusRAS and then the command indicated above:
Quote:
Originally Posted by mezomatic View Post
I used
Code:
refineWallLayerSmart -basedOnYPlus -targetYPlus 1 Wall 1.15 -overwrite
Did you get different results?
But I got this message instead:
Code:
--> FOAM FATAL ERROR: 
targetYPlusValue is larger than max yPlus (0), no need to refine the wall layer mesh.
Or you can use "refineLevel" option to force refine.
Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   July 13, 2013, 15:44
Default
  #37
New Member
 
Join Date: Mar 2013
Posts: 9
Rep Power: 4
mezomatic is on a distinguished road
Hey Bruno,

try running simpleFoam on it first for a few timesteps, so the yPlusRAS tool can compute the y+ values properly. Otherwise it's just zero everywhere (see error message) and as that is already below the desired y+ of 1, there won't be anything refined...
mezomatic is offline   Reply With Quote

Old   July 13, 2013, 16:15
Default
  #38
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi mezomatic,

Quote:
Originally Posted by mezomatic View Post
try running simpleFoam on it first for a few timesteps, so the yPlusRAS tool can compute the y+ values properly. Otherwise it's just zero everywhere (see error message) and as that is already below the desired y+ of 1, there won't be anything refined...
Uhm... simpleFoam crashed at iteration 538 due to massive continuity problems.
Nonetheless, I checked the y+ values on the wall at the iteration 500... and the maximum value of "y+ = 1e9" is waaaaaaaaaaaay too much! Which means that refining the mesh to "y+ = 1" would require the cells to be so thin near the wall, that... uhm... maybe as thin as an atom? I didn't even do the math... all I know is that checkMesh seriously complains about the resulting refined mesh.

Therefore, I strongly advise you to first make your case simulate without crashing, and only then you should try refining the mesh near the wall

Best regards,
Bruno
immortality likes this.
wyldckat is offline   Reply With Quote

Old   July 13, 2013, 16:35
Default
  #39
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
as Bruno says I received an error too and it seems your BC's and maybe other settings have a big problem in them!find that first.
__________________
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   July 13, 2013, 16:42
Default
  #40
New Member
 
Join Date: Mar 2013
Posts: 9
Rep Power: 4
mezomatic is on a distinguished road
Hmm that's strange... I've got no problems at all running the the case without the refinement. My max y+ is 59.

Maybe there's someting wrong with the files. Here's the case again.
I'm using Version 2.2.0
Attached Files
File Type: gz smartRefine.tar.gz (2.6 KB, 8 views)
mezomatic 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
Number of cells in mesh don't match with size of cellLevel colinB OpenFOAM Native Meshers: snappyHexMesh and Others 11 January 13, 2015 12:47
2D Mesh Generation Tutorial for GMSH aeroslacker Open Source Meshers: Gmsh, Netgen, CGNS, ... 12 January 19, 2012 04:52
non-smooth mesh Svensson OpenFOAM Native Meshers: snappyHexMesh and Others 11 January 18, 2012 10:13
I wonder, how do I mesh a car? MadsR OpenFOAM Native Meshers: snappyHexMesh and Others 0 May 2, 2011 15:39
Wall mesh refinement based on y+ Hrushi OpenFOAM Mesh Utilities 0 July 22, 2010 03:53


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