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

[snappyHexMesh] SnappyHexMesh do not add layers

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 2 Post By AtoHM
  • 3 Post By Yann
  • 1 Post By Ryôzanpaku Tiger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2023, 10:16
Question SnappyHexMesh do not add layers
  #1
New Member
 
RT
Join Date: Mar 2020
Location: Germany
Posts: 16
Rep Power: 6
Ryôzanpaku Tiger is on a distinguished road
Dear all,

I would like to add layers around a small cylindrical hole in a very thin plate (width = 1 mm), but the layers are not added with the log "no layers to generate".

Here is the snappyHexMeshDict:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2306                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       true;

geometry
{
    pipe.stl     { type triSurfaceMesh; name pipe;   }
    inlet.stl    { type triSurfaceMesh; name inlet;  }
    outlet.stl   { type triSurfaceMesh; name outlet; }
    plane.stl    { type triSurfaceMesh; name plane;
        regions
        {
            plane_back   {name plane_back;  }
            plane_bottom {name plane_bottom;}
            plane_front  {name plane_front; }
            plane_hole1  {name plane_hole1; }
            plane_hole2  {name plane_hole2; }
            plane_hole3  {name plane_hole3; }
            plane_hole4  {name plane_hole4; }
            plane_hole5  {name plane_hole5; }
            plane_hole6  {name plane_hole6; }
            plane_left   {name plane_left;  }
            plane_right  {name plane_right; }
            plane_top    {name plane_top;   }
        }
    }
}


// Settings for the castellatedMesh generation.
castellatedMeshControls
{
    maxGlobalCells 15000000;
    maxLocalCells  5000000;
    maxLoadUnbalance 0.1;
    minRefinementCells 0;
    nCellsBetweenLevels 3;

    features
    (
        { file "pipe.extendedFeatureEdgeMesh";   level 2; }
        { file "plane.extendedFeatureEdgeMesh";  level 2; }
    );

    refinementSurfaces
    {
        pipe  { level (2 2); patchInfo { type patch; } }
        inlet    { level (2 2); patchInfo { type patch; } }
        outlet   { level (2 2); patchInfo { type patch; } }
        plane
        {
            level (2 2);
            patchInfo { type patch; }
            regions
            {
                plane_hole1 { level (4 5); }
                plane_hole2 { level (4 5); }
                plane_hole3 { level (4 5); }
                plane_hole4 { level (4 5); }
                plane_hole5 { level (4 5); }
                plane_hole6 { level (4 5); }
            }
        }
    }

    resolveFeatureAngle 30;
    refinementRegions { }
    locationsInMesh
    (
        ( (0.0081 0.0001 0.0049) fluid    )
        ( (0.0139 0.0001 0.0001) pipe  )
        ( (0.0001 0.0001 0.0001) plane )
    );
    allowFreeStandingZoneFaces false;
}

// Settings for the snapping.
snapControls
{
    nSmoothPatch 3;
    tolerance 1.0;
    nSolveIter 100;
    nRelaxIter 5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

addLayersControls
{
    layers
    {
        plane_hole1  { nSurfaceLayers 3; }
        plane_hole2  { nSurfaceLayers 3; }
        plane_hole3  { nSurfaceLayers 3; }
        plane_hole4  { nSurfaceLayers 3; }
        plane_hole5  { nSurfaceLayers 3; }
        plane_hole6  { nSurfaceLayers 3; }
    }

    relativeSizes yes;
    expansionRatio 1.1;
//    firstLayerThickness 0.3;
    finalLayerThickness 0.3;
    minThickness 0.05;
    nGrow 0;
    featureAngle 150;

    maxFaceThicknessRatio 0.5;
    nSmoothSurfaceNormals 1;
    nSmoothThickness 10;

    minMedialAxisAngle 90;
    maxThicknessToMedialRatio 0.3;
    nSmoothNormals 3;

    nRelaxIter 5;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
}

meshQualityControls
{
    maxNonOrtho 75;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minFlatness 0.5;
    minVol 1e-30;
    minTetQuality 1e-30;
    minArea -1;
    minTwist 0.02;
    minDeterminant 0.001;
    minFaceWeight 0.02;
    minVolRatio 0.01;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;
}

mergeTolerance 1e-6;

// ************************************************************************* //
I also tried to use absolute values, like
Code:
    relativeSizes no;
    expansionRatio 1.1;
    firstLayerThickness 0.00005;
 //   finalLayerThickness 0.3;
    minThickness 0.00005;
but it didn't work either.

I would very appreciate any hint on how to get the layers to work. Thank you!
Attached Images
File Type: jpg hole_mesh.jpg (119.5 KB, 14 views)
Ryôzanpaku Tiger is offline   Reply With Quote

Old   November 28, 2023, 10:38
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13
AtoHM is on a distinguished road
Hi,
on first look I would think it should work, I hope not to miss something obvious. It could be beneficial if you provided the log file.


What can stop the layers from growing is a clash with any of the quality metrics. I see you are not completely using the default values, or, at least I spotted "minFlatness" which is not in the ESI 2112 version: https://www.openfoam.com/documentati...shquality.html it might be "minFaceFlatness" but its inactive by default. You can try with the default setting, maybe it helps.
Ryôzanpaku Tiger and wht like this.
AtoHM is offline   Reply With Quote

Old   November 28, 2023, 11:19
Default
  #3
New Member
 
RT
Join Date: Mar 2020
Location: Germany
Posts: 16
Rep Power: 6
Ryôzanpaku Tiger is on a distinguished road
Dear AtoHM,

thank you very much for the reply and for the hint! I will try to use the default quality metrics.

Meanwhile, I attach the log file. I would very appreciate if you could take a look.

Thanks again for the help!
Attached Files
File Type: txt log.txt (124.2 KB, 3 views)
Ryôzanpaku Tiger is offline   Reply With Quote

Old   November 28, 2023, 11:43
Default
  #4
New Member
 
RT
Join Date: Mar 2020
Location: Germany
Posts: 16
Rep Power: 6
Ryôzanpaku Tiger is on a distinguished road
UPDATE: I tried the following quality metrics:
Code:
    maxNonOrtho 75;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minVol 1e-30;
    minTetQuality -1e+30;
//    minVolCollapseRation 0.5;
    minArea -1;
    minTwist 0.02;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minFaceFlatness -1;
    minVolRatio 0.01;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;
but unfortunately, there is still "No layers generated".

I would very appreciate further help!
Ryôzanpaku Tiger is offline   Reply With Quote

Old   November 28, 2023, 11:48
Default
  #5
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hello folks,

It seems you are meshing a multiregion case, according to the use of locationsInMesh.

For such case, snappy creates interfaces during the meshing process, as you can see in your log file :

Code:
Adding patches for face zones
-----------------------------

Patch Type                Name                          FaceZone                      FaceType  
----- ----                ----                          --------                      --------  
24    wall                fluid_to_plane             fluid_to_plane             internal  
25    wall                plane_to_fluid             fluid_to_plane             internal  
26    wall                fluid_to_pipe              fluid_to_pipe              internal  
27    wall                pipe_to_fluid              fluid_to_pipe              internal
This is very handy on multiregion cases because it allows to add layers only on one side of the interface. (typically you want to add layers on the fluid side, not on the solid side).
To do so, you will have to use these names in your layer definition. (for instance fluid_to_plane)

I hope I didn't say anything stupid because it's been a while I didn't run a multiregion case.

Regards,
Yann
AtoHM, Ryôzanpaku Tiger and wht like this.
Yann is offline   Reply With Quote

Old   November 28, 2023, 11:55
Default
  #6
New Member
 
RT
Join Date: Mar 2020
Location: Germany
Posts: 16
Rep Power: 6
Ryôzanpaku Tiger is on a distinguished road
Dear Yann,

thank you for the help! Yes, I do mesh a multi-region case. At first, I didn't want to create the layers over the whole plane, but over the holes only. I thought it was possible. But may be not in the multi-region case?

However, eventually I will need to have the layers over the whole plane, therefore, I will try to use the patch names as you suggest.

Thank you very much for the help!
Ryôzanpaku Tiger is offline   Reply With Quote

Old   November 28, 2023, 16:32
Default
  #7
New Member
 
RT
Join Date: Mar 2020
Location: Germany
Posts: 16
Rep Power: 6
Ryôzanpaku Tiger is on a distinguished road
Dear Yann,

thank you for the hint! I tried using the interface patches and it worked. Now I am getting the layers at all interfaces: fluid-pipe, fluid-plane.

Thank you again for the help!
Yann likes this.
Ryôzanpaku Tiger is offline   Reply With Quote

Reply

Tags
layer addition, snapphexmesh


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
[snappyHexMesh] SnappyHexMesh add Layer Only failed fxzf OpenFOAM Meshing & Mesh Conversion 1 January 11, 2023 05:14
[snappyHexMesh] Add layers at the bottom of a mesh chayoun OpenFOAM Meshing & Mesh Conversion 5 June 2, 2021 12:35
[snappyHexMesh] Inconsistent Layers SnappyHexMesh CfdUser5855 OpenFOAM Meshing & Mesh Conversion 0 March 10, 2021 14:42
[snappyHexMesh] Snappy add layers failed mqsim OpenFOAM Meshing & Mesh Conversion 1 January 24, 2021 16:02
[snappyHexMesh] snappyHexMesh fails adding layers biscarri OpenFOAM Meshing & Mesh Conversion 13 March 21, 2020 13:40


All times are GMT -4. The time now is 03:38.