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] problem with adding layers (https://www.cfd-online.com/Forums/openfoam-meshing/224499-problem-adding-layers.html)

duguyoudi February 21, 2020 21:57

problem with adding layers
 
2 Attachment(s)
Hello all,



I have some problems with adding layer near surface given by stl files. I have tried to add 5 layers (i.e. nSurfaceLayers 5) for all patches. Other addLayersControls settings are as follows.



Code:

    relativeSizes true;

    expansionRatio 1.2;

    finalLayerThickness 0.8;

    minThickness 0.01;

    nGrow 1;
    featureAngle 60;
    nRelaxIter 5;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;

After adding layers, the thickness of layers turns to be zero. In addition, it seems no layer is added and the edge is not shaped correctly (all the corners should be rectangular). Please find settings and log files in the attached zip file.

patch faces layers overall thickness
[m] [%]
----- ----- ------ --- ---
building1 617 0 0 0
building2 1419 0 0 0
...



Does anybody have some ideas about it?


Leo

john myce February 23, 2020 13:17

Hi Leo,

Well by seeing your configuration, I think from what I have seen that
Code:

nGrow 1;
can highly affect the addLayers phase by affecting it badly so you can try to let this parameter to 0 (default value).

Also, for
Code:

featureAngle 60;
try to increase to a value much higher like from 120 to 150. (you can rise it up to 180 degrees).

If these two parameters are not enough to solve the addlayer phases:

For the sharp edges what you can do is increase up to 10
Code:

nSmoothSurfaceNormals
to help SHM to better pointing the normal vector.

For snapping setup you can increase :
Code:

nSolveIter 30;
to either 100 or 300 to make sure it has enough iterations to capture the edges.
For instance on a 6 millions cells, it is not affecting a lot the time for meshing but it improves a bit the snapping phase.

Cheers,

duguyoudi February 24, 2020 21:22

4 Attachment(s)
Quote:

Originally Posted by john myce (Post 759224)
Hi Leo,

Well by seeing your configuration, I think from what I have seen that
Code:

nGrow 1;
can highly affect the addLayers phase by affecting it badly so you can try to let this parameter to 0 (default value).

Also, for
Code:

featureAngle 60;
try to increase to a value much higher like from 120 to 150. (you can rise it up to 180 degrees).

If these two parameters are not enough to solve the addlayer phases:

For the sharp edges what you can do is increase up to 10
Code:

nSmoothSurfaceNormals
to help SHM to better pointing the normal vector.

For snapping setup you can increase :
Code:

nSolveIter 30;
to either 100 or 300 to make sure it has enough iterations to capture the edges.
For instance on a 6 millions cells, it is not affecting a lot the time for meshing but it improves a bit the snapping phase.

Cheers,


Hi John,


Thank you for your help.


I set nGrow = 0, featureAngle = 120 (or 150 or 180) with others unchanged (Figure angle120, angle150 and angle180). I also tried to increase nSmoothSurfaceNormals to 10 and nSolveIter to 300. Layers were successfully added but the results are far from ideal. Do you have other suggestions?


Thank you,


Leo

john myce February 25, 2020 04:09

Hi Leo,

It seems you have a bad snap. I did not see it but you forgot in your SHM dict to mention the feature snapping tools : try to add these lines in the snappingControls section just after the function nRelaxIter 5;

Code:

    // Feature snapping

        // Number of feature edge snapping iterations.
        // Leave out altogether to disable.
        nFeatureSnapIter 10;

        // Detect (geometric only) features by sampling the surface
        // (default=false).
        implicitFeatureSnap false;

        // Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap true;

        // Detect features between multiple surfaces
        // (only for explicitFeatureSnap, default = false)
        multiRegionFeatureSnap false;

Cheers,

sita February 25, 2020 09:16

Hi Leo,

I'm running into similar issues when trying to mesh a ship hull. As long as I stick to the settings used in the DTCHull tutorial (3 wall layers), everything's fine, but as soon as I try to add more layers, I end up with an invalid mesh.

I came across some posts by seaspray (Eric Bretscher) in this thread (posts #6 and #8). They're from 2014, so not very recent, but his strategy might be worthwhile trying.

Cheers,
Sita

duguyoudi February 27, 2020 00:10

4 Attachment(s)
Quote:

Originally Posted by john myce (Post 759435)
Hi Leo,

It seems you have a bad snap. I did not see it but you forgot in your SHM dict to mention the feature snapping tools : try to add these lines in the snappingControls section just after the function nRelaxIter 5;

Code:

    // Feature snapping

        // Number of feature edge snapping iterations.
        // Leave out altogether to disable.
        nFeatureSnapIter 10;

        // Detect (geometric only) features by sampling the surface
        // (default=false).
        implicitFeatureSnap false;

        // Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap true;

        // Detect features between multiple surfaces
        // (only for explicitFeatureSnap, default = false)
        multiRegionFeatureSnap false;

Cheers,


Hi John,


You are right. The snap is bad. I have checked .stl and .eMesh and everything seems fine (Fig. building_stl and edgeMesh). But SHM can't capture edges of rooftop correctly while grid at the bottom is OK (Fig. building_snap and building_mesh2).


Here are settings for snap


Code:

snapControls
{

    nSmoothPatch 3;

    tolerance 4.0;


    nSolveIter 100;

    nRelaxIter 5;

    nFeatureSnapIter  10;

    implicitFeatureSnap false;

    explicitFeatureSnap true;

    multiRegionFeatureSnap false;
}

Do you know how to solve this problem?


Thank you,


Leo

duguyoudi February 27, 2020 22:24

Hi John and Sita,


Thank you for your replies. I solved this by decreasing resolveFeatureAngle.


Cheers,


Leo


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