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

[mesh manipulation] Defining regions with topoSet

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes
  • 8 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2014, 23:15
Default Defining regions with topoSet
  #1
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 21
Rep Power: 14
the.drizzle is on a distinguished road
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.
Attached Images
File Type: jpg temp.jpg (67.8 KB, 505 views)
the.drizzle is offline   Reply With Quote

Old   May 11, 2014, 20:52
Default
  #2
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 21
Rep Power: 14
the.drizzle is on a distinguished road
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.
the.drizzle is offline   Reply With Quote

Old   May 12, 2014, 12:57
Default
  #3
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Old   May 13, 2014, 05:22
Default
  #4
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 21
Rep Power: 14
the.drizzle is on a distinguished road
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...
Attached Images
File Type: png working.png (25.2 KB, 449 views)
the.drizzle is offline   Reply With Quote

Old   May 13, 2014, 05:38
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
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?
alexeym is offline   Reply With Quote

Old   May 13, 2014, 05:47
Default
  #6
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 21
Rep Power: 14
the.drizzle is on a distinguished road
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 :-)
the.drizzle is offline   Reply With Quote

Old   July 5, 2016, 05:56
Default
  #7
Senior Member
 
ArielJ
Join Date: Aug 2015
Posts: 127
Rep Power: 10
arieljeds is on a distinguished road
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..
Attached Files
File Type: txt topoSetDict.txt (1.0 KB, 352 views)
File Type: txt refineMeshDict.txt (1.9 KB, 123 views)
File Type: txt blockMeshDict.txt (17.4 KB, 68 views)
arieljeds is offline   Reply With Quote

Old   July 5, 2016, 06:34
Default
  #8
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 21
Rep Power: 14
the.drizzle is on a distinguished road
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!
the.drizzle is offline   Reply With Quote

Reply

Tags
toposet, toposetdict


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
[snappyHexMesh] defining porous zone in toposet mvee OpenFOAM Meshing & Mesh Conversion 5 July 13, 2020 12:28
Defining regions with topoSet BarCFD OpenFOAM Pre-Processing 2 February 4, 2018 11:18
Defining multiple regions in MRFsimpleFoam ameen@cfd OpenFOAM Running, Solving & CFD 7 May 9, 2014 05:29
splitting regions and defining BC in conjugate heat transfer skuznet OpenFOAM Pre-Processing 3 December 9, 2013 04:42
defining regions Harriet Pearson Main CFD Forum 0 February 19, 2004 12:44


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