CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] Defining regions with topoSet (https://www.cfd-online.com/Forums/openfoam-meshing/135169-defining-regions-toposet.html)

the.drizzle May 9, 2014 23:15

Defining regions with topoSet
 
1 Attachment(s)
Hi there,

I'm having trouble figuring out how to get topoSet to do what I want...

Basically, I want to create a compound mesh where each region has different material properties. Making single simple shapes such as rectangles, cylinders and an annulus is straightforward enough, but making more complicated shapes such as the quarter-cirle annulus I've (poorly) illustrated below are eluding me.

In particular, it seems to me that it should be possible to make something like the below image by using some boolean operations--create an annulus and remove some of it by removing the portion that intersects a box. I don't know if this is actually possible via topoSetDict though.

So, any suggestions? If boolean operations are not possible via topoSetDict, how else might I be able to accomplish something like this?

Thanks in advance for any help.

the.drizzle May 11, 2014 20:52

OK, how about this then...

Let's say I want to define a fairly generic closed polygon (no crossing boundaries) in terms of vertex coordinates, and then select the cells internal to the polygon. What seems the most intuitive solution to me would be to define said polygon as a patch in my blockMeshDict file and use that patch in topoSetDict to do the selection. This of course won't work, as defining a patch in this manner is invalid.

Thus, I guess what I'm asking is how I might go about doing this sort of patch selection? Perhaps as some sort of slave relative to the grid patch shown in my previous post? And if that's correct, how?

Thanks in advance for any help.

mturcios777 May 12, 2014 12:57

Depending on your version of OpenFOAM, you can select cells inside a surface geomnetry by using the surfaceToCell source. If you define your shape as an STL file you should be able to get what you want.

the.drizzle May 13, 2014 05:22

1 Attachment(s)
Thanks mturcios777, my problem has (and still remains) doing boolean operations with topoSet. However, I have (sort of) taken your advice and simply did things in gmsh, and used the gmshToFoam utility to convert the mesh. Once that was done, simply selecting the regions via topoSetDict was easy, and splitMeshRegions works like a charm as well.

If anyone can provide some insight as to how to do this via blockMesh + topoSet, I'd still like to know...

alexeym May 13, 2014 05:38

Hi,

I'll assume you'd like to have cellSet. To create quarter of cylinder, you'll need to create outer cylinder, delete from it inner cylinder, delete half with box, and delete half of the acquired half with another box. So it should be something like (I'll create quarter of a cylinder in the center, correct coordinates for your case):

Code:

    {
        name c0;
        type cellSet;
        action new;
        source cylinderToCell;
        sourceInfo
        {
            p1 (0 0 0);
            p2 (0 0 1);
            radius 1;
        }
    }

    {
        name c0;
        type cellSet;
        action delete;
        source cylinderToCell;
        sourceInfo
        {
            p1 (0 0 0);
            p2 (0 0 1);
            radius 0.8;
        }
    }

    {
        name c0;
        type cellSet;
        action delete;
        source boxToCell;
        sourceInfo
        {
            box (-1 -1 0) (1 0 1);
        }
    }

    {
        name c0;
        type cellSet;
        action delete;
        source boxToCell;
        sourceInfo
        {
            box (-1 -1 0) (0 1 1);
        }
    }

After these operations in c0 there will be just a quarter of the cylinder.

Or you'd like to do something else?

the.drizzle May 13, 2014 05:47

Thanks, that's just the kind of tip I have been looking for! I think I now see where I was going wrong, and get on using this tool instead of just swearing at it :-)

arieljeds July 5, 2016 05:56

3 Attachment(s)
hi there, I know this is an old thread but it is exactly on the topic I need to ask about.. I am trying to use topoSet and refineMesh for the first time on a basic cylinder in multiphase flow mesh. What I would like to do is refine the mesh just around the cylinder and in the wake area and leave the rest quite coarse but I'm having trouble with topoSetDict and refineMeshDict understanding the dictionaries and getting the right entries. I'm attaching the blockMeshDict.txt file as it's too long to include here as well as my (barely edited) refineMeshDict and topoSetDict. If anyone can offer some advice on editing these files to refine the cells in the area around the cylinder and wake, I would be very grateful..

the.drizzle July 5, 2016 06:34

Good ol' email notifications!

I'm no longer working in CFD these days (stupid economy!) and my solution is likely outdated in terms of the current OF release. That said though, I have a whole demo script around here somewhere that at least sets up the geometry / meshing consistently, so just pm me an address and I'll be happy to dig it up and send it to you.

Cheers!


All times are GMT -4. The time now is 00:55.