|
[Sponsors] |
June 25, 2021, 06:17 |
Rounded cube edges with snap
|
#1 |
New Member
Join Date: May 2020
Posts: 23
Rep Power: 6 |
Dear all,
I am meshing a buildings array with a cylinder mounted on the centered cube using blockMesh and snappyHexMesh. The issues I am facing is that when I set snap as false, I manage to obtain sharp edges for the cubes but of course the cylinder will not be well defined (see figure 1)... Then if I set snap as true, the cylinder is well caught but the corners/edges of the cubes are rounded (see figure 2)... Do you know how I can have sharp edges for the cubes while being able to have a well defined cylinder ? Thanks in advance ! Ps: Here is the snappyHexMesh code Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.1 | | \\ / 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; snap true; addLayers false; geometry { box1 { type searchableBox; min (-0.4275 -0.125 0); max ( 0.1275 0.125 0.16); } buildings.stl { type triSurfaceMesh; name buildings; } pipe.stl { type triSurfaceMesh; name pipe; } }; // Settings for the castellatedMesh generation. castellatedMeshControls { maxLocalCells 100000; maxGlobalCells 2000000; minRefinementCells 2; maxLoadUnbalance 0.10; nCellsBetweenLevels 2; features ( { file "buildings.eMesh"; level 0; } { file "pipe.eMesh"; level 0; } ); refinementSurfaces { buildings { // Surface-wise min and max refinement level level (3 3); } pipe { // Surface-wise min and max refinement level level (5 5); } } resolveFeatureAngle 10; refinementRegions { box1 { mode inside; levels ((1e15 2)); } } locationInMesh (0 0.015 0); allowFreeStandingZoneFaces true; } // Settings for the snapping. snapControls { nSmoothPatch 1; tolerance 7.0; nSolveIter 30; nRelaxIter 10; strictRegionSnap true; multiRegionFeatureSnap true; } // Settings for the layer addition. addLayersControls { relativeSizes true; layers { sphere.stl_firstSolid { nSurfaceLayers 1; } } // Expansion factor for layer mesh expansionRatio 1.0; finalLayerThickness 0.3; minThickness 0.25; nGrow 0; featureAngle 90; //- 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 // Note: changed(corrected) w.r.t 16x! 90 degrees corresponds to 130 in 16x. minMedianAxisAngle 90; // Create buffer region for new layer terminations nBufferCellsNoExtrude 0; nLayerIter 50; nRelaxedIter 20; } meshQualityControls { //- Maximum non-orthogonality allowed. Set to 180 to disable. maxNonOrtho 65; //- Max skewness allowed. Set to <0 to disable. maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minVol 1e-13; minTetQuality 1e-30; //- Minimum face area. Set to <0 to disable. minArea -1; //- Minimum face twist. Set to <-1 to disable. dot product of face normal //- and face centre triangles normal minTwist 0.05; //- minimum normalised cell determinant //- 1 = hex, <= 0 = folded or flattened illegal cell minDeterminant 0.001; //- minFaceWeight (0 -> 0.5) minFaceWeight 0.05; //- minVolRatio (0 -> 1) minVolRatio 0.01; //must be >0 for Fluent compatibility minTriangleTwist -1; //- if >0 : preserve single cells with all points on the surface if the // resulting volume after snapping (by approximation) is larger than // minVolCollapseRatio times old volume (i.e. not collapsed to flat cell). // If <0 : delete always. //minVolCollapseRatio 0.5; // Advanced //- Number of error distribution iterations nSmoothScale 4; //- amount to scale back displacement at error points errorReduction 0.75; // Optional : some meshing phases allow usage of relaxed rules. // See e.g. addLayersControls::nRelaxedIter. relaxed { //- Maximum non-orthogonality allowed. Set to 180 to disable. maxNonOrtho 75; } } // Advanced // Flags for optional output // 0 : only write final meshes // 1 : write intermediate meshes // 2 : write volScalarField with cellLevel for postprocessing // 4 : write current intersections as .obj files debug 0; // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1e-6; // ************************************************************************* // |
|
June 25, 2021, 06:56 |
|
#2 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Providing an edge refinement usually helps for me. Like
Code:
features ( { file "buildings.eMesh"; level 1; } ... P.S. This looks like a very generic city to live in |
|
July 2, 2021, 21:32 |
|
#3 |
Senior Member
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7 |
Hello Bibill,
It seems that you haven't assigned any patches to your geometry, i.e. probably everything is in defaultFaces now. For some reason that escapes me snappyHexMesh seems to ignore feature edges if the boundary faces are not assigned to patches. If you just want to try meshing without spending too much time defining the patches first, you may try createPatch or autoPatch. With createPatch you should be able to move all the faces from defaultPatch to an arbitrary patch e.g. of type wall or generic patch. It doesn't matter if all boundary faces are in one single patch and it should be sufficient for sHM to work properly. Also you can open the *.obj file of your feature edges with ParaView to check whether they are defined correctly. Good luck |
|
Tags |
mesh 3d, mesh openfoam, snapphhexmesh, snappyhex |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh sticking point | natty_king | OpenFOAM Meshing & Mesh Conversion | 11 | February 20, 2024 10:12 |
SimpleFoam & Theater | jipai | OpenFOAM Running, Solving & CFD | 3 | June 18, 2019 11:11 |
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell | Arman_N | OpenFOAM Meshing & Mesh Conversion | 1 | May 20, 2019 18:16 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |