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

[Other] How to create a mesh with boundary layers and y+ < 1

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2014, 11:28
Unhappy How to create a mesh with boundary layers and y+ < 1
  #1
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Hi Foamers,

I have been tirelessly trying out different permutation and combination of layer control parameters, so that I can get proper boundary layers and y+ < 1, but to no good effect, when I increase nSurfaceLayers to 10, no layers are added at all, I have a complex geometry, which rotates.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.1                                 |
|   \\  /    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;
snap            true;
addLayers       true;

geometry
{

    ImperialBlade.stl 
    {
        type triSurfaceMesh;
    }
    
    
    outerCylinder.stl
    {
        type        triSurfaceMesh;
        name        outerCylinder;
        regions
        {
            ascii
            {
                 name       outerCylinder;
            }
        }
    }    
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    maxLocalCells  2000000;

    maxGlobalCells 3000000;
    
    minRefinementCells 0;

    
    maxLoadUnbalance 0.10;


    nCellsBetweenLevels 3;
    
    
    features
    (
        {
	  file   "ImperialBlade.eMesh";
	  level    5;
        }

	{
	  file "outerCylinder.eMesh";
	  level 0;
	}

    );



    refinementSurfaces
    {
        ImperialBlade.stl
        {
            level       (5 5);
        }
	  
	outerCylinder
        {
            level       (0 0);
        }
 
    }

    // Resolve sharp angles
    resolveFeatureAngle 30;


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

    // Specifies refinement level for cells in relation to a surface. One of
    // three modes
    // - distance. 'levels' specifies per distance to the surface the
    //   wanted refinement level. The distances need to be specified in
    //   descending order.
    // - inside. 'levels' is only one entry and only the level is used. All
    //   cells inside the surface get refined up to the level. The surface
    //   needs to be closed for this to be possible.
    // - outside. Same but cells outside.

    refinementRegions
    {
        
       outerCylinder
        {
            mode        inside;
            levels      ((1E15 0));
        }
        
    }


    // Mesh selection
    // ~~~~~~~~~~~~~~

    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    locationInMesh (-677.989649107597 -873.503400652118 1357.52027014113);


    allowFreeStandingZoneFaces true;
}



// Settings for the snapping.
snapControls
{
    
    nSmoothPatch 3;

    
    tolerance 4.0; // 1.0;

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 300;

    
    nRelaxIter 5;

    
    nFeatureSnapIter 30;
}



// Settings for the layer addition.
addLayersControls
{
    // Are the thickness parameters below relative to the undistorted
    // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes false;

    // Per final patch (so not geometry!) the layer information
    layers
    {
        "ImperialBlade.*"
         {
            nSurfaceLayers 10;
         }
    }

    // Expansion factor for layer mesh
    expansionRatio 1.2;

    finalLayerThickness 0.1;

    
    minThickness 0.01;

    
    nGrow 0;

    // Advanced settings

    // When not to extrude surface. 0 is flat surface, 90 is when two faces
    // are perpendicular
    featureAngle 30;

    // Maximum number of snapping relaxation iterations. Should stop
    // before upon reaching a correct mesh.
    nRelaxIter 5;

    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 1;

    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 3;

    // Smooth layer thickness over surface patches
    nSmoothThickness 0;

    // Stop layer growth on highly warped cells
    maxFaceThicknessRatio 0.6;

    // Reduce layer growth where ratio thickness to medial
    // distance is large
    maxThicknessToMedialRatio 0.3;

    // Angle used to pick up medial axis points
    // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
    minMedianAxisAngle 90;


    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 0;


    
    nLayerIter 40;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    //- Maximum non-orthogonality allowed. Set to 180 to disable.
    maxNonOrtho 65;

    //- Max skewness allowed. Set to <0 to disable.
    maxBoundarySkewness 20;
    maxInternalSkewness 4;

    //- Max concaveness allowed. Is angle (in degrees) below which concavity
    //  is allowed. 0 is straight face, <0 would be convex face.
    //  Set to 180 to disable.
    maxConcave 80;

    //- Minimum pyramid volume. Is absolute volume of cell pyramid.
    //  Set to a sensible fraction of the smallest cell volume expected.
    //  Set to very negative number (e.g. -1E30) to disable.
    minVol 1e-13;

    
    minTetQuality -1; // 1e-30;

    //- Minimum face area. Set to <0 to disable.
    minArea -1;

    //- Minimum face twist. Set to <-1 to disable. dot product of face normal
    //- and face centre triangles normal
    minTwist 0.01;

    //- minimum normalised cell determinant
    //- 1 = hex, <= 0 = folded or flattened illegal cell
    minDeterminant 0.001;

    //- minFaceWeight (0 -> 0.5)
    minFaceWeight 0.05;

    //- minVolRatio (0 -> 1)
    minVolRatio 0.01;

    //must be >0 for Fluent compatibility
    minTriangleTwist -1;


    // Advanced

    //- Number of error distribution iterations
    nSmoothScale 4;
    //- amount to scale back displacement at error points
    errorReduction 0.75;

    // Optional : some meshing phases allow usage of relaxed rules.
    // See e.g. addLayersControls::nRelaxedIter.
    relaxed
    {
        //- Maximum non-orthogonality allowed. Set to 180 to disable.
        maxNonOrtho 75;
    }
}


// Advanced

// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
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;
I am using this tool to guess the minimum wall distance in terms of finalLayer thickness and expansionratio, but I haven't been able to get y+ less than 50, with any combinations I have used.

my blade thickness is 1.25 mm and I am using boundary layer displacement thickness to be 2 times of that, that means final layer thickness of 1 and contracting down to, 1.5e-5 m (desired distance from the blade surface)

why is it so hard to get correct y+ and wall distance from the blade in snappy-Hex,
I mean is there a tool which could tell average, this is just frustrating.
fedvasu is offline   Reply With Quote

Old   April 1, 2014, 07:57
Default
  #2
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
To begin try to add only 1 cell. And check that the mesh is OK. Then only add more cells in the boundary layer.
Stéphane.
openfoam_user is offline   Reply With Quote

Old   April 1, 2014, 13:19
Default
  #3
Member
 
Join Date: Oct 2013
Posts: 92
Rep Power: 13
fedvasu is on a distinguished road
Quote:
Originally Posted by openfoam_user View Post
To begin try to add only 1 cell. And check that the mesh is OK. Then only add more cells in the boundary layer.
Stéphane.
you mean nSurfaceLayers 1; with the wall distance and then start adding more layers?

Thank you Stéphane,
fedvasu is offline   Reply With Quote

Reply

Tags
mesh, openfoam-2.2.x, wall distance, yplus


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
y+ = 1 boundary layer mesh with snappyHexMesh Arzed23 OpenFOAM Running, Solving & CFD 6 November 23, 2022 16:15
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 08:34
[snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 09:26
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[ICEM] how to create a 2d tri mesh with quad mesh in the boundary layer seal2013 ANSYS Meshing & Geometry 3 October 6, 2013 17:09


All times are GMT -4. The time now is 06:31.