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

[snappyHexMesh] Bad stl surface fitting

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By asltpo

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 24, 2023, 14:05
Default Bad stl surface fitting
  #1
DGT
New Member
 
Damien
Join Date: Jul 2012
Posts: 4
Rep Power: 13
DGT is on a distinguished road
Good evening,


I am new with snappyHexMesh and currently trying to mesh a square beam.
I am facing problem as can be seen on the picture : there are some steps in the mesh
(the red square is the stl geometry).

Previously, I already tried to mesh the same square but with no angle of attack and it was fine.


I tried to increase the resolution which led me to huge mesh, played with the angle, but nothing seems to work.

If someone knows how to solve my problem, it would be great.


Thank you for your help,


Damien





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

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers       false;


geometry
{
    Beam_5deg_mesh.stl     {type triSurfaceMesh; name Beam1;
                   regions  {solid  {name Beam1;}}
                  }
}


castellatedMeshControls
{
 
    maxLocalCells 1000000;
    maxGlobalCells 20000000;
    minRefinementCells 20;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 1;
    features (
               {file "Beam_5deg_mesh.eMesh"; level 9;}
    );
    resolveFeatureAngle 4;
    featureAngle 4;
    locationInMesh (1.0001 1.0001 6.43);
    allowFreeStandingZoneFaces true;

    refinementSurfaces
    {
        Beam1
        {
            // Surface-wise min and max refinement level
            level (6 10);

            // Optional specification of patch type (default is wall). No
            // constraint types (cyclic, symmetry) etc. are allowed.
            patchInfo
            {
                type wall;
            }
        }
    }
    refinementRegions
    {
            }
}


snapControls
{   
    nSmoothPatch 10;
    tolerance 0.10;
    nSolveIter 300;
    nRelaxIter 5;
    nFeatureSnapIter 30;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}
addLayersControls
{
    relativeSizes false;
    expansionRatio 1.2;
    firstLayerThickness 0.001;
    minThickness 0.0005;
    nGrow 0;
    featureAngle 30;
    slipFeatureAngle 30;
    nRelaxIter 5;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedialAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 15;
    layers
    {
        "Beam1"
        {
            nSurfaceLayers 3;
        }
    }
}  

meshQualityControls
{
    #include "meshQualityDict"


    // Advanced

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

// Advanced

// Write flags
writeFlags
(
    scalarLevels
    layerSets
    layerFields     // write volScalarField for layer coverage
);


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;


// ************************************************************************* //
beam.jpg
DGT is offline   Reply With Quote

 


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
[Gmsh] gmshToFoam generates patches with 0 faces and 0 points Simurgh OpenFOAM Meshing & Mesh Conversion 4 August 25, 2023 07:58
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 18:28
[mesh manipulation] extrudeMesh from STL Surface TRT OpenFOAM Meshing & Mesh Conversion 1 March 26, 2018 07:15
Immersed mesh - STL surface intersection tool arvind3008 Main CFD Forum 0 October 17, 2012 05:51
Problems of Duns Codes! Martin J Main CFD Forum 8 August 14, 2003 23:19


All times are GMT -4. The time now is 10:32.