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

[mesh manipulation] splitMeshRegion

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

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 12, 2014, 04:59
Default splitMeshRegion
  #1
New Member
 
alireza j
Join Date: Sep 2010
Posts: 3
Rep Power: 14
FekrKon is on a distinguished road
Hi OF-Users,

In my case I have two different regions (say SOLID and FLUID). I used topoSet to define different regions and "splitMeshRegions -cellZones -overwrite" to split it into SOLID and FLUID. So far so good. My problem is that what I get at the interface between two regions is just one interface boundary which is know as (say SOLID _to_FLUID of FLUID_to_SOLID). However, what I want is two interface boundaries. i.e. SOLIDtop_to_FLUID and SOLIDbottom_to_FLUID).
in splitMeshRegions wiki it is mentioned to use -useFaceZones to do so but I cannot get anything out of that. Anybody has done anything similar and can give me a sample or any hint?
I appreciate any help

Regards,
FekrKon is offline   Reply With Quote

Old   July 2, 2014, 07:05
Default
  #2
dzi
Member
 
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 13
dzi is on a distinguished road
Hi FekrKon,
could you solve this? I have a similar problem finding my defined regions in the interfaces with SHM on multiregions...

http://www.cfd-online.com/Forums/ope...tml#post499500

regards dirk
dzi is offline   Reply With Quote

Old   July 3, 2014, 05:24
Default
  #3
New Member
 
alireza j
Join Date: Sep 2010
Posts: 3
Rep Power: 14
FekrKon is on a distinguished road
Hi dzi,

No I couldn't eventually solve this problem!
FekrKon is offline   Reply With Quote

Old   July 30, 2014, 02:53
Default splitMeshRegions -cellZonesOnly -useFaceZones
  #4
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 17
fabian_roesler is on a distinguished road
Have a look into this bug report. There is a good example on how to use the -useFaceZones option for splitMeshRegions.

http://www.openfoam.org/mantisbt/view.php?id=1282

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   July 30, 2014, 05:30
Default
  #5
dzi
Member
 
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 13
dzi is on a distinguished road
Hi Fabian,
thanks for your reply! I also found that bugfix post, and i think
"splitMeshRegions -useZellzonesOnly -useFaceZones " is what I am looking for.
The example case from mattjis is working correct, but still I cannot get a working snappyHexMeshDict for my case.

Here again a sketch of my setup:
Code:
------------------------------
|                            |
|    ------------------      |
|    |box1    |box2   |      |
|    |        |       |      |
|    |        |       |      |
|    |        -       |      |
|    |        |       |      |
|    |        |       |      |
|    |        |       |      |
|    |        |       |      |
|    ------------------      |
|                            |
------------------------------ blockMesh
box1 and box 2 are separated by a splitted interface (*_large, *_small).

Box1.stl and Box2.stl are defined in constant/trisurface with some
Code:
solid (...) endsolid
sections which I want to find as patches after splitMeshRegions.
The outer mesh is generated from a blockMeshDict.

This is the snappyHexMeshDict to get 3 regions domain0, box1, box2


Code:
geometry
{
    box1.stl
    {
        type triSurfaceMesh;
//         name box1;       
    regions
    {
      box1_top {name box1_top;}
      box1_interface_large {name box1_interface_large;}
      box1_interface_small {name box1_interface_small;}
    }
    }

    box2.stl
    {
        type triSurfaceMesh;
      name box2;
    regions
     {
         box2_interface_large    { name box2_interface_large; }
         box2_interface_small    { name box2_interface_small; }
         box2_bot {name box2_bot;}
     }
    
    }
};
(...)
  refinementSurfaces
    {
        box1.stl
        //         box1      // use this if name set in geometry section ??
        {
 //            Surface-wise min and max refinement level
            level (1 1);
            faceZone box1;
            cellZone box1;
           cellZoneInside inside;
        regions
        {
          box1_top{
          level (1 1); 
            cellZone box1_top ;
          faceZone box1_top;
           cellZoneInside inside;
          }
          box1_walls{
          level (1 1); 
           cellZone box1_walls ;
          faceZone box1_walls;
           cellZoneInside inside;
          }
        }
        }
        

    box2
        {
          level (1 1);
          faceZone box2;
          cellZone box2;
      cellZoneInside inside;
       regions 
         {
         box2_interface_large
         {
          level (1 2); 
             cellZone box2_interface_large;
          faceZone box2_interface_large;
          cellZoneInside inside;
         }
                  box2_interface_small
         {
          level (1 2); 
            cellZone box2_interface_small;
          faceZone box2_interface_small;
         } 
         box2_bot
         {
          level (1 2); 
           cellZone box2_bot;
          faceZone box2_bot;
         } 
        }
     }
    }
but after
Code:
splitMeshRegions -cellZones  -overwrite
paraFoam -touchAll
but all my wall definitions are lost.

Using

Code:
 splitMeshRegions -cellZonesOnly -useFaceZones -overwrite
ends in


Code:
 Using current faceZones to divide inter-region interfaces into multiple patches.

Using current cellZones to split mesh into regions. This requires all cells to be in one and only one cellZone.

--> FOAM FATAL ERROR: 
For the cellZonesOnly option all cells have to be in a cellZone.
Cell 0 at(-4.62449 -4.41817 -9.50173) is not in a cellZone. There might be more unzoned cells.

    From function splitMeshRegions
    in file splitMeshRegions.C at line 1576.

FOAM exiting
So, all cells have to be in one and the same cellzone , but there are "unzoned cells".
I still could not catch them with any setSet command and assign them to a cellZone. Maybe somebody has an idea about this? (Because of this I switched from a .unv outbox to blockMeshDict, but got the same error). I really would like to know, where and how to set the correct faceZones and cellZones in sHmDict with regions.

Attached is my case with a makeMesh and cleanMesh, I would be glad if somebody gets it working to generate the patches after splitMeshRegions

https://www.dropbox.com/s/fswjgaxaac...Box_2boxes.tgz

Thanks dirk
dzi is offline   Reply With Quote

Old   July 30, 2014, 08:38
Default
  #6
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 17
fabian_roesler is on a distinguished road
Hi

From a first glance I would say you do not need to build cellZones for the patch definition between the two regions. So basically do the following for the two regions:

Code:
faceZone box1;
cellZone box1;
cellZoneInside inside;
and put the separating patches to:

Code:
faceZone box1_top;
faceType internal;
without additional cell zone. Hope that helps!

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   July 30, 2014, 10:47
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Fabian,

how do you know all the parameters you can use in snappyHexMesh ?
I am trying the same thing with a very smart and easy and cleaned case but the result is:

- With region stl I only can create one face for the whole region
- With single stl I can create all faces but then I can not build cellZones for splitting the regions due to the fact that the surfaces are not closed.

I have a simple question if its possible to define faceZones in the regions section like:
Code:
regionSTL.stl
{
       level (0 0);
       faceZone region1Patch;
       cellZone region1;
       cellZoneInside inside;

       regions
       {
             // That patch I want to have in const/polyMesh/faceZones after snappyHexMesh
             patch1  { level (0 0); faceZone facePatch1; }
             // That patch I want to have in const/polyMesh/faceZones after snappyHexMesh
             patch2  { level (0 0); faceZone facePatch2; }
        }
}
Everything I pasted in the regions sub brackets is ignored and I always get a single faceZone for the region.
Additinally I donīt know where to put the (for me new) keyword you mentioned:
Code:
faceZone box1_top;
faceType internal;
It would be a pleasure to hear from you.
Thanks in advance,
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 30, 2014, 11:14
Default topoSet
  #8
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 17
fabian_roesler is on a distinguished road
Hi Tobi

Same happens to me. I guess it is only possible to build one faceZone. However, in such cases I use topoSet. I select the faces connected to both cellZones and put them into a new faceZone for handling in splitMeshRegions. Somithing like:

1. Select all faces of cellZone A
2. Subset with all faces of cellZone B
3. Build new faceZone from faceSet

Quote:
- With region stl I only can create one face for the whole region
- With single stl I can create all faces but then I can not build cellZones for splitting the regions due to the fact that the surfaces are not closed.
For this problem I usualy create several stl files. One for the region itself and non-closed surfaces for the patches.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   July 30, 2014, 12:01
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by fabian_roesler View Post
Hi Tobi

Quote:
- With region stl I only can create one face for the whole region
- With single stl I can create all faces but then I can not build cellZones for splitting the regions due to the fact that the surfaces are not closed.
For this problem I usualy create several stl files. One for the region itself and non-closed surfaces for the patches.

Cheers

Fabian

Hi Fabian,

well I tried this too but then I have the problem, that I have to define a faceZone for the region to get a cellZone as well for splitting the domain into its different zones. Unfortunately the written faceZones of the single STL's which determine the patches I want to get are overwritten (only working in single domain and therefor I always use regions - as far as I know).

Well thanks for your feedback and I will check out your steps. If this is leading to the solution I let you know (but it has to, because you make it in that way)...

I keep you posted.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 22, 2014, 05:33
Default
  #10
dzi
Member
 
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 13
dzi is on a distinguished road
Hi Tobi and Fabian,
thanks a lot for your recommendations and thoughts. I tried again with these instructions. I dont know if I did it right, because all this setSet, topoSet, subset, setToZone, zoneToPatch stuff is somehow confusing.

I used the commands
Code:
setSet, createPatch, splitMeshRegions
.
With this procedure I get a separated interface between the two boxes, also the grading works (the large interface has a finer grid)

Here is what I did, the procedure can be found in the
Code:
makeMesh.sh
shellscript:

1. generate the stl files. These are: the box1 and box2 complete (still with solid/endsolid sections inside), and also the single stl faces ( all by Salome ->export stl function)
2.
Code:
snappyHexMesh -overwrite
. The sHm-dict contains all definitions, so that in the refinementSurfaces-section the faces can be defined as separate facesZones.
Also, box1 and box2 are defined as cellzones.
3.
Code:
setSet -batch batch.setSet
is used to get sets from zones. See the setSet.batch. Two facesets box2FaceSet, box2FaceSet come out.
4.
Code:
createPatch -overwrite
creates patches from the sets. See system/createPatchDict (patchBox1FaceSet,patchBox2FaceSet)
5.
Code:
splitMeshRegions -cellZonesOnly -useFaceZones -overwrite
can now create the regions box1, box2, and domain0 with the splitted interface,
6. paraFoam -touchAll; paraFoam shows what happened.

All in all, there is progress but still it is not, what I wanted

The interface is there, but "sieved". Also I have now 4 interfaces (too much!) inbetween box1 and box2. Only if all 4 are checked, I get the whole faces.
I expected to get in box2 only
box2_interface_large_to_box_1
and
box2_interface_small_to_box_1
(and analog for box1).

Maybe somebody has a hint what else to add/remove?
Many thanks,
dirk

(the case is here:
https://www.dropbox.com/s/zejca1h5fm...ievedPatch.tgz )

EDIT:
now I have seen, createPatch throws an error and splitMeshRegions -cellZonesOnly -useFaceZones -overwrite
throws the error (--> FOAM FATAL ERROR:
For the cellZonesOnly option all cells have to be in a cellZone.
Cell 0 at(-4.62447 -4.41827 -9.50164) is not in a cellZone. There might be more unzoned cells.
)

But when I leave out createPatch it "works" with:

setSet -batch batch.setSet
splitMeshRegions -cellZones -useFaceZones -overwrite
paraFoam -touchAll
Attached Images
File Type: jpg box1box2all.jpg (51.9 KB, 273 views)
File Type: jpg box2.jpg (58.6 KB, 207 views)
File Type: jpg box2_4interface.jpg (99.4 KB, 211 views)
File Type: jpg box2_largesmall_interface.jpg (86.2 KB, 209 views)

Last edited by dzi; August 22, 2014 at 06:20. Reason: first error found...
dzi is offline   Reply With Quote

Old   September 4, 2014, 09:48
Default
  #11
dzi
Member
 
Join Date: Nov 2011
Location: Berlin
Posts: 31
Rep Power: 13
dzi is on a distinguished road
Hello all,
after hours of try and error of multiple configurations and tools I want to share what I found on how to get splitted patches for a multi region case.
It seems to work now on a the simple construct of the 2 boxes with a splitted patch (all options with the solid/endsolid sections in the stl file did not work, also the experiments with creatPatch and splitMeshRegions -cellZonesOnly -useFaceZones ended in the defect surfaces).

Starting point is the generation of stl-files from salome for each single face or group. They provide a closed surface.
All faces are read in the sHMdict geometry section and get a name.

In the refinementSurfaces section the level defines the refinement level etc. In this example, one part of the interface gets a finer grid.

The key was to use
Code:
splitMeshRegions
with the
Code:
-blockedFaces
option, which generates regions according to defined faceSets
(see: http://openfoamwiki.net/index.php/SplitMeshRegions:
-blockedFaces FACESET
Specify additional region boundaries that walking does not cross by specifying a faceSet
)
in this case: setSet.batch:

Code:
faceSet box1FaceSet new zoneToFace box1_top
faceSet box1FaceSet add zoneToFace box1_interface_large
faceSet box1FaceSet add zoneToFace box1_interface_small
faceSet box1FaceSet add zoneToFace box1_walls
faceSet box1FaceSet subset

faceSet box2FaceSet new zoneToFace box2_bot
faceSet box2FaceSet add zoneToFace box2_walls
faceSet box2FaceSet subset

faceSet box1InterfLargeFaceSet new zoneToFace box1_interface_large
faceSet box1InterfSmallFaceSet new zoneToFace box1_interface_small

faceSet borderFaceSet new faceToFace box1FaceSet
faceSet borderFaceSet add faceToFace box2FaceSet 
faceSet borderFaceSet subset
With this faceSets, the complete domain gets splitted into the regions and all patches are preserved using:

Code:
splitMeshRegions -blockedFaces borderFaceSet -useFaceZones  -overwrite
Finally,
Code:
paraFoam -touchAll
lets you find all regions and patches with paraFoam.

What I did not try yet, is how to proceed with the mesh in regions,
but I guess one can create cellSets from regions and work on them (renaming? refine?).

The clean case is here : https://www.dropbox.com/s/m6hniecba2...ittedpatch.tgz
good luck, dirk
Attached Images
File Type: jpg allregions.jpg (60.3 KB, 255 views)
File Type: jpg interfaceBox1Box2.jpg (68.0 KB, 293 views)
File Type: png patches.png (52.0 KB, 167 views)
dzi is offline   Reply With Quote

Old   October 23, 2014, 03:18
Default
  #12
New Member
 
Join Date: Jul 2013
Posts: 8
Rep Power: 11
Alex2 is on a distinguished road
Quote:
For this problem I usualy create several stl files. One for the region itself and non-closed surfaces for the patches
Hi Fabian,

could you please explain, how to use and deal with different stl-files for the region and the patches in sHM? I also tried that, but didn't succeed. A short example would be great!!

@Tobi: Have you solved this problem yet?

Thanks in advance
Alex2 is offline   Reply With Quote

Old   October 23, 2014, 04:16
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi Alex,

no I did not investigate more time to that topic because that was necessary for me and I have no priority (at the moment) solving that problem.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 3, 2015, 09:01
Default
  #14
Member
 
Peng Liang
Join Date: Mar 2014
Posts: 59
Rep Power: 11
tjliang is on a distinguished road
Quote:
Originally Posted by FekrKon View Post
Hi OF-Users,

In my case I have two different regions (say SOLID and FLUID). I used topoSet to define different regions and "splitMeshRegions -cellZones -overwrite" to split it into SOLID and FLUID. So far so good. My problem is that what I get at the interface between two regions is just one interface boundary which is know as (say SOLID _to_FLUID of FLUID_to_SOLID). However, what I want is two interface boundaries. i.e. SOLIDtop_to_FLUID and SOLIDbottom_to_FLUID).
in splitMeshRegions wiki it is mentioned to use -useFaceZones to do so but I cannot get anything out of that. Anybody has done anything similar and can give me a sample or any hint?
I appreciate any help

Regards,
Hi,

have you solved the problem achieving multi boundaries at interface between two regions? I have the same problem, it would be kind if you could tell me that.

Best Regards,

Peng
tjliang is offline   Reply With Quote

Old   November 3, 2015, 11:31
Default
  #15
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,680
Blog Entries: 6
Rep Power: 49
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear peng,

The easiest and fastest way would be to use setSet to create new sets corresponding to the faces you want to have at the boundaries and then use createPatch to create a new patch out of the set. This has to be done for both meshes.

I did not investigate into doing this within the snappyhexmesh
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 5, 2015, 19:53
Default
  #16
Senior Member
 
nasir musa yakubu
Join Date: Mar 2014
Location: Birmingham
Posts: 109
Rep Power: 11
esujby is on a distinguished road
please has anyone tried this method with snappyhexmesh?

thanks
esujby is offline   Reply With Quote

Old   March 8, 2016, 07:39
Default original patch names not generated
  #17
Member
 
Antonio Liggieri
Join Date: Aug 2010
Posts: 72
Rep Power: 13
alfa_8C is an unknown quantity at this point
Hi FOAMer's

I'm trying to generate a multi region mesh with sHM. I can manage to create the different regions. However, no predefined patch names are created. I've taken the snappyMultiRegion case from Tobias Holzmann as tutorial.

http://www.holzmann-cfd.de/index.php...ppymultiregion


But I can't figure out, how I can realise the naming of specific patches...

For any hints and help thanks a lot in advance!
alfa_8C is offline   Reply With Quote

Old   March 8, 2016, 09:15
Default
  #18
Senior Member
 
nasir musa yakubu
Join Date: Mar 2014
Location: Birmingham
Posts: 109
Rep Power: 11
esujby is on a distinguished road
Hello Alfa,
the mesh looks easy, but what do you mean by names the regions, because i was expecting you would name the regions based on your snappyhexmeshdict. i think it would be better to to provide your snappyhexmeshdict and some description of what you are trying to name and in which file dictionary you intend to name the regions.

kind regards

Nas


Quote:
Originally Posted by alfa_8C View Post
Hi FOAMer's

I'm trying to generate a multi region mesh with sHM. I can manage to create the different regions. However, no predefined patch names are created. I've taken the snappyMultiRegion case from Tobias Holzmann as tutorial.

http://www.holzmann-cfd.de/index.php...ppymultiregion


But I can't figure out, how I can realise the naming of specific patches...

For any hints and help thanks a lot in advance!
esujby is offline   Reply With Quote

Old   March 8, 2016, 13:43
Default
  #19
Member
 
Pascal Balz
Join Date: Feb 2015
Location: Germany
Posts: 44
Rep Power: 10
pbalz is on a distinguished road
Quote:
Originally Posted by alfa_8C View Post
However, no predefined patch names are created.
Hi Antonio,

I'm guessing you have the region-wise stl files built up of different solids, like you would do in a one-region mesh?
In this case I'm sorry to disappoint you, but as far as I know snappy isn't capable of using the predefined patches. It just creates the interfaces between the regions, so you need to manually adjust these patches later on (with topoSet and createPatches).
__________________
Regards,
Pascal
pbalz is offline   Reply With Quote

Old   March 8, 2016, 19:19
Default
  #20
Senior Member
 
nasir musa yakubu
Join Date: Mar 2014
Location: Birmingham
Posts: 109
Rep Power: 11
esujby is on a distinguished road
Also, from the geometry you sent me, i will definitely be using salome to mesh the geometry and not snappyhexmesh...if u need help with this i can definitely help
esujby is offline   Reply With Quote

Reply

Tags
splitmeshregions, toposet

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
[Other] splitMeshRegion problem(cell in multi zones) huangkai OpenFOAM Meshing & Mesh Conversion 0 April 10, 2019 10:52
[mesh manipulation] splitMeshRegion for chtMultiRegionFoamCase Bob! OpenFOAM Meshing & Mesh Conversion 0 February 27, 2017 18:08
cht splitMeshRegion but keeping porous cellZones klilla OpenFOAM Pre-Processing 3 November 19, 2013 08:32
[mesh manipulation] splitMeshRegion Khelian973 OpenFOAM Meshing & Mesh Conversion 1 July 2, 2009 05:02
[mesh manipulation] SplitMeshRegion ivan_cozza OpenFOAM Meshing & Mesh Conversion 2 October 29, 2008 06:38


All times are GMT -4. The time now is 20:51.