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] No generation of layer onto zerothickness surface (https://www.cfd-online.com/Forums/openfoam-meshing/221771-no-generation-layer-onto-zerothickness-surface.html)

crubio.abujas October 29, 2019 12:38

No generation of layer onto zerothickness surface
 
Hello folks,


I'm trying to mesh a open flat baffle to get the drag coefficient. I've been strugling with the generation of a boundary layer onto a zeroThickness surface. I've tried different configuration, differnt amount of layers and relative or absolute sizes without success. Other surfaces have no problem in generating this layers, that why I think the problem is related with this baffle zone.



When generating the boundary it seems that it creates something on Iteration 0 that is undone by further iterations. Hope anyone can help me figuring out what is happening.



Here is the snappyHexMeshDict file:

Code:

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

castellatedMesh true;
snap            true;
addLayers      false;


geometry
{
    central_facets
    {
        type triSurfaceMesh;
        file "central_facets_scaled.stl";
    }

    refinementBox
    {
        type searchableBox;
        min (-2.5 -9.0 -2.5 );
        max ( 2.5 1.0  2.5);
    }
};



castellatedMeshControls
{

    maxLocalCells 100000;

    maxGlobalCells 2000000;

    minRefinementCells 10;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 3;

    features
    (
        {
            file "central_facets_scaled.eMesh";
            level 6;
        }
    );






    refinementSurfaces
    {
        central_facets
        {
            level (5 5);
            faceZone central_facets;
            faceType baffle;
        }
    }

    resolveFeatureAngle 30;




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



    locationInMesh (3.0001 3.0001 0.43);


    allowFreeStandingZoneFaces true;
}



snapControls
{
    nSmoothPatch 5;

    tolerance 5;

    nSolveIter 30;

    nRelaxIter 5;


        nFeatureSnapIter 10;

        implicitFeatureSnap false;

        explicitFeatureSnap true;

        multiRegionFeatureSnap false;
}



addLayersControls
{
    relativeSizes true;

    layers
    {
        "lowerWall"
        {
            nSurfaceLayers 1;
        }
        "central_facets.*"
        {
            nSurfaceLayers 1;
        }
    }

    expansionRatio 1;

    finalLayerThickness 0.2;

    minThickness 0.000001;

    nGrow 0;

    featureAngle 60;

    slipFeatureAngle 30;

    nRelaxIter 3;

    nSmoothSurfaceNormals 1;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 1.0;

    minMedianAxisAngle 90;

    nBufferCellsNoExtrude 0;

    nLayerIter 50;
}



meshQualityControls
{
    #include "meshQualityDict"
}



writeFlags
(
    scalarLevels
    layerSets
);


mergeTolerance 1e-6;


And here is the output of the layer generation:


Code:

/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 6-fa1285188035
Exec  : snappyHexMesh -dict system/snappyHexMeshDict_layers
Date  : Oct 29 2019
Time  : 16:53:19
Host  : "AS-CALCULO"
PID    : 1448
I/O    : uncollated
Case  : /mnt/f/Gestrack/Dish/CFD/surfaceTest
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 3

Read mesh in = 0.32 s

Overall mesh bounding box  : (-3.5 -15 -3.5) (3.5 5 3.5)
Relative tolerance        : 1e-06
Absolute matching distance : 2.23159e-05

Reading refinement surfaces.
Read refinement surfaces in = 0 s

Reading refinement shells.
Read refinement shells in = 0 s

Setting refinement level of surface to be consistent with shells.
Checked shell refinement in = 0 s

Reading features.
Read features in = 0 s


Determining initial surface intersections
-----------------------------------------

Edge intersection testing:
    Number of edges            : 1798014
    Number of edges to retest  : 1798014
    Number of intersected edges : 12303
Calculated surface intersections in = 4.04 s

Initial mesh : cells:584570  faces:1798014  points:621554
Cells per refinement level:
    0    180
    1    532
    2    8752
    3    23296
    4    496586
    5    39416
    6    15808

Adding patches for surface regions
----------------------------------

Patch Type                Region                       
----- ----                ------                       
central_facets:

5    wall                central_facets               
6    wall                central_facets_slave         

Added patches in = 0.02 s

Selecting decompositionMethod none
Layer thickness specified as final layer and expansion ratio.

Shrinking and layer addition phase
----------------------------------

Using mesh parameters
{
    maxNonOrtho    65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      80;
    minVol          1e-13;
    minTetQuality  1e-15;
    minArea        -1;
    minTwist        0.02;
    minDeterminant  0.001;
    minFaceWeight  0.05;
    minVolRatio    0.01;
    minTriangleTwist -1;
    nSmoothScale    4;
    errorReduction  0.75;
}



Merging all faces of a cell
---------------------------
    - which are on the same patch
    - which make an angle < 60 degrees
      (cos:0.5)
    - as long as the resulting face doesn't become concave by more than 90 degrees
      (0=straight, 180=fully concave)

Merging 0 sets of faces.

No faces merged ...

Merging all points on surface that
- are used by only two boundary faces and
- make an angle with a cosine of more than 0.5.

No straight edges simplified and no points removed ...

Checking mesh manifoldness ...
Outside of mesh is multiply connected across edges or points.
This is not a fatal error but might cause some unexpected behaviour.


Checking initial mesh ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                : 0
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                    : 0
    faces with skewness > 4  (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                          : 0
    faces on cells with determinant < 0.001                : 0
Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
Converting zoned faces into baffles ...
For zone central_facets found patches central_facets and central_facets_slave
Created 0 baffles in = 3.44 s



Adding in total 0 inter-processor patches to handle extrusion of non-manifold processor boundaries.

Handling points with inconsistent layer specification ...

Handling non-manifold points ...

Checking patch manifoldness ...
Outside of local patch is multiply connected across edges or points at 9034 points.
Set displacement to zero for all 9034 non-manifold points

Handling feature edges ...

patch                faces    layers avg thickness[m]
                                    near-wall overall
-----                -----    ------ --------- -------
lowerWall            970      1      0.2      0.2   
central_facets      8222    1      0.2      0.00314
central_facets_slave 8222    1      0.2      0.00314

Selecting externalDisplacementMeshMover displacementMedialAxis
displacementMedialAxis : Calculating distance to Medial Axis ...
displacementMedialAxis : Smoothing normals ...
    Iteration 0  residual 0.795454
displacementMedialAxis : Inserting points on patch inlet if angle to nearest layer patch > 30 degrees.
displacementMedialAxis : Inserting points on patch outlet if angle to nearest layer patch > 30 degrees.
displacementMedialAxis : Inserting points on patch frontAndBack if angle to nearest layer patch > 30 degrees.
displacementMedialAxis : Inserting points on patch upperWall if angle to nearest layer patch > 30 degrees.
displacementMedialAxis : Smoothing normals in interior ...
    Iteration 0  residual 0.186764

Layer addition iteration 0
--------------------------

Determining displacement for added points according to pointNormal ...
Detected 144 points with point normal pointing through faces.
Reset displacement at 6 points to average of surrounding points.

displacementMedialAxis : Smoothing using Medial Axis ...
displacementMedialAxis : Reducing layer thickness at 45 nodes where thickness to medial axis distance is large
displacementMedialAxis : Removing isolated regions ...
displacementMedialAxis : Number of isolated points extrusion stopped : 122
displacementMedialAxis : Smoothing field ...
    Iteration 0  residual 7.872e-20
displacementMedialAxis : Moving mesh ...
displacementMedialAxis : Iteration 0
Moving mesh using displacement scaling : min:1  max:1
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                : 0
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                    : 0
    faces with skewness > 4  (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                          : 0
    faces on cells with determinant < 0.001                : 0
displacementMedialAxis : Successfully moved mesh
displacementMedialAxis : Finished moving mesh ...
truncateDisplacement : Unextruded 0 faces due to non-consecutive vertices being extruded.
truncateDisplacement : Unextruded 0 faces due to stringed edges with inconsistent extrusion.

Setting up information for layer truncation ...

Checking mesh with layer ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                : 0
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                    : 0
    faces with skewness > 4  (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                          : 0
    faces on cells with determinant < 0.001                : 0
Detected 0 illegal faces (concave, zero area or negative cell pyramid volume)
Extruding 970 out of 17414 faces (5.57023%). Removed extrusion at 0 faces.
Added 970 out of 17414 cells (5.57023%).
Edge intersection testing:
    Number of edges            : 1801000
    Number of edges to retest  : 0
    Number of intersected edges : 12303
Writing 970 added cells to cellSet addedCells
Writing 0 faces inside added layer to faceSet layerFaces

Writing fields with layer information:
    nSurfaceLayers    : actual number of layers
    thickness        : overall layer thickness
    thicknessFraction : overall layer thickness (fraction of desired thickness)


patch                faces    layers  overall thickness
                                      [m]      [%]
-----                -----    ------  ---      ---
lowerWall            970      1        0.2      100   
central_facets      8222    0        0        0     
central_facets_slave 8222    0        0        0     

Layer mesh : cells:585540  faces:1801000  points:622601
Cells per refinement level:
    0    210
    1    592
    2    9632
    3    23296
    4    496586
    5    39416
    6    15808
Writing mesh to time 4
Wrote mesh in = 15.76 s.
Layers added in = 19.2 s.
Checking final mesh ...
Checking faces in error :
    non-orthogonality > 65  degrees                        : 0
    faces with face pyramid volume < 1e-13                : 0
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                    : 0
    faces with skewness > 4  (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                          : 0
    faces on cells with determinant < 0.001                : 0
Finished meshing without any errors
Finished meshing in = 26.97 s.
End


any idea on how to face this problem?


Thank you very much!

aendres July 14, 2022 09:55

Mesh first, then create the baffle
 
Just for future reference: You can first create the patch without defining it as a baffle with
Code:

central_facets
{
    level (5 5);
    faceZone central_facets;
}

and after meshing use createBaffles to create a baffle from the faceZone central_facets. This allows for layer creation on baffle patches.

chris_j_meyer October 18, 2022 10:12

Quote:

Originally Posted by aendres (Post 831688)
Just for future reference: You can first create the patch without defining it as a baffle with
Code:

central_facets
{
    level (5 5);
    faceZone central_facets;
}

and after meshing use createBaffles to create a baffle from the faceZone central_facets. This allows for layer creation on baffle patches.




Hi, can you explain this in a little more detail please. Perhaps some questions:


When choosing the facetype as baffle in SHM two wall boundary conditions are created anyway, are you not accomplishing the same with converting a faceZone into baffles? Or do you convert the facezone into a single wall/baffle?


I assume SHM is executed again with a different dictionary file?


In any event, it would be really appreciated if you can provide slightly more detail.

aendres October 25, 2022 03:20

Hi,

the problem was, that when choosing the face type baffle for the zero-thickness geometry directly in snappyHexMeshDict, it did not create the boundary layers on this baffle patch. You can circumvent this by first running snappyHexMesh without the 'faceType baffle;' entry. This creates a regular patch, which allows snappyHexMesh to add layers to this patch. The added entry 'faceZone central_facets;' in snappyHexMeshDict creates a faceZone from this patch. Here, the job of snappyHexMesh is done. We have a zero-thickness patch with boundary layers.

Now we have to convert the regular patch to a baffle type patch. The created faceZone can be used after meshing with the tool 'createBaffles' to transform the 'central_facets' patch and faceZone to a baffle patch.

Hope this makes things a little clearer :)


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