CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   refineWallLayer cellZone preservation workaround (https://www.cfd-online.com/Forums/openfoam/171524-refinewalllayer-cellzone-preservation-workaround.html)

jameswilson620 May 10, 2016 11:56

refineWallLayer cellZone preservation workaround
 
1 Attachment(s)
All,

I am using a solver derived from porousInterFoam and would like to refine the lower wall cells with refineWallLayer in a shell script:
Code:

...
echo "Executing resetFields: copying .org files"

cp 0/alpha.water.org 0/alpha.water
cp 0/T.org 0/T
cp 0/porosity.org 0/porosity

rm ./processor*

blockMesh

refineWallLayer -overwrite lowerWall 0.5 //this splits cells in zone "porous" and subsequently removes them from porous

#setSet
#faceSet f0 new patchToFace lowerWall
#cellSet c0 new faceToCell f0 any
#cellZoneSet porous  setToCellZone c0

setFields
...

the command: refineWallLayer, removes the newly created cells from their parent cell zone, in this case, zone "porous".

This is a bug resolved here: http://bugs.openfoam.org/view.php?id=1524 but I am using stock OF2.3.0.

Since i am using OF2.3.0, I would like to find a suitable work around to add the cells back to the cell zone "porous". You'll find, in the code snippet above, an excerpt from a shell script I use in my case file (attached here). I have attempted to use setSet to add the new cells adjacent to "lowerWall" back to cell zone "porous". This leads me to three questions for the forum:

1. When operating on the command line using setSet and the commented commands found in the shell script above, why aren't the cells adjacent to lowerWall added to cell zone "porous"? Another note, when executing the commands in the terminal, I receive no errors. Heres the output:

Code:

uname@uname270:~/SOME/PRIVATE/PATH/case1$ setSet
/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : setSet
Date  : May 10 2016
Time  : 10:35:30
Host  : "uname270"
PID    : 18503
Case  : /SOME/PRIVATE/PATH
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time:0  cells:16000  faces:64281  points:32564  patches:5  bb:(0 0 0) (0.3 0.3 0.01)
cellZones:
        porous        size:4000
        freeFlowBlock1        size:4000
        freeFlowBlock2        size:3000
        freeFlowBlock3        size:4000
        inletBlock        size:900

Time = 0
    mesh not changed.
Please type 'help', 'quit' or a set command after prompt.
readline>faceSet f0 new patchToFace lowerWall
    Set:f0  Size:0  Action:new
    Adding all faces of patch lowerWall ...
    Found matching patch lowerWall with 100 faces.
    Writing f0 (size 100) to "constant/polyMesh/sets/f0" and to vtk file "VTK/f0/f0_0.vtk"

readline>cellSet c0 new faceToCell f0 any
    Set:c0  Size:0  Action:new
    Adding cells according to faceSet f0 ...
    Writing c0 (size 100) to "constant/polyMesh/sets/c0" and to vtk file "VTK/c0/c0_0.vtk"

readline>cellZoneSet porous  setToCellZone c0
readline>^C

2. is there a way to automate these commands in a shell script? perhaps as a series of commands in controlDict? These commands, as they are presented without #comment, produce an error when used in a shell script as setSet seems to be an interactive utility when provoked. The solution to this problem is relevant to OF but likely deals more with the computer science aspects of interacting with linux. My apologies for this one.

3. Is there another, more effective solution to this problem while using OF2.3.0?

Thanks for looking into this thread, James


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