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] Mesh contains holes on interface of multiregion case (https://www.cfd-online.com/Forums/openfoam-meshing/222746-mesh-contains-holes-interface-multiregion-case.html)

DriesAllaerts December 6, 2019 09:14

Mesh contains holes on interface of multiregion case
 
5 Attachment(s)
Hi all,

I'm trying to use snappyHexMesh to create meshes for multiregion cases. I have a separate stl file for every region, and I start from a background mesh generated by blockMesh. I'm only using the castellatedMesh step, snap and addLayers is set to false. snappyHexMesh works fine when the interface between different regions is flat. When the interface is curved, however, some holes appear in the mesh on the interface (see MWE_fig2 for example). I think this problem is related to the fact that curved surfaces are triangulated in the stl files, and very small differences in triangulation are conceived by snappy as a hole in the geometry which does not need to be meshed.

I created a minimal working example to illustrate the issue. The example consists of two concentric cylinders corresponding to a fluid and a solid region (see MWE_fig1). Figure MWE_fig2 shows a close up of the mesh at the interface, showing that there are several holes in the mesh. Figure MWE_fig3 shows the interface patch solid_to_fluid in red, and the white line across the interface correspond to faces that are erroneously indentified as a boundary face with patchtype wall instead of a mappedWall between solid and fluid.

The main consequence of these holes is that part of the interface is converted into insulatedWalls, so the effective area through which heat is exchanged between fluid and solid is reduced. A secondary consequence is that some of the faces are assigned to the wrong region: the solid has a patch fluid_patch0 that originates from the fluid stl file, and the fluid has a patch solid_patch0 which originates from the solid stl file. I attached a log file with the output of blockMesh, surfaceFeatureExtract and splitMeshRegions.

I have tried several things to solve this issue but without succes. Increasing the original block mesh resolution does not solve the issue. Adding refinement levels does not solve the issue. The stl files are extracted from AutoDesk Inventor; increasing the resolution of the surface triangulation in the stl file reduces the amount of holes, though even at the highest resolution there are still holes in the mesh. Turning on the snapping phase closes the holes, but the faces corresponding to the deleted cells remain boundary faces with patch type wall, which means that the effective interface area is still reduced. I also tried nCellZoneErodeIter, handleSnapProblems, and increasing the mergeTolerance, but none of them has any effect. Setting gapLevelIncrement makes the problem worse.

Has anyone encountered similar issues and did you find a solution? Should this be reported as a bug in snappyHexMesh?

Thanks for looking into this case.
Dries Allaerts

Tobi December 15, 2019 14:52

Hi,


try to activate the allowFreeStandingZoneFaces option in the snappyHexMeshDict file.


Code:

castellatedMeshControls                                                       
{                                                                             
    maxLocalCells 8000000;                                                     
    maxGlobalCells 2000000;                                                   
    minRefinementCells 0;                                                     
    maxLoadUnbalance 0.20;                                                     
    nCellsBetweenLevels 3;                                                     
                                                                               
    features                                                                   
    (                                                                         
    );                                                                         
                                                                               
    refinementSurfaces                                                         
    {                                                                         
    }                                                                         
                                                                               
    refinementRegions                                                         
    {                                                                         
    }                                                                         
                                                                               
    // Resolve sharp angles                                                   
    resolveFeatureAngle 30;                                                   
                                                                               
    locationInMesh (0.005 -0.1 0.1);                                           
                                                                               
    allowFreeStandingZoneFaces yes;                                           
}


DriesAllaerts December 17, 2019 03:48

Hi Tobias,

Thank you for your suggestion! I activated the freeStandingZoneFaces flag in my minimal working example , but unfortuantely it did not affect the mesh in any way. There are still holes on the interface between fluid and solid; and the fluid still has a boundary patch "solid_patch0" (not to be confused with the interface patch "fluid_to_solid"), and the solid still has a boundary patch "fluid_patch0".

Let me know if you think of other options that might solve this problem.

Thank you for your interest in the issue.

Dries

Tobi December 17, 2019 04:08

Hi,


with your hint about the additional patch, everything is clear. You two STL surfaces are not equal and thus, you get some small gaps in between the connecting triangulated surfaces. SnappyHexMesh realizes that and put a new region in. Therefore, you also get these new patches.

DriesAllaerts December 17, 2019 04:32

Thanks Tobias, your explanation makes sense. My next question is then: How can I avoid this issue? The geometries are generated with AutoDesk Inventor, and they are saved as binary stl files at the highest resolution possible in Inventor. Whenever I have a geometry with a curved fluid-solid interface, I will face the same issue due to the surface triangulation. Is there a way to specify a surface tolerance with snappyHexMesh? Or is there another way to use snappyHexMesh to mesh multiRegion cases with curved interfaces?

Thanks
Dries

Tobi December 17, 2019 04:41

Its up to you how you want to deal with that. I prefer using Salome meca. However, blender is also a good choice. It depends which software you like and which fits best for you. I cannot make a statement to that actually.



If snappyHexMesh is able to handle something with tolerances, I don't know. Another option would be:



- meshing region 1
- meshing region 2


within single meshing procedures.

DriesAllaerts December 17, 2019 04:43

Okay, thanks for your help! I'll have a look at Salome or Blender.

Dries


All times are GMT -4. The time now is 01:31.