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

topoSet select cells by layers in a structured grid

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2020, 13:38
Default topoSet select cells by layers in a structured grid
  #1
New Member
 
Join Date: Jun 2019
Posts: 15
Rep Power: 6
samiahmed is on a distinguished road
Hello,
I have a structured mesh around an object as shown in the first attached image.

Is there a way in topoSet or setSet utilities to select cells by number of layers from a wall. (e.g: in the figure below, select the third layer from the wall shown in green: see attached image).

Thanks
Attached Images
File Type: png mesh.png (42.3 KB, 9 views)
File Type: png cellSet_by_layers.png (51.8 KB, 14 views)
samiahmed is offline   Reply With Quote

Old   May 12, 2020, 15:46
Default
  #2
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
I think there is no direct way. But you could try selecting first the faces belonging to the patch. Then grow this set three times. Do same for a second set, but grow only two times. Finally subtract second from first. Not tested but should work.
JNSN is offline   Reply With Quote

Old   May 12, 2020, 16:57
Default
  #3
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

- I think there is one topoSet can do this: haloToCell, which selects a specified number of layers, i.e. the entry of "steps".
- You need two subsequent haloToCell with "steps=2", and "steps=1", respectively. The first haloToCell (steps=2) will select the first two layers, and based on this haloToCell, another haloToCell (steps=1), the third layer only will be selected.

Hope this helps.

PS: Just out of curiosity, why do you wanna select the third layer only?
CFD_10 likes this.
HPE is offline   Reply With Quote

Old   May 13, 2020, 17:35
Default
  #4
New Member
 
Join Date: Jun 2019
Posts: 15
Rep Power: 6
samiahmed is on a distinguished road
Could you please give me an example on how to use that?

I need to select the third layer because if that is possible I can create faceZones easily by the same approach (to create baffles, etc.).
samiahmed is offline   Reply With Quote

Old   May 13, 2020, 17:37
Default
  #5
New Member
 
Join Date: Jun 2019
Posts: 15
Rep Power: 6
samiahmed is on a distinguished road
Quote:
Originally Posted by JNSN View Post
I think there is no direct way. But you could try selecting first the faces belonging to the patch. Then grow this set three times. Do same for a second set, but grow only two times. Finally subtract second from first. Not tested but should work.
How to grow a set three time?
samiahmed is offline   Reply With Quote

Old   May 14, 2020, 09:57
Default
  #6
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 137
Rep Power: 19
JNSN is on a distinguished road
Good question. This should do the trick:
Code:
actions
(
    
    // face set from patch
    {
        name    f0;
        type    faceSet;
        source patchToFace;
        action new;
        sourceInfo
        {
            name patchName;      
            action  new;
        }
    }

    // first layer cells
    {
        name    c0;
        type    cellSet;
        action  new;
        source     faceToCell;
        sourceInfo
        {
            set     f0;
            option  any;
        }
    }

    {
        name f0;
        type faceSet;
        source cellToFace;
        action new;
        sourceInfo
        {
            set c0;
            option all;
        }
    }


    // first and second layer cells
    {
        name    c0;
        type    cellSet;
        action  new;
        source     faceToCell;
        sourceInfo
        {
            set     f0;
            option  any;
        }
    }

);
JNSN is offline   Reply With Quote

Old   May 15, 2020, 17:06
Default
  #7
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

For `haloToCell` set, the following might be used as a guideline (haven't tested it):

Code:
actions
(
     // first layer
    {
        name    c1;
        type      cellSet;
        source   patchToCell;
        action new;
        sourceInfo
        {
            name <patchName>;
        }
    }

     // second layer
    {
        name    c2;
        type      cellSet;
        source   haloToCell;
        action    new;
        steps     1;
        sourceInfo
        {
            set    c1;
        }
    }

     // third layer
    {
        name    c3;
        type      cellSet;
        source   haloToCell;
        action    new;
        steps     1;
        sourceInfo
        {
            set    c2;
        }
    }

);
- Note that `topoSet` is a parallel executable. It may save you time depending on your case size.

Hope this helps.
HPE 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
[ICEM] Structured grid without blocking in ICEM BahaZero ANSYS Meshing & Geometry 19 March 5, 2013 11:36
[ICEM] error analysis despaired student ANSYS Meshing & Geometry 7 June 27, 2012 11:57
killed "snappyHexMesh" parkh32 OpenFOAM Pre-Processing 2 April 8, 2012 17:12
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03:23
structured grid and/or increase convergence rate Ashish Pande FLUENT 0 May 12, 2006 03:36


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