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

[snappyHexMesh] multiple regions

Register Blogs Community New Posts Updated Threads Search

Like Tree13Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2013, 11:59
Default multiple regions
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
Hello all,

I have a new problem. Well lets say not a new but an old new problem. I want to mesh the domain shown in the attachement.

There are two STL file. One for the water and on for the solid region.

Now I want to mesh the geometry with sHM and write out the "two" regions.

As you can see in the picture the water stl is seperated into two single regions and the solid depends on six singel regions.

After meshing with sHM the command checkMesh gives me the following:

Code:
Mesh stats
    points:           1163130
    faces:            3316330
    internal faces:   3274409
    cells:            1076892
    boundary patches: 8
    point zones:      0
    face zones:       2
    cell zones:       2
To get the regions I set the following in the sHM dict:

Code:
        rohr
        {
            // Surface-wise min and max refinement level
            level (2 2);

            faceZone rohr;
            cellZone rohr;
            cellZoneInside inside;
        }
        wasser
        {
            // Surface-wise min and max refinement level
            level (0 0);

            faceZone wasser;
            cellZone wasser;
            cellZoneInside inside;

        }
If I have a look at the meshed geometry with paraFoam I have the two cellZones like I want to have.

CellZone 1 = 2x fluid
CellZone 2 = 6x solid

(attached file)


After splitting the cellZones to regions with
Code:
splitMeshRegions -cellZones
I got 14 regions. every solid region is seperated in a new mesh couse they are not connected to each other.

So my question:

How can I handle that problem?
After splitting my mesh I want to have only the two regions!


I hope that I described my problem properply.

Thanks for every help.
Tobi
Attached Images
File Type: jpg geometry.jpg (12.4 KB, 1122 views)
File Type: jpg Bildschirmfoto vom 2013-02-01 16:53:21.jpg (25.9 KB, 992 views)
Tobi is offline   Reply With Quote

Old   February 2, 2013, 07:00
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

A quick glance to your post makes me remember an old thread about multi-regions, for which I left a link at the wiki page, namely section 3.2: http://openfoamwiki.net/index.php/Sn...-region_meshes

Best regards,
Bruno
Tobi likes this.
__________________
wyldckat is offline   Reply With Quote

Old   February 2, 2013, 07:02
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 wyldckat View Post
Hi Tobi,

A quick glance to your post makes me remember an old thread about multi-regions, for which I left a link at the wiki page, namely section 3.2: http://openfoamwiki.net/index.php/Sn...-region_meshes

Best regards,
Bruno
Thanks Bruno,

i ll have a look at it!
Tobi is offline   Reply With Quote

Old   February 2, 2013, 07:36
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
10000 thanks - works!

- now I am the happiest men in the world.

Greate work.
wyldckat likes this.
Tobi is offline   Reply With Quote

Old   February 2, 2013, 10:40
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
Well Bruno just one question.

Now I have my case ready, but there is only one boundary as
Code:
oldInternalFaces
Code:
Checking patch topology for multiply connected surfaces ...
    Patch               Faces    Points   Surface topology                  
    defaultFaces        0        0        ok (empty)                        
    inlet               0        0        ok (empty)                        
    outlet              0        0        ok (empty)                        
    mappedOut           0        0        ok (empty)                        
    mappedIn            0        0        ok (empty)                        
    wallWasser          0        0        ok (empty)                        
    wasserToRohre       0        0        ok (empty)                        
    oldInternalFaces    34074    34398    ok (closed singly connected)
How can I set the BC for that?
Sorry I am not familiar with setSet and stuff like that!?

Any suggestions?
Tobi is offline   Reply With Quote

Old   February 2, 2013, 15:15
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

"oldInternalFaces" is just an old collection of faces, which should no longer be used. In other words, after you split the zones into regions, the main mesh is basically gone. You now have to (only) set the boundary conditions for the regions.

For more information, check the "chtMultiRegion*Foam" tutorials

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 3, 2013, 18:40
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 wyldckat View Post
Hi Tobi,

"oldInternalFaces" is just an old collection of faces, which should no longer be used. In other words, after you split the zones into regions, the main mesh is basically gone. You now have to (only) set the boundary conditions for the regions.

For more information, check the "chtMultiRegion*Foam" tutorials

Best regards,
Bruno
Hi Bruno,

well thats not the problem. The problem is, that after splitting the mesh I getting 2 regions again. The step I done befor does not make sence at all if I get again two regions.

Okay a short example:

I want to mesh the region shown in the picture.
The two seperated region should be (after meshing) one region.

After meshing and using your advice I get picture #2
The two blocks are in the cellZone wasser

But if I split my mesh now I get two regions again: each for one block.

- region1: wasser
- region2: domain0


But both regions should be in one!
Do you know what I mean?

Is that possible to do?

Thanks Tobi
Attached Images
File Type: jpg p1.jpg (12.3 KB, 291 views)
File Type: jpg pic2.jpg (31.2 KB, 295 views)
File Type: jpg pic3.jpg (33.8 KB, 299 views)
Tobi is offline   Reply With Quote

Old   February 4, 2013, 06:23
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

From your images, it looks like you have 4 regions in total, no matter what. There is no clear indication that the tubes are connected between the two blocks. If the tubes were connected, you should then have 3 regions in total.

If you can share a simpler version of this case, it should be easier to help you.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 4, 2013, 08:10
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno

here is my testcase.

After splitting into Regions I get 4 Regions and the region

"wasser" and " domain1" should be together as one region.

Hope it clear now.

As you said, the geometry is not connected. Thats my question at all. Is it possible to get one region with two not connected regions!?


Couse If you have 20 not connected pipes and all has the same properties it would be very very nice to get only one region which contains all 20 pipes.

Thanks for helping.


Testcase Download
Tobi is offline   Reply With Quote

Old   February 5, 2013, 06:23
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

Good point... now that I think of it, there should be as many zones as tubes...
But from your description, I remembered this groovyBC example: http://openfoamwiki.net/index.php/Co...ing_of_patches - it allows for two separated domains of the mesh to interact with one-another. But I don't remember how exactly it works.

I'll try to look into this the coming weekend... but I hope you manage to figure this out sooner

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 10, 2013, 08:34
Default
  #11
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

OK, I didn't have time to test the following theory, but it should work:
  1. Define the pipes as being part of a single solid. Ditto for the housing blocks.
  2. Generate the mesh using snappyHexMesh and using multi-regions, as shown on "mesh/snappyHexMesh/snappyMultiRegionHeater". The pipes will be defined into a single cell zone region.
  3. Take out the unwanted mesh, following the instructions I mentioned on the 2nd post.
  4. Then... uhm... it depends. You can use createPatch, autoPatch or even snappyHexMesh in a non-refining run, for assigning the patches to the mesh.
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 11, 2013, 19:54
Default
  #12
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno,

I build a new simpler case.
Just wanna mesh three seperated pipes.

1. create background
2. mesh with sHM
3. step in your post #2


then I have my pipes as mesh but without the correct BC.
A new run with sHM to generate the patches is not working.

The other tools "createPatch" or "autoPatch" I ll try but I never done sth. with that commands.

If you know how to create the patches out of the STL files please let me know


My very easy testcase: www.holzmann-cfd.de/openfoamcases/testCase.tar.gz

Thanks in advance
Tobi


PS: via autoPatch its possible to seperate the patches into "autopatch xx" well ... maybe there is a better solution
Tobi is offline   Reply With Quote

Old   February 12, 2013, 19:46
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno,

with an additional sHM run without refinement I get some Boundary Faces but not the whole boundary. Its splittet into oldInternalFields and patches created with the additional run.



AutoPatch is not working couse its not completely a good surface
Tobi is offline   Reply With Quote

Old   February 13, 2013, 05:40
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

Only in the coming weekend will I be able to play with this.
But in the mean time, try to first use splitMeshRegions (not sure of the name of the app) and then use autoPatch each region.

Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 13, 2013, 12:32
Default
  #15
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno,

I have an idea and I think its working but now I have a strange problem. With checkMesh I get 4 regions but if I split my mesh into my regions I get over 70 regions - most of them just contain 1 - 3 cells.

How can I provide that problem?

Code:
Region    Cells
------    -----
0    57621
1    12473
2    59994
3    201142
4    2
5    3
6    1
7    1
8    1
9    1
10    2
11    2
12    3
13    1
14    2
15    4
16    1
17    2
18    3
19    1
20    3
21    2
22    1
23    1
24    2
25    1
26    1
27    19
28    2
29    15
30    2
31    2
32    2
33    1
34    1
35    2
36    1
37    2
38    1
39    1
40    1
41    2
42    4
43    2
44    2
45    3
46    1
47    2
48    3
49    1
50    3
51    1
52    1
53    1
54    2
55    1
56    1
57    2
58    1
59    1
60    2
61    1
62    1
63    1
64    1
65    2
66    2
67    1
68    1
69    1
70    1
71    1
72    2
73    1
74    2
75    1
76    1
77    1
78    1
79    1
Tobi is offline   Reply With Quote

Old   February 13, 2013, 17:20
Default
  #16
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

Multi-regions is a pain to deal with, at least until we get the hang of it.

OK, hints/details/suggestions:
  1. Make the geometry even simpler, at least for now: use only 3 square'ish pipes. The reason is so that you have a less complex and lighter mesh to experiment with, therefore also avoiding crooked meshes.
  2. If you examine in detail the tutorial "mesh/snappyHexMesh/snappyMultiRegionHeater", you'll see that each block only has one name. The interfaces are automatically derived by splitMeshRegions. Which means that for the first mesh, you should not use the definitions of "inlet" and "outlet", simply keep them all as "walls".
  3. After splitting the mesh regions, you can use changeDictionary for renaming patches, if-and-only-if there are enough regions they can interface with... i.e. in the same way as the tutorial "mesh/snappyHexMesh/snappyMultiRegionHeater".
Good luck!
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 13, 2013, 18:08
Default
  #17
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 wyldckat View Post
Hi Tobi,

Multi-regions is a pain to deal with, at least until we get the hang of it.

OK, hints/details/suggestions:
  1. Make the geometry even simpler, at least for now: use only 3 square'ish pipes. The reason is so that you have a less complex and lighter mesh to experiment with, therefore also avoiding crooked meshes.
  2. If you examine in detail the tutorial "mesh/snappyHexMesh/snappyMultiRegionHeater", you'll see that each block only has one name. The interfaces are automatically derived by splitMeshRegions. Which means that for the first mesh, you should not use the definitions of "inlet" and "outlet", simply keep them all as "walls".
  3. After splitting the mesh regions, you can use changeDictionary for renaming patches, if-and-only-if there are enough regions they can interface with... i.e. in the same way as the tutorial "mesh/snappyHexMesh/snappyMultiRegionHeater".
Good luck!
Bruno

Hi Bruno,

thanks for the hints.
The last problem is gonna be solved by refining the STL mesh!

So first problem solved!
Tobi is offline   Reply With Quote

Old   February 14, 2013, 13:35
Default
  #18
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno,

well everythings works fine with multiregion. Yesterday I meshed a reactor with heatelemnt and steel (3 regions) out of four due to the domain0.

But that was not a problem couse domain0 does not matter. I delete that region and renamed the patches with createPatch.

The only thing that makes the multi region complicated is the fact, that if you have more similar geometries e.g. pipes with same properties but not connected to each other, you ll get several regions for each pipe (but you know that). After sHM you have all pipes in ONE region but by splitting it, it ll be seperated.

Well I think the easiest way is:

1. for every single region you have to build one STL (instead of building one STL for 10 pipes)
2. load everything into sHM
3. Meshing
4. splitting

and then: create a simple script that change all the entries and values you have to change.


I ll do that way now and publish my case here.
Yesterday I had success in doing that way on a other geometry. This one ll be published in a few weeks couse now I am not allowed to publish it.

Tobi

BUT Bruno, thanks for all your help and commitment to help me!
Tobi is offline   Reply With Quote

Old   February 14, 2013, 18:04
Default
  #19
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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 Bruno,

do you know how to solve that problem:
--------------------------------------------------------

I made my six pipes and the channel as singel STL and after splitting the mesh I get some little smart domains with one or two cells at the interface between pipes and channel (attachement! <- the two brightness cells)

How can I solve that problem?
Or did anybody else know that problem?

Tobi
Attached Images
File Type: jpg additionalDomains.jpg (22.4 KB, 153 views)
Tobi is offline   Reply With Quote

Old   February 15, 2013, 08:18
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Tobi,

My guess is that the base mesh needs a little bump in one of the directions, because an edge might be in the wrong place, leading snappy to have difficulties aligning the final mesh onto the surface of the pipes.

The other possibility is the need to improve some of the quality controls for meshing. Don't forget that when meshing all zones, snappy will have to take into account both sides of all surfaces, not just one side!

Use the "Extract Cells by Region" filter on ParaView to diagnose better those odd shaped cells (don't forget to not decompose polyhedra!), where you'll probably see some contortions going on there! It'll be easier this way to assess what quality indicator is having problems there.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply


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] Unkown multiple regions in checkMesh hokhay OpenFOAM Meshing & Mesh Conversion 4 December 30, 2021 08:40
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[CAD formats] Clean / Repair STL file with multiple regions on command line matthiasd OpenFOAM Meshing & Mesh Conversion 6 May 24, 2016 07:51
[snappyHexMesh] Using snappyHexMesh for multiple enclosed regions richard_vega OpenFOAM Meshing & Mesh Conversion 0 November 13, 2014 15:28
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21


All times are GMT -4. The time now is 10:15.