|
[Sponsors] |
[snappyHexMesh] snappyHexMesh parameter setting |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 15, 2023, 16:46 |
snappyHexMesh parameter setting
|
#1 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
Hello,
I'm simulating flow over cylinder in order to learn openfoam. However, would you please let me know how i could alter snappyhexMesh parameters in order to nail to my desired mesh (specially close to the cylinder wall). Mind you, I have attached my mesh and desired mesh:).Thank you for your time. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // castellatedMesh true; snap true; addLayers true; geometry { cylinder { type searchableCylinder; point1 (0 0 -0.01); point2 (0 0 0.01); radius 0.02; } refinementBox { type searchableBox; min (-0.2 -0.2 -0.01); max (0.5 0.2 0.01); } }; castellatedMeshControls { maxLocalCells 100000; maxGlobalCells 200000000; minRefinementCells 10; maxLoadUnbalance 0.10; nCellsBetweenLevels 3; // important resolveFeatureAngle 30; allowFreeStandingZoneFaces true; features (); refinementSurfaces { cylinder { level (4 4); patchInfo { type wall; inGroups (cylinderGroup); } } }; refinementRegions { refinementBox { mode inside; levels ((1 1)); } } locationInMesh (0.1 0.1 0); } snapControls { nSmoothPatch 3; tolerance 2.0; nSolveIter 30; // nRelaxIter 5; // nFeatureSnapIter 10; // implicitFeatureSnap false; explicitFeatureSnap true; multiRegionFeatureSnap false; } // Controls for boundary layer addition addLayersControls { relativeSizes true; layers { "cylinder" { nSurfaceLayers 7; } } expansionRatio 1.2; finalLayerThickness 0.3; minThickness 0.1; nGrow 0; featureAngle 30; slipFeatureAngle 80; nRelaxIter 3; nSmoothSurfaceNormals 1; nSmoothNormals 3; nSmoothThickness 10; maxFaceThicknessRatio 0.5; maxThicknessToMedialRatio 0.3; minMedianAxisAngle 90; nBufferCellsNoExtrude 0; nLayerIter 50; } // Controls for mesh quality meshQualityControls { maxNonOrtho 65; maxBoundarySkewness 20; maxInternalSkewness 4; maxConcave 80; minVol 1e-18; minTetQuality 1e-9; minArea -1; minTwist 0.05; minDeterminant 0.001; minFaceWeight 0.05; minVolRatio 0.01; minTriangleTwist -1; // Advanced nSmoothScale 4; errorReduction 0.75; relaxed { maxNonOrtho 75; } } // Advanced debug 0; mergeTolerance 1e-6; |
|
August 15, 2023, 17:35 |
|
#2 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Thats as good as a snappyHexMesh-mesh gets. Do you have any specific part you want another way? To me, it looks fine.
|
|
August 16, 2023, 02:46 |
|
#3 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
Dear AtoHM, thank you for your response. My first goal is to understand snappyHexMesh nature deep as much as possible.
As you can see in zoomed area in the second mesh, except for boundary layers there are three step in meshing. The point is this jump from smaller grids to larger grids is smooth and each cell just were splited to four cells (not two cells). In contrast, in my mesh there are cells that were splited to two cells. I just want to know how I could do that. I don't know whether I could convey my mean or not?! Thanks |
|
August 16, 2023, 03:26 |
|
#4 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Ah, I get it.
Do not worry, what you see is just a visual thing coming from a Paraview setting. You should deactivate the 'decompose polyhedra' option to get a better representation, as shown here: How to visualize polyhedron mesh in paraview Just to clarify, snappy does neither split in half nor into 4, it's always 1 to 8 because we are in 3d. This is called an octree and shown e.g. here: https://www.cradle-cfd.com/technolog...etail0004.html |
|
August 16, 2023, 03:51 |
|
#5 |
Senior Member
Saeed Jamshidi
Join Date: Aug 2019
Posts: 214
Rep Power: 8 |
Dear AtoHM, thank you again. It was really helpful.
I have attached my result; Maybe someone would see it! |
|
August 16, 2023, 04:25 |
|
#6 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Glad to help, now, go and play with
Code:
nCellsBetweenLevels 3; |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] creating baffles using snappyHexMesh (for given random shaped surfaces) | ashish.svm | OpenFOAM Meshing & Mesh Conversion | 1 | January 17, 2018 02:24 |
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing | peterhess | OpenFOAM Meshing & Mesh Conversion | 2 | January 3, 2018 03:54 |
question about fluid2 parameter setting | Mike Wang | FLOW-3D | 1 | November 3, 2017 04:41 |
Turbulence Model Parameter Setting Up- Vortex Shedding Problem | nima_nzm | Main CFD Forum | 4 | June 12, 2015 10:43 |
compile errors of boundary condition "expDirectionMixed" | liying02ts | OpenFOAM Bugs | 2 | February 1, 2010 21:11 |