Find answers, ask questions, and connect with our <br>community around the world.

Home Forums OpenFOAM Forum snappyHexMesh error Reply To: snappyHexMesh error

  • Srinivas

    Member
    February 27, 2023 at 6:47 am

    ignore Above Dict, its wrong Dict. below is correct SnappyHexMeshDict.

     

    /*——————————–*- C++ -*———————————-*\
    | ========= | |
    | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
    | \\ / O peration | Version: 2.2.0 |
    | \\ / A nd | Web: http://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
    {
    STOLFuselage.stl {type triSurfaceMesh; name STOLFuselage;}
    STOLgear.stl {type triSurfaceMesh; name STOLgear;}
    STOLleftcanard.stl {type triSurfaceMesh; name STOLleftcanard;}
    STOLleftrudder.stl {type triSurfaceMesh; name STOLleftrudder;}
    STOLleftwing.stl {type triSurfaceMesh; name STOLleftwing;}
    STOLmotorcase.stl {type triSurfaceMesh; name STOLmotorcase;}
    STOLrightcanard.stl {type triSurfaceMesh; name STOLrightcanard;}
    STOLrightrudder.stl {type triSurfaceMesh; name STOLrightrudder;}
    STOLrightwing.stl {type triSurfaceMesh; name STOLrightwing;}

    refinementBox
    {
    type searchableBox;
    min (-6000 -600 -600);
    max ( 2000 600 600);
    }

    };

    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 4; // 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 “STOLrightcanard.eMesh”; level 3;}
    {file “STOLFuselage.eMesh”; level 3;}
    {file “STOLgear.eMesh”; level 4;}
    {file “STOLleftcanard.eMesh”; level 3;}
    {file “STOLleftrudder.eMesh”; level 3;}
    {file “STOLleftwing.eMesh”; level 3;}
    {file “STOLmotorcase.eMesh”; level 4;}
    {file “STOLrightrudder.eMesh”; level 3;}
    {file “STOLrightwing.eMesh”; level 3;}

    );

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

    refinementSurfaces // Surface-wise min and max refinement level
    {
    STOLrightcanard {level (3 3);}
    STOLFuselage {level (3 3);}
    STOLgear {level (4 4);}
    STOLleftcanard {level (3 3);}
    STOLleftrudder {level (3 3);}
    STOLleftwing {level (3 3);} // was 4 4
    STOLmotorcase {level (4 4);} // was 4 4
    STOLrightrudder {level (3 3);}
    STOLrightwing {level (3 3);} // was 4 4

    }

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

    refinementBox
    {
    mode inside;
    levels ((1E15 4));
    }

    }

    locationInMesh (-3000 600 600); //to decide which side of mesh to keep **
    allowFreeStandingZoneFaces true;
    }

    // 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.
    addLayersControls //add the PATCH names from inSTOLleftwing the STL file so STLpatchName_inSTOLleftwingSTLName
    {
    relativeSizes true; // was true
    layers
    {
    STOLrightcanard
    {nSurfaceLayers 8;} // was 3

    STOLFuselage
    {nSurfaceLayers 8;} // was 3

    STOLgear
    {nSurfaceLayers 8;} // was 3

    STOLleftcanard
    {nSurfaceLayers 8;} // was 3

    STOLleftrudder
    {nSurfaceLayers 8;} // was 3

    STOLleftwing
    {nSurfaceLayers 8;} // was 3

    STOLmotorcase
    {nSurfaceLayers 8;} // was 3

    STOLrightrudder
    {nSurfaceLayers 8;} // was 3

     

    STOLrightwing
    {nSurfaceLayers 8;} // was 3

    }

    expansionRatio 1.05;
    finalLayerThickness 0.1; //was 0.00016
    minThickness 0.001; //was 0.00008
    nGrow -1; // was 1

    // Advanced settings

    featureAngle 170; // was 70 //- When not to extrude surface. 0 is flat, 90 is right angle.
    nRelaxIter 3; //- Max# of snapping relaxation iter. Should sSTOLleftcanard 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; // SSTOLleftcanard 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 25; // 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-30;
    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;

    // ************************************************************************* //

error: Content is protected !!