CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   topoSet Dictionary Problem (https://www.cfd-online.com/Forums/openfoam-programming-development/176507-toposet-dictionary-problem.html)

cute August 20, 2016 11:16

topoSet Dictionary Problem
 
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 August 23, 2016 15:17

Any suggestion .......

Traction August 24, 2016 02:59

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.

cute August 24, 2016 12:08

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.

anishtain4 August 24, 2016 12:48

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);

cute August 24, 2016 13:01

Thanks Mahdi, setting center at (0.5, 0.5, 0.5) solved the problem.

Carno September 2, 2016 03:34

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?

Traction September 2, 2016 11:14

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.

Carno September 3, 2016 05:50

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 September 3, 2016 06:07

The problem seems solved... thanks... :):)

Carno September 6, 2016 02:28

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...


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