|
[Sponsors] |
February 24, 2023, 15:05 |
Bad stl surface fitting
|
#1 |
New Member
Damien
Join Date: Jul 2012
Posts: 4
Rep Power: 14 |
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; // ************************************************************************* // |
|
February 28, 2023, 18:54 |
|
#2 | |
New Member
Tom
Join Date: Jan 2023
Posts: 4
Rep Power: 3 |
Hi Damian,
Firstly a caveat: I'm also fairly new to SHM so not speaking from vast experience. It looks like you have an issue with the "snapping" stage of the process, because your Beam1 boundary appears castellated suggesting it has not snapped accurately (or at all) to the stl. According to the user guide: Quote:
So you could try relaxing the mesh quality criteria in meshQualityDict to see if this improves snapping. An alternative approach might be to rotate the background mesh by the angle of attack so it is aligned with your beam, then rotate the final mesh back again afterwards. Hope this helps. |
||
March 1, 2023, 02:35 |
|
#3 |
New Member
Damien
Join Date: Jul 2012
Posts: 4
Rep Power: 14 |
Hello Tom,
Thank you for your answer. I'm sorry but the snappy is not as bad as I showed on the picture : it was just a matter of time step in paraview ! I'm facing some other problems now and trying to solve them. Thank you for your help. Damien |
|
|
|
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 08:58 |
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? | EternalSeekerX | SU2 | 3 | October 9, 2020 19:28 |
[mesh manipulation] extrudeMesh from STL Surface | TRT | OpenFOAM Meshing & Mesh Conversion | 1 | March 26, 2018 08:15 |
Immersed mesh - STL surface intersection tool | arvind3008 | Main CFD Forum | 0 | October 17, 2012 06:51 |
Problems of Duns Codes! | Martin J | Main CFD Forum | 8 | August 15, 2003 00:19 |