CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   problem in toposet (https://www.cfd-online.com/Forums/openfoam-pre-processing/101942-problem-toposet.html)

Ahmed Khattab May 17, 2012 14:21

problem in toposet
 
Hi Foamers,

i'm trying to run chtMultiRegionFoam on my own case, it's a tube with outer diameter 11cm, inner diameter 10cm and length 100cm i created a cylinder in blockMesh file with outer diameter 11cm and length 100 cm asin this code
Code:

convertToMeters 0.01;

vertices
(
    (0  0          0)      // point 0


    (0  11          0)      // point 01
    (0  16.5        1.47372) // point 02
    (0  20.52628    5.5)    // point 03
    (0  22          11)      // point 04
    (0  20.52628    16.5)    // point 05
    (0  16.5        20.52628)// point 06
    (0  11          22)      // point 07
    (0  5.5        20.52628)// point 08
    (0  1.47372    16.5)    // point 09
    (0  0          11)      // point 10
    (0  1.47372    5.5)    // point 11
    (0  5.5        1.47372) // point 12
 


    (100  11          0)      // point 13
    (100  16.5        1.47372) // point 14
    (100  20.52628    5.5)    // point 15
    (100  22          11)      // point 16
    (100  20.52628    16.5)    // point 17
    (100  16.5        20.52628)// point 18
    (100  11          22)      // point 19
    (100  5.5        20.52628)// point 20
    (100  1.47372    16.5)    // point 21
    (100  0          11)      // point 22
    (100  1.47372    5.5)    // point 23
    (100  5.5        1.47372) // point 24
    (0    11          11)      // point 25
    (100  11          11)      // point 26


);

blocks

(

  hex (25 1 3 25 26 13 15 26) (10 10 10) simpleGrading (1 1 1)

 

  hex (25 3 5 25 26 15 17 26) (10 10 10) simpleGrading (1 1 1)
 
  hex (25 5 7 25 26 17 19 26) (10 10 10) simpleGrading (1 1 1)
 
  hex (25 7 9 25 26 19 21 26) (10 10 10) simpleGrading (1 1 1)

  hex (25 9 11 25 26 21 23 26) (10 10 10) simpleGrading (1 1 1)
 
  hex (25 11 1 25 26 23 13 26) (10 10 10) simpleGrading (1 1 1)

 

);

edges
(

arc 1 3 (0  16.5        1.47372)

arc 3 5 (0  22          11)

arc 5 7 (0  16.5        20.52628)

arc 7 9 (0  5.5        20.52628)

arc 9 11 (0  0          11)

arc 11 1 (0  5.5        1.47372)




arc 13 15 (100  16.5        1.47372)

arc 15 17 (100  22          11)

arc 17 19 (100  16.5        20.52628)

arc 19 21 (100  5.5        20.52628)

arc 21 23 (100  0          11)

arc 23 13 (100  5.5        1.47372)
);

boundary
(
   
    outerface
    {
        type wall;
        faces
        (
            (1 13 15 3)
           
            (3 15 17 5)
           
            (5 17 19 7)
           
            (7 19 21 9)
           
            (9 21 23 11)
         
            (11 23 13 1)
           
        );
    }
    inlet
    {
        type wall;
        faces
        (
            (25 1 3 25)
             
            (25 3 5 25)
           
            (25 5 7 25)
           
            (25 7 9 25)
           
            (25 9 11 25)
         
            (25 11 1 25)
         
           
        );
    }
    outlet
    {
        type wall;
        faces
        (
            (26 15 13 26)
           
            (26 17 15 26)
           
            (26 19 17 26)
           
            (26 21 19 26)
         
            (26 23 21 26)
           
            (26 13 23 26)
           
      );
    }
 );


mergePatchPairs
(
);

and created a file topoSetDict to divide it to two regions flow, and tube like this:
Code:

actions
(
    // flow inside the tube
    {
        name    flow;
        type    cellSet;
        action  new;
        source  cylinderToCell;
        sourceInfo
        {
            p1 (0  11 11);  // start point on cylinder axis//
            p2 (100 11 11);  // end point on cylinder axis//
            radius 10.0;
             
           
        }
    }
 
    {
        name    flow;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set flow;          // name of cellSet
        }
    }

//tube
    {
        name    tube;
        type    cellZoneSet;
        action  clear;
    }
    {
        name    tube;
        type    cellSet;
        action  add;
        source  cellToCell;
        sourceInfo
        {
            set flow;
        }
    }
    {
        name    tube;
        type    cellSet;
        action  invert;
    }
    {
        name    tube;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set tube;
        }
    }
);

but when running blockMesh, topoSet, splitMeshRegion it divide it to one region (tube) and this is log file log.topoSet
Code:

Create time

Create polyMesh for time = 0

Reading topoSetDict

Time = 0
    mesh not changed.
Created set flow
    Applying source cylinderToCell
    Adding cells with centre within cylinder, with p1 = (0 11 11), p2 = (100 11 11) and radius = 10
    Set flow now size 0
Created set flow
    Applying source setToCellZone
    Adding all cells from cellSet flow ...
    Set flow now size 0
Created set tube
    Clearing set
    Set tube now size 0
Read set tube with size 0
    Applying source cellToCell
    Adding all elements of cellSet flow ...
    Set tube now size 0
Read set tube with size 0
    Inverting set
    Set tube now size 6000
Created set tube
    Applying source setToCellZone
    Adding all cells from cellSet tube ...
    Set tube now size 6000

End

and log.splitMeshRegions
Code:

Create time

Create mesh for time = 0

Creating single patch per inter-region interface.

Trying to match regions to existing cell zones.


Number of regions:1

Writing region per cell file (for manual decomposition) to "/home/khattab/ahmed.2.0.1/tutorials/heatTransfer/chtMultiRegionFoam/Graetz10/constant/cellToRegion"

Writing region per cell as volScalarField to "/home/khattab/ahmed.2.0.1/tutorials/heatTransfer/chtMultiRegionFoam/Graetz10/0/cellToRegion"

Region    Cells
------    -----
0    6000

Region    Zone    Name
------    ----    ----
0    1    tube

Sizes of interfaces between regions:

Interface    Region    Region    Faces
---------    ------    ------    -----

Reading volScalarField Y_char
Reading volScalarField cellToRegion
Reading volScalarField p
Reading volScalarField T
Reading volScalarField k
Reading volScalarField epsilon
Reading volScalarField P_rgh
Reading volScalarField Y_pmma
Reading volVectorField U

Only one region. Doing nothing.
End

please help :confused:

Ahmed Khattab May 28, 2012 04:18

Dears,

finally i have found the problem. in blockMeshDict i have converted units to centimeter so i have wrote 0.1m as 10. in toposet i used same value but it red it as meters so 10 became 10m. it red only tube region because it was invert of other region which had been red as empty. as assigned all cells for tube region.
now every thing is do well.
thanks for all who red this post.
ahmed

kid May 28, 2012 05:56

Hi,
What does topoSet do ?

Ahmed Khattab May 28, 2012 11:44

Quote:

Originally Posted by kid (Post 363408)
Hi,
What does topoSet do ?

Dear Kid,

topoSet is used to split your mesh into many regions so you can give properties to the entire region not only for patches. i used for the first time for heat transfer problem in chtMultiRegioFoam solver with multiRegionHeater case. you can try the case and will get a good experience of it.

if any question don't hesitate to post for me.

good luck :)

kettnera May 28, 2012 16:08

New to OpenFoam and I am attempting post process the results from the the chtMultiRegionFoam tutorials. I cannot seem to get paraview to read any of the files. If I attempt to look at the with a gedit the file does not load correctly and I get nonsense. This has not been a problem for other tutorials. I am running open foam on a virtually install Ubuntu 12.04.

Suggestions please
Thanks

Ahmed Khattab May 29, 2012 05:50

Quote:

Originally Posted by kettnera (Post 363468)
New to OpenFoam and I am attempting post process the results from the the chtMultiRegionFoam tutorials. I cannot seem to get paraview to read any of the files. If I attempt to look at the with a gedit the file does not load correctly and I get nonsense. This has not been a problem for other tutorials. I am running open foam on a virtually install Ubuntu 12.04.

Suggestions please
Thanks

Hi Kettnera,
i experienced same problem before, after processing chtMultiRegionFoam solver, as usual type paraFoam and paraview will open then from toolbar choose file then open, it will open window for you shows the directory of your case choose the five files with .openfoam extension (bottomair topair heater rightssolid leftsolid), click apply. now you can see results.

the problem with gedit is that results are written in binary so you can't see it correctly. if you want go to controlDict file in system directory then change ninary to Ascii code then you will see results correctly.

good luck :)

kettnera May 29, 2012 16:28

Thx

Ahmed
That did it.

Ahmed Khattab June 4, 2012 00:31

you are welcome.

rehan June 7, 2012 07:19

Hello sir,
1)can you please tell me the significance of 'invert' action?
also 2) what does 'type cellset' & 'type cellzoneset' mean?

Ahmed Khattab June 7, 2012 12:21

Quote:

Originally Posted by rehan (Post 365234)
Hello sir,
1)can you please tell me the significance of 'invert' action?
also 2) what does 'type cellset' & 'type cellzoneset' mean?

Hi Rehan,

1- invert is used to specify region which is the rest of the domain instead of specify it as every region you can just say that it is the invert of all regions in the domain.

2- about this question give me more time to get a detailed answer for you.

:):):)

Meinan March 24, 2013 15:18

Hi ~~ I wonder do you still work on chtMultiRegionFoam? cuz I see that the time you replied is really long time ago, I am totally new to OPenFoam, and now I am trying to split the region into solid and fluid. I generated my mesh in ICEM, and converted it in Openfoam, and now I am trying to split the region, I try to define the region in MakeCellSets file, I wonder am I doing right? Should I split the region in MakeCellSets or topoSet? I feel so confused, really hope that you can reply me! THanks!!!

Mahdi2010 October 29, 2015 08:26

Hi all

I am building a test case with 2 main regions (1 solid and 1 fluid attached together). I built it simply by using topoSet. My question is if I wanna create a wallFilmRegion between these two regions, how can I address the source info for that? I mean what it the correct source info for this patch?

If you look at the case "tutorail/lagrangian/reactingParcelFilmFoam/rivuletpanel", the wallFilmRegion is created using a source from blockMeshDict.
{
name wallFilm;
type faceSet;
action new;
source patchToFace;
sourceInfo
{
name filmWalls;
}
}
{
name wallFilm;
type faceZoneSet;
action new;
source setToFaceZone;
sourceInfo
{
faceSet wallFilmFaces;
}
}

But in my case the connecting patch between solid region and fluid region is not defined in advance and should be created within the topoSet itself! (First by topoSet I define 2 regions and now I wanna address the patch in between as source for wallFilmRegion.) any idea for that!?

AliRezaJafari December 10, 2016 10:56

topoSetDict
 
1 Attachment(s)
Hi
How can be defined for a triangular box?

us7 September 7, 2017 06:17

Quote:

Originally Posted by AliRezaJafari (Post 629057)
Hi
How can be defined for a triangular box?

Hello Ali,
Did you find the solution for this geometry. I also have same problem?

Umer

krndv September 18, 2017 13:08

topoSet in inclined box
 
Hello all,

How can I define an inclined cell zone (a rectangular box inclined at an angle), as boxToCell gives horizontal

Thank you

student666 September 18, 2017 22:42

Hi,

according to this
https://openfoamwiki.net/index.php/TopoSet

you could use
Code:

surfaceToCell
first to create a cellSet, then by
Code:

setToCellZone
you can have your cellZone as well.

In any case the problem is that you have to get to a mesh with cells not intersecating your stl surface or you won't get a smooth and plained "surface" at your cellZone.

Regards.

Anil kumar October 26, 2017 06:29

Usage of topoSetDict
 
Hello,

Can any one help me in understanding, how the topoSetDict is functioning and what exactly is box defines. Will this box collects all the information from the cells ? :confused:

me12p1006 November 1, 2017 02:20

creating square patch (for air inlet) on the bottom face using cellset in toposet
 
Hi all,

I am trying to feed air through a square inlet on the bottom face of a 3D rectangular tank filled with water. I am able to do this using faceset in toposet dict as follows:
{
name faceGrabbed;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.035 0.035 0.08)(0.04 0.04 0.08);
}
}

But when i tried to do it with cellset (by replacing the type with cellset) as given below in toposet dict then I am facing the following error: unexpected class name cellset expected faceset while reading object faceGrabbed.

{
name faceGrabbed;
type cellSet;
action new;
source boxToCell;
sourceInfo
{
box (0.015 0.015 0)(0.02 0.02 0);
}
}
)

My create patch dictionary is as follows:

{
//- name of new patch
name bubble;

//- type of new patch
patchInfo
{
type patch;
}
//- How to construct: either from 'patches' or 'set'
constructFrom set;
//- if constructionFrom = set : name of faceSet
set faceGrabbed;
}
);

I am running the following commands:
blockMesh
TopoSet
CreatePatchDict -overwrite
-------here I am getting error: Foam fatal IO error: unexpected class name cellset expected faceset while reading object faceGrabbed.

Can anyone please help as I tried a lot to retrieve this.





Quote:

Originally Posted by Ahmed Khattab (Post 363395)
Dears,

finally i have found the problem. in blockMeshDict i have converted units to centimeter so i have wrote 0.1m as 10. in toposet i used same value but it red it as meters so 10 became 10m. it red only tube region because it was invert of other region which had been red as empty. as assigned all cells for tube region.
now every thing is do well.
thanks for all who red this post.
ahmed


student666 November 1, 2017 23:50

From your topoSetDict:

Quote:

name faceGrabbed;
type cellSet;
From your createPatchDict error:

Quote:

unexpected class name cellset expected faceset while reading object faceGrabbed
Hint:
Maybe you should define a faceSet into your topoSet...

Rajesh Nimmagadda November 2, 2017 00:21

Yes, I did it with faceset. But I want to try the same with cellset also. The reason for using cellset is to create circular patch in future instead of square patch as mentioned above. As far as I know, we can only create circular patch using cellset.

So I want to know how can i do it with cellset in toposet.

Thanks for your reply.





Quote:

Originally Posted by student666 (Post 670102)
From your topoSetDict:

From your createPatchDict error:

Hint:
Maybe you should define a faceSet into your topoSet...



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