CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

strange form of cells near refinementzone

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 5, 2017, 20:03
Default strange form of cells near refinementzone
  #1
New Member
 
Join Date: Nov 2016
Posts: 8
Rep Power: 2
Bob! is on a distinguished road
Hello together,

I'm trying to simulate an open channel flow with interFoam, using openFoam version 4.1.

After meshing with snappyHexMesh i get a strange looking Mesh at the inside of my geometry (picture attached).
When looking from outside at the surface everything seems fine.
You'll find my snappyHexMeshDict attached...

Any hints would help me a lot, i'm under a great pressure of time and won't find the mistake!
Thanks a lot!!!

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

// Which of the steps to run
castellatedMesh true;    // make basic mesh ?
snap            true;    // decide to snap back to surface ?
addLayers       false;   // decide to add viscous layers ?


geometry // Load in STL files here
{
    Spundwand.stl {type triSurfaceMesh; name Spundwand;}
    Aussenwand.stl {type triSurfaceMesh; name Aussenwand;}
    refinementBox {type searchableBox; min (-1 -1 -1); max (10 10 10);}
};

castellatedMeshControls
{
    maxLocalCells 10000000;  //max cells per CPU core
    maxGlobalCells 20000000; //max cells to use before mesh deletion step
    minRefinementCells 10;  //was 0 - zero means no bad cells are allowed during refinement stages
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 1;  // expansion factor between each high & low refinement zone

    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
    (
        {file "Aussenwand.eMesh"; level 1;}
        {file "Spundwand.eMesh"; level 1;}
    );

    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    refinementSurfaces // Surface-wise min and max refinement level
    {
    Aussenwand {level (3 3);}
    Spundwand {level (3 3);}
    }  


    resolveFeatureAngle 80;  // Resolve sharp angles // Default 30
    refinementRegions        // In descending levels of fine-ness
    {
    Spundwand
        {
        mode distance;
        levels ((0.0125 3)); // was ((0.001 4) (0.003 3) (0.01 2))
        }
    Aussenwand
        {
        mode distance;
        levels ((0.0125 3)); // was ((0.001 4) (0.003 3) (0.01 2))
        }
    }
    locationInMesh (1.1 1.1 1.1);  //to decide which side of mesh to keep **
    allowFreeStandingZoneFaces false;
}


// Settings for the snapping.
snapControls
{
    nSmoothPatch 3;
    tolerance 4.0;
    nSolveIter 30;
    nRelaxIter 5;
    nFeatureSnapIter 15; // default is 10
    
// New settings from openfoam 2.2 onwards for SHMesh

implicitFeatureSnap false; // default is false - detects without doing surfaceFeatureExtract
explicitFeatureSnap true; // default is true
multiRegionFeatureSnap false; // deafault is false - detects features between multiple surfaces

}



// Settings for the layer addition. //nicht nötig wenn oben false
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName 
{
    relativeSizes false; // was true
    layers
    {
    Aussenwand
        {nSurfaceLayers 1;} // was 3
    Spundwand
        {nSurfaceLayers 1;} // was 3
    }

    expansionRatio 1.3;
    finalLayerThickness 0.00016; //was 0.00016
    minThickness 0.00008; //was 0.00008
    nGrow 0; // was 1 


    // Advanced settings

    featureAngle 80; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle.
    nRelaxIter 3;  //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
    nSmoothSurfaceNormals 1;  // Number of smoothing iterations of surface normals
    nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
    nSmoothThickness 10;  // Smooth layer thickness over surface patches
    maxFaceThicknessRatio 0.5; // Stop layer growth on highly warped cells
    maxThicknessToMedialRatio 0.3; // Reduce layer growth where ratio thickness to medial distance is large
    minMedianAxisAngle 130;  // Angle used to pick up medial axis points
    nBufferCellsNoExtrude 0;   // Create buffer region for new layer terminations
    nLayerIter 50; // Overall max number of layer addition iterations
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    maxNonOrtho 65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minFlatness 0.5;
    minVol 1e-13;
    minTetQuality 1e-9;
    minArea -1;
    minTwist 0.02;
    minDeterminant 0.001;
    minFaceWeight 0.02;
    minVolRatio 0.01;
    minTriangleTwist -1;

    // Advanced

    nSmoothScale 4;
    errorReduction 0.75;
}

// Advanced

debug 0;


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;


// ************************************************************************* //
Attached Images
File Type: png outside.png (22.1 KB, 19 views)
File Type: png part_of_insideMesh.png (31.3 KB, 21 views)
Bob! is offline   Reply With Quote

Old   March 5, 2017, 23:08
Default
  #2
Senior Member
 
Join Date: Aug 2013
Posts: 274
Rep Power: 6
Antimony is on a distinguished road
Hi,

If I am not mistaken, your second image (the one in grey) is a slice/clip. If so, there isn't anything wrong with your mesh, at least nothing that is discernible from the images.

You have refinementRegions which lead to polyhedral cells which are shown by Paraview that way.

When you load up the .foam file (I assume that is how you are viewing the mesh), uncheck the "Decompose Polyhedra" option and your mesh should look fine.

Hope this helps.

Cheers,
Antimony
Antimony is offline   Reply With Quote

Old   March 6, 2017, 08:05
Default
  #3
New Member
 
Join Date: Nov 2016
Posts: 8
Rep Power: 2
Bob! is on a distinguished road
Hello Antimony,

thanks a lot for the quick and helpful reply! Got it, looks much better.
Greetings
Robert
Bob! is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
problems using snappyHexMesh 2.1.0 on a supercomputer Sunxing OpenFOAM Native Meshers: snappyHexMesh and Others 9 September 20, 2014 09:30
snappyHexMesh makes strange things batta31 OpenFOAM Native Meshers: snappyHexMesh and Others 9 February 5, 2013 12:15
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05:50
Ignore cells on partition boundary Karl FLUENT 7 May 11, 2002 22:12


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