CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] very bad quality of cylinder mesh using blockMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Alczem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2025, 07:18
Default very bad quality of cylinder mesh using blockMesh
  #1
Member
 
Join Date: Apr 2021
Posts: 47
Rep Power: 5
AlxB is on a distinguished road
hello,
I try with blockMesh to properly mesh a cylinder, hollowed out at its centre.

Despite a very good looking, the check mesh is very bad.

What could explain this ?

Thanks

here below are thecheckMesh log, the blockMesh log and the blockMeshDict :

Code:
Create time

Create mesh for time = 0

Check mesh...
    Enabling user-defined geometry checks.

Time = 0

Mesh stats 
    points:           67600
    faces:            192500
    internal faces:   182500
    cells:            62500
    faces per cell:   6
    boundary patches: 4
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     62500
    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
    inlet               2500     2600     ok (non-closed singly connected)  
    outlet              2500     2600     ok (non-closed singly connected)  
    side                2500     2600     ok (non-closed singly connected)  
    hub                 2500     2600     ok (non-closed singly connected)  
    ".*"                10000    10000    ok (closed singly connected)      


Checking faceZone topology for multiply connected surfaces...
    No faceZones found.

Checking basic cellZone addressing...
    No cellZones found.

Checking basic pointZone addressing...
    No pointZones found.

Checking geometry...
    Overall domain bounding box (-2.220446e-16 -1 -1) (1 1 1)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (5.8963373e-17 7.8558055e-18 3.9279028e-18) OK.
 ***High aspect ratio cells found, Max aspect ratio: 2.4865046e+147, number of cells 60000
  <<Writing 60000 cells with high aspect ratio to set highAspectRatioCells
 ***Zero or negative face area detected.  Minimum area: 0
  <<Writing 80952 zero area faces to set zeroAreaFaces
 ***Zero or negative cell volume detected.  Minimum negative volume: -2.5077213e-37, Number of negative volume cells: 59712
  <<Writing 59712 zero volume cells to set zeroVolumeCells
    Mesh non-orthogonality Max: 90 average: 87.67614
   *Number of severely non-orthogonal (> 70 degrees) faces: 192.
 ***Number of non-orthogonality errors: 174908.
  <<Writing 175100 non-orthogonal faces to set nonOrthoFaces
    Face pyramids OK.
 ***Max skewness = 3.8802559e+117, 4997 highly skew faces detected which may impair the quality of the results
  <<Writing 4997 skew faces to set skewFaces
    Coupled point location match (average 0) OK.
Checking faces in error :
    non-orthogonality > 65  degrees                        : 175100
    faces with face pyramid volume < 1e-13                 : 9800
    faces with face-decomposition tet quality < 1e-15      : 0
    faces with concavity > 80  degrees                     : 0
    faces with skewness > 4   (internal) or 20  (boundary) : 0
    faces with interpolation weights (0..1)  < 0.02        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.02                           : 0
    faces on cells with determinant < 0.001                : 0
  <<Writing 184900 faces in error to set meshQualityFaces

Failed 6 mesh checks.

End
Code:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from "system/blockMeshDict"
Creating block edges
No non-planar block faces defined
Creating topology blocks

Creating topology patches - from boundary section

Creating block mesh topology

Check topology

	Basic statistics
		Number of internal faces : 4
		Number of boundary faces : 16
		Number of defined boundary faces : 16
		Number of undefined boundary faces : 0
	Checking patch -> block consistency

Creating block offsets
Creating merge list (topological search)...
Deleting polyMesh directory "constant/polyMesh"

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale (1 1 1)
    Block 0 cell size :
        i : 0.031410759 .. 0.031410759
        j : 0.02 .. 0.02
        k : 1 .. 0

    Block 1 cell size :
        i : 0.031410759 .. 0.031410759
        j : 0.02 .. 0.02
        k : 1 .. 0

    Block 2 cell size :
        i : 0.031410759 .. 0.031410759
        j : 0.02 .. 0.02
        k : 1 .. 0

    Block 3 cell size :
        i : 0.031410759 .. 0.031410759
        j : 0.02 .. 0.02
        k : 1 .. 0

No patch pairs to merge

Writing polyMesh with 0 cellZones
----------------
Mesh Information
----------------
  boundingBox: (-1 -1 0) (1 1 1)
  nPoints: 67600
  nCells: 62500
  nFaces: 192500
  nInternalFaces: 182500
----------------
Patches
----------------
  patch 0 (start: 182500 size: 2500) name: inlet
  patch 1 (start: 185000 size: 2500) name: outlet
  patch 2 (start: 187500 size: 2500) name: side
  patch 3 (start: 190000 size: 2500) name: hub

End
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2406                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 1;

// Location and Dimensions of the cylinder:
ROTx0 			0;
ROTy0 			0;
ROTz0 			0;

Hrot 			1;
Rrot			0.5;
Rhub 			1;

grad			25;

// NOTE: this will produce a washer oriented along the Z axis//

// Calculations for cylinder geometry:
h 				#eval{$Hrot+$ROTz0};
vx 				#eval{$ROTx0+$Rrot};
nvx 			#eval{$ROTx0-$Rrot};
vy 				#eval{$ROTy0+$Rrot};
nvy 			#eval{$ROTy0-$Rrot};

// Calculations for hub:
hHB 			#eval{$Hrot+$ROTz0};
vxHB 			#eval{$ROTx0+$Rhub};
nvxHB 			#eval{$ROTx0-$Rhub};
vyHB 			#eval{$ROTy0+$Rhub};
nvyHB 			#eval{$ROTy0-$Rhub};

// Calculations for arcs:
c1 		#eval{$ROTx0 + ($Rrot*cos(45.0))};//cosine in 1st quadrant
s1 		#eval{$ROTy0 + ($Rrot*sin(45.0))};//sine in 1st quadrant
c2 		#eval{$ROTx0 + ($Rrot*cos(135.0))};//cosine in 2nd quadrant
s2 		#eval{$ROTy0 + ($Rrot*sin(135.0))};//sine in 2nd quadrant
c3 		#eval{$ROTx0 + ($Rrot*cos(225.0))};//cosine in 3rd quadrant
s3 		#eval{$ROTy0 + ($Rrot*sin(225.0))};//sine in 3rd quadrant
c4 		#eval{$ROTx0 + ($Rrot*cos(315.0))};//cosine in 4th quadrant
s4 		#eval{$ROTy0 + ($Rrot*sin(315.0))};//sine in 4th quadrant

// Calculations for hub arcs:
c1HB 	#eval{$ROTx0 + ($Rhub*cos(45.0))};//cosine in 1st quadrant
s1HB 	#eval{$ROTy0 + ($Rhub*sin(45.0))};//sine in 1st quadrant
c2HB 	#eval{$ROTx0 + ($Rhub*cos(135.0))};//cosine in 2nd quadrant
s2HB 	#eval{$ROTy0 + ($Rhub*sin(135.0))};//sine in 2nd quadrant
c3HB 	#eval{$ROTx0 + ($Rhub*cos(225.0))};//cosine in 3rd quadrant
s3HB 	#eval{$ROTy0 + ($Rhub*sin(225.0))};//sine in 3rd quadrant
c4HB 	#eval{$ROTx0 + ($Rhub*cos(315.0))};//cosine in 4th quadrant
s4HB 	#eval{$ROTy0 + ($Rhub*sin(315.0))};//sine in 4th quadrant

vertices
(   
//   Vertices for the cylinder :
//   x       y       z
    ($vx     $ROTy0  $ROTz0) 	// 0 to 3          
    ($ROTx0  $vy     $ROTz0)           
    ($nvx    $ROTy0  $ROTz0)           
    ($ROTx0  $nvy    $ROTz0)          
    
    ($vx     $ROTy0  $h)			// 4 to 7           
    ($ROTx0  $vy     $h)            
    ($nvx    $ROTy0  $h)            
    ($ROTx0  $nvy    $h)
		
	($vxHB   $ROTy0  $ROTz0) 	// 8 to 11          
    ($ROTx0  $vyHB   $ROTz0)           
    ($nvxHB  $ROTy0  $ROTz0)           
    ($ROTx0  $nvyHB  $ROTz0)          
    
    ($vxHB   $ROTy0  $h)		// 12 to 15           
    ($ROTx0  $vyHB   $h)            
    ($nvxHB  $ROTy0  $h)            
    ($ROTx0  $nvyHB  $h)
);

// block: 8 vertices with local coordinate system is right-handed
blocks
(
    hex ( 0 3 11 8 4 7 15 12) 	( $grad  $grad  $grad )    simpleGrading (1 1 0)
    hex ( 3 2 10 11 7 6 14 15)	( $grad  $grad  $grad )    simpleGrading (1 1 0)
    hex ( 2 1 9 10 6 5 13 14)	( $grad  $grad  $grad )    simpleGrading (1 1 0)
	hex ( 1 0 8 9 5 4 12 13)	( $grad  $grad  $grad )    simpleGrading (1 1 0)
);

edges
(
     arc 0 1 ($c1 $s1 $ROTz0)
     arc 1 2 ($c2 $s2 $ROTz0)
     arc 2 3 ($c3 $s3 $ROTz0)
     arc 3 0 ($c4 $s4 $ROTz0)
     
     arc 4 5 ($c1 $s1 $h)
     arc 5 6 ($c2 $s2 $h)
     arc 6 7 ($c3 $s3 $h)
     arc 7 4 ($c4 $s4 $h)
	 
	 arc 8 9 ($c1HB $s1HB $ROTz0)
     arc 9 10 ($c2HB $s2HB $ROTz0)
     arc 10 11 ($c3HB $s3HB $ROTz0)
     arc 11 8 ($c4HB $s4HB $ROTz0)
     
     arc 12 13 ($c1HB $s1HB $h)
     arc 13 14 ($c2HB $s2HB $h)
     arc 14 15 ($c3HB $s3HB $h)
     arc 15 12 ($c4HB $s4HB $h)
);

// boundary: looking from inside the block in a clockwise direction
boundary
(
	inlet
    {
        type patch;
        faces
        (
			(0 1 9 8)
            (1 2 10 9)
            (2 3 11 10)
			(3 0 8 11)
			);
    }
	outlet
    {
        type patch;
        faces
        (
			(4 12 13 5)
            (5 13 14 6)
            (6 14 15 7)
			(7 15 12 4)
		);
    }
	side
    {
        type patch;
        faces
        (
			(0 4 5 1)
            (1 5 6 2)
            (2 6 7 3)
			(3 7 4 0)
		);
    }
	hub
    {
        type patch;
        faces
        (
			(8 12 13 9)
            (9 13 14 10)
            (10 14 15 11)
			(11 15 12 8)
        );
    } 

);

mergePatchPairs
(
);
Attached Images
File Type: jpg cylMesh.jpg (193.0 KB, 10 views)
AlxB is offline   Reply With Quote

Old   January 28, 2025, 08:39
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 273
Rep Power: 6
Alczem is on a distinguished road
Hey!


There is probably something wrong in the order of the vertices or the blocks, but I cannot tell for sure, I only use blockMesh on very rare occasions.


What I can suggest is to simplify your blockMeshDict by meshing only a quarter of your geometry (so only one block) and then use mirrorMesh to duplicate this quarter into a half and a second time to duplicate it into your full geometry. That should help in pinpointing the error.
AlxB likes this.
Alczem is online now   Reply With Quote

Reply

Tags
blockmesh, checkmesh, cylinder, quality

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ansys Meshing - Fluent] Want to know the influence of mesh quality y__tb FLUENT 2 May 12, 2022 22:36
[snappyHexMesh] SHM Bad quality snapping/terracing ryan55510 OpenFOAM Meshing & Mesh Conversion 0 April 20, 2022 21:20
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[snappyHexMesh] Bad quality mesh at external corners Bollonga OpenFOAM Meshing & Mesh Conversion 2 October 31, 2017 14:42
[ICEM] Bad Quality **Anny** ANSYS Meshing & Geometry 7 May 28, 2015 06:03


All times are GMT -4. The time now is 05:18.