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

[snappyHexMesh] how to mesh a domain splitted in two?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2013, 05:21
Unhappy how to mesh a domain splitted in two?
  #1
New Member
 
anonymous
Join Date: May 2013
Posts: 6
Rep Power: 12
aCFDuser is on a distinguished road
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
aCFDuser is offline   Reply With Quote

Old   August 30, 2013, 18:06
Default
  #2
Member
 
Jace
Join Date: Oct 2012
Posts: 77
Rep Power: 15
zhengzh5 is on a distinguished road
Quote:
Originally Posted by aCFDuser View Post
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.
zhengzh5 is offline   Reply With Quote

Old   September 20, 2013, 03:46
Default
  #3
New Member
 
anonymous
Join Date: May 2013
Posts: 6
Rep Power: 12
aCFDuser is on a distinguished road
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.
aCFDuser is offline   Reply With Quote

Old   September 20, 2013, 12:40
Default
  #4
Member
 
Jace
Join Date: Oct 2012
Posts: 77
Rep Power: 15
zhengzh5 is on a distinguished road
Quote:
Originally Posted by aCFDuser View Post
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.
zhengzh5 is offline   Reply With Quote

Old   August 11, 2015, 13:32
Default
  #5
Member
 
Join Date: Dec 2014
Posts: 50
Rep Power: 11
Harak is on a distinguished road
Quote:
Originally Posted by zhengzh5 View Post
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
Harak is offline   Reply With Quote

Old   August 19, 2015, 04:33
Default
  #6
Member
 
Vineet Bhola
Join Date: Jun 2015
Location: Chemnitz, Germany
Posts: 49
Rep Power: 10
vineet_bhola is on a distinguished road
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
vineet_bhola is offline   Reply With Quote

Old   August 19, 2015, 08:27
Default
  #7
Member
 
Join Date: Dec 2014
Posts: 50
Rep Power: 11
Harak is on a distinguished road
Quote:
Originally Posted by vineet_bhola View Post
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

Harak
Harak is offline   Reply With Quote

Reply

Tags
snappyhexmesh 3d, split volumes


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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
Sudden increase the residual of Maxwell's equations hsezsz CFX 2 October 13, 2016 06:58
SnappyHexMesh... Domain boundaries are uneven Blue8655 OpenFOAM Pre-Processing 0 January 20, 2016 11:43
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20


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