View Issue Details

IDProjectCategoryView StatusLast Update
0001569OpenFOAMBugpublic2015-10-22 10:10
Reporteruser1060Assigned Tohenry  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionsuspended 
PlatformGNU/LinuxOSUbuntuOS Version12.04
Summary0001569: bug in applying stitchMesh on rectangular blocks
DescriptionHi all,

I think there is something wrong in stitchMesh utility for applying on rectangular blocks . I have attached a sample describing the problem. In the sample I want to combine three blocks so that the block 1 cover the block 0 and the block 2 cover the block 1. The block 0 is cylinder. The block 1 is a cube with a circular hole to cover the block 0. The block 2 is a larger cube with a rectangular hole to cover the block1. If you use the strip file (Allrun_cylinder) to generate the mesh, you will have a grid consisted of three blocks 0,1 and 2. Apparently everything is fine and checkMesh reports “Mesh OK”. But checking the the log.stitchMesh and Boundary file in the directory polyMesh shows something else. The first file shows the error:

“Zero length edge detected. Probable projection error: slave patch probably does not project onto master”

for merging common patches between blocks 1 and 2 while there is not any error for merging common blocks 0 and 1 which have similar situation. Of course, since it not possible to to use stitchMesh more than once for each zone, I was forced to consider all common faces on blocks 1 (and 2) as one patch called external_surr_sec0 (and internal_surr_sec1).

The second file also shows that the createPatch has failed to remove the common patches between blocks 1 and 2 and reported their details in some files such as Boundary, faceZones, cellZones, etc. while it has successfully removed common patches between block 0 and block 1 (which are cylindrical). Correcting the generated mesh is not possible manually and defining usual boundary conditions for the grid with the current state causes it to crash. I have also replaced the type patch with the type empty for the common patches but there is no difference in the generated mesh.

Best regards,
Mohammad
TagsstitchMesh

Activities

user1060

2015-03-13 13:22

 

gridGen_v1.tar.gz (1,840,057 bytes)

wyldckat

2015-03-14 14:34

updater   ~0004122

Greetings MHB,

This issue looked familiar to me. I suspect you're not using a recent version of OpenFOAM, because "mergeMeshes" can be used with "-overwrite" since... I think since OpenFOAM 2.1.

This and other related details are addressed here: http://www.cfd-online.com/Forums/openfoam-meshing-utilities/113863-when-can-stitchmesh-used.html

The solution to your case is to use "-perfect" in the second run of "stitchMesh".

As for stitching it all at once, this is also explained on that thread and on this bug report: http://www.openfoam.org/mantisbt/view.php?id=347


As for the message itself... I'm not sure if "-partial" should be upgraded to support scenarios where the mesh perfectly overlaps.

Best regards,
Bruno

user1060

2015-03-16 15:50

 

gridGen_realCase.tar.gz (1,852,062 bytes)

user1060

2015-03-16 15:52

  ~0004146

Hi Bruno,

Thank you very much for your guidance. Yes it works fine with replacing option partial with perfect for stitchMesh. But I think it does not work for more complicated cases.
The case I already attached was for explaining the problem. After applying your solution to the real case that I am working on it I see that it does not work although the situation is the same. Please see the new file attached. In the real case I have six blocks. Before the final step, I generate a block consisted of five smaller blocks and everything is fine without any error and checkMesh reports OK. But at the final step when I want to cover the mentioned rectangular block generated from the previous steps by a larger block having a rectangular hole, stitchMesh gives error even though I use “perfect” option for that. If possible, could you please check it as well?

Best regards,
Mohammad

wyldckat

2015-03-29 12:28

updater  

why_perfect_will_not_work.png (35,806 bytes)   
why_perfect_will_not_work.png (35,806 bytes)   

wyldckat

2015-03-29 12:40

updater   ~0004528

Hi Mohammad,

The "-perfect" option will not work because of what's shown in the attached picture "why_perfect_will_not_work.png".
For this, the "-partial" option would have to be used, but the problem is that the algorithm is not prepared to handle such this scenario; it can handle stitching 3 of the 4 internal sides in the last operation, but the 4th side will lead to the error you've gotten.

You can try splitting the last big mesh into 2 or 4 parts, so that you can stitch each big part individually and then finally stitch these big parts to each other... it could work, because the final stitches would be connecting the internal block to the external block, therefore making the algorithm more aware of what needs to be done.
I'll put up a drawing in a few minutes on what I'm referring to.

Because the problem with the current algorithm is that it sort-of goes around in a loop trying to close the final internal patches, but it gets lost when it can't find an end in the direction it's looking, probably because there is no connection to the external patch.


I would say that fixing this issue in the algorithm falls into the category of a feature request, because this isn't exactly a common requirement for stitchMesh.

Best regards,
Bruno

wyldckat

2015-03-29 13:16

updater  

example.png (60,764 bytes)   
example.png (60,764 bytes)   

wyldckat

2015-03-29 13:17

updater   ~0004531

In the attached image "example.png" is one possible configuration, so that you stitch each one of the 4 green blocks to the internal pipe and only after that should you stitch between each one of the green blocks.

henry

2015-10-22 10:10

manager   ~0005463

Feature request requiring funding or code contribution.

Issue History

Date Modified Username Field Change
2015-03-13 13:22 user1060 New Issue
2015-03-13 13:22 user1060 File Added: gridGen_v1.tar.gz
2015-03-14 14:34 wyldckat Note Added: 0004122
2015-03-16 15:50 user1060 File Added: gridGen_realCase.tar.gz
2015-03-16 15:52 user1060 Note Added: 0004146
2015-03-24 00:17 liuhuafei Issue cloned: 0001604
2015-03-29 12:28 wyldckat File Added: why_perfect_will_not_work.png
2015-03-29 12:40 wyldckat Note Added: 0004528
2015-03-29 13:16 wyldckat File Added: example.png
2015-03-29 13:17 wyldckat Note Added: 0004531
2015-08-17 00:49 wyldckat Tag Attached: stitchMesh
2015-10-22 10:10 henry Note Added: 0005463
2015-10-22 10:10 henry Status new => closed
2015-10-22 10:10 henry Assigned To => henry
2015-10-22 10:10 henry Resolution open => suspended