Difference between revisions of "CheckMesh"

From OpenFOAMWiki
(Output explanation: had a better look at the source code and updated the description of the aspect ratio)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== What is "non-orthogonality"? ==
+
==Name==
Is the line connecting two cell centers across the merged patches normal to the face? It is not, which represents mesh non-orthogonality.
+
<tt>checkMesh</tt> - Checks validity of a mesh.
  
== What is "skewness"? ==
+
{{VersionInfo}}{{Version2.1}}
Does the line connecting two cell centers across the merged patches go through the center of the face? It does not, which represents skewness.
+
  
== Source ==
+
==Synopsis==
[http://openfoam.cfd-online.com/cgi-bin/forum/show.cgi?tpc=1&post=12204#POST12204 Hrv]
+
checkMesh [OPTIONS]
 +
 
 +
==Description==
 +
Checks validity of a mesh
 +
 
 +
'''-allGeometry'''
 +
:Include bounding box checks
 +
'''-allTopology'''
 +
:Include extra topology checks
 +
'''-noTopology'''
 +
:Skip checking the mesh topology
 +
 
 +
'''-noZero'''
 +
:Exclude the ''0'' directory from the times list
 +
'''-time''' ''RANGES''
 +
:Select time steps. ''RANGES'' follows the [[Tip_Advanced_Time_Selection_Options | time selection rules]]
 +
'''-latestTime'''
 +
:Apply only on the latest time available
 +
'''-constant'''
 +
:Include the ''constant'' directory in the times list
 +
 
 +
'''-parallel'''
 +
:Run the utility in parallel
 +
'''-roots''' ''"(DIR1 [...DIRN])"''
 +
:Directories through which the data are distributed
 +
'''-region''' ''NAME''
 +
:Specify a mesh region by its ''NAME''
 +
 
 +
'''-case''' ''DIR''
 +
:Execute the command on the case directory ''DIR''. If not provided, use the current directory
 +
'''-noFunctionObjects'''
 +
:Skip the execution of the [[functionObjects]]
 +
'''-help'''
 +
:Display the help and exit
 +
 
 +
==Output explanation==
 +
The output will be explained based on the <tt>checkMesh</tt> output for the tutorial <tt>$FOAM_TUTORIALS/incompressible/icoFoam/cavity</tt>.
 +
 
 +
1. <tt>Mesh statistics</tt>
 +
    points:          882
 +
    internal points:  0
 +
    faces:            1640
 +
    internal faces:  760
 +
    cells:            400
 +
    boundary patches: 3
 +
    point zones:      0
 +
    face zones:      0
 +
    cell zones:      0
 +
 +
Overall number of cells of each type:
 +
    hexahedra:    400
 +
    prisms:        0
 +
    wedges:        0
 +
    pyramids:      0
 +
    tet wedges:    0
 +
    tetrahedra:    0
 +
    polyhedra:    0
 +
 +
2. <tt>Checking topology...</tt>
 +
    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                 
 +
    movingWall          20      42      ok (non-closed singly connected) 
 +
    fixedWalls          60      122      ok (non-closed singly connected) 
 +
    frontAndBack        800      882      ok (non-closed singly connected) 
 +
 
 +
3. <tt>Checking geometry...</tt>
 +
 
 +
    Overall domain bounding box (0 0 0) (0.1 0.1 0.01)
 +
    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 (8.47033e-18 -8.47033e-18 -5.901e-17) OK.
 +
    Max cell openness = 1.35525e-16 OK.
 +
    Max aspect ratio = 1 OK.
 +
    Minimum face area = 2.5e-05. Maximum face area = 5e-05.  Face area magnitudes OK.
 +
    Min volume = 2.5e-07. Max volume = 2.5e-07.  Total volume = 0.0001.  Cell volumes OK.
 +
    Mesh non-orthogonality Max: 0 average: 0
 +
    Non-orthogonality check OK.
 +
    Face pyramids OK.
 +
    Max skewness = 1e-08 OK.
 +
    Coupled point location match (average 0) OK.
 +
 
 +
4. Conclusion
 +
Mesh OK.
 +
 
 +
Geometry tests:
 +
; Bounding box
 +
:The minimal box that can contain the mesh
 +
 
 +
; Non-empty, non-wedge directions
 +
:(1 1 0) means x and y are not empty neither wedges. But z is empty or wedge.
 +
 
 +
; Non-empty directions
 +
:(1 1 0) means x and y are not empty directions. But z is.
 +
 
 +
; Aspect ratio
 +
: Face aspect ratio:
 +
:: The ratio between the longest and the shortest length.
 +
: Cell aspect ratio:
 +
:: If the mesh is pseudo-2D, then it's just the ratio between the biggest and the smallest areas of the cell's bounding box.
 +
:: If 3D, then it's the largest between the previous ratio and the result of the following expression: <math>\frac {1.0}{6.0} \times \frac {|ax|+|ay|+|az|}{v^{\frac {2.0}{3.0}}}</math>
 +
:: where:
 +
::* <math>ax</math>, <math>ay</math>, <math>az</math>: are the areas of the bounding box of the cell
 +
::* <math>v</math>: is the volume of the cell
 +
: Note: aspect ratio 1.0 is the best.
 +
 
 +
; Cell volumes
 +
:The difference between min and max should be as small as possible (or the evolution should be as smooth as possible - not check for that)
 +
 
 +
; Mesh non-orthogonality
 +
:Measure the angle between the line connecting two cell centres and the normal of their common face - 0.0 is the best.
 +
 
 +
; Skewness
 +
:Measure the distance between the intersection of the line connecting two cell centres with their common face and the centre of that face - smaller is better.
 +
 
 +
=== Other Explanations ===
 +
* [http://www.cfd-online.com/Forums/openfoam-post-processing/61395-dxfoam-reader-update.html#post196456 DxFoam reader update - post #15] - Hrvoje Jasak comments on the topics of non-orthogonality and skewness.
  
 
[[Category:Mesh manipulation utilities]]
 
[[Category:Mesh manipulation utilities]]

Latest revision as of 15:53, 21 February 2015

1 Name

checkMesh - Checks validity of a mesh.

Valid versions: OF Version 21.png

2 Synopsis

checkMesh [OPTIONS]

3 Description

Checks validity of a mesh

-allGeometry

Include bounding box checks

-allTopology

Include extra topology checks

-noTopology

Skip checking the mesh topology

-noZero

Exclude the 0 directory from the times list

-time RANGES

Select time steps. RANGES follows the time selection rules

-latestTime

Apply only on the latest time available

-constant

Include the constant directory in the times list

-parallel

Run the utility in parallel

-roots "(DIR1 [...DIRN])"

Directories through which the data are distributed

-region NAME

Specify a mesh region by its NAME

-case DIR

Execute the command on the case directory DIR. If not provided, use the current directory

-noFunctionObjects

Skip the execution of the functionObjects

-help

Display the help and exit

4 Output explanation

The output will be explained based on the checkMesh output for the tutorial $FOAM_TUTORIALS/incompressible/icoFoam/cavity.

1. Mesh statistics

   points:           882
   internal points:  0
   faces:            1640
   internal faces:   760
   cells:            400
   boundary patches: 3
   point zones:      0
   face zones:       0
   cell zones:       0

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

2. 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                  
   movingWall          20       42       ok (non-closed singly connected)  
   fixedWalls          60       122      ok (non-closed singly connected)  
   frontAndBack        800      882      ok (non-closed singly connected)  

3. Checking geometry...

   Overall domain bounding box (0 0 0) (0.1 0.1 0.01)
   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 (8.47033e-18 -8.47033e-18 -5.901e-17) OK.
   Max cell openness = 1.35525e-16 OK.
   Max aspect ratio = 1 OK.
   Minimum face area = 2.5e-05. Maximum face area = 5e-05.  Face area magnitudes OK.
   Min volume = 2.5e-07. Max volume = 2.5e-07.  Total volume = 0.0001.  Cell volumes OK.
   Mesh non-orthogonality Max: 0 average: 0
   Non-orthogonality check OK.
   Face pyramids OK.
   Max skewness = 1e-08 OK.
   Coupled point location match (average 0) OK.

4. Conclusion

Mesh OK.

Geometry tests:

Bounding box
The minimal box that can contain the mesh
Non-empty, non-wedge directions
(1 1 0) means x and y are not empty neither wedges. But z is empty or wedge.
Non-empty directions
(1 1 0) means x and y are not empty directions. But z is.
Aspect ratio
Face aspect ratio:
The ratio between the longest and the shortest length.
Cell aspect ratio:
If the mesh is pseudo-2D, then it's just the ratio between the biggest and the smallest areas of the cell's bounding box.
If 3D, then it's the largest between the previous ratio and the result of the following expression: \frac {1.0}{6.0} \times \frac {|ax|+|ay|+|az|}{v^{\frac {2.0}{3.0}}}
where:
  • ax, ay, az: are the areas of the bounding box of the cell
  • v: is the volume of the cell
Note: aspect ratio 1.0 is the best.
Cell volumes
The difference between min and max should be as small as possible (or the evolution should be as smooth as possible - not check for that)
Mesh non-orthogonality
Measure the angle between the line connecting two cell centres and the normal of their common face - 0.0 is the best.
Skewness
Measure the distance between the intersection of the line connecting two cell centres with their common face and the centre of that face - smaller is better.

4.1 Other Explanations