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/)
-   -   topoSetDict by Mesh from another Software (https://www.cfd-online.com/Forums/openfoam-pre-processing/142063-toposetdict-mesh-another-software.html)

Parisa_Khiabani September 22, 2014 17:42

topoSetDict by Mesh from another Software
 
Hi,
I have imported a mesh from another software to OpenFOAM. Right now, I have all the faces in the boundary file in polymesh.
I am using chtMultiRegionFoam. How can I set the topoSetDict? In the sourceInfo, I would like to put all the faces that make the cell. What should be the keyword in the source?
Is that my strategy correct?

Regards,
Parisa

Parisa_Khiabani September 22, 2014 18:15

In a better way to ask, suppose that I have all the boundary faces.
How can I make the zone with the available faces, and then set the zone.

Thanks,
Parisa

wyldckat October 4, 2014 13:01

Greetings Parisa,

Since you didn't provide specific details, I'll have to give a general answer.
You can use this command to find tutorials that use topoSet:
Code:

find $FOAM_TUTORIALS -name Allrun | xargs grep -sl topoSet
In addition, the master example file for topoSetDict is pointed by this command:
Code:

find $FOAM_UTILITIES -name topoSetDict
Best regards,
Bruno

Wien3 December 12, 2014 06:29

3 Attachment(s)
Good Morning,
I am very interested on this thread, so I will detail my problem. I guess it is exactly the same that Parisa_Khiabani had.

I have been working with engrid and I have a complete model (includin its mesh) which consists of a cube inside another cube. The fluid will enter from the inlet and it will go out by the outlet, and the idea is to analyse the influence on it about temperature.

For this purpose I have worked with chtMultiregionSimpleFoam. I achieved to do the same but creating the 2 cubes directly from OpenFoam, the first one with the mesh and the second one as a region in topoSetDict.
PHP Code:

convertToMeters 1;

vertices
(
    (
0 0 0)
    (
5 0 0)
    (
5 2 0)
    (
0 2 0)
    (
0 0 2)
    (
5 0 2)
    (
5 2 2)
    (
0 2 2)
);

blocks
(
    
hex (0 1 2 3 4 5 6 7) (100 30 30simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    
Top
    
{
        
type patch;
        
faces
        
(
            (
4 5 6 7)
        );
    }
    
Bottom
    
{
        
type patch;
        
faces
        
(
            (
0 1 2 3)
        );
    }
    
Inlet
    
{
        
type patch;
        
faces
        
(
            (
0 4 7 3)
        );
    }
    
Outlet
    
{
        
type patch;
        
faces
        
(
            (
1 2 6 5)
        );
    }
    
Back
    
{
        
type patch;
        
faces
        
(
            (
0 1 5 4)
        );
    }
    
Front
    
{
        
type patch;
        
faces
        
(
            (
3 2 6 7)
        );
    }


);

mergePatchPairs
(
); 

PHP Code:

actions
(
    
// cube
    
{
        
name    cube;
        
type    cellSet;
        
action  new;
        
source  boxToCell;
        
sourceInfo
        
{
            
box (2.3 0.8 0.8 )(2.7 1.2 1.2);
        }
    }
    {
        
name    cube;
        
type    cellZoneSet;
        
action  new;
        
source  setToCellZone;
        
sourceInfo
        
{
            
set cube;
        }
    }
    
// fluid
    
{
        
name    fluid;
        
type    cellZoneSet;
        
action  clear;
    }
    {
        
name    fluid;
        
type    cellSet;
        
action  add;
        
source  cellToCell;
        
sourceInfo
        
{
            
set cube;
        }
    }
    {
        
name    fluid;
        
type    cellSet;
        
action  invert;
    }
    {
        
name    fluid;
        
type    cellZoneSet;
        
action  new;
        
source  setToCellZone;
        
sourceInfo
        
{
            
set fluid;
        }
    }
); 

Once I know how to work with this solver, I am trying to work with it but using my engrid model. From it export I obtain every single file inside polymesh folder except blockMeshdict (so they are boundary, faces, neighbour, owner and points).

If I just substitute this files in the polymesh of my OF model, it gaves problem with the fluid region. I have been testing and I got the conclusion that the cube of my engrid file would be cutting the fluid region, so it doesn't know how to interpret it.

So my question to the forum is: What I have to do to have my element of study (in this case is the little cube, but it could be a cylinder or whatever) to make it work as a region in topoSetDict and not having to create it?? In this case a cube it is not a problem, but you can imagine if it is a complex structure.

I guess it should be similiar to what I found here: https://github.com/OpenFOAM/OpenFOAM...SetDicthttp:// between lines 145 and 158. I post it here but I don't know why it doesn't paste well.

// // Select based on surface
// source surfaceToCell;
// sourceInfo
// {
// file "www.avl.com-geometry.stl";
// useSurfaceOrientation false; // use closed surface inside/outside
// // test (ignores includeCut,
// // outsidePoints)
// outsidePoints ((-99 -99 -59)); // definition of outside
// includeCut false; // cells cut by surface
// includeInside false; // cells not on outside of surf
// includeOutside false; // cells on outside of surf //
nearDistance -1; // cells with centre near surf // // (set to -1 if not used) //
curvature 0.9; // cells within nearDistance // // and near surf curvature // // (set to -100 if not used) // }

I attach the following pictures: engrid model and the case made directly from OF with this solver. If it is necessary to attach any further information don't hesitate to ask.
This is quite important for my and I don't know how to continue.

Thank you in advance!


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