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

[snappyHexMesh] refineWallLayer

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2010, 09:10
Default refineWallLayer
  #1
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
hello,

can someone give me an example how to use the refineWallLayer utility with snappyHexMesh ?

Regards,
Stephane
openfoam_user is offline   Reply With Quote

Old   July 16, 2010, 10:35
Default
  #2
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
how to use the refineWallLayer utility

With snappyHexMesh just create 1 'big' layer. Then use several times the refineWallLayer utility to refine.

if your solid is composed of 3 surfaces called : head, body and back

refineWallLayer -overwrite head 0.3
refineWallLayer -overwrite body 0.3
refineWallLayer -overwrite back 0.3

At the end check your final mesh with:
checkMesh -latestTime

Stephane
openfoam_user is offline   Reply With Quote

Old   July 29, 2011, 09:47
Default
  #3
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Hi Stephane,

I agree with you, in cases where addLayers functionality with snappyHexMesh fails to add several layers.
Do you have a work around to refine the wall layers from different patches at once?
I tried
Code:
refineWallLayer [OPTIONS] 'patch1 patch2,...' <edgeWeight>
Code:
refineWallLayer [OPTIONS] '(patch1 patch2,...)' <edgeWeight>
Code:
refineWallLayer [OPTIONS] '(patch1,patch2,...)' <edgeWeight>
Code:
refineWallLayer [OPTIONS] ':patch1,patch2,...:' <edgeWeight>
w/o success! I guess that there is no behavior like a <wordList> implemented,
so right now i have to use a shell script...

May you or someone else could give me an advice? Thanks!

/Stefan
SD@TUB is offline   Reply With Quote

Old   October 11, 2012, 16:22
Default write last step only
  #4
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
I know it's an old thread, but do you know a way to write only the last mesh of refineWallLayer when it is used in a shell script ?

Writing the mesh at each iteration is very time consuming.
ic3wall is offline   Reply With Quote

Old   October 12, 2012, 09:49
Default
  #5
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
It should be working if you set 'startFrom latestTime;' in <constant/controlDict>!

/Stefan
SD@TUB is offline   Reply With Quote

Old   October 12, 2012, 09:52
Default
  #6
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
I tried that, but it still writes the new mesh each time refineWallLayer is executed.
ic3wall is offline   Reply With Quote

Old   October 16, 2012, 09:32
Default
  #7
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
I can't understand it. It should be working. There is a '-overwrite' flag that overwrite the mesh of last time step. If this flag isn't used, the application write out the mesh to the new time step.
What version do you use? What is your script look like?

/Stefan
SD@TUB is offline   Reply With Quote

Old   October 16, 2012, 10:29
Default
  #8
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
The overwrite flag, if I understand it correctly, simply overwrites the time in which the mesh is currently located. For example, if you apply refineWallLayer (with the overwrite flag on) on a mesh in time 1, the new "refined" mesh will be written in time 1, deleting the old mesh. Without the overwrite flag, the new mesh will simply be written in time 2.
My script looks like that:

Code:
. $WM_PROJECT_DIR/bin/tools/RunFunctions
while [ condition]
do

stuff to calculate refineWallLayer inputs

runApplication refineWallLayer lowerWall $Ratio -overwrite
rm log.refineWallLayer
 
done
exit
With the above script, a new mesh is written each loop, which becomes a very long process when the application is run 100+ times..My guess is that modifications in refineWallLayer.C would be needed.
I use OF 1.7.1

Last edited by ic3wall; October 16, 2012 at 11:17.
ic3wall is offline   Reply With Quote

Old   October 17, 2012, 11:30
Default
  #9
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Quote:
Originally Posted by ic3wall View Post
The overwrite flag, if I understand it correctly, simply overwrites the time in which the mesh is currently located. For example, if you apply refineWallLayer (with the overwrite flag on) on a mesh in time 1, the new "refined" mesh will be written in time 1, deleting the old mesh. Without the overwrite flag, the new mesh will simply be written in time
That's fully correct! After clearing this point, I am a little confused what you are really intend to do!? refineWallLayer need to handle the whole mesh despite 'just' splitting all cells near of your specified patch. If you want to speed up, use it in parallel (by runParallel in your script).

/Stefan
SD@TUB is offline   Reply With Quote

Old   October 17, 2012, 16:25
Default
  #10
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 14
ic3wall is on a distinguished road
I know refineWallLayer deals with the hole mesh, but is there a way to tell the utility to keep the last iteration in memory instead of writing it and then reading it for the next iteration ?

i didn't think of running it in parallel ... but again decomposing and reconstructing the mesh at each iteration will be time consuming as well
ic3wall is offline   Reply With Quote

Old   October 20, 2012, 12:59
Default
  #11
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Quote:
Originally Posted by ic3wall View Post
I know refineWallLayer deals with the hole mesh, but is there a way to tell the utility to keep the last iteration in memory instead of writing it and then reading it for the next iteration ?
Now I get what you want. Yes, that should be done by rewriting refineWallLayer.C. I am not sure if writing memory to disk drive is the time consuming part!? Did you check this?

Another possibility might by using subSetMesh to write near wall layer to separate mesh, perform refining and stitch it with 'far field mesh' afterwards. Didn't try it yet.

/Stefan
SD@TUB is offline   Reply With Quote

Reply


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[snappyHexMesh] refineWallLayer vs add layer Astan OpenFOAM Meshing & Mesh Conversion 0 March 18, 2019 12:03
refineWallLayer error after upgrading wildfire230 OpenFOAM Pre-Processing 2 October 27, 2017 15:21
refineWallLayer cellZone preservation workaround jameswilson620 OpenFOAM 0 May 10, 2016 10:56
[snappyHexMesh] snappyHexMesh and refineWallLayer Claudio OpenFOAM Meshing & Mesh Conversion 0 June 20, 2013 13:36


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