|
[Sponsors] |
[Technical] checkMesh - concave faces definition |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 30, 2013, 11:01 |
checkMesh - concave faces definition
|
#1 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 339
Rep Power: 28 |
The utility checkMesh determines the presence of concave faces by calling the function checkFaceAngles(). The code of this function is attached (OF-2.1.x). Here is the relevant code section of checkGeometry.C
Code:
if (allGeometry) { faceSet faces(mesh, "concaveFaces", mesh.nFaces()/100 + 1); if (mesh.checkFaceAngles(true, 10, &faces)) { //noFailedChecks++; label nFaces = returnReduce(faces.size(), sumOp<label>()); if (nFaces > 0) { Info<< " <<Writing " << nFaces << " faces with concave angles to set " << faces.name() << endl; faces.instance() = mesh.pointsInstance(); faces.write(); } } } Code:
// Check normal edgeNormal /= magEdgeNormal; if ((edgeNormal & faceNormal) < SMALL) { if (faceI != errorFaceI) { // Count only one error per face. errorFaceI = faceI; nConcave++; } if (setPtr) { setPtr->insert(faceI); } maxEdgeSin = max(maxEdgeSin, magEdgeNormal); } Code:
if ((edgeNormal & faceNormal) < SMALL) faceNormal is the normalized face normal vector. So its magnitude is one and the vector is perpendicular to the face. edgeNormal is also a normalized vector. edgeNormal was generated by calculating the cross-product of two consecutive edges of the face. As an edge connects two points, an edge can always be represented by a vector pointing from one point to the other point. However, as all edges of the face lie within a plane to which the faceNormal is prependicular. The cross-product of two edges yields always a vector parallel to the faceNormal. In fact it can be parallel or anti-parallel. The condition Code:
((edgeNormal & faceNormal) < SMALL) So, the condition is false for the parallel case and false for the anti-parallel case. How can this condition detect a concave cell? What I figured out is that the following is a concave cell, meaning that the edges delimiting the face make a bend inwards. I can't see that the condition behind which the line nConcave++; is located is able to detect this. o------o | xxxx/ | xxx/ | xxo | xxx\ o-----o What am I missing, or am I somewhere wrong? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Decomposing meshes | Tobi | OpenFOAM Pre-Processing | 22 | February 24, 2023 09:23 |
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface | Kryo | OpenFOAM Meshing & Mesh Conversion | 13 | February 17, 2022 07:34 |
parallel run OpenFoam | Srinath Reddy | OpenFOAM Running, Solving & CFD | 13 | February 27, 2019 09:15 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 18:57 |
[Gmsh] Vertex numbering is dense | KateEisenhower | OpenFOAM Meshing & Mesh Conversion | 7 | August 3, 2015 10:49 |