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

[snappyHexMesh] SHM doesn´t snap reliable to feature edge

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 2 Post By OpenFOOL
  • 1 Post By decanter
  • 2 Post By Ship Designer

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2019, 11:30
Default SHM doesn´t snap reliable to feature edge
  #1
New Member
 
Join Date: May 2019
Posts: 3
Rep Power: 7
OpenFOOL is on a distinguished road
Hi folks,


first of all I want to say that this forum helped me a lot already just by reading threads. Unfortunately I have to open my first thread, because I despair of using SnappyHexMesh with my geometry. Originally I use several STL files which form a pump passage geometry (therefore it´s more complex), but to make things as simple as possible I will use another geometry to describe the problems I am facing. I get the same "problematic" results with those geometrys.

The main problem is SnappyHexMesh not snapping to the edges in a reliable manner.

The white lines represent the detected feature edges. So every edge was detected correctly. But SHM fails at the snapping process, see pictures below. My settings are as follows...


Code:
castellatedMeshControls
{
    maxLocalCells 100000;
    maxGlobalCells 2000000;
    minRefinementCells 0;
    maxLoadUnbalance 0.1;
    nCellsBetweenLevels 2;

    features
    (

    {
            file        "model1c.eMesh";
            level       3;
        }

    );
Code:
refinementSurfaces
    {
        model1c
        {
            level       (2 2);
        }
    }
Code:
snapControls
{
    nSmoothPatch 4;
    tolerance 5;
    nSolveIter 300;
    nRelaxIter 5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap true;
}
Apparently it does not matter what settings I use. Sometimes I get a slightly better result but those defects won´t disappear completely. At the inlet of the pump are four rippled locations, all 90° apart. Those ones seem to be too far away for SHM to snap to the edge (castellated circle, so there are 4 locations of the same distance to the edge, see Pumpe_2.jpeg). But changing the tolerance won´t let them disappear.

Does somebody see my mistake? It´s a quite common geometry, so I think it should be possible to mesh it with SHM. If you have any idea or suggestion or if you need more information, please let me know. Many thanks in advance.


Leon


Edit: I am stupid. I wondered why there's no surface refinement step in my castellated mesh. I looked at the number of cells...they are above the maximum global cells. So SHM won't be refine anything at all. Now I used a higher maximum global cells setting and got better results, but defects are still there. Maybe I am on the right way at least.
Attached Images
File Type: jpg Pump.jpg (76.6 KB, 312 views)
File Type: jpg Pumpe_2_Castellated.jpg (85.9 KB, 314 views)
File Type: jpg Pumpe_2.jpg (75.7 KB, 254 views)
File Type: jpg Pumpe_5_Castellated.jpg (74.2 KB, 240 views)
File Type: jpg Pumpe_5.jpg (73.8 KB, 229 views)
lourencosm and davcrisp like this.

Last edited by OpenFOOL; June 17, 2019 at 09:20.
OpenFOOL is offline   Reply With Quote

Old   June 18, 2019, 10:00
Default New run
  #2
New Member
 
Join Date: May 2019
Posts: 3
Rep Power: 7
OpenFOOL is on a distinguished road
Ok, now I changed the maxGlobalCells entry and made a refinement at the profile. The red lines indicate the feature edges. They're correctly identified by surfaceFeatureExtract. But still I get those distortions, no matter what I try. Does somebody know what I could do else?

Many thanks in advance



My current settings are as follows...


blockMeshDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


convertToMeters 1;

vertices
(
    (-210 -210 -10)
    (210 -210 -10)
    (210 210 -10)
    (-210 210 -10)
    (-210 -210 110)
    (210 -210 110)
    (210 210 110)
    (-210 210 110)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (63 63 15) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
);

mergePatchPairs
(
);

// ************************************************************************* //
snappyHexMeshDict
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    model1c
    {
        type        triSurfaceMesh;
        file        "model1c.stl";
    }
};

castellatedMeshControls
{
    maxLocalCells 2000000;
    maxGlobalCells 10000000;
    minRefinementCells 0;
    maxLoadUnbalance 0.1;
    nCellsBetweenLevels 1;

    features
    (
        {
            file        "model1c.eMesh";
            level       3;
        }

    );

    refinementSurfaces
    {
        model1c
        {
            level       (2 4);
        }
    }

    resolveFeatureAngle 30;

    refinementRegions
    {
    }

    locationInMesh (-40 0 90);

    allowFreeStandingZoneFaces true;
}

snapControls
{
    nSmoothPatch 4;
    tolerance 4;
    nSolveIter 200;
    nRelaxIter 5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap true;
}

addLayersControls
{
    relativeSizes true;
    layers
    {
        model1c
        {
            nSurfaceLayers 1;
        }
    }
    expansionRatio 1;
    finalLayerThickness 0.3;
    minThickness 0.1;
    nGrow 0;
    featureAngle 30;
    nRelaxIter 3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
}

meshQualityControls
{
    maxNonOrtho 65;

    maxBoundarySkewness 20;
    maxInternalSkewness 4;

    maxConcave 80;
    minFlatness 0.5;
    //minVol 1e-13;
    minVol 1e-13;
    minTetQuality -1;
    minArea -1;
    minTwist 0.01;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
    nSmoothScale 4;
    errorReduction 0.75;
    relaxed
    {
    }
}

mergeTolerance 1e-06;

// ************************************************************************* //
surfaceFeatureExtractDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5                                     |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


model1c.stl
{
    extractionMethod         extractFromSurface;

    extractFromSurfaceCoeffs
    {
        includedAngle        150;
    }

    subsetFeatures
    {
        nonManifoldEdges     no;
        openEdges            yes;
    }

    trimFeatures
    {
        minElem              0;
        minLen               0;
    }

    writeFeatureEdgeMesh     yes;

    writeObj                 yes;
}



// ************************************************************************* //
Attached Images
File Type: jpg Pumpe_new2.jpg (179.9 KB, 187 views)
File Type: jpg Pump_profile_distorted2.jpg (163.1 KB, 164 views)
File Type: jpg Pump_profile_distorted2_castellated.jpg (154.5 KB, 131 views)
File Type: jpg Pump_profile_distorted4.jpg (80.6 KB, 117 views)
File Type: jpg Pump_profile_distorted4_castellated.jpg (91.8 KB, 90 views)
OpenFOOL is offline   Reply With Quote

Old   August 7, 2020, 08:42
Default
  #3
New Member
 
Join Date: Aug 2020
Posts: 16
Rep Power: 6
decanter is on a distinguished road
Hello!

may I ask if you solved your problem so far? I am having a similar problem with distortions. You can see my geometry in the attached file. It is basicly the internal fluid volume in a decanter centrifuge. The empty areas are screwflights which snappy could snap well, but I have some missing parts alon the edges.
Attached Images
File Type: jpg dissortations.jpg (27.2 KB, 171 views)
davcrisp likes this.
decanter is offline   Reply With Quote

Old   August 8, 2020, 13:08
Default
  #4
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7
Ship Designer is on a distinguished road
Hi Leon,

You could try to increase the resolution of your input geometry file, e.g. stl ro obj file. For snappyHexMesh to snap correctly it is important that the faces of the geometry file are smaller than the desired mesh faces. So preferrably use a too fine geometry file, it doesn't hurt.

You can also check your geometry file with ParaView and then apply the Feature Edges filter. You can then adjust the feature angle until the edges you need in your mesh are continuous without gaps. Note that the angle indicated in the Feature Edges filter is reversed in relation to the one needed in surfaceFeatureDict. Thus, if according to Feature Edges an angle of 30° looks okay, then in surfaceFeatureDict you'll have to specify 150.

Hope this helps, cheers
lourencosm and zermenos like this.
Ship Designer is offline   Reply With Quote

Old   December 8, 2022, 22:30
Default
  #5
Member
 
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10
fedez91 is on a distinguished road
Hello Claudio,

Just out of curiosity, how do you know this?? There is very little information about the characteristics of the .stl file, other than it should be closed. I am having a lot of issues with reliable snaping, and I recall that I read something somewhere about the .stl file, but I could not find what or where.
fedez91 is offline   Reply With Quote

Old   January 4, 2023, 11:58
Default
  #6
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7
otaolafr is on a distinguished road
Quote:
Originally Posted by fedez91 View Post
Hello Claudio,

Just out of curiosity, how do you know this?? There is very little information about the characteristics of the .stl file, other than it should be closed. I am having a lot of issues with reliable snaping, and I recall that I read something somewhere about the .stl file, but I could not find what or where.
have a look at one of the sticky post in the openfoam meshing & mesh conversion section
Creating waterproof STL using snappyHexMesh or salome
otaolafr is offline   Reply With Quote

Reply

Tags
feature edge handling, snap controls, snappy hex mesh, watertight


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] Failed Edge Snap with box geometry and correct feature capture thiagomarinho OpenFOAM Meshing & Mesh Conversion 7 May 7, 2022 10:19
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[snappyHexMesh] SHM: sharp edge resolving problem with explicit feature edges piotr.mecht OpenFOAM Meshing & Mesh Conversion 21 May 9, 2020 15:56
[snappyHexMesh] SHM: feature edge snapping not conforming thab OpenFOAM Meshing & Mesh Conversion 3 November 26, 2012 15:04
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


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