CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Multi Region Meshing with sHM

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

LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2011, 03:30
Default Multi Region Meshing with sHM
New Member
Join Date: Jun 2010
Location: Germany
Posts: 13
Rep Power: 15
marango is on a distinguished road
Hi everybody,

I'm currently working on a complex geometry with multiple regions. Therefore I decided to use snappyHexMesh to create a mesh of my geometry. Since my results are not useful, I do have some questions about working with sHM. Perhaps somebody can help me, finding the answers.

(1) In my geometry I have two regions that consists of different materials. One region is a pipe with a wall thickness of 2mm and the other one is a cylinder that perfectly fits in that pipe, so that there's no space in between. My question is how sHM works with these two regions. Does it create the mesh for each region one after the other and finally puts them together OR does it uses the regions "in parallel" while creating the mesh?

(2) I tried to to create a mesh for each region and manually merge them with mergeMeshRegions. Since sHM cannot exactly resolve the curvature of the pipe and cylinder, it creates some space between these two parts (see picture below). Does anyone can give me some advice to make them perfectly fit?

(3) In snappyHexMeshDict I have to define an inside point. Do I have to choose a special point or is it indifferent in which region this point lies?

(4) When I use multiple regions with sHM, it doesn't remove the outer cells I don't need. Is there a way to remove them manually?

Many thanks in advance!

Attached Images
File Type: jpg pipe_cylinder.jpg (12.9 KB, 89 views)
marango is offline   Reply With Quote

Old   September 16, 2011, 03:11
New Member
Join Date: May 2011
Location: München
Posts: 12
Rep Power: 15
Clementhuon is on a distinguished road
Hi marango,

II don't know how you proceed exactly but I think you should try this way. It depends how you created your geometry but I think that if you use SHM you get two .stl files for your two regions.
Put the two.stl file in your trisurface folder. Then constrruct your SHMdict this way

        type "chooseyourtype";
        name "choosethename";

        type ;
        name ;


// Settings for the castellatedMesh generation.

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    // While refining maximum number of cells per processor. This is basically
    // the number of cells that fit on a processor. If you choose this too small
    // it will do just more refinement iterations to obtain a similar mesh.
    maxLocalCells 1000000;

    // Overall cell limit (approximately). Refinement will stop immediately
    // upon reaching this number so a refinement level might not complete.
    // Note that this is the number of cells before removing the part which
    // is not 'visible' from the keepPoint. The final number of cells might
    // actually be a lot less.
    maxGlobalCells 2000000;

    // The surface refinement loop might spend lots of iterations
    // refining just a few cells. This setting will cause refinement
    // to stop if <= minimumRefine are selected for refinement. Note:
    // it will at least do one iteration (unless the number of cells
    // to refine is 0)
    minRefinementCells 10;

    // Number of buffer layers between different levels.
    // 1 means normal 2:1 refinement restriction, larger means slower
    // refinement.
    nCellsBetweenLevels 2;

    // Explicit feature edge refinement (with OpenFOAM-2)
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
            file "pipe.eMesh";
            level 1;
            file "fluid.eMesh";
            level 1;

    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies two levels for every surface. The first is the minimum level,
    // every cell intersecting a surface gets refined up to the minimum level.
    // The second level is the maximum level. Cells that 'see' multiple
    // intersections where the intersections make an
    // angle > resolveFeatureAngle get refined up to the maximum level.

            // Surface-wise min and max refinement level
            level (1 1);

            // Surface-wise min and max refinement level
            level (1 1);
Then in your constant and system directory you will have to create a "pipe" and a "fluid" folder to set the different parameters of your two material.

For the location in mesh point, you have just to choose a point in your geometry, whatever is the meterial.

You also can look (maybe you allready did it) the tutorial mesh/snappyHexMesh/snappyMultiRegionHeater

I hope that will help you ....

Clementhuon is offline   Reply With Quote

Old   September 16, 2011, 08:50
New Member
Join Date: Jun 2010
Location: Germany
Posts: 13
Rep Power: 15
marango is on a distinguished road
Hi Clementhuon,

thanks for your help.

I've also tried the way you described. But there occur some other problems. Like I wrote in the first post, I'm working on a high complex geometry, where the cylinder and the pipe only represent a small part. When I use the whole geometry with multi regions sHM creates these spaces between the regions too. But there are less of them. I guess it could be a matter of refinement, but when I choose a higher level of refinement, sHM aborts due to lack of memory. That's why I decided to mesh each region and finally merge them.

Perhaps your way is the better one, but I don't know how to avoid the spaces between.

Even if sHM creates a good mesh, the problem in (4) still remains. I have really no idea.

Have a nice weekend,
marango is offline   Reply With Quote

Old   March 27, 2012, 00:51
Senior Member
Daniele Vicario
Join Date: Mar 2009
Location: Novara, Italy
Posts: 142
Rep Power: 17
danvica is on a distinguished road
Hi marango,
I'm facing the same problem.

Did you already found a solution ?

danvica is offline   Reply With Quote


Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Negative initial temperature error (chtMultiRegionFoam) jebin OpenFOAM Pre-Processing 60 July 17, 2022 05:10
Can I use fvOptions to couple a solid region and a fluid region? titanchao OpenFOAM Running, Solving & CFD 4 January 14, 2022 07:55
Problem with chtMultiregionFoam radiation boundary condition baran_foam OpenFOAM Running, Solving & CFD 10 December 17, 2019 17:36
Problem simulating the temperature rise in a composite material (chtMultiRegionFoam) Adam_K OpenFOAM Running, Solving & CFD 2 March 27, 2019 06:51
Multi region meshing noob@cfd Siemens 2 March 26, 2012 12:32

All times are GMT -4. The time now is 18:04.