CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [Gmsh] gmshToFoam: checkMesh errors (https://www.cfd-online.com/Forums/openfoam-meshing/81949-gmshtofoam-checkmesh-errors.html)

Akuji November 11, 2010 09:17

gmshToFoam: checkMesh errors
 
Hi there

I have done a mesh in gmsh, then I tried to move it on OpenFoam. At 1st, I do gmshTo FOam, then-checkMesh. But at finish I saw "Failed 1 mesh checks." I use a gmsh-2.4.2 and openfoam- 1.7.0.

And here all:
Time = 0

Mesh stats
points: 69920
faces: 775242
internal faces: 735386
cells: 377657
boundary patches: 4
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 377657
polyhedra: 0

Checking topology...
Boundary definition OK.
***Unused points found in the mesh, number unused by faces: 127 number unused by cells: 127
<<Writing 127 unused points to set unusedPoints
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
nok 0 0 ok (empty)
bottom 10084 5175 ok (non-closed singly connected)
cube 29772 15019 ok (non-closed singly connected)
defaultFaces 0 0 ok (empty)

Checking geometry...
Overall domain bounding box (-890 -1000 0) (1256 1146 1074)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-3.99048e-17 -4.59563e-18 -5.13186e-16) OK.
Max cell openness = 2.07714e-15 OK.
Max aspect ratio = 249.614 OK.
Minumum face area = 68.8107. Maximum face area = 4790.95. Face area magnitudes OK.
Min volume = 50.9853. Max volume = 103579. Total volume = 4.94611e+09. Cell volumes OK.
Mesh non-orthogonality Max: 87.2498 average: 26.9519
*Number of severely non-orthogonal faces: 3143.
Non-orthogonality check OK.
<<Writing 3143 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 1.99996 OK.

Failed 1 mesh checks.

End



Where is the mistake?

T.D. November 30, 2010 08:09

Quote:

Originally Posted by Akuji (Post 283096)
Hi there

I have done a mesh in gmsh, then I tried to move it on OpenFoam. At 1st, I do gmshTo FOam, then-checkMesh. But at finish I saw "Failed 1 mesh checks." I use a gmsh-2.4.2 and openfoam- 1.7.0.

And here all:
Time = 0

Mesh stats
points: 69920
faces: 775242
internal faces: 735386
cells: 377657
boundary patches: 4
point zones: 0
face zones: 0
cell zones: 1

Overall number of cells of each type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 377657
polyhedra: 0

Checking topology...
Boundary definition OK.
***Unused points found in the mesh, number unused by faces: 127 number unused by cells: 127
<<Writing 127 unused points to set unusedPoints
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
Patch Faces Points Surface topology
nok 0 0 ok (empty)
bottom 10084 5175 ok (non-closed singly connected)
cube 29772 15019 ok (non-closed singly connected)
defaultFaces 0 0 ok (empty)

Checking geometry...
Overall domain bounding box (-890 -1000 0) (1256 1146 1074)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-3.99048e-17 -4.59563e-18 -5.13186e-16) OK.
Max cell openness = 2.07714e-15 OK.
Max aspect ratio = 249.614 OK.
Minumum face area = 68.8107. Maximum face area = 4790.95. Face area magnitudes OK.
Min volume = 50.9853. Max volume = 103579. Total volume = 4.94611e+09. Cell volumes OK.
Mesh non-orthogonality Max: 87.2498 average: 26.9519
*Number of severely non-orthogonal faces: 3143.
Non-orthogonality check OK.
<<Writing 3143 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 1.99996 OK.

Failed 1 mesh checks.

End



Where is the mistake?

Hi,
Try to use "frontal" mesh type in options.
also make sure that you have created all physical surfaces and volumes and lines.
Good Luck

Akuji December 1, 2010 04:30

Quote:

Originally Posted by T.D. (Post 285389)
Hi,
Try to use "frontal" mesh type in options.
also make sure that you have created all physical surfaces and volumes and lines.
Good Luck

Hi, T.D.

I use frontal mesh type un options (it's default)/
About physical surfaces and lines: all lines are included in surfaces. Should I at 1st make a physical lines ans then physical surfaces? Or will be enought to create a surfaces immediatly?

T.D. December 1, 2010 08:21

Quote:

Originally Posted by Akuji (Post 285537)
Hi, T.D.

I use frontal mesh type un options (it's default)/
About physical surfaces and lines: all lines are included in surfaces. Should I at 1st make a physical lines ans then physical surfaces? Or will be enought to create a surfaces immediatly?

Hi,
Every patch you need to use in calculations you must define as physical.
so if your patches are all surfaces that surrounds a volume, in other ways 3D geometry, then you must only define physical surfaces and the physical internal volume.
If it is 2D, then you must define the physical lines and the physical internal surface.

you can send me the gmsh file, i can check it for you.

GoodLuck

Maimouna November 24, 2014 09:13

Dear T.D.,

I got the same error when I checked mesh in Gmsh '' Failed 1 mesh checks'', my mesh file is showing below
Quote:

D = 0.0016;
R = 0.0008;

xmin = -0.384;
xmax = 0.384;

ymin = 0;
ymax = 0.320;

zmin = -1;
zmax = 1;

lc = 0.1;

// Number of nodes in x, y and z directions
nx = 100;
ny = 100;
nz = 1;

Point(1) = {xmin, ymin, zmin, lc};
Point(2) = {xmax, ymin, zmin, lc};
Point(3) = {xmax, ymax, zmin, lc};
Point(4) = {xmin, ymax, zmin, lc};

Point(5) = {-0.224, 0.160, zmin, lc};

Point(6) = {-0.224+R, 0.160-R, -1, lc};
Point(7) = {-0.224+R, 0.160+R, -1, lc};
Point(8) = {-0.224-R, 0.160+R, -1, lc};
Point(9) = {-0.224-R, 0.160-R, -1, lc};

Point(10) = {-0.224-R, 0, -1, lc};
Point(11) = {-0.224+R, 0, -1, lc};
Point(12) = {0.384, 0.160-R, -1, lc};
Point(13) = {0.384, 0.160+R, -1, lc};
Point(14) = {-0.224+R, 0.320, -1, lc};
Point(15) = {-0.224-R, 0.320, -1, lc};
Point(16) = {-0.384, 0.160+R, -1, lc};
Point(17) = {-0.384, 0.160-R, -1, lc};

Circle(1) = {6, 5, 7};
Circle(2) = {7, 5, 8};
Circle(3) = {8, 5, 9};
Circle(4) = {9, 5, 6};

Line(5) = {1, 10};
Line(6) = {10, 11};
Line(7) = {11, 2};
Line(8) = {2, 12};
Line(9) = {12, 13};
Line(10) = {13, 3};
Line(11) = {3, 14};
Line(12) = {14, 15};
Line(13) = {15, 4};
Line(14) = {4, 16};
Line(15) = {16, 17};
Line(16) = {17, 1};

Line(17) = {9, 17};
Line(18) = {9, 10};
Line(19) = {6, 11};
Line(20) = {6, 12};
Line(21) = {7, 13};
Line(22) = {7, 14};
Line(23) = {8, 15};
Line(24) = {8, 16};

// Definition of line loop and surface
Line Loop(1) = {5,-18,17,16};
Plane Surface(1) = {1};

Line Loop(2) = {6,-19,-4,18};
Plane Surface(2) = {2};

Line Loop(3) = {7,8,-20,19};
Plane Surface(3) = {3};

Line Loop(4) = {20,9,-21,-1};
Plane Surface(4) = {4};

Line Loop(5) = {21,10,11,-22};
Plane Surface(5) = {5};

Line Loop(6) = {22,12,-23,-2};
Plane Surface(6) = {6};

Line Loop(7) = {-24,23,13,14};
Plane Surface(7) = {7};

Line Loop(8) = {-17,-3,24,15};
Plane Surface(8) = {8};

// Definition of number of nodes on lines
Transfinite Line{5, 17, 24, 13} = 100;
Transfinite Line{18, 16, 19, 8} = 100;
Transfinite Line{10, 22, 23, 14} = 10;
Transfinite Line{4, 6, 2, 12} = 100;
Transfinite Line{15, 3, 1, 9} = 100;
Transfinite Line{7, 20, 21, 11} = 100;

// Definition of the corners of the mesh and creation of a structured
//hexahedral mesh
Transfinite Surface{1} = {1,10,9,17};
Recombine Surface{1};

Transfinite Surface{2} = {10,11,6,9};
Recombine Surface{2};

Transfinite Surface{3} = {11,2,12,6};
Recombine Surface{3};

Transfinite Surface{4} = {6,12,13,7};
Recombine Surface{4};

Transfinite Surface{5} = {7,13,3,14};
Recombine Surface{5};

Transfinite Surface{6} = {7,14,15,8};
Recombine Surface{6};

Transfinite Surface{7} = {16,8,15,4};
Recombine Surface{7};

Transfinite Surface{8} = {17,9,8,16};
Recombine Surface{8};

// Extrusion in the third dimension
Extrude{0,0,zmax-zmin}{
Surface{1,2,3,4,5,6,7,8};
Layers{nz};Recombine;
}

// Definition of surfaces for boundary conditions
Physical Surface("inlet") = {177,199,45};
Physical Surface("outlet") = {125,103,81};
Physical Surface("top") = {173,147,129};
Physical Surface("bottom") = {33,55,77};
Physical Surface("cylinder") = {155,111,63,191};
Physical Surface("frontAndBack") = {5,4,3,90,134,112,107,85,6,156,133,151,2,8,1,178,3 7,59,68,46,200,165,41};

// Definition of a volume
Physical Volume("volume") = {1,2,3,4,5,6,7,8};

Mesh 3;
Save "channel-with-cylinder.msh";

Could you please tell me where is the problem that shows the error ''Failed 1 mesh checks''?

Lots of thanks in advanced.

Maimouna

alexeym November 24, 2014 10:24

1 Attachment(s)
Well, I'm not T.D. ;)

If you get the error, post this error. Otherwise person, who would like to help you, have to create geo-file by copying what you've posted, then run gmsh to create msh-file, run gmshToFoam in an arbitrary case, run checkMesh to learn what exact error you've got.

In fact there are two errors:

Code:

***High aspect ratio cells found, Max aspect ratio: 155090, number of cells 50787
  <<Writing 50787 cells with high aspect ratio to set highAspectRatioCells

and

Code:

    Mesh non-orthogonality Max: 86.6188 average: 20.8455
  *Number of severely non-orthogonal (> 70 degrees) faces: 2260.
    Non-orthogonality check OK.
  <<Writing 2260 non-orthogonal faces to set nonOrthoFaces

Now take a look at a picture of a mesh (attached to the message). First problem can be solved by reducing size of the cube in y-direction (as any way you going to run 2D case). Non-orthogonality around the cylinder can be solved by rearranging nodes of the mesh. As overall mesh is awful, I've decided not to look exact location of the problem.

Maimouna November 24, 2014 12:16

Dear Alexey,

many thanks for your last post. Actually the error that I got after checkMesh is shown below
Quote:

maimouna@maimouna-desktop:~/OpenFOAM/OpenFOAM-2.2.2/tutorials/incompressible/pimpleDyMFoam/freeOscillatingCylinderComparisionTest$ checkMesh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.2.2-9739c53ec43f
Exec : checkMesh
Date : Nov 24 2014
Time : 17:08:14
Host : "maimouna-desktop"
PID : 5621
Case : /home/maimouna/OpenFOAM/OpenFOAM-2.2.2/tutorials/incompressible/pimpleDyMFoam/freeOscillatingCylinderComparisionTest
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 104760
internal points: 0
faces: 207414
internal faces: 102654
cells: 51678
faces per cell: 6
boundary patches: 7
point zones: 0
face zones: 1
cell zones: 1

Overall number of cells of each type:
hexahedra: 51678
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 0
polyhedra: 0

Checking topology...
Boundary definition OK.
***Total number of faces on empty patches is not divisible by the number of cells in the mesh. Hence this mesh is not 1D or 2D.
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
frontAndBack 102465 103869 ok (non-closed singly connected)
bottom 297 596 ok (non-closed singly connected)
inlet 207 416 ok (non-closed singly connected)
cylinder 396 792 ok (non-closed singly connected)
outlet 207 416 ok (non-closed singly connected)
top 297 596 ok (non-closed singly connected)
defaultFaces 891 1000 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.384 0 -1) (0.384 0.32 1)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 0)
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (7.31352789305e-16 8.45626662634e-16 -1.59518906061e-17) OK.
***High aspect ratio cells found, Max aspect ratio: 1344.20375221, number of cells 211
<<Writing 211 cells with high aspect ratio to set highAspectRatioCells
Minimum face area = 2.05992588458e-08. Maximum face area = 0.0353777777778. Face area magnitudes OK.
Min volume = 4.11985176916e-08. Max volume = 0.000216983703704. Total volume = 0.49151195786. Cell volumes OK.
Mesh non-orthogonality Max: 44.1792278785 average: 11.5762701315
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 2.46069682679 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

Honestly, I didn't understand where that two errors that you posted in #6 where are come from. Could you please explain me more and what about the error that I got?

Many thanks for your help.

Maimouna

alexeym November 24, 2014 13:22

I've just copy-pasted your geo-file (that you've posted as quote instead of attaching it).

In your output I was able to find only error with aspect ratio of cell. Aspect ratio threshold is 1000 (http://foam.sourceforge.net/docs/cpp...50565b3157bb4c), in your mesh maximum is 1344. In this case the error can be ignored.

Maimouna November 25, 2014 06:10

Dear Alexey,

many thanks for your help.

Best regards

Maimouna


All times are GMT -4. The time now is 14:20.