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

refineWallLayer

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 15, 2010, 09:10
Default refineWallLayer
  #1
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 298
Rep Power: 8
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: 298
Rep Power: 8
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: 68
Rep Power: 6
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: 4
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: 68
Rep Power: 6
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: 4
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: 68
Rep Power: 6
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: 4
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: 68
Rep Power: 6
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: 4
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: 68
Rep Power: 6
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

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
Comparison of axisymmetric case, Starccm+ and OpenFOAM linnemann OpenFOAM Running, Solving & CFD 12 June 16, 2011 05:43


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