|
[Sponsors] |
June 30, 2022, 05:35 |
Merging of multiple patch pairs
|
#1 |
New Member
Lennart
Join Date: May 2022
Posts: 15
Rep Power: 4 |
Hi,
I am trying to build a mesh consisting of 4 blocks. For simplicity we can assume that they are cubic and of uniform size (see attached sketch). Block 0 and 1 share an interface with the same number of cells on each side. However, block 2 and 3 have different cell numbers, so they need to be merged with the other blocks. Therefore, I have included double vertices for block 2 and 3. Now I am using mergePatchPairs to connect the patches with the double vertices. I am able to connect block 0 & 2 and block 1 & 3, but when I also want to connect block 2 & 3, I get the following error message from blockMesh: Code:
--> FOAM FATAL ERROR: Face 14502 reduced to less than 3 points. Topological/cutting error A. Old face: 2(6350 6366) new face: 2(6350 6366) This is my blockMeshDict: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; note "x"; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; vertices ( // front (0 1 0) // 0 (1 1 0) // 1 (1 0 0) // 2 (0 0 0) // 3 (1 -1 0) // 4 (0 -1 0) // 5 (1 1 0) // 6 (2 1 0) // 7 (2 0 0) // 8 (1 0 0) // 9 (1 0 0) // 10 (2 0 0) // 11 (2 -1 0) // 12 (1 -1 0) // 13 // back (0 1 -1) // 14 (1 1 -1) // 15 (1 0 -1) // 16 (0 0 -1) // 17 (1 -1 -1) // 18 (0 -1 -1) // 19 (1 1 -1) // 20 (2 1 -1) // 21 (2 0 -1) // 22 (1 0 -1) // 23 (1 0 -1) // 24 (2 0 -1) // 25 (2 -1 -1) // 26 (1 -1 -1) // 27 ); blocks ( // block 0 hex (0 1 2 3 14 15 16 17) (10 10 10) edgeGrading ( 1 1 1 1 1 1 1 1 1 1 1 1 ) // block 1 hex (3 2 4 5 17 16 18 19) (10 10 10) edgeGrading ( 1 1 1 1 1 1 1 1 1 1 1 1 ) // block 2 hex (6 7 8 9 20 21 22 23) (15 15 15) edgeGrading ( 1 1 1 1 1 1 1 1 1 1 1 1 ) // block 3 hex (10 11 12 13 24 25 26 27) (20 20 20) edgeGrading ( 1 1 1 1 1 1 1 1 1 1 1 1 ) ); defaultPatch { name walls; type wall; } boundary ( back { type symmetryPlane; faces ( (0 1 2 3) (3 2 4 5) (6 7 8 9) (10 11 12 13) ); } front { type symmetryPlane; faces ( (14 15 16 17) (17 16 18 19) (20 21 22 23) (24 25 26 27) ); } inlet { type patch; faces ( (0 14 17 3) (3 17 19 5) ); } outlet { type patch; faces ( (7 8 22 21) (11 12 26 25) ); } b0left { type patch; faces ( (1 2 16 15) ); } b2right { type patch; faces ( (9 6 20 23) ); } b1left { type patch; faces ( (2 4 18 16) ); } b3right { type patch; faces ( (13 10 24 27) ); } b2bottom { type patch; faces ( (8 9 23 22) ); } b3top { type patch; faces ( (10 11 25 24) ); } ); mergePatchPairs ( ( b0left b2right ) ( b1left b3right ) ( b2bottom b3top ) ); ); // ************************************************************************* // |
|
May 24, 2023, 19:38 |
|
#2 |
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
I am having the same issue. Did you solve it?
|
|
May 26, 2023, 06:25 |
|
#3 |
Member
Zeinab
Join Date: Feb 2023
Posts: 32
Rep Power: 3 |
Hello,
you can not use stitchMesh/mergePatchPairs twice on the same edge, because stitchMesh converts the interface cells to polyhedral cells, and stitchMesh can not work on polyhedra cells itself. So, that's what create the problem. Personally I'll try to use snappy, or I will put a cyclic BC on the patches that cannot be merged. Also, I will try different order of merging but I think it won't work in this case if all the blocks have the same dimensions. |
|
June 1, 2023, 11:32 |
|
#4 | |
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
Quote:
I am trying to merge those 3 blocks (See image) but I have an error, though mergePatchPairs does not have to merge the same edge twice: Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : _7bdb509494-20201222 OPENFOAM=2012 Arch : "LSB;label=32;scalar=64" Exec : blockMesh Date : Jun 01 2023 Time : 16:29:49 Host : DESKTOP-R70FIVH PID : 3664 I/O : uncollated Case : /mnt/c/Users/demar/desktop/provamesh nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Creating block mesh from "system/blockMeshDict" Creating block edges No non-planar block faces defined Creating topology blocks Creating topology patches Creating block mesh topology Check topology Basic statistics Number of internal faces : 0 Number of boundary faces : 18 Number of defined boundary faces : 18 Number of undefined boundary faces : 0 Checking patch -> block consistency Creating block offsets Creating merge list (topological search)... Creating polyMesh from blockMesh Creating patches Creating cells Creating points with scale 1 Block 0 cell size : i : 0.15 .. 0.15 j : 0.1 .. 0.1 k : 0.25 .. 0.25 Block 1 cell size : i : 0.35 .. 0.35 j : 0.1 .. 0.1 k : 0.25 .. 0.25 Block 2 cell size : i : 0.15 .. 0.15 j : 0.3 .. 0.3 k : 0.25 .. 0.25 Creating merge patch pairs Adding point and face zones Creating attachPolyTopoChanger --> FOAM FATAL ERROR: (openfoam-2012) Face 73739 reduced to less than 3 points. Topological/cutting error A. Old face: 0() new face: 0() From void Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const in file slidingInterface/coupleSlidingInterface.C at line 1450. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::exitOrAbort(int, bool) at ??:? #2 Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const at ??:? #3 Foam::slidingInterface::setRefinement(Foam::polyTopoChange&) const at ??:? #4 Foam::polyTopoChanger::topoChangeRequest() const at ??:? #5 Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) at ??:? #6 Foam::attachPolyTopoChanger::attach(bool) at ??:? #7 ? at ??:? #8 ? in /lib/x86_64-linux-gnu/libc.so.6 #9 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 #10 ? at ??:? Aborted (core dumped) Last edited by Edoardo1993; June 1, 2023 at 20:56. |
||
June 6, 2023, 06:16 |
|
#5 |
Member
Zeinab
Join Date: Feb 2023
Posts: 32
Rep Power: 3 |
Hello,
Okay I'll let you know how does stitchMesh/mergePatchPairs work as far as I know. They work on hexagonal mesh cells, merge them, and convert them to polyhedral cells. So, any non-hexagonal cells can not be merged by the previous utilities. So think about your case and see what happens when you merge the first two blocks, you will see that you have created a polyhedra cell that needs to be merged with the face in the third block. You can check it actually using check mesh. Merge two cells, and use checkMesh to see the type of the cells. You can always merge the blocks automatically by using equal number of cells at the common face between the two blocks, and also by using the same vertices of the face at the interface. Else, you can use cyclic BC. |
|
June 7, 2023, 00:58 |
|
#6 |
Senior Member
|
Hi,
3 blocks you showed does not need mergePatchPairs. An attached image and case is the most simple mesh with 3 blocks. If you share a simplified working case, we could easily solve problems. |
|
June 7, 2023, 07:15 |
|
#7 | ||
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
Quote:
Hi, snak. The case you shared is like mine, but blocks have to have different grading and number of cells. Block1 has to have a fine mesh while block2 and block3 a really coarse mesh. Quote:
Hi Zena, thank you for the answer. Unfortunately I can not merge the faces automatically by matching number of cells because I need different number of cells and different grading on each block. I'll take your tip and I am going to understand what BC is, hoping I can create the right mesh with it. |
|||
June 7, 2023, 08:43 |
|
#9 |
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
Exactly! But when I lunch your blockMesh I get the same error (probably for the reason that Zena27 explained): Code:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : _7bdb509494-20201222 OPENFOAM=2012 Arch : "LSB;label=32;scalar=64" Exec : blockMesh Date : Jun 07 2023 Time : 13:40:20 Host : DESKTOP-R70FIVH PID : 460 I/O : uncollated Case : /mnt/c/Users/demar/desktop/canecllami nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Creating block mesh from "system/blockMeshDict" Creating block edges No non-planar block faces defined Creating topology blocks Creating topology patches Creating block mesh topology --> FOAM Warning : From Foam::polyMesh::polyMesh(const Foam::IOobject&, Foam::pointField&&, const cellShapeList&, const faceListList&, const wordList&, const Foam::PtrList<Foam::dictionary>&, const Foam::word&, const Foam::word&, bool) in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 919 Found 6 undefined faces in mesh; adding to default patch frontAndBack Check topology Basic statistics Number of internal faces : 0 Number of boundary faces : 18 Number of defined boundary faces : 18 Number of undefined boundary faces : 0 Checking patch -> block consistency Creating block offsets Creating merge list (topological search)... Creating polyMesh from blockMesh Creating patches Creating cells Creating points with scale 1 Block 0 cell size : i : 1 .. 1 j : 1 .. 1 k : 1 .. 1 Block 1 cell size : i : 0.5 .. 0.5 j : 0.5 .. 0.5 k : 1 .. 1 Block 2 cell size : i : 0.3333333333 .. 0.3333333333 j : 0.3333333333 .. 0.3333333333 k : 1 .. 1 Creating merge patch pairs Adding point and face zones Creating attachPolyTopoChanger --> FOAM FATAL ERROR: (openfoam-2012) Face 43 reduced to less than 3 points. Topological/cutting error A. Old face: 2(15 12) new face: 2(15 12) From void Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const in file slidingInterface/coupleSlidingInterface.C at line 1450. FOAM aborting #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::error::exitOrAbort(int, bool) at ??:? #2 Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const at ??:? #3 Foam::slidingInterface::setRefinement(Foam::polyTopoChange&) const at ??:? #4 Foam::polyTopoChanger::topoChangeRequest() const at ??:? #5 Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) at ??:? #6 Foam::attachPolyTopoChanger::attach(bool) at ??:? #7 ? at ??:? #8 ? in /lib/x86_64-linux-gnu/libc.so.6 #9 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 #10 ? at ??:? Aborted (core dumped) |
|
June 7, 2023, 08:53 |
|
#10 |
Senior Member
|
Hi
Oops, you got the error with OpenFOAM v2012... I am using OpenFOAM v2212. The same Warning appears but no errors there. Log looks like this Code:
Merging 3 patch pairs Adding point and face zones Merging with attachPolyTopoChanger Removed 6 empty merged patches: (b0xMax b0yMax b1xMin b1yMax b2xMax b2yMin) Removed 6 empty merged face zones: (b0xMaxb1xMin0Side0Zone b0xMaxb1xMin0Side1Zone b0yMaxb2yMin1Side0Zone b0yMaxb2yMin1Side1Zone b1yMaxb2xMax2Side0Zone b1yMaxb2xMax2Side1Zone) --addition possible related commit https://develop.openfoam.com/Develop...e3d5f68046b95a |
|
June 7, 2023, 09:02 |
|
#11 | |
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
Quote:
Though the warning, is the mesh generated totally usable? Could you please attach the polyMesh directory? I want to try if it works properly and therefore I will maybe switch to v2212. Thank you |
||
June 7, 2023, 09:33 |
|
#13 |
New Member
Edoardo
Join Date: Apr 2023
Location: Italy
Posts: 27
Rep Power: 3 |
||
June 8, 2023, 07:32 |
|
#14 |
Senior Member
|
Hi Edoardo1993,
When you just grading the mesh, there is no need to merge interfaces. If you add blocks, you have to merge additional interfaces. Attached is a test case including results. It is derived from the standard cavity case. The case is just a demonstration of blockMesh.It is preferable to avoid a sudden change in mesh. |
|
Tags |
blockmesh, mergepatchpairs |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
steadyUniversalMRFFoam Tutorial fails in MixingPlane | HenrikJohansson | OpenFOAM Bugs | 0 | February 14, 2019 05:48 |
mapField error | rvl565 | OpenFOAM Pre-Processing | 1 | September 6, 2018 17:13 |
[Other] dynamicTopoFVMesh and pointDisplacement | RandomUser | OpenFOAM Meshing & Mesh Conversion | 6 | April 26, 2018 08:30 |
createPatch Segmentation Fault (CORE DUMPED) | sam.ho | OpenFOAM Pre-Processing | 2 | April 21, 2014 03:01 |
chtMultiRegionFoam Tutorial | m.nichols19 | OpenFOAM | 12 | September 9, 2010 12:56 |