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

topoSet Dictionary Problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 20, 2016, 11:16
Default topoSet Dictionary Problem
  #1
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
Dear Foamers,

I am trying to create a circle in the center of XY-plane using topoSetDict. But it does not grab any cell with given information in the file. Could you please find the error? The code is given below.

blockMeshDict:
Code:
convertToMeters 1;

vertices
(
    (0 0 0)
    (1 0 0)
    (1 1 0)
    (0 1 0)
    (0 0 1)
    (1 0 1)
    (1 1 1)
    (0 1 1)
);

blocks ( hex (0 1 2 3 4 5 6 7) (200 200 1) simpleGrading (1 1 1) );
topoSetDict:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}

actions
(  
    {
        name s8;
        type cellSet;
        action new;
        source sphereToCell;
        sourceInfo
        {
            centre (0.5 0.5 0);
            radius 0.2;
        }
    }

);
Here is the output after running topoSet and you can see that size = 0.
Code:
Create time

Create polyMesh for time = 0

Reading topoSetDict

Time = 0
    mesh not changed.
Created cellSet s8
    Applying source sphereToCell
    Adding cells with centre within sphere, with centre = (0.5 0.5 0) and radius = 0.2
    cellSet s8 now size 0

End
cute is offline   Reply With Quote

Old   August 23, 2016, 15:17
Default
  #2
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
Any suggestion .......
cute is offline   Reply With Quote

Old   August 24, 2016, 02:59
Default
  #3
Member
 
Join Date: Mar 2014
Posts: 39
Rep Power: 12
Traction is on a distinguished road
Hello,
it looks like you have a z-resolution of a single cell. That means that the centre of your cells is located in z = 0.5 !
Right now you do not overlap the cell centre with your current topoSet sphere because you just reach z = 0.2 !

The regarding sphereToCell.H source file says that sphereToCell is ....
Quote:
A topoSetSource to select cells based on cell centres inside sphere.
Traction is offline   Reply With Quote

Old   August 24, 2016, 12:08
Default
  #4
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
Thanks for the explanation.
So Is it possible to have only two dimensions in OpenFoam? Or how can we make two dimensional case ignoring 3rd dimension.
cute is offline   Reply With Quote

Old   August 24, 2016, 12:48
Default
  #5
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
To have a two-dimensional case you should use empty boundary condition in the third direction. However you cannot have more than one cell in that direction or your solution diverges.

I think setting the boundary condition to empty does not solve your problem, you gotta change centre (0.5 0.5 0); to centre (0.5 0.5 0.5);
anishtain4 is offline   Reply With Quote

Old   August 24, 2016, 13:01
Default
  #6
Member
 
anonymous
Join Date: Mar 2016
Location: Canada
Posts: 93
Rep Power: 10
cute is on a distinguished road
Thanks Mahdi, setting center at (0.5, 0.5, 0.5) solved the problem.
cute is offline   Reply With Quote

Old   September 2, 2016, 03:34
Default
  #7
Member
 
carno
Join Date: Mar 2009
Posts: 70
Rep Power: 17
Carno is on a distinguished road
I have similar problem. I already have created mesh with SHM. Now I want to put cells in the cylinder region in one cell set.
topoSetDIct is:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    arotating;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1 (70 100 60);
            p2 (90 100 60);
            radius 40;
        }
    }
);
Output is:
Code:
Date   : Sep 02 2016
Time   : 08:28:54
Host   : "ASHSSP"
PID    : 8112
Case   : 
nProcs : 1
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

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

Create polyMesh for time = 1

Reading topoSetDict

Time = 1
    mesh not changed.
Created cellSet arotating
    Applying source cylinderToCell
    Adding cells with centre within cylinder, with p1 = (70 100 60), p2 = (90 100 60) and radius = 40
    cellSet arotating now size 43125

End
But I am not able to see that cellSet. Why is so?
Carno is offline   Reply With Quote

Old   September 2, 2016, 11:14
Default
  #8
Member
 
Join Date: Mar 2014
Posts: 39
Rep Power: 12
Traction is on a distinguished road
What do you exactly mean by you "are not able to see that cellSet" ?
Your log seems to be ok. The cellSet should be located in your constant directory. If you want to postProcess the field in paraview you can use the foamToVTK utility for example.
Traction is offline   Reply With Quote

Old   September 3, 2016, 05:50
Default
  #9
Member
 
carno
Join Date: Mar 2009
Posts: 70
Rep Power: 17
Carno is on a distinguished road
I am sorry. I posted half the topoSetDict. Full one is here.

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
    {
        name    c0;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1 (70 100 60);
            p2 (90 100 60);
            radius 40;
        }
    }
    {
        name    arotating;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
             set c0;
        }
    }
)
After this when I check the checkMesh, I see only 1 cellZone?

Code:
Time = 1

Mesh stats
    points:           1220821
    faces:            3085221
    internal faces:   2830773
    cells:            935095
    faces per cell:   6.3266235
    boundary patches: 5
    point zones:      0
    face zones:       1
    cell zones:       1
That's the problem. Sorry again...
I am trying to generate cellZones by both the methods. 1. By SHM 2. topoSet, I am not succeeding in either.
Carno is offline   Reply With Quote

Old   September 3, 2016, 06:07
Default
  #10
Member
 
carno
Join Date: Mar 2009
Posts: 70
Rep Power: 17
Carno is on a distinguished road
The problem seems solved... thanks...
Carno is offline   Reply With Quote

Old   September 6, 2016, 02:28
Default
  #11
Member
 
carno
Join Date: Mar 2009
Posts: 70
Rep Power: 17
Carno is on a distinguished road
I solved the problem by creating cellZones in the SHM. Like below,

Code:
        rad
        {
            level       (2 2);
            faceZone    rad;
            cellZone    rad;
            cellZoneInside  inside;
        }

Another thing was that I was not able to view the cellZones in the Paraview. This is because it was my confusion that the cellzones will showup like regions in Paraview. I confirmed the cellZone creation by CheckMesh command.

Thanks for the help...
Carno 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
Problem with interFoam; Wave/wiggle alpha1 behavior JonW OpenFOAM 10 February 4, 2023 07:27
Problem writing to dictionary MrAndersson OpenFOAM Programming & Development 4 September 12, 2017 15:46
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13


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