CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   how to mesh a domain splitted in two? (http://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.


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