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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 16, 2019, 10:30
Default SHM doesnīt snap reliable to feature edge
  #1
New Member
 
Join Date: May 2019
Posts: 3
Rep Power: 3
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, 39 views)
File Type: jpg Pumpe_2_Castellated.jpg (85.9 KB, 37 views)
File Type: jpg Pumpe_2.jpg (75.7 KB, 28 views)
File Type: jpg Pumpe_5_Castellated.jpg (74.2 KB, 30 views)
File Type: jpg Pumpe_5.jpg (73.8 KB, 31 views)

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

Old   June 18, 2019, 09:00
Default New run
  #2
New Member
 
Join Date: May 2019
Posts: 3
Rep Power: 3
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, 20 views)
File Type: jpg Pump_profile_distorted2.jpg (163.1 KB, 19 views)
File Type: jpg Pump_profile_distorted2_castellated.jpg (154.5 KB, 19 views)
File Type: jpg Pump_profile_distorted4.jpg (80.6 KB, 17 views)
File Type: jpg Pump_profile_distorted4_castellated.jpg (91.8 KB, 16 views)
OpenFOOL is offline   Reply With Quote

Old   August 7, 2020, 07:42
Default
  #3
New Member
 
Join Date: Aug 2020
Posts: 10
Rep Power: 2
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, 9 views)
decanter is offline   Reply With Quote

Old   August 8, 2020, 12:08
Default
  #4
Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 41
Rep Power: 2
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
Ship Designer is offline   Reply With Quote

Reply

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


All times are GMT -4. The time now is 05:17.