CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] non-orthogonality problem (https://www.cfd-online.com/Forums/openfoam-meshing/239476-non-orthogonality-problem.html)

tommynego95 November 8, 2021 08:49

non-orthogonality problem
 
Hello all,

In the current study i'm following i need to mesh a complex body.
I decided to use snappyHexMesh since it has a good mesh capability and meshes with hexaedral elements.
The sHM process end with no problems exept the fact that i get a lot of non-orthogonals elements on my mesh, about 5000.
I don't get what i' m doing wrong
Here is the blockMeshDict file for the background mesh:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  9
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}

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

convertToMeters 0.001;

//x [-250;100]
//y [0;170]
//z [0;11.273]
vertices
(
    (-300 0 0)
    (500 0 0)
    (500 300 0)
    (-300 300 0)
    (-300 0 11)
    (500 0 11)
    (500 300 11)
    (-300 300 11)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (80 30 11) simpleGrading (1 1 1)

edges
();

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 3 7 4)
        );
    }
   
    outlet
    {
        type patch;
        faces
        (
            (1 2 6 5)
            (7 6 2 3)
        );
    }
   
    front_back
    {
        type empty;
        faces
        (
            (0 3 2 1)
            (5 6 7 4)
        );
    }
   
    symmetry
    {
            type symmetryPlane;
            faces
            (
                (0 1 5 4)
            );
    }
);


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

The surfaceFeaturesDict
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  9
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      dictionary;
    object      surfaceFeaturesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

wall
{
        surfaces ("wall.stl");

        includedAngle 90;
        geometricTestOnly      yes;
        writeObj        yes;
}
porous_domain
{
        surfaces ("porous_domain.stl");

        includedAngle 90;
        geometricTestOnly      yes;
        writeObj        yes;
}


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

and the snappyHexMeshDict

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  9
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap            true;
addLayers      true;
geometry
{
    wall
    {
        type closedTriSurfaceMesh;
        file "wall.stl";
    }

    porous_domain
    {
        type closedTriSurfaceMesh;
        file "porous_domain.stl";
    }
   
    refinementBox
    {
        type searchableBox;
        min (-0.3 0 0);
        max (0.25 0.2 0.011);
    }
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    maxLocalCells 100000000;

    maxGlobalCells 200000000;

    minRefinementCells 10;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 2;



    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
    features
    (
        {
            file "wall.eMesh";
            levels ((2 3));
        }
       
        {
            file "porous_domain.eMesh";
            levels ((2 2));
        }
    );
       


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

    refinementSurfaces
    {
        wall
        {

            level (0 0);
            patchInfo
            {
                type wall;
            }
        }
       
        porous_domain
        {
            level (2 2);
           
            faceZone porous_domain;
            cellZone porous_domain;
            cellZoneInside inside;
           
            boundary internal;
           
            patchInfo
            {
                type patch;
            }
        }
    }

    resolveFeatureAngle 30;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~

    refinementRegions
    {
    refinementBox
        {
            mode    inside;
            level  1;
        }
    }


    // Mesh selection
    // ~~~~~~~~~~~~~~
    locationInMesh (-0.25 0.001 0.005);

    allowFreeStandingZoneFaces true;
}



// Settings for the snapping.
snapControls
{

    nSmoothPatch 5;

    tolerance 4.0;

    nSolveIter 100;

    nRelaxIter 5;

    // Feature snapping
        nFeatureSnapIter 30;

        implicitFeatureSnap false;

        explicitFeatureSnap true;

        multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{

    relativeSizes false;

    layers
    {
        wall
        {
                nSurfaceLayers 5;
        }
    }

    expansionRatio 1.2;

    finalLayerThickness 0.2;

    minThickness 0.1;

    nGrow 0;

    featureAngle 30;

    slipFeatureAngle 30;

    nRelaxIter 3;

    nSmoothSurfaceNormals 1;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.3;

    minMedianAxisAngle 90;

    nBufferCellsNoExtrude 0;

    nLayerIter 50;
}


meshQualityControls
{
    #include "meshQualityDict"
}


debug 1;


writeFlags
(
    scalarLevels
    layerSets
    layerFields 
);

mergeTolerance 1e-6;


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

I also attach the .stl files so if anybody wants to help.
The .stl files are exported from a geometry i modeled in salome.


All times are GMT -4. The time now is 16:43.