CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] stitchMesh: how to stitch two non-conformal patches?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Ship Designer
  • 2 Post By GerhardHolzinger

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2020, 18:38
Default stitchMesh: how to fuse two non-conformal patches, without creating new cells?
  #1
New Member
 
Join Date: Jun 2020
Location: UK
Posts: 22
Rep Power: 6
Rango is on a distinguished road
Hi all,

Is there a way to utilize 'stitchMesh' to merge two non-conformal boundary patches shared between two regions into internal faces, without forming any new cells at the interface? For the sake of simplicity, as shown in attached images to this post, let's say I want to generate a mesh from two regions (part1 in blue, part2 in red), which are separated by non-conformal patches (part1_to_part2, and part2_to_part1).


Obviously, I can't use '-perfect' flag since the patches are non-conformal (interface patches do not have equal number of faces). And, the two following commands do not result in the desired mesh (i.e. part1 is divided into some new (pyramid and prism) cells as shown in the attached image):
HTML Code:
stitchMesh -partial part1_to_part2 part2_to_part1 -overwrite
HTML Code:
stitchMesh part1_to_part2 part2_to_part1 -overwrite
I have attached the case for your reference, and I am using openFOAM-5.x.


Any help or comments would be highly appreciated!


Cheers
Attached Images
File Type: png meshParts.png (11.8 KB, 95 views)
File Type: png couple_faces.png (7.7 KB, 93 views)
File Type: jpg undesired_Mesh.jpg (27.9 KB, 99 views)
Attached Files
File Type: zip stitchMesh_nonConformal.zip (6.0 KB, 10 views)

Last edited by Rango; November 10, 2020 at 07:43.
Rango is offline   Reply With Quote

Old   November 7, 2020, 19:59
Default
  #2
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7
Ship Designer is on a distinguished road
Hello Rango,

The result in the image looks fine to me. How else would you like to have the mesh? Also, if I remember correctly, the -perfect flag of stitchMesh can be applied if the outer edges of two faces are identical, regardless of their internal cell subdivision. Maybe just double check to be sure.

Cheers, Claudio
Ship Designer is offline   Reply With Quote

Old   November 7, 2020, 20:28
Default
  #3
New Member
 
Join Date: Jun 2020
Location: UK
Posts: 22
Rep Power: 6
Rango is on a distinguished road
Hi Claudio,

Many thanks for the swift response. Sorry, I should have been more clear on the point that how I would like the final mesh to be! The ideal result for me would be a mesh consists of only hexahedra cells with neat cubical shape! In other words, I want 'stitchMesh' to just fuse the shared patches without forming any new arbitrary cells at the interface.

Regarding the '-perfect' flag, I quote the message from 'stitchMesh' application:
"Note: both patches need to align perfectly. Both the vertex positions and the face centres need to align to within a tolerance given by the minimum edge length on the patch"

Last edited by Rango; November 10, 2020 at 16:57.
Rango is offline   Reply With Quote

Old   November 16, 2020, 22:44
Default
  #4
Senior Member
 
Claudio Boezio
Join Date: May 2020
Location: Europe
Posts: 137
Rep Power: 7
Ship Designer is on a distinguished road
Hello Rango,

I think you're right about using the -partial option with stitchMesh. Regarding the creation of cells at the joining face, this depends on the geometry and cells already present. Please bear in mind, that every vertex on one patch needs a corresponding vertex on the other. The choice of master and slave patch will determine which one will be left unchanged and which will undergo adaptation to match the master vertices. Thus, if the vertices don't match already (perfect condition, as you correctly said), introduction of modified cells is inevitable. For this, hex cells will be converted to polyhedrons if additional vertices are needed on an edge, but they will have two ore more coplanar faces. That's what you get e.g. when doing mesh refinements at the transition between levels. In the picture you sent, you want to connect four faces to one. Instead of making a polyhedron with four coplanar faces, stitchMesh chose to make four wedges instead. I don't think there's a way to influence this and it depends on the faces configurations you want to join. If you have only one patch to merge, you can also try with blockMesh and mergePatchPairs and see if there's a difference. But for the reasons I explained, you probably will have to accept at least one row of non-cubical cells. Is there a particular reason why the cube shape is important? As long as you don't get non-ortho cells or other quality issues it shouldn't be a problem. Please let me know how it goes please, thanks.


Cheers, Claudio
serles likes this.
Ship Designer is offline   Reply With Quote

Old   November 17, 2020, 04:29
Default
  #5
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Quote:
Originally Posted by Ship Designer View Post
Hello Rango,
Instead of making a polyhedron with four coplanar faces, stitchMesh chose to make four wedges instead.
Cheers, Claudio
I think the four wedges are an illusion/artifact caused by the option "Use VTK Polyhedron" in ParaView not being enabled.

checkMesh reports a polyhedral cell with 9 faces when I run the attached case.
Ship Designer and Rango like this.
GerhardHolzinger is offline   Reply With Quote

Old   November 23, 2020, 20:24
Default
  #6
New Member
 
Join Date: Jun 2020
Location: UK
Posts: 22
Rep Power: 6
Rango is on a distinguished road
Hi both,


Many thanks for your answers.

Quote:
Originally Posted by Ship Designer View Post
Is there a particular reason why the cube shape is important?
The cube shape per say does not matter really, however, I think it'd be nice to have the flexibility of creating non-conforming meshes (with hanging nodes!). They can have their own specific applications and come in handy some times.

Quote:
I think the four wedges are an illusion/artifact caused by the option "Use VTK Polyhedron" in ParaView not being enabled.
You are absolutely right. How silly of me! I should have unchecked the "Decompose polyhedra" option of Paraview, and obviously should have used "blockmesh" to check my mesh (lesson learned!).


Cheers
Rango is offline   Reply With Quote

Old   May 17, 2022, 08:49
Default
  #7
New Member
 
Emre
Join Date: Sep 2020
Posts: 7
Rep Power: 6
emrebnc is on a distinguished road
unchecking decompose polyhedra option corrects this
emrebnc is offline   Reply With Quote

Reply

Tags
non-conformal patches, stitchmesh


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
Problem using AMI vinz OpenFOAM Running, Solving & CFD 298 November 13, 2023 09:19
Possible bug with stitchMesh and cyclics in OpenFoam Jack001 OpenFOAM Pre-Processing 0 May 21, 2016 09:00
[mesh manipulation] Problem with stitchMesh: it does not work in meshes with several common patches arnau1985 OpenFOAM Meshing & Mesh Conversion 2 June 25, 2013 09:49
stitchMesh for uncongruent patches (stitch tolerance) beugold OpenFOAM 0 June 18, 2009 08:38


All times are GMT -4. The time now is 04:17.