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

[snappyHexMesh] Addlayers and refined edges (snappyHexMesh)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 25, 2014, 09:00
Default Addlayers and refined edges (snappyHexMesh)
  #1
New Member
 
Max Foamer
Join Date: Oct 2014
Posts: 5
Rep Power: 11
Max Foamer is on a distinguished road
Hello,

I have been trying to add layers to an Ahmed body with refined edges, but the layers collapse at the refined edges. Any suggestions?






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 false;    // make basic mesh ?
snap            false;    // decide to snap back to surface ?
addLayers       true;  // decide to add viscous layers ?


geometry // Load in STL files here
{
    Ahmedm.stl {type triSurfaceMesh; name Ahmedm;}
    refinementBox1 {type searchableBox; min (-0.4 -0.3 0); max ( 1 0.3 0.35);}
    refinementBox2 {type searchableBox; min (-1.444 -0.935 0); max ( 6.264 0.935 0.002);}
};

castellatedMeshControls
{
    maxLocalCells 10000000;  //max cells per CPU core
    maxGlobalCells 200000000; //max cells to use before mesh deletion step
    minRefinementCells 0;  //was 0 - zero means no bad cells are allowed during refinement stages
    maxLoadUnbalance 0.1;
    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 "Ahmedm.eMesh"; level 9;} 

    );

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

    refinementSurfaces // Surface-wise min and max refinement level
    {
    Ahmedm {level (4 6);}
    Ground {level (4 4);}
    Inlet {level (0 4);}
    Outlet {level (0 4);}
    //SymT  {level (0 4);}
    SymR {level (0 4);}
    SymL {level (0 4);}
    }  

    resolveFeatureAngle 160;  // Resolve sharp angles // Default 30
    refinementRegions        // In descending levels of fine-ness


    {
    Ahmedm {mode distance;  levels ((0.01 5)(0.02 4) (0.2 3) (0.5 2) (0.7 1));} //((0.0003 5)(1. 4) (1.3 3) (2. 1));}

    //Ground {mode distance;  levels ((0.02 4) (0.2 3) (0.5 2) (0.6 1));}
    refinementBox1 {mode inside; levels ((3 3));}
    refinementBox2 {mode distance;  levels ((0.01 4) (0.05 3) (0.08 2) (0.5 1));} 
    //refinementBox2 {mode inside; levels ((3 3));}
    
      } // was ((0.001 4) (0.003 3) (0.01 2))
    locationInMesh (-1.2545 0 0.5314);  //to decide which side of mesh to keep **
    allowFreeStandingZoneFaces true;
}


// Settings for the snapping.
snapControls
{
    nSmoothPatch 3;
    tolerance 3;
    nSolveIter 300;
    nRelaxIter 7;
    nFeatureSnapIter 13; // 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 true; // deafault is false - detects features between multiple surfaces

}



// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName 
{
    relativeSizes false; // was true
    layers
    {
    Ahmedm
             {nSurfaceLayers 4;} // was 3
    Ground
        {nSurfaceLayers 4;}
    }

    expansionRatio 2;
    finalLayerThickness 0.00085; //was 0.00016
    minThickness 0.0000025; //was 0.00008
    nGrow 0; // was 1 


    // Advanced settings

    featureAngle 160; // 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 5;  // Number of smoothing iterations of surface normals
    nSmoothNormals 7; // Number of smoothing iterations of interior mesh movement direction
    nSmoothThickness 15;  // Smooth layer thickness over surface patches
    maxFaceThicknessRatio 0.7; // Stop layer growth on highly warped cells
    maxThicknessToMedialRatio 0.7; // Reduce layer growth where ratio thickness to medial distance is large
    minMedianAxisAngle 80;  // Angle used to pick up medial axis points
    nBufferCellsNoExtrude 0;   // Create buffer region for new layer terminations
    nLayerIter 100; // Overall max number of layer addition iterations
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    maxNonOrtho 80;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 30;
    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: jpg Screenshot from 2014-10-25 14:49:20.jpg (66.6 KB, 135 views)
Max Foamer is offline   Reply With Quote

Reply

Tags
edges, snappyhexmesh


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] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 08:26
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 17:16
[snappyHexMesh] snappyHexMesh creates inverted meshes emat OpenFOAM Meshing & Mesh Conversion 3 March 27, 2017 08:50
[snappyHexMesh] collapsed edges snappyHexMesh ynos OpenFOAM Meshing & Mesh Conversion 1 April 16, 2014 08:23
[snappyHexMesh] SnappyHexMesh Internal Flow Example (Diesel Injector) Irish09 OpenFOAM Meshing & Mesh Conversion 23 July 15, 2013 07:45


All times are GMT -4. The time now is 02:14.