CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Multi region meshing & recovering the original patch names (https://www.cfd-online.com/Forums/openfoam-meshing/74092-multi-region-meshing-recovering-original-patch-names.html)

fluidpath March 24, 2010 07:01

Multi region meshing & recovering the original patch names
 
1 Attachment(s)
Hello All,

I have been trying to do some multi region (multi volume) using snappyHexMesh (sHM) with a simple two boxes side by side geometry. I am struggling with getting it to work, in terms of getting 2 distinct volume regions and recovering my original geometry patches. I've attached a tiny tar archive of the case for reference.


I started with the following individual STL files :-

box01.stl (5 out of 6 faces of a closed box)
baffle01.stl (common wall between the two box volumes)
box02.stl (5 out of 6 faces of a closed box)
baffle02.stl (copy of baffle01.stl but with flipped normals)


I then edited the individual STL files and post-fixed the "solid" and "endsolid" keywords with the desired region name :-

box01_baffle01
box01_box01
box02_baffle02
box02_box02

These four individual files were then concatenated together to form the final 2 closed volume multi region STL parts :-

cat box01.stl baffle01.stl > fluid_box01.stl
cat box02.stl baffle02.stl > fluid_box02.stl


As a side note I found that I couldn't recover the correct two volumes if the normals weren't consistently facing outward for each volume (I am guessing inward normals would also work).

In the sHM dictionary (under refinementSurfaces{} ) I defined the following 2 face and 2 cell zone names in order to extract the 2 regions (the key geometry{} & refinementsurfaces{} sections are posted at the bottom of this message for convenience) :-

fluid_box01_fz
fluid_box01_cz
fluid_box02_fz
fluid_box02_cz

I then ran blockMesh (whose extents are purposefully larger than those of the STL geometry) and sHM on the case before running "splitMeshRegions -cellZones" utility. This recovers nicely the 3 distinct regions in my case - fluid_box01_cz, fluid_box02_cz and domain0 which contains the remaining volume cells, outside of the 2 box STL geometry.

The following lists the resulting patches for each of the 3 recovered regions :-

"domain0" boundary patches
----------
minX
maxX
minY
maxY
minZ
maxZ
domain0_to_fluid_box01_cz
domain0_to_fluid_box02_cz

"fluid_box01_cz" boundary patches
-----------
fluid_box01_cz_to_domain0
fluid_box01_cz_to_fluid_box02_cz


"fluid_box02_cz" boundary patches
-----------
fluid_box02_cz_to_fluid_box01_cz
fluid_box02_cz_to_domain0


My question is how can I preserve or recover the original patch region names that I specified in the 2 STL files. As you can see from above I currently end up with names along the lines of "cellZone A_to_cellZoneB". This test case only had two region patches in each of the 2 closed STL files so a simple renaming operation could be used. However, if each of the 2 closed STL files had 6 region patch names (i.e. 1 per box side) then I think you would still only get the above list of resulting patches?

Am I correct in thinking that sHM cannot use many separate STL files to do multi region meshing, unless the separate regions are wholely contained inside a single closed volume stl file? So if you had a box shaped region that you wanted meshed and this was contained in 2 separate stl files this would not work.


Thank you for any help or assistance you can give me!






geometry
{
fluid_box01.stl
{
type triSurfaceMesh;
//cannot use name with regions
// name fluid_box01;

regions
{
box01_box01 // Named region in the STL file
{
name box01_box01; // User-defined patch name
}
box01_baffle01
{
name box01_baffle01;
}
}
}

fluid_box02.stl
{
type triSurfaceMesh;
//cannot use name with regions
// name fluid_box02;

regions
{
box02_box02 // Named region in the STL file
{
name box02_box02; // User-defined patch name
}
box02_baffle02
{
name box02_baffle02;
}
}
}

};


.
.
.


refinementSurfaces
{
fluid_box01.stl
{
// Surface-wise min and max refinement level
level (1 1);
faceZone fluid_box01_fz;
cellZone fluid_box01_cz;
zoneInside true;

regions
{
box01_box01 // Named region in the STL file
{
level (1 1); // User-defined patch name
}
box01_baffle01
{
level (1 1);
}
}
}

fluid_box02.stl
{
// Surface-wise min and max refinement level
level (1 1);
faceZone fluid_box02_fz;
cellZone fluid_box02_cz;
zoneInside true;

regions
{
box02_box02 // Named region in the STL file
{
level (1 1); // User-defined patch name
}
box02_baffle02
{
level (1 1);
}
}
}
}

.
.
.

jackeyhust May 17, 2013 17:01

Nobody knows the solution?
 
I had the same problem. Could anybody give some solution?:) thanks a lot!

wyldckat May 19, 2013 06:08

Greetings to all! Jackie, welcome to the forum!

@Jackie: I got your email about this thread. I know I've either answered to this question in the past or I've already seen the answer in the forum. But after 15 minutes of searching, I can't find it.
Either way, try reading the following threads for ideas:
Best regards,
Bruno

billie May 19, 2013 06:33

I want do do the same thing with sHM and I searched the forums up and down but could not find a solution.

I think original patches are preserved if there is one region and a blockMesh which is larger than than the actual geometry but not if you have multiple regions.

I tried with a simple test case, a short pipe with only a subset of the solid walls as separate patch where a heat flux should be applied but the original patch is not preserved by sHM. I can share the case and upload it next week if anyone wants to take a look at it.

jackeyhust May 19, 2013 19:13

Thank you so much!
 
Quote:

Originally Posted by wyldckat (Post 428510)
Greetings to all! Jackie, welcome to the forum!

@Jackie: I got your email about this thread. I know I've either answered to this question in the past or I've already seen the answer in the forum. But after 15 minutes of searching, I can't find it.
Either way, try reading the following threads for ideas:
Best regards,
Bruno

Hi, Bruno,

it's really kind of you! I read your recommended post. That's quite nice and useful. I will try it and give you the feedback.

regards,

Jackie


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