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

[snappyHexMesh] Snappyhex mesh: poor inlet mesh

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 23, 2016, 05:41
Default Snappyhex mesh: poor inlet mesh
  #1
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11
Swagga5aur is on a distinguished road
Hello snappyhexzmeshers, I am currently experiencing an issue when geneating a mesh for a complex geometry of a catalytic burner, with respect to the inlet of the domain.

The issue is shown in the attached figures, and increasing the mesh density doedsn't improve the issue, it only persists in the same areas of the geometry.

The domain is a quarter of the real system, where the straight parts of the inlet is symmetry planes and the circular part is a wall.

The code for the snappyhexmesh and blockmesh directories are shown below:

I know that the refinementsurfaces and refinementregions are quite low and I have tried increasing them up a cell count of 8millions, the currentmesh is around 1million cells.

It should be noted that the blockmesh z boundary cuts off the top of the stl files, such that the air inlet patch is cut off as the air inlet mesh didn't improve the resulting velocity.

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       true;   // decide to add viscous layers ?


geometry // Load in STL files here
{
    inair.stl {type triSurfaceMesh; name inair;}
    out.stl {type triSurfaceMesh; name out;}
    ref_remain.stl {type triSurfaceMesh; name ref_remain;}
    burnout.stl {type triSurfaceMesh; name burnout;}
    mono.stl {type triSurfaceMesh; name mono;}
    swirl.stl {type triSurfaceMesh; name swirl;}
    sym.stl {type triSurfaceMesh; name sym;}
    inpipe.stl {type triSurfaceMesh; name inpipe;}
        refinementBox
        {
            type searchableBox;
            min (0.02 0.03 0.05);
            max (0.1 0.11 0.3);
        }
};

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

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

    features // taken from STL from each .eMesh file created by "SurfaceFeatureExtract" command
    (
        {file "inair.eMesh"; level 3;} 
        {file "out.eMesh"; level 3;} 
        {file "ref_remain.eMesh"; level 3;} 
        {file "burnout.eMesh"; level 3;} 
        {file "mono.eMesh"; level 3;}
    {file "swirl.eMesh"; level 3;}
    {file "inpipe.eMesh"; level 3;}
    {file "sym.eMesh"; level 3;}
    );

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

    refinementSurfaces // Surface-wise min and max refinement level
    {
    inair {level (0 0);}
        out {level (0 0);}
    ref_remain {level (1 1);} // was 3 3
    burnout {level (1 1);} // was 3 3
    mono {level (1 1);} // was 3 3
    swirl {level (3 3);} // was 3 3
    inpipe {level (3 3);} // was 3 3
    sym {level (0 0);}
    }  


    resolveFeatureAngle 80;  // Resolve sharp angles // Default 30 was 80
//    refinementRegions        // In descending levels of fine-ness
//    {volume {mode distance; levels ((0.0006 4) (0.002 3) (0.01 2));}} // was ((0.001 4) (0.003 3) (0.01 2))
//    This is combined with the nSmoothPatch, with the nSmoothPatch describing the amount of cells inbetween the refinement levels
    refinementRegions
    {
        refinementBox
        {
            mode inside;   // inside;
            levels ((1E15 1));  //1E15 4
        }
    }

    locationInMesh (0.085 0.1 0.21);   //to decide which side of mesh to keep **
    allowFreeStandingZoneFaces true;
}



// Settings for the snapping.
snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 5;    //should be 5 was 3
    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 5.0;    //was 4.0
    //- Number of mesh displacement relaxation iterations.
    nSolveIter 50;    //Recomended (typically 30-100)
    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 5;    //This specifies the maximum number of relaxing iterations to remove bad cells or mesh points. The relaxing process will stop immediately when the specified number of iterations are done even if the mesh still has bad cells. Thus, higher values will ensure better mesh quality but be more time consuming recommended 8 was 5
    //- Highly experimental and wip: number of feature edge snapping
    //  iterations. Leave out altogether to disable.
    //  Do not use here since mesh resolution too low and baffles present
    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 important when working with heat transfer between fluid and solid

}



// Settings for the layer addition.
addLayersControls //add the PATCH names from inside the STL file so STLpatchName_insideSTLName 
{
    relativeSizes true; // was true
    layers
    {
    ref_remain
             {nSurfaceLayers 3;} // was 3
    burnout
        {nSurfaceLayers 3;} // was 3
    mono
        {nSurfaceLayers 3;} // was 3
    swirl
        {nSurfaceLayers 3;} // was 3        
    inpipe
        {nSurfaceLayers 4;} // was 3            
    }

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


    // Advanced settings

    featureAngle 180; //set 80  was 70 //- When not to extrude surface. 0 is flat, 90 is right angle. was 180
    nRelaxIter 3;  //- Max# of snapping relaxation iter. Should stop before upon reaching a correct mesh.
    nSmoothSurfaceNormals 5;  // Number of smoothing iterations of surface normals    was 1, recommended 4-5
    nSmoothNormals 3; // Number of smoothing iterations of interior mesh movement direction
    slipFeatureAngle 70;
    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 was 130 recommendend 90
    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
{
    //- Maximum non-orthogonality allowed. Set to 180 to disable.
    maxNonOrtho 180; //65;
    maxBoundarySkewness 20;    //20    4
    maxInternalSkewness 4;    //8    3
    maxConcave 80;        //80
    minFlatness 0.5;
    minVol 1e-13;
    minTetQuality -1e+30;    //was 1e-15
    minArea -1;
    minTwist 0.02;
    minDeterminant 0.001;
    minFaceWeight 0.05;    // was 0.02
    minVolRatio 0.01;
    minTriangleTwist -1;

    // Advanced

    nSmoothScale 4;    //number of error distribution iterations (typically 4).
    errorReduction 0.75;    //amount to scale back displacement at error points (typically 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;


// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\

| =========                 |                                                 |

| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |

|  \\    /   O peration     | Version:  2.0.1                                 |

|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |

|    \\/     M anipulation  |                                                 |

\*---------------------------------------------------------------------------*/

FoamFile

{

    version     2.0;

    format      ascii;

    class       dictionary;

    object      blockMeshDict;

}

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



convertToMeters 1; // does nothing in this case, 0.1 would shrink it by 10x



vertices   // (x y z)   

(

    (0.02 0.03 0.05)       // was 0.02 0.03 0.05

    (0.1 0.03 0.05)     // was 0.1 0.03 0.05

    (0.1 0.11 0.05)   // was 0.1 0.11 0.05

    (0.02 0.11 0.05)     // was 0.02 0.11 0.05 

    (0.02 0.03 0.26)     // was 0.02 0.03 0.3    0.02 0.03 0.26

    (0.1 0.03 0.26)   // was 0.1 0.03 0.3    0.1 0.03 0.26

    (0.1 0.11 0.26) // was 0.1 0.11 0.3        0.1 0.11 0.26

    (0.02 0.11 0.26)   // was 0.02 0.11 0.3    0.02 0.11 0.26

);



blocks          

(

    hex (0 1 2 3 4 5 6 7) (24 24 75) simpleGrading (1 1 1)    //was 16 16 50

);



edges           

(

);



patches         //copied from DICAT shm example "M3_mixing elbow1"

(               

    patch maxY 

    (

        (3 7 6 2)

    )

    patch minX

    (

        (0 4 7 3)

    )

    patch maxX

    (

        (2 6 5 1)

    )

    patch minY

    (

        (1 5 4 0)

    )

    patch minZ

    (

        (0 3 2 1)

    )

    patch maxZ

    (

        (4 5 6 7)

    )

);



mergePatchPairs

(

);



// ************************************************************************* //
iteration 0, yscale upper limit of 31.6


iteration 150, yscale upper limit of 31.6

iteration 150 rescaled, yscale upper limit of 3.09e+2

Thanks for your help in advance.

Please let me know if additional information is necessary.

Last edited by Swagga5aur; November 23, 2016 at 08:12.
Swagga5aur is offline   Reply With Quote

Old   December 3, 2016, 17:59
Default
  #2
Senior Member
 
Lasse Brams Vinther
Join Date: Oct 2015
Posts: 118
Rep Power: 11
Swagga5aur is on a distinguished road
I found a solution to my issue, which was due to defining both pressure and velocity at the inlet patch, where its recommended to specify Dirichlet boundary conditions at two different patches, further explained in another post on the forum:
http://www.cfd-online.com/Forums/ope...ible-flow.html
Swagga5aur is offline   Reply With Quote

Reply

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] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
[ICEM] 2D hybrid mesh (unstructured mesh highly dependent on structured mesh parameters) shubham jain ANSYS Meshing & Geometry 1 April 10, 2017 06:03
Star CCM Overset Mesh Error (Rotating Turbine) thezack Siemens 7 October 12, 2016 12:14
[ICEM] surface mesh merging problem everest ANSYS Meshing & Geometry 44 April 14, 2016 07:41
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


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