CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   snappyHexMesh: No layer at the outer surfaces of the mesh (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/106859-snappyhexmesh-no-layer-outer-surfaces-mesh.html)

Jane L September 11, 2012 04:16

snappyHexMesh: No layer at the outer surfaces of the mesh
 
2 Attachment(s)
Hi Foamers!

I have a -maybe simple- problem when generating a mesh of a prismatic body in snappyHexMesh. The layers are only produced in the inner part of the mesh while there are no layers on the outside boundaries of the mesh. This kind of mesh results in high values of yPlus close to the outer faces.

I created a very simple mesh of a cylinder to show that problem. I clipped the mesh twice to make the inner part visible (see attached pictures).

Here is the snappyHexMeshDict I used:
Code:

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

geometry
{
    circle.stl
    {
        type triSurfaceMesh;        name circle;
    }

};

// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters

    maxLocalCells 15000000;

    maxGlobalCells 30000000;

    minRefinementCells 0;


    nCellsBetweenLevels 3;

    // Explicit feature edge refinement

    features
    (
    );

    // Surface based refinement

    refinementSurfaces
    {
        circle
        {
            level (1 1); // was (2 2)
        }
    }

    resolveFeatureAngle 180;

    // Region-wise refinement

    refinementRegions
    {
    }

    // Mesh selection

    locationInMesh (0.45 0 0.0005);

    allowFreeStandingZoneFaces true;
}

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

    tolerance 4.0;

    nSolveIter 30;

    nRelaxIter 5;
}



// Settings for the layer addition.
addLayersControls
{
    relativeSizes true;

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

    expansionRatio 1.25;

    finalLayerThickness 0.8;

    minThickness 0.25;

    nGrow 2;


    // Advanced settings

    featureAngle 180;
    nRelaxIter 5;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
    maxNonOrtho 65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minVol 1e-13;
    minTetQuality 1e-30;
    minArea -1;
    minTwist 0.05;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;
    // Advanced
    nSmoothScale 4;
    errorReduction 0.75;
    relaxed
    {
        maxNonOrtho 75; // war nicht hier
    }

}

debug 0;
mergeTolerance 1e-6;


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

Anybody an idea to solve this?

Thanks in advance!

Eloise September 13, 2012 08:38

Hi,

I've never tried to insert Layers on an outer wall with sHM, but here is what I'd try:

1) in the output of blockMesh utility, you get a message in which you can read the name of your different patches such as:
Code:

----------------
Patches
----------------
  patch 0 (start: 3450365 size: 15060) name: frontAndBack
  patch 1 (start: 3465425 size: 4650) name: outlet
  patch 2 (start: 3470075 size: 4650) name: inlet
  patch 3 (start: 3474725 size: 38905) name: upperWall
  patch 4 (start: 3513630 size: 38905) name: lowerWall

2) Let's say that you want to insert VL in the patch named lowerWall, I'd then adapt the snappyHexMeshDict as follow:
Code:

layers    {
      "circle.*"  {nSurfaceLayers 2; }
      lowerWall  {nSurfaceLayers 2;}
      }

Let me know if that works, I'm curious to know :)

Otherwise, I'd already create the layers in the background mesh with blockMesh.

Regards,
Elo´se


All times are GMT -4. The time now is 13:21.