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/)
-   -   [blockMesh] Problem to merge faces of some defined blocks in OpenFOAM using blockMesh (https://www.cfd-online.com/Forums/openfoam-meshing/237792-problem-merge-faces-some-defined-blocks-openfoam-using-blockmesh.html)

Ali_Sh August 5, 2021 01:12

Problem to merge faces of some defined blocks in OpenFOAM using blockMesh
 
Hello all,
I have created a domain (shown in the pic) and would like to define boundaries as shown in the pic. My first question is about how to define two separate faces in one boundary e.g. top and bottom faces of the rectangular cube to be specified in boundary named "boundary" (they could be specified separately in two boundary names, but how to specify them together). The following error has been appeared by using code

blockMeshDict: https://drive.google.com/file/d/10WB...ew?usp=sharing

P: https://drive.google.com/file/d/141c...ew?usp=sharing

U: https://drive.google.com/file/d/1Fcp...ew?usp=sharing

https://i.stack.imgur.com/bPRWu.jpg

HTML Code:

--> FOAM FATAL ERROR: face 0 in patch 2 does not have neighbour cell face: 4(0 4 7 3)
The model is created by defining 18 blocks. The second question is about how to specify and merge faces between blocks (for defining outlet_perf (cylinder wall) as a boundary). In blockMeshing, the following error is appearing (Do we have to define shared vertices twice and create each of the connected blocks with same vertices by different numbering to define, later, master and slave in mergePatchPairs?)

HTML Code:

--> FOAM FATAL ERROR: Trying to specify a boundary face 4(8 9 13 12) on the face on cell 10 which is either an internal face or already belongs to some other patch. This is face 0 of patch 2 named outlet_perf_wall.
By defining shared vertices twice to correspond each of two merging blocks to one of them, when we have to specify two master and slave combination (there was not any problem by only one master and slave specification i.g. for, only, perforation walls) in mergePatchPairs (1 combination is specified for tip, which will be wall, and 4 patches for cylinder wall, that will be patch type) the following error is appearing:

HTML Code:

--> FOAM FATAL ERROR: Face 74168 reduced to less than 3 points. Topological/cutting error A. Old face: 2(27764 27765) new face: 2(27764 27765)
I have tried to solve the problem by adding 4 repeated vertices dedicated to the merging face of the back block relative to perforation block to pass probable problem related to new numbering of the vertices by mergePatchPairs when there are two master and slave statements, and by specifying perforation tip and walls as masters to remain unchanged. The blockMesh run without any problem, but there were shown 6 failed items by checkMesh; the model was weirded somewhere in paraview GUI as the pic below:

blockMeshDict: https://drive.google.com/file/d/1mG5...ew?usp=sharing

https://i.stack.imgur.com/5WQK9.jpg

The third question is for the checkMesh result of the main codes; "Q3" in the "All Errors". What's the problem? Is this error important?

Full text of each aforementioned errors are in the following attached file:

All Errors: https://drive.google.com/file/d/1Juy...ew?usp=sharing

bigphil August 20, 2021 11:12

It seems like you may be misunderstanding how to use blockMesh.

Here are some tips I suggest you follow:

Tip 1: run the checkMesh utility after creating the mesh
After creating the mesh with blockMesh it is important to check the mesh for any
errors by running the checkMesh command; blockMesh may not give errors if, for
example, a block is incorrectly defined as left-handed; however, checkMesh will
indicate that cells are inverted with negative volumes:
Code:

  Checking geometry...
      Overall domain bounding box (0 0 0) (0.1 0.1 0.01)
      Mesh has 2 geometric (non-empty/wedge) directions (1 1 0)
      Mesh has 2 solution (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.84453e-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.
  ***Zero or negative cell volume detected.  Minimum negative volume: -2.5e-07, Number of negative volume cells: 400
    <<Writing 400 zero volume cells to set zeroVolumeCells
      Mesh non-orthogonality Max: 180 average: 180
  ***Number of non-orthogonality errors: 760.
    <<Writing 760 non-orthogonal faces to set nonOrthoFaces
  ***Error in face pyramids: 2400 faces are incorrectly oriented.
    <<Writing 1640 faces with incorrect orientation to set wrongOrientedFaces
      Max skewness = 1.66533e-14 OK.
      Coupled point location match (average 0) OK.
  Failed 3 mesh checks.


Tip 2: if there are errors in the blocks, check each block one-by-one
If after running checkMesh, you receive errors, such as inverted negative volume cells, then often the easiest method to diagnose the problem is to comment out all the blocks (and all boundary patches) except one and then run blockMesh followed by checkMesh to see if that particular block is invalid; for example:
Code:

blocks (
    hex (0 1 8 9 10 11 18 19) (20 20 1) simpleGrading (1 1 1)
    // hex (1 2 5 8 11 12 15 18) (10 20 1) simpleGrading (1 1 1) // commented blocks
    // hex (2 3 4 5 12 13 14 15) (30 20 1) simpleGrading (1 1 1) // commented blocks
    // hex (8 5 6 7 18 15 16 17) (10 20 1) simpleGrading (1 1 1) // commented blocks
);

and also comment-out all boundary patches when you are checking each block
one-by-one:
Code:

boundary (
// inlet1 // {
    //    type patch;
    //    faces
    //    (
    //        (0 10 19 9)
    //    );
    // }
    // ... and comment out all the other patches
);  // Do not comment out this line (end of the boundary section)


Tip 3: interpreting blockMesh errors: blockMesh tells us exactly where to look If you receive errors when running blockMesh, the error message will typically
explain the source of the problem; consider the following blockMesh error: Creating block mesh topology
Code:

--> FOAM FATAL ERROR:
 face 0 in patch 0 does not have neighbour cell face: 4(3 0 6 2)
From function Foam::labelList Foam::polyMesh::facePatchFaceCells(const faceList&, const labelListList&, const faceListList&, Foam::label) const
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 118.
 FOAM aborting

This error states that there is a problem with the 0th face of the 0th patch i.e. go to the first patch in the boundary list and the problem is with its first face.


Philip


All times are GMT -4. The time now is 19:51.