|
[Sponsors] |
July 20, 2016, 11:25 |
Mesh Quality
|
#1 |
New Member
Join Date: May 2016
Posts: 10
Rep Power: 9 |
Hi everyone,
I have been trying to create a good mesh for a DMTB 5415 hull on a cluster using the interDyMFoam DTCHull case as an initial framework. During the meshing I have run into two major problems. The first is that the mesh sometimes create large projections out of the hull and into the internal mesh and out of the hull into the empty space around the simulation.I have attached a png of the hull and also three views of my latest mesh showing this (just the hull and mid plane faces). I believe this to be related to an error that occurred stating "face 3556 area does not match neighbor by 199.059% -- possible face ordering problem" however I have never encountered this error before and I am unsure how to resolve it besides simply increasing the matchTolerance. The second problem I have encountered is that checkMesh command states that there are multiple problems with the mesh. While I have been able to find many sources discussing these errors (non-orthogonality, aspect ratio, etc.), I have found few that actually detail solutions. If any one could provide advice I would greatly appreciate it. For your perusal I have listed the checkMesh result as well as the .sh file used to run the job. Code:
Mesh stats points: 24423927 faces: 72415887 internal faces: 71566740 cells: 23999140 faces per cell: 5.99949 boundary patches: 7 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 23989651 prisms: 3155 wedges: 0 pyramids: 0 tet wedges: 31 tetrahedra: 0 polyhedra: 6303 Breakdown of polyhedra by number of faces: faces number of cells 4 2693 5 3610 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology atmosphere 40000 40501 ok (non-closed singly connected) inlet 60000 60701 ok (non-closed singly connected) outlet 60000 60701 ok (non-closed singly connected) bottom 40000 40501 ok (non-closed singly connected) side 240000 241001 ok (non-closed singly connected) midPlane 239191 241497 ok (non-closed singly connected) hull 169956 176100 multiply connected (shared edge) <<Writing 2 conflicting points to set nonManifoldPoints Checking geometry... Overall domain bounding box (-2500 -1900 -1600) (7500 280.699 400) Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) Mesh has 3 solution (non-empty) directions (1 1 1) Boundary openness (3.47857e-15 -2.80481e-13 4.43739e-17) OK. ***High aspect ratio cells found, Max aspect ratio: 1.88814e+104, number of cells 40691 <<Writing 40691 cells with high aspect ratio to set highAspectRatioCells Minimum face area = 1.31473e-15. Maximum face area = 37537.2. Face area magnitudes OK. ***Zero or negative cell volume detected. Minimum negative volume: -164819, Number of negative volume cells: 39073 <<Writing 39073 zero volume cells to set zeroVolumeCells Mesh non-orthogonality Max: 179.98 average: 7.61462 *Number of severely non-orthogonal (> 70 degrees) faces: 276597. ***Number of non-orthogonality errors: 110081. <<Writing 386678 non-orthogonal faces to set nonOrthoFaces ***Error in face pyramids: 234514 faces are incorrectly oriented. <<Writing 148561 faces with incorrect orientation to set wrongOrientedFaces ***Max skewness = 97465.4, 12994 highly skew faces detected which may impair the quality of the results <<Writing 12994 skew faces to set skewFaces Coupled point location match (average 0) OK. Failed 5 mesh checks. End Code:
#!/bin/bash #$ -S /bin/bash #$ -cwd #$ -V #$ -q abaqus.q #$ -l qname=abaqus.q #$ -M hpc3450@localhost #$ -m be #$ -o motorBike_Test-out.o #$ -e motorBike_Test-err.e #$ -pe dist.pe 8 blockMesh > log.blockMesh surfaceFeatureExtract > log.surfaceFeatureExtract for ((a=1; a<=6; a++)); do topoSet -dict system/topoSetDict.$a > log.topoSet$a refineMesh -overwrite > log.refineMesh$a refineMesh -overwrite done renumberMesh > log.renumberMesh decomposePar > log.decomposePar mpirun -np 8 snappyHexMesh -parallel > log.snappyHexMesh reconstructParMesh -time 0.0001 > log.reconstructParMesh1 reconstructParMesh -time 0.0002 > log.reconstructParMesh2 reconstructParMesh -time 0.0003 > log.reconstructParMesh3 Thank you everyone for reading this post, I look forward to any advice you can provide. All the best, Climenha |
|
July 20, 2016, 23:54 |
|
#2 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 15 |
Hi,
I see huge negative volume cells in your checkMesh output. Are you sure that your blockMesh has been defined correctly and is not defined inside out? You can run checkMesh after your blockMesh to verify this (and possibly even see the log file of blockMesh). My guess is that something has been defined inside out. Cheers, Antimony |
|
July 21, 2016, 11:17 |
|
#3 |
New Member
Join Date: May 2016
Posts: 10
Rep Power: 9 |
Hey Antimony,
Firstly thank you for your reply. As per your recommendation I executed blockMesh and then checkMesh upon that mesh. The results can be seen below. blockmesh Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 3.0.1-119cac7e8750 Exec : blockMesh Date : Jul 21 2016 Time : 06:02:35 Host : "su2-HP" PID : 4137 Case : /home/su2/Destroyer_Block nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Creating block mesh from "/home/su2/Destroyer_Block/system/blockMeshDict" Creating curved edges Creating topology blocks Creating topology patches Creating block mesh topology Check topology Basic statistics Number of internal faces : 5 Number of boundary faces : 26 Number of defined boundary faces : 26 Number of undefined boundary faces : 0 Checking patch -> block consistency Creating block offsets Creating merge list . Creating polyMesh from blockMesh Creating patches Creating cells Creating points with scale 100 Block 0 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 93.3497 .. 4.66748 Block 1 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 2.37 .. 2.37 Block 2 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 0.118 .. 0.118 Block 3 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 0.112 .. 0.112 Block 4 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 2.6 .. 2.6 Block 5 cell size : i : 20 .. 20 j : 12.6667 .. 12.6667 k : 1.92319 .. 9.61596 Writing polyMesh ---------------- Mesh Information ---------------- boundingBox: (-2500 -1900 -1600) (7500 0 400) nPoints: 22770951 nCells: 22500000 nFaces: 67770000 nInternalFaces: 67230000 ---------------- Patches ---------------- patch 0 (start: 67230000 size: 75000) name: atmosphere patch 1 (start: 67305000 size: 45000) name: inlet patch 2 (start: 67350000 size: 45000) name: outlet patch 3 (start: 67395000 size: 75000) name: bottom patch 4 (start: 67470000 size: 150000) name: side patch 5 (start: 67620000 size: 150000) name: midPlane End Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 3.0.1-119cac7e8750 Exec : checkMesh Date : Jul 21 2016 Time : 07:07:18 Host : "su2-HP" PID : 4498 Case : /home/su2/Destroyer_Block nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time --> FOAM Warning : From function checkMesh in file db/Time/timeSelector.C at line 270 No time specified or available, selecting 'constant' Create polyMesh for time = constant Time = constant Mesh stats points: 22770951 faces: 67770000 internal faces: 67230000 cells: 22500000 faces per cell: 6 boundary patches: 6 point zones: 0 face zones: 0 cell zones: 0 Overall number of cells of each type: hexahedra: 22500000 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 0 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology atmosphere 75000 75651 ok (non-closed singly connected) inlet 45000 45451 ok (non-closed singly connected) outlet 45000 45451 ok (non-closed singly connected) bottom 75000 75651 ok (non-closed singly connected) side 150000 150801 ok (non-closed singly connected) midPlane 150000 150801 ok (non-closed singly connected) Checking geometry... Overall domain bounding box (-2500 -1900 -1600) (7500 0 400) Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) Mesh has 3 solution (non-empty) directions (1 1 1) Boundary openness (-1.14402e-14 1.29876e-13 5.55219e-18) OK. Max cell openness = 4.17037e-16 OK. Max aspect ratio = 178.571 OK. Minimum face area = 1.41867. Maximum face area = 1866.99. Face area magnitudes OK. Min volume = 28.3733. Max volume = 23648.6. Total volume = 3.8e+10. Cell volumes OK. Mesh non-orthogonality Max: 0 average: 0 Non-orthogonality check OK. Face pyramids OK. Max skewness = 4.06057e-11 OK. Coupled point location match (average 0) OK. Mesh OK. End Can you think of any other reasons why my mesh would fail these checks? I conducted another test recently (denser mesh in more important areas) that removed the problems of nonorthogonality and aspect ratio however I am still encountering the skewness errors. If there is any information that I could provide that would aid in your understanding I would be happy to do so. Thanks in advance for any advice you can give. All the best, Climenha |
|
July 22, 2016, 02:47 |
|
#4 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 15 |
Hi,
Well, skewness, high-aspect ratio and most of the other issues crop up mainly from the snapping process. It maybe useful to post your meshing dictionary files here along with the geometry. What was the aspect ratio of the cells that you have before running snappyHexMesh? Note that snappy prefers to have meshes that have, as close as possible, cells with unit aspect ratio before beginning its run. Cheers, Antimony |
|
July 25, 2016, 10:18 |
|
#5 |
New Member
Join Date: May 2016
Posts: 10
Rep Power: 9 |
Hi,
My snappyHexMeshDict and blockMeshDict are as follows Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.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 true; // Geometry. Definition of all surfaces. All surfaces are of class // searchableSurface. // Surfaces are used // - to specify refinement for any mesh cell intersecting it // - to specify refinement for any mesh cell inside/outside/near // - to 'snap' the mesh boundary to the surface geometry { M5415_ASCII.stl { type triSurfaceMesh; name hull; patchInfo { type wall; } } }; // Settings for the castellatedMesh generation. castellatedMeshControls { // Refinement parameters // ~~~~~~~~~~~~~~~~~~~~~ // If local number of cells is >= maxLocalCells on any processor // switches from from refinement followed by balancing // (current method) to (weighted) balancing before refinement. maxLocalCells 1000000; // Overall cell limit (approximately). Refinement will stop immediately // upon reaching this number so a refinement level might not complete. // Note that this is the number of cells before removing the part which // is not 'visible' from the keepPoint. The final number of cells might // actually be a lot less. maxGlobalCells 20000000; // The surface refinement loop might spend lots of iterations refining just a // few cells. This setting will cause refinement to stop if <= minimumRefine // are selected for refinement. Note: it will at least do one iteration // (unless the number of cells to refine is 0) minRefinementCells 0; // Number of buffer layers between different levels. // 1 means normal 2:1 refinement restriction, larger means slower // refinement. nCellsBetweenLevels 4; // Explicit feature edge refinement // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Specifies a level for any cell intersected by its edges. // This is a featureEdgeMesh, read from constant/triSurface for now. features ( { file "M5415_ASCII.eMesh"; level 2; } ); // Surface based refinement // ~~~~~~~~~~~~~~~~~~~~~~~~ // Specifies two levels for every surface. The first is the minimum level, // every cell intersecting a surface gets refined up to the minimum level. // The second level is the maximum level. Cells that 'see' multiple // intersections where the intersections make an // angle > resolveFeatureAngle get refined up to the maximum level. refinementSurfaces { hull { // Surface-wise min and max refinement level level (0 0); } } resolveFeatureAngle 45; // Region-wise refinement // ~~~~~~~~~~~~~~~~~~~~~~ // Specifies refinement level for cells in relation to a surface. One of // three modes // - distance. 'levels' specifies per distance to the surface the // wanted refinement level. The distances need to be specified in // descending order. // - inside. 'levels' is only one entry and only the level is used. All // cells inside the surface get refined up to the level. The surface // needs to be closed for this to be possible. // - outside. Same but cells outside. refinementRegions { } // Mesh selection // ~~~~~~~~~~~~~~ // After refinement patches get added for all refinementSurfaces and // all cells intersecting the surfaces get put into these patches. The // section reachable from the locationInMesh is kept. // NOTE: This point should never be on a face, always inside a cell, even // after refinement. locationInMesh (-0.7 0 0); // Whether any faceZones (as specified in the refinementSurfaces) // are only on the boundary of corresponding cellZones or also allow // free-standing zone faces. Not used if there are no faceZones. allowFreeStandingZoneFaces true; } // 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 1.0; //- Number of mesh displacement relaxation iterations. nSolveIter 100; //- Maximum number of snapping relaxation iterations. Should stop // before upon reaching a correct mesh. nRelaxIter 5; nFeatureSnapIter 10; } // 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 3; } } // 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.007; // Minimum thickness of cell layer. If for any reason layer // cannot be above minThickness do not add layer. // See relativeSizes parameter. minThickness 0.0025; // 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 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 1; // Number of smoothing iterations of interior mesh movement direction nSmoothNormals 3; // Smooth layer thickness over surface patches nSmoothThickness 20; // 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 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; // Merge tolerance. Is fraction of overall bounding box of initial mesh. // Note: the write tolerance needs to be higher than this. mergeTolerance 1E-6; // ************************************************************************* // blockMeshDict Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 100; vertices ( (-25 -19 -16) (75 -19 -16) (75 19 -16) (-25 19 -16) (-25 -19 -1) (75 -19 -1) (75 19 -1) (-25 19 -1) (-25 -19 0.185) (75 -19 0.185) (75 19 0.185) (-25 19 0.185) (-25 -19 0.244) (75 -19 0.244) (75 19 0.244) (-25 19 0.244) (-25 -19 0.3) (75 -19 0.3) (75 19 0.3) (-25 19 0.3) (-25 -19 1.6) (75 -19 1.6) (75 19 1.6) (-25 19 1.6) (-25 -19 10) (75 -19 10) (75 19 10) (-25 19 10) ); blocks ( hex (0 1 2 3 4 5 6 7) (200 50 50) simpleGrading (1 1 0.05) hex (4 5 6 7 8 9 10 11) (200 50 50) simpleGrading (1 1 1) hex (8 9 10 11 12 13 14 15) (200 50 50) simpleGrading (1 1 1) hex (12 13 14 15 16 17 18 19) (200 50 50) simpleGrading (1 1 1) hex (16 17 18 19 20 21 22 23) (200 50 50) simpleGrading (1 1 1) hex (20 21 22 23 24 25 26 27) (200 50 50) simpleGrading (1 1 5) ); edges ( ); boundary ( atmosphere { type patch; faces ( (24 25 26 27) ); } inlet { type patch; faces ( (1 2 6 5) (5 6 10 9) (9 10 14 13) (13 14 18 17) (17 18 22 21) (21 22 26 25) ); } outlet { type patch; faces ( (0 4 7 3) (4 8 11 7) (8 12 15 11) (12 16 19 15) (16 20 23 19) (20 24 27 23) ); } bottom { type symmetryPlane; faces ( (0 3 2 1) ); } side { type symmetryPlane; faces ( (3 7 6 2) (7 11 10 6) (11 15 14 10) (15 19 18 14) (19 23 22 18) (23 27 26 22) ); } midPlane { type symmetry; faces ( (0 1 5 4) (4 5 9 8) (8 9 13 12) (12 13 17 16) (16 17 21 20) (20 21 25 24) ); } ); mergePatchPairs ( ); // ************************************************************************* // https://queensuca-my.sharepoint.com/...064b342de8a5b4 Again thank you for all your help and for any advice you can give. All the best, Climenha |
|
July 25, 2016, 10:44 |
|
#6 |
New Member
Join Date: May 2016
Posts: 10
Rep Power: 9 |
I should include some context to the previous post. I'm trying to work towards modelling a full hull in fluid flow. Because of this I am trying to mesh the first half of the hull and then insert the full stl file later. Is this a poor way of completing the simulation or is this an acceptable route. I ask because this is my first independent simulation and I'm still trying to get the hang of modeling my own cases.
All the best, Climenha |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 09:38 |
Polyhedral Mesh Quality in Star-CCM+ | niazaliahmed | STAR-CCM+ | 3 | March 8, 2012 13:51 |
[ICEM] Tetra mesh quality before and after prism layer | Chander | ANSYS Meshing & Geometry | 0 | December 25, 2011 22:04 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 11:55 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 18:10 |