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

[snappyHexMesh] sHM layer reduction towards outlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2016, 06:50
Default sHM layer reduction towards outlet
  #1
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
Hello Foamers,

I have a question regarding layer insertion in sHM:
I have a surface in my model which should be layered (e.g. wall) and an adjacent surface that should have no layer (e.g. an outlet), its 3dimensional, look at the picture below (outlet is at the bottom)
sHM is decreasing my layers towards the surface that has no layers - why?
I already played with some parameters like nGrow or featureAngle, but with no success. Maybe some of you have a hint.

cheers
Attached Images
File Type: png Screenshot from 2016-05-17 11:47:10.png (9.5 KB, 32 views)
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Old   May 19, 2016, 10:33
Default
  #2
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
no ideas?
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Old   May 19, 2016, 19:37
Default
  #3
Senior Member
 
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 25
me3840 is on a distinguished road
Can you post your snappy dictionary? I'll bet it has to do with the angles in the prism layer setup.
me3840 is offline   Reply With Quote

Old   May 20, 2016, 08:14
Default
  #4
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.3.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;
meshQuality         true;
snap                true;
addLayers           true;


geometry
{

var1e_swx_from_icem_flaechen_benannt_cutted.stl
        {
            type triSurfaceMesh;
        name var1e_swx_from_icem_flaechen_benannt_cutted;
        regions
        {
            OUTLETS        {    name outlets;}
            ROHRE        {    name rohre;}
            INLET        {    name inlet;}
            QUERKANAL1    {    name querkanal1;}
            QUERKANAL2    {    name querkanal2;}
            QUERKANAL3    {    name querkanal3;}
            KRUEMMER1    {    name kruemmer1;}
            /*KRUEMMER2    {    name kruemmer2;}
            KRUEMMER3    {    name kruemmer3;}
            KRUEMMER4    {    name kruemmer4;}*/
            HEADER1        {    name header1;}
            HEADER2        {    name header2;}
            HEADER3        {    name header3;}
            HEADER4        {    name header4;}
            HEADER5        {    name header5;}
            HEADER6        {    name header6;}
            HEADER7        {    name header7;}
            HEADER8        {    name header8;}
            /*HEADER9        {    name header9;}
            HEADER10    {    name header10;}
            HEADER11    {    name header11;}
            HEADER12    {    name header12;}*/
            SYMM        {    name symm;}
        }
    }


feinebox
    {
    type searchableBox;
    min (3     8    0);
    max (26    8.3    6);
    }
    
};


castellatedMeshControls
{
    
     maxGlobalCells     40000000;
     maxLocalCells         1000000;
     minRefinementCells 0;
     nCellsBetweenLevels 3;

    features
    (
        {    file     "var1e_swx_from_icem_flaechen_benannt_cutted.eMesh";            level 0;    }
        
        
        

);        

    refinementSurfaces
    {
    var1e_swx_from_icem_flaechen_benannt_cutted
    {
        level (2 3);
            regions
            {
                      rohre        {    level (2 3);        }
                      outlets        {    level (2 3);        }
                      inlet        {    level (2 3);        }
                      querkanal1    {    level (2 3);        }
                      querkanal2    {    level (2 3);        }
                      querkanal3    {    level (2 3);        }
                      kruemmer1    {    level (2 3);        }
                      /*kruemmer2    {    level (2 3);        }
                      kruemmer3    {    level (2 3);        }
                      kruemmer4    {    level (2 3);        }*/
                      header1        {    level (2 3);        }
                      header2        {    level (2 3);        }
                      header3        {    level (2 3);        }
                      header4        {    level (2 3);        }
                      header5        {    level (2 3);        }
                      header6        {    level (2 3);        }
                      header7        {    level (2 3);        }
                      header8        {    level (2 3);        }
                      symm        {    level (2 3);        }
                      inlet        {    level (2 3);        }
                      outlets        {    level (2 3);        }
                      //header12    {    level (2 3);        }

        
            }
        }
     }
    refinementRegions 
        {    
        feinebox        
               {        
                    mode inside;
                    levels ((1E15 0));
            }
        
         }  
    
    resolveFeatureAngle 30;

    allowFreeStandingZoneFaces true;   

    locationInMesh (5.0005000511194281582016 9.007272265124 1.00005000014285523886);

    maxLoadUnbalance 0.10;
    
}


addLayersControls
{
       // Are the thickness parameters below relative to the undistorted
        // size of the refined cell outside layer (true) or absolute sizes (false).
    relativeSizes true;
        // Expansion factor for layer mesh
           // expansionRatio 1.1;
    //- Wanted thickness of final added cell layer. If multiple layers
        //  is the thickness of the layer furthest away from the wall.
    //  See relativeSizes parameter.
    thickness 0.2; 
    firstLayerThickness 0.2; 
    //- Minimum thickness of cell layer. If for any reason layer
       //  cannot be above minThickness do not add layer.
       //  Relative to undistorted size of cell outside layer.   
     minThickness 0.000001;


    /* möglich sind:
    first layer thickness ('firstLayerThickness') and overall thickness ('thickness') or
    first layer thickness ('firstLayerThickness') and expansion ratio ('expansionRatio') or
    final layer thickness ('finalLayerThickness') and expansion ratio ('expansionRatio') or
    final layer thickness ('finalLayerThickness') and overall thickness ('thickness') or
    overall thickness ('thickness') and expansion ratio ('expansionRatio'
    */

    layers
            {
            rohre        { nSurfaceLayers 1;   }        
            querkanal1    { nSurfaceLayers 1;   }    
            querkanal2    { nSurfaceLayers 1;   }    
            querkanal3    { nSurfaceLayers 1;   }    
            kruemmer1    { nSurfaceLayers 1;   }    
            /*kruemmer2    { nSurfaceLayers 1;   }    
            kruemmer3    { nSurfaceLayers 1;   }    
            kruemmer4    { nSurfaceLayers 1;   }*/
            header1        { nSurfaceLayers 1;   }
            header2        { nSurfaceLayers 1;   }    
            header3        { nSurfaceLayers 1;   }    
            header4        { nSurfaceLayers 1;   }    
            header5        { nSurfaceLayers 1;   }    
            header6        { nSurfaceLayers 1;   }    
            header7        { nSurfaceLayers 1;   }    
            header8        { nSurfaceLayers 1;   }    
            //symm        { nSurfaceLayers 1;   }    
            //inlet        { nSurfaceLayers 1;   }    
            outlets        { nSurfaceLayers 0;   }    
            //header12    { nSurfaceLayers 1;   }    


    
       
            }
    //- If points get not extruded do nGrow layers of connected faces that are
        //  also not grown. This helps convergence of the layer addition process
    //  close to features.
    //      This specifies the number of layers of connected faces that are not grown. This helps in convergence of the layer addition               process close to features.
    nGrow 0;

    // Advanced settings

        //- When not to extrude surface. 0 is flat surface, 90 is when two faces
        //  make straight angle.
    featureAngle 210; //180; //130    
    SlipFeatureAngle 75;
    //- Maximum number of snapping relaxation iterations. Should stop
       //  before upon reaching a correct mesh.
        nRelaxIter 40;
    // Number of smoothing iterations of surface normals
    nSmoothSurfaceNormals 6;//3
    // Number of smoothing iterations of interior mesh movement direction
    nSmoothNormals 6;//3
    // Smooth layer thickness over surface patches
    nSmoothThickness 30;//10
    // Stop layer growth on highly warped cells
    // This specifies the maximum allowable value of aspect ratio. Sometimes (especially in corners) the layers must be generated over            highly warped cells. The layer generation will stop for cells where aspect ratio is higher than this value.
    maxFaceThicknessRatio 50;//0.5;
    // Reduce layer growth where ratio thickness to medial
        // distance is large
    maxThicknessToMedialRatio 0.8;//0.3
    // Angle used to pick up medial axis points
    minMedianAxisAngle 90;    
    // Create buffer region for new layer terminations
    nBufferCellsNoExtrude 2; //0
    // Overall max number of layer addition iterations
    nLayerIter 50;
    // No of steps walking away from the surface (to stop dislocations walking through the mesh)
    nMedialAxisIter 1000; // default: 2^31 (unlimited)
}
 
snapControls
{

    nSmoothPatch 5;//3            von 3 im vgl zu #1


    tolerance 1.5; //vorher 1.5

    nSolveIter 300;

    explicitFeatureSnap        true;
    implicitFeatureSnap     false;
    multiRegionFeatureSnap    true;
    nRelaxIter 10;

    nFeatureSnapIter 10;
}

meshQualityControls
{
 
    maxNonOrtho 65;//180; //50; // 65

    maxBoundarySkewness 5;//-1;//20;    von 20 im vgl zu #1

    maxInternalSkewness 4;//-1;//4;     von 0.5 im vgl zu #1

    maxConcave 80;//180;//80;

    minVol 1e-13;//-1e-33;//1e-13;

    minTetQuality 1e-30;//-1e-30;//1e-30;

    minArea -1;

    minTwist 0.02;//-1e-30;  //0.02;

    minDeterminant 0.001;//-1; //0.001; //0.001

    minFaceWeight 0.02;//-1;  //0.02;

    minVolRatio 0.01;//-1;    //0.01;

    minTriangleTwist 0.01;//-1;

    nSmoothScale 4;

    errorReduction 0.75; //0.75; 
}



debug 0;


mergeTolerance 1e-2;


// ************************************************************************* //
Thank you for your answer, this is my sHM dict.
Reuslting from this sHM dict:
Picture #1 shows the transition of the BL from "rohre" to "symm" and pic #2 shows transition from "rohre" to "outlets". In both cases the BL should have been projected onto the face which should have no BL (i.e. symm and outlets respectively). In my sHM dict I tried to either comment out BL for symm or say "zero layers" for "outlets", both don't work.

When you talk about the feature angle.. I also attached 2 pictures that show a parametric study of this angle starting at 90° at the left going to 180° to the right (for the first picture) and a detailed study from 150° t165° to 180°. You can see that none of the cases is satisfying, since the BL either won't go around the corner or is not projected on the left wall where I don't want to have a BL.
Attached Images
File Type: png #1_rohre-symm.png (9.8 KB, 13 views)
File Type: png #2_rohre-out.png (12.6 KB, 12 views)
File Type: jpg layers_feature_angle_90-130-150-180.jpg (153.1 KB, 19 views)
File Type: jpg layers_feature_angle_150-165-180.jpg (152.6 KB, 12 views)
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Old   May 21, 2016, 04:51
Default
  #5
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
Hi Hugo,

I think the answer to your question is in the code.
Have a look to
src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C

In the method Foam::autoLayerDriver::doLayers you can find:
// Per patch the number of layers (-1 or 0 if no layer)
const labelList& numLayers = layerParams.numLayers();


layerParams is an object containing what is read from sHMDict.

The difference between -1 or 0 can be seen in
// Construct pointVectorField with correct boundary conditions for adding
// layers
Foam::tmp<Foam:: pointVectorField>
Foam::autoLayerDriver::makeLayerDisplacementField


There, all the patches are set to slip:

wordList patchFieldTypes
(
pointPatches.size(),
slipPointPatchVectorField::typeName
);


Apart from the patches where numLayers is 0 or >0:

forAll(numLayers, patchI)
{
// 0 layers: do not allow slip so fixedValue 0
// >0 layers: fixedValue which gets adapted
if (numLayers[patchI] == 0)
{
patchFieldTypes[patchI] =
zeroFixedValuePointPatchVectorField::typeName;
}
else if (numLayers[patchI] > 0)
{
patchFieldTypes[patchI] = fixedValuePointPatchVectorField::typeName;
}
}


So, if you set nSurfaceLayers to -1 for the patches symm and outlets, they will be set to slip and the points should slide to accommodate the prisms grown on the adjacent patches.

Hope it helps,
Francesco
fra76 is offline   Reply With Quote

Old   May 23, 2016, 07:39
Default
  #6
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
Hello Francesco,

thank you for your suggestion, I set nSurfaceLayers -1 for symm, inlet and outlets as you wrote, but it does´t work
Have you tried it?

regards
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Old   May 24, 2016, 03:53
Default
  #7
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
pls find the download link of a minimum example: https://we.tl/kjyiZhC6ZX
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Old   May 25, 2016, 01:14
Default
  #8
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18
fra76 is on a distinguished road
No, I haven't tried it recently and I don't know when I can try it again. What I am sure is that I had prisms doing what you want on a patch coming from blockMesh. In this case the patch is defined as symmetryPlane in blockMeshDict and it is not specified at all in the snappyHexMeshDict.

I don't know how much this could help you. I'll let you know if I manage to try your test case.

Francesco
fra76 is offline   Reply With Quote

Old   June 17, 2016, 04:42
Default
  #9
New Member
 
m0guib's Avatar
 
Hugo
Join Date: Mar 2012
Location: Frankfurt am Main
Posts: 10
Rep Power: 14
m0guib is on a distinguished road
still andybody has no ideas?
__________________
Fährste quer, siehste mehr!
m0guib is offline   Reply With Quote

Reply


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] SHM addLayers doesnt work on the small surface handicraft OpenFOAM Meshing & Mesh Conversion 4 October 5, 2018 04:50
[snappyHexMesh] Problem airfoil snappyhexmesh add layer bye bye my blue OpenFOAM Meshing & Mesh Conversion 1 May 5, 2017 06:56
[snappyHexMesh] SHM not snapping to some surfaces Swift OpenFOAM Meshing & Mesh Conversion 13 January 4, 2016 02:56
[snappyHexMesh] SHM is assigning all faces to the first patch? me3840 OpenFOAM Meshing & Mesh Conversion 2 September 20, 2015 21:03
[snappyHexMesh] Boundary layer in a pipe Clementhuon OpenFOAM Meshing & Mesh Conversion 6 March 12, 2012 13:41


All times are GMT -4. The time now is 23:00.