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] Can' get stl patch name for addLayers right? (https://www.cfd-online.com/Forums/openfoam-meshing/95775-can-get-stl-patch-name-addlayers-right.html)

klausb January 2, 2012 08:10

Can' get stl patch name for addLayers right?
 
Hello,

I need to add layers to my wing boundary to ultimately resolve the boundary layer.

So far I was not able to get the patch name of the wing (wing.stl with the name wing) right so no layers were added. I know other people ran into the same problem but I couldn't find an answer.

How is this name defined?

What's the correct syntax in the snappyHexMeshDict?

Here the relevant sections of snappyHexMeshDict:

addLayers true; // true;
...

geometry
{
wing.stl
{
type triSurfaceMesh;
name wing;

regions
{
wing
{
name wing;
}
}
}

...

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

layers
{
wing
{
nSurfaceLayers 3;
}

}

Klaus

linnemann January 2, 2012 09:25

Disable layers and note the name of the patches of the output.

It will probably be wing_solid.

If you open the stl file the first line will read.

solid some_name_here

If some_name_here is empty snappy will add _solid to the patch name.

If some_name_here is present snappy will add _some_name_here to the patch name.

This is the name you have to use for the layers.

So its the name of the final output patch, not geometry!

klausb January 2, 2012 09:59

Name is right but no layers added?!
 
3 Attachment(s)
Thank you for your feedback,

in my case even so the name defined in the stl file is wing (solid wing ...), the patch name accepted by OpenFoam is just wing - fixed.

Nevertheless, the problems remains, no layers are added - see attached picture, snappyHexMeshDict and log file.

What's wrong?

Klaus

PeterX30 January 2, 2012 18:31

Most likely it will work when you change the layers definition entry

wing

in line 208 of your sHMdict into

wing_solid

If there is no specific region name specified in the STL then automatically the
created patch will get "_solid" at the end of the patch name.

klausb January 2, 2012 18:48

There IS a specific region name in the stl file!
 
Hello,

There IS a specific region name in the stl file! It's wing (first line in the file is: solid wing)

I am aware of the naming in the first line of stl files.

That's why I am struggling with the error identification.

Klaus

bobburnquist January 3, 2012 05:53

1 Attachment(s)
Hi Klaus,
do you work with ascii or binary stl file?
You can change the name in the ascii file. In my case its:
solid part
---
endsolid part

You have to define this name in the sHMDict: nameofstl_part

But i have the same problems with the layers (see pictures)
I changed these values again and again.
Code:

finalLayerThickness 1;//0.3

    //- 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.5; //0.1

Hopefully we ll get a solution.

PeterX30 January 3, 2012 05:55

Check the log. Here the names of the patches are documented.
In your case it might be now :"wing_wing"

linnemann January 3, 2012 06:28

Hi Again

When you do the regions thing in the snappyDict it does not add _name to the patch name.

Try and change the geometry section to this instead

Code:

geometry
{
    wing.stl
    {
        type triSurfaceMesh;
        regions
        {
            wing
            {
                name wing;
            }
        }
    }

If you notice its a little different from you initial post.

If this does not work its not a naming issue, but some settings.

If you want/can share the case using maybe a public dropbox link.

EDIT.

on a side note you have set

relativeSizes true;

and the

finalLayerThickness 0.002;

If relative is set to true its relative to the first cell height as I recall.
So 0.002 relative to the first cell height which is already small might get you below the tolerance and it will skip adding the layer.

what happens if you use the settings from the SHM flange tutorial?
just paste this in I've changed the names.

Code:

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

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

    // Expansion factor for layer mesh
    expansionRatio 1.2;


    //- Wanted thickness of final added cell layer. If multiple layers
    //  is the thickness of the layer furthest away from the wall.
    //  See relativeSizes parameter.
    finalLayerThickness 0.3;

    //- Minimum thickness of cell layer. If for any reason layer
    //  cannot be above minThickness do not add layer.
    //  See relativeSizes parameter.
    minThickness 0.25;

    //- 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.
    nGrow 0;


    // Advanced settings

    //- When not to extrude surface. 0 is flat surface, 90 is when two faces
    //  make straight angle.
    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 10;

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

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

    // Angle used to pick up medial axis points
    minMedianAxisAngle 90;

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


    // Overall max number of layer addition iterations. The mesher will exit
    // if it reaches this number of iterations; possibly with an illegal
    // mesh.
    nLayerIter 50;

    // Max number of iterations after which relaxed meshQuality controls
    // get used. Up to nRelaxIter it uses the settings in meshQualityControls,
    // after nRelaxIter it uses the values in meshQualityControls::relaxed.
    nRelaxedIter 20;
}


Best


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