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

[snappyHexMesh] problem with adding layers

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By john myce
  • 2 Post By duguyoudi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 21, 2020, 21:57
Default problem with adding layers
  #1
New Member
 
Join Date: May 2013
Posts: 29
Rep Power: 12
duguyoudi is on a distinguished road
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
Attached Images
File Type: png building.png (69.6 KB, 107 views)
Attached Files
File Type: zip settings_N_log.zip (20.2 KB, 8 views)
duguyoudi is offline   Reply With Quote

Old   February 23, 2020, 13:17
Default
  #2
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
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,
saeed jamshidi likes this.
john myce is offline   Reply With Quote

Old   February 24, 2020, 21:22
Default
  #3
New Member
 
Join Date: May 2013
Posts: 29
Rep Power: 12
duguyoudi is on a distinguished road
Quote:
Originally Posted by john myce View Post
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
Attached Images
File Type: png angle120.png (151.6 KB, 88 views)
File Type: png angle150.png (164.4 KB, 70 views)
File Type: png angle180.png (161.8 KB, 59 views)
File Type: png smoothnormal_10.png (152.1 KB, 66 views)
duguyoudi is offline   Reply With Quote

Old   February 25, 2020, 04:09
Default
  #4
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
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,
john myce is offline   Reply With Quote

Old   February 25, 2020, 09:16
Default
  #5
Senior Member
 
Sita Drost
Join Date: Mar 2009
Location: Arnhem, The Netherlands
Posts: 227
Rep Power: 18
sita is on a distinguished road
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
sita is offline   Reply With Quote

Old   February 27, 2020, 00:10
Default
  #6
New Member
 
Join Date: May 2013
Posts: 29
Rep Power: 12
duguyoudi is on a distinguished road
Quote:
Originally Posted by john myce View Post
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
Attached Images
File Type: png building_stl.png (27.6 KB, 63 views)
File Type: png edgeMesh.png (58.2 KB, 56 views)
File Type: jpg building_snap.jpg (143.1 KB, 60 views)
File Type: jpg building_mesh2.jpg (141.5 KB, 58 views)
duguyoudi is offline   Reply With Quote

Old   February 27, 2020, 22:24
Default
  #7
New Member
 
Join Date: May 2013
Posts: 29
Rep Power: 12
duguyoudi is on a distinguished road
Hi John and Sita,


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


Cheers,


Leo
sita and alabardati1918 like this.
duguyoudi is offline   Reply With Quote

Reply


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] adding layers on complex terrain surface in SHM potac OpenFOAM Meshing & Mesh Conversion 1 November 9, 2020 06:40
[snappyHexMesh] Problem with curves and layers Ouschen OpenFOAM Meshing & Mesh Conversion 1 January 24, 2019 08:49
chtMultiRegionSimpleFoam 3D problem Lucie OpenFOAM Pre-Processing 2 June 21, 2016 05:23
[snappyHexMesh] snappyHexMesh not adding layers to a solid jet_engine OpenFOAM Meshing & Mesh Conversion 0 June 3, 2016 08:25
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 39 March 31, 2016 08:43


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