CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

Defining regions with topoSet

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 9, 2014, 23:15
Default Defining regions with topoSet
  #1
New Member
 
Join Date: Oct 2011
Location: Sydney, NSW
Posts: 20
Rep Power: 5
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, 48 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: 20
Rep Power: 5
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: 727
Rep Power: 18
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: 20
Rep Power: 5
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, 43 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,132
Rep Power: 20
alexeym will become famous soon enoughalexeym will become famous soon enough
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: 20
Rep Power: 5
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

Reply

Tags
toposet, toposetdict

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
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 05:42
Defining Regions and Patching Hoper FLUENT 1 September 14, 2009 01:21
defining regions Harriet Pearson Main CFD Forum 0 February 19, 2004 13:44
defining boundary regions Steve CD-adapco 2 January 22, 2004 11:31


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