CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   refineWallLayer (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/78211-refinewalllayer.html)

openfoam_user July 15, 2010 09:10

refineWallLayer
 
hello,

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

Regards,
Stephane

openfoam_user July 16, 2010 10:35

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

SD@TUB July 29, 2011 09:47

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

ic3wall October 11, 2012 16:22

write last step only
 
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.

SD@TUB October 12, 2012 09:49

It should be working if you set 'startFrom latestTime;' in <constant/controlDict>!

/Stefan

ic3wall October 12, 2012 09:52

I tried that, but it still writes the new mesh each time refineWallLayer is executed.

SD@TUB October 16, 2012 09:32

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

ic3wall October 16, 2012 10:29

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

SD@TUB October 17, 2012 11:30

Quote:

Originally Posted by ic3wall (Post 386899)
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

ic3wall October 17, 2012 16:25

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

SD@TUB October 20, 2012 12:59

Quote:

Originally Posted by ic3wall (Post 387183)
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


All times are GMT -4. The time now is 05:48.