|
[Sponsors] |
[snappyHexMesh] Prism layer collapsing in refinement transition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 14, 2021, 09:44 |
Prism layer collapsing in refinement transition
|
#1 |
New Member
|
Dear all,
I am trying to generate 8 prism layers around a 60 m long submarine with a refinement region at the bow. However, SHM is not able to generate a prism layer along the transition between bow a midbody region, see attached figures. The nSurfaceLayer distribution on the hull shows a 'scar' in this transition. I have played with settings in the SHMdict without success. Any help will be appreciated, Ruben Code:
// Settings for the snapping. snapControls { //- Number of patch smoothing iterations before finding correspondence // to surface nSmoothPatch 3; //- Relative distance for points to be attracted by surface feature point // or edge. True distance is this factor times local // maximum edge length. // tolerance 4.0; tolerance 2.0; //- Number of mesh displacement relaxation iterations. nSolveIter 100; //- Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 10; nFeatureSnapIter 20; explicitFeatureSnap true; //false multiRegionFeatureSnap true; //- Detect features between multiple surfaces // (only for explicitFeatureSnap, default = false) implicitFeatureSnap false; //true } // Settings for the layer addition. 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 { hull { nSurfaceLayers 8; } } // Expansion factor for layer mesh expansionRatio 1.5; // Wanted thickness of final added cell layer. If multiple layers // is the thickness of the layer furthest away from the wall. // Relative to undistorted size of cell outside layer. // See relativeSizes parameter. finalLayerThickness 0.60; // Minimum thickness of cell layer. If for any reason layer // cannot be above minThickness do not add layer. // See relativeSizes parameter. minThickness 1.0e-10; // 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. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings // When not to extrude surface. 0 is flat surface, 90 is when two faces // are perpendicular featureAngle 180; //60; // Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals nSmoothSurfaceNormals 50; // Number of smoothing iterations of interior mesh movement direction nSmoothNormals 50; // Smooth layer thickness over surface patches nSmoothThickness 10; // Stop layer growth on highly warped cells maxFaceThicknessRatio 0.8; // Reduce layer growth where ratio thickness to medial // distance is large maxThicknessToMedialRatio 0.9; // Angle used to pick up medial axis points // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x. 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; } // Generic mesh quality settings. At any undoable phase these determine // where to undo. meshQualityControls { #include "meshQualityDict" } // 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; // Write flags writeFlags ( scalarLevels // write volScalarField with cellLevel for postprocessing layerSets // write cellSets, faceSets of faces in layer 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;
__________________
R. |
|
January 14, 2021, 13:05 |
|
#2 |
New Member
Join Date: Feb 2016
Posts: 23
Rep Power: 10 |
What does the rest of your shmDict look like (specificially the castellatedMeshControls section)?
|
|
January 14, 2021, 13:50 |
|
#3 |
New Member
|
Dear 37269,
Thank you for your reply. I am using the following settings: Code:
castellatedMeshControls { maxLocalCells 10000000; maxGlobalCells 100000000; minRefinementCells 0; nCellsBetweenLevels 1; features ( { file "submarine_mainHull.eMesh"; level 1; } ); refinementSurfaces { hull { level (1 1); } } resolveFeatureAngle 45; refinementRegions { hull // Name of region created in geometry section { mode distance; levels ((0.60 1)); } refinement_bow { mode inside; levels ((1.0 2)); } } allowFreeStandingZoneFaces true; } snapControls { nSmoothPatch 3; tolerance 2.0; nSolveIter 100; nRelaxIter 10; nFeatureSnapIter 20; explicitFeatureSnap true; multiRegionFeatureSnap true; implicitFeatureSnap false; }
__________________
R. |
|
May 11, 2021, 04:44 |
|
#4 |
New Member
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
||
May 12, 2021, 10:21 |
|
#5 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hi hiaselhans,
You have to activate some writeFlags before running snappyHexMesh in order to visualize layer coverage in ParaView. Check Ruben's snappyHexMeshDict, this is the part you need to use: Code:
// Write flags writeFlags ( scalarLevels // write volScalarField with cellLevel for postprocessing layerSets // write cellSets, faceSets of faces in layer layerFields // write volScalarField for layer coverage ); Yann |
|
May 12, 2021, 13:16 |
|
#6 | |
New Member
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
Hi Yann,
Thanks a lot for your answer, i had these writeflags on, but couldn't find the fields on my patch. Are they maybe dropped after a simpleFoam run? Thanks Simon Quote:
|
||
May 13, 2021, 04:44 |
|
#7 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hi Simon,
If you ran snappyHexMesh with the -overwrite option, the fields created by these writeFlags should be in the 0 directory. You will need to load the time step 0 in paraView to be able to see it. (If you use the paraview native reader for OpenFOAM, you might need to untick the "Skip Zero Time" before loading your case) What is your workflow on this case? Yann |
|
May 13, 2021, 09:28 |
|
#8 |
New Member
Join Date: Jan 2014
Posts: 9
Rep Power: 12 |
Hi Yann,
thanks for the hint! I already tried the "skip 0" checkbox but didn't work. Now, the problem was that i was doing a reconstructPar -latesttime. with -withZero added it does work fine. Thanks! https://www.openfoam.com/documentati...structPar.html now to my real problem i was playing around a lot with shM to get rid of those holes in the boundary layer but it seems like an immanent problem many people are facing... |
|
May 13, 2021, 11:55 |
|
#9 |
Senior Member
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29 |
Hi Simon,
Glad to know you have solved your problem. For your information, if you are using ParaView's builtin reader for OpenFOAM, you can change the "Case Type" from "Reconstructed Case" to "Decomposed Case" in order to directly read the decomposed case and avoid the reconstructPar step. It can be useful for large cases when reconstructPar can take a while to reconstruct the whole case. Now, as you said, the real deal is to manage a good layer coverage with snappyHexMesh. As you have already seen, this is not an easy task. Try to have the same surface refinement level on the whole surface, as snappy can struggle with transitions zones betwen refinement levels. You can also play with the meshQualityControls parameters. Most of the time snappy kills the layer addition because the result cannot satisfy mesh quality criteria. Cheers, Yann |
|
Tags |
prism layers, refinement, snappyhesmesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ = 1 boundary layer mesh with snappyHexMesh | Arzed23 | OpenFOAM Running, Solving & CFD | 6 | November 23, 2022 16:15 |
[snappyHexMesh] Holes in internal mesh when adding boundary layer snappyHex | otaolafr | OpenFOAM Meshing & Mesh Conversion | 3 | February 8, 2021 09:19 |
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner | panpanzhong | OpenFOAM Meshing & Mesh Conversion | 5 | July 3, 2018 06:53 |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
errors | Fahad | Main CFD Forum | 0 | March 23, 2004 14:20 |