CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (https://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   how to mesh a domain splitted in two? (https://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/121765-how-mesh-domain-splitted-two.html)

aCFDuser August 5, 2013 05:21

how to mesh a domain splitted in two?
 
Dear foamers,

I'm quite new using SnappyHexMesh and I'm facing the following problem:

My complex model (irregular surfaces), from a .stl file, has an internal surface (without thickness) that splits the domain in two volumes. I'd like to have this internal surface as a patch to apply some BCs on it. The triangles of both surface meshes perfectly match.
How can I mesh both sub-volumes with this zero-thickness surface in between?

I have tried the following:
1.- Import the external surface (my .stl file) and the internal surface (also an .stl) as separated files in SnappyHexMesh and I generated the volumetric mesh.
--> didn't work: "locationInMesh" only allows one point and thereby, only one of the volume is meshed (the one were the point in locationInMesh is located).

2.- Import both surfaces (external and internal) as one surface mesh using surfaceAdd
-->didn't work: for the same reason as before.

3.- Mesh the whole volume without the internal surface and then apply surfaceToPatch using the internal surface.
-->didn't work: Only some triangles at the external surface where recognized as part of the patch, which is very rare since the internal surface doesn't have any triangle on the external surface mesh (only some nodes and edges).

4.- Mesh the whole volume without the internal surface (same as 3) but then I used topoSet to identify the cell near the internal surface and then createBaffles.
--> Nice try but not what I need because the selected cells (that belong to the new patch) are not snapped on the internal surface and thereby, the resulting patch keeps the castellated mesh (stair-like shape).

From these tests, I got the impression that the best solution for my problem would be to mesh both volumes at the same time, but I cannot find any option in snappyHexMeshDict that allows this.

Thanks in advance

zhengzh5 August 30, 2013 18:06

Quote:

Originally Posted by aCFDuser (Post 443852)
Dear foamers,

I'm quite new using SnappyHexMesh and I'm facing the following problem:

My complex model (irregular surfaces), from a .stl file, has an internal surface (without thickness) that splits the domain in two volumes. I'd like to have this internal surface as a patch to apply some BCs on it. The triangles of both surface meshes perfectly match.
How can I mesh both sub-volumes with this zero-thickness surface in between?

I have tried the following:
1.- Import the external surface (my .stl file) and the internal surface (also an .stl) as separated files in SnappyHexMesh and I generated the volumetric mesh.
--> didn't work: "locationInMesh" only allows one point and thereby, only one of the volume is meshed (the one were the point in locationInMesh is located).

2.- Import both surfaces (external and internal) as one surface mesh using surfaceAdd
-->didn't work: for the same reason as before.

3.- Mesh the whole volume without the internal surface and then apply surfaceToPatch using the internal surface.
-->didn't work: Only some triangles at the external surface where recognized as part of the patch, which is very rare since the internal surface doesn't have any triangle on the external surface mesh (only some nodes and edges).

4.- Mesh the whole volume without the internal surface (same as 3) but then I used topoSet to identify the cell near the internal surface and then createBaffles.
--> Nice try but not what I need because the selected cells (that belong to the new patch) are not snapped on the internal surface and thereby, the resulting patch keeps the castellated mesh (stair-like shape).

From these tests, I got the impression that the best solution for my problem would be to mesh both volumes at the same time, but I cannot find any option in snappyHexMeshDict that allows this.

Thanks in advance

i did something similar before with the chtMultiRegionFoam, basically using the method 1 you described. put each of the closed-volume into a separate stl file and have snappyHexMesh mesh both stls in one go. then use splitMeshRegions to separate them into individual regions, each region containing the internal surface.

Hope that's what you're looking for.

aCFDuser September 20, 2013 03:46

Dear zhengzh5,

Thanks for your advice. I was away for a long period but now I'm back to solve this problem.

I tried what you suggested (following method 1) and I managed to have both volumes meshed. Moreover, I can specified the cell size near the internal surface but still the cells are not snapped on the internal surface. I tried splitMeshRegions but does work, I guess because there is only one region.

In any case, since I can specified the cell size near the internal surface, I can make it very thin and then apply some conditions to those cells.

Thanks for your help.

zhengzh5 September 20, 2013 12:40

Quote:

Originally Posted by aCFDuser (Post 452659)
Dear zhengzh5,

Thanks for your advice. I was away for a long period but now I'm back to solve this problem.

I tried what you suggested (following method 1) and I managed to have both volumes meshed. Moreover, I can specified the cell size near the internal surface but still the cells are not snapped on the internal surface. I tried splitMeshRegions but does work, I guess because there is only one region.

In any case, since I can specified the cell size near the internal surface, I can make it very thin and then apply some conditions to those cells.

Thanks for your help.

if you have multiple stl files specifying multiple volumes, then splitMeshRegions should be able to identify multiple regions. i normally use "splitMeshRegions -cellZones -overwrite". and use "paraFoam -touchAll" after you have split the regions such that it generates multiple .foam file for you to view each of the regions independently, or together in paraFoam.

Just a quick question, Do you have multiple solids in each of the stl files specifying the patches making up the volume? and what is your snappyHexMeshDict looks like, particularly the part where you specify the geometry and refinementSurfaces.

Harak August 11, 2015 13:32

Quote:

Originally Posted by zhengzh5 (Post 448973)
i did something similar before with the chtMultiRegionFoam, basically using the method 1 you described. put each of the closed-volume into a separate stl file and have snappyHexMesh mesh both stls in one go. then use splitMeshRegions to separate them into individual regions, each region containing the internal surface.

Hope that's what you're looking for.

Hi Jace,

I'm having exactly the same problem.
Would you please describe the solution step by step?

I really appreciate it :)

Thanks

vineet_bhola August 19, 2015 04:33

Hi Harak,
You need to define 2 geometries(in my example) based on stl files and then later use them in refinementSurfaces to define cellzones. If you don't add cellzones and facezones, only one of the volumes containing LocationInmesh point will be meshed
Make sure these stl files are closed and are properly oriented. You can use surfaceCheck command to get these informations whether the stl is closed and have one normal direction

1. step
geometry
{
solid.stl
{
type triSurfaceMesh;
name solid;
}

wasser_clean.stl
{
type triSurfaceMesh;
name wasser;
}
};

2. step
refinementSurfaces
{
solid
{
// Surface-wise min and max refinement level
level (2 2);
faceZone solid;
cellZone solid;
zoneInside true;

}

wasser
{
// Surface-wise min and max refinement level
level (2 2);
faceZone wasser;
cellZone wasser;
zoneInside true;
}
}

Hope that helps,
Vineet

Harak August 19, 2015 08:27

Quote:

Originally Posted by vineet_bhola (Post 560161)
Hi Harak,
You need to define 2 geometries(in my example) based on stl files and then later use them in refinementSurfaces to define cellzones. If you don't add cellzones and facezones, only one of the volumes containing LocationInmesh point will be meshed
Make sure these stl files are closed and are properly oriented. You can use surfaceCheck command to get these informations whether the stl is closed and have one normal direction

1. step
geometry
{
solid.stl
{
type triSurfaceMesh;
name solid;
}

wasser_clean.stl
{
type triSurfaceMesh;
name wasser;
}
};

2. step
refinementSurfaces
{
solid
{
// Surface-wise min and max refinement level
level (2 2);
faceZone solid;
cellZone solid;
zoneInside true;

}

wasser
{
// Surface-wise min and max refinement level
level (2 2);
faceZone wasser;
cellZone wasser;
zoneInside true;
}
}

Hope that helps,
Vineet

Hi Vineet,

thanks for your reply.
In the meanwhile I found another way to do it and it worked as well :)

I did one stl file for each domain and then put them in one stl file with gedit and defined there the patch names. After that I snappyHexMeshed this one stl file so that I get only one part meshed, repeated it for the other part and finally used mergeMeshes to get the two separated parts into one mesh :)
Quite effortful but working :D

Harak


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