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] snappyHexMesh does not create boundary patches from .stl files (https://www.cfd-online.com/Forums/openfoam-meshing/173831-snappyhexmesh-does-not-create-boundary-patches-stl-files.html)

bug_or_feature June 28, 2016 11:07

snappyHexMesh does not create boundary patches from .stl files
 
Hi everyone,

Having read quite a few threads I decided to join the forum myself. Thanks for all the help you have already provided me with while not even being registered.

Now to a problem I was not able to solve yet: I am trying to mesh a multi region case (one region solid, one region fluid). I have .stl files for each region (solid.stl, fluid.stl). According to the surfaceCheck utility both .stl files are closed surfaces (which was hard enough to begin with). Additionally both .stl files contain various different patches:

Code:

solid solid_region_1
    ...
endsolid
solid solid_region_2
    ...
endsolid

I configured my blockMesh so that the box is slightly larger than my geometry. The geometry is cut in half in the middle because I assume it to be symmetric to that plane (this is the only place where the blockMesh cuts the geometry).

In my snappyHexMeshDict I loaded the .stl files in the geometry sub-directory like this:

Code:

geometry
{
    solid.stl
    name solid
    regions
    {
        solid_region_1
        {
              name solid_region_1
        }
        ...
    }
    fluid.stl
    ....
}

I also declared them in the refinementSurfaces sub-dict:

Code:

refinementSurfaces
{
    solid
    {
        level (1 1);
        faceZone solid;
        cellZone solid;
        cellZoneInside inside;
        regions
        {
            solid_region_1
            {
                level (2 2);
                patchInfo
                {
                    type wall;
                }
          }
          ...

My Problem is, that all these patches I declared in the .stl file (and it was a pain to declare them and keep the surface closed), are simply disappearing after running snappyHexMesh. It just puts "defaultFaces" and "solid_to_fluid" in constant/soild/polyMesh/boundary. It also keeps adding "domain0" (and respective boundaries), which is the empty space resulting from the blockMesh being a little bit bigger than the actual geometry.

My question is: How can I tell snappyHexMesh to keep all the patches that are nicely defined in the .stl files so I can use those patches to apply boundary conditions in my simulation later on?

I found quite a few threads on similar topics but non provided the answer I was looking for. I even ran snappy only on the solid part of the geometry (altering all the necessary files of course) but that does not change the problem that my patches are gone after the meshing process.

Can someone give me a hint what I am doing wrong?

Best regards and thanks in advance

Antimony June 28, 2016 21:43

Hi,

solid { level (1 1); faceZone solid; cellZone solid; cellZoneInside inside;

I am not sure if this is what is causing the problem, but by stating "cellZoneInside inside", you are asking snappyHexMesh to mesh through, which means that there will be no patches from the solid.stl file...

Cheers,
Antimony

Antimony June 28, 2016 21:43

Hi,

Code:

solid   
 {       
            level (1 1);
            faceZone solid;
            cellZone solid;
            cellZoneInside inside;

I am not sure if this is what is causing the problem, but by stating "cellZoneInside inside", you are asking snappyHexMesh to mesh through, which means that there will be no patches from the solid.stl file...

Cheers,
Antimony

bug_or_feature June 29, 2016 05:07

Hi Antimony,

Thank you for your answer! I think you are right. I commented that line out and now I can find the patches in the boundary file in constant/polyMesh.

I am new to OpenFOAM. Can you briefly explain what "cellZonesInside" actually does? I am confused what cell zones actually are (you read it everywhere but I did not find a proper explanation how they are assigned). From what I have read I suspect cell zones are groups of cells? And face zones groups of cell faces?

Best regards

bug_or_feature June 29, 2016 08:38

Hi again,

Maybe I should elaborate a bit on what I am trying to achieve:

My geometry is basically a block with a hole inside. I have one .stl file for the block (with the hole cut out) and one .stl file for the cylinder that fills that very hole. The fluid is supposed to flow through the hole (hence the fluid.stl contains the cylinder). I want to simulate the heat transfer from the fluid to the solid. Therefore I need meshes of both the cylinder (fluid) and the block surrounding it (solid). I don't need a mesh of the surrounding of my geometry (I guess this is the domain0 I get all the time, but I think this one can be deleted after the meshing). But I need to have patches on the outside of the solid domain to be able to use boundary conditions on those (because heat is dissipated by the solid block).

Best regards

bug_or_feature June 30, 2016 12:36

Hey,

I think I have found the problem: cutting my geometry in half with blockMesh was apparently no good idea. I have tested meshing without cutting the objects and the patches show up in the boundary file.

Best regards

ullal August 13, 2016 14:19

Quote:

Originally Posted by bug_or_feature (Post 607460)
Hey,

I think I have found the problem: cutting my geometry in half with blockMesh was apparently no good idea. I have tested meshing without cutting the objects and the patches show up in the boundary file.

Best regards

Hi bug_or_feature

Can you post your snappy Hex mesh dict. I am having the same problem-only part of my patches are showing up. Other patches along with the geometry part is missing

Thanks

bug_or_feature August 30, 2016 20:18

Hi,
Sorry for the delay.

In my case this had nothing to do with the sHMD at all. Therefore posting it does not really help you I guess.

I did modify the blockMeshDict to fix the problem. You need to be aware, that the block you define in the blockMeshDict has to fit or surround your geometry. I tried to cut through my geometry with the blockMesh and this must have caused my error. Maybe you are trying something similar?

greetings :-)


All times are GMT -4. The time now is 21:39.