CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

stitchMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2011, 10:52
Default stitchMesh
  #1
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Hi Foamers,

I am having some problems with stitchMesh utility. May be could suggest me a correct or a better way.

I am having 5 different geometries, which are to be meshed independently, and then merged together. i generate these geometries in Salome 6.0 and then export it as .stl files to be meshed by sHM. Now, say that I have patch 1 in geometry 1 and patch 2 in geometry 2 which are to be merged and stitched. Since these must be identical patches, I have a single .stl file for both these patches, that I use it in both the geometries. After the sHM has been done, I find that they are not exactly the same, but there is an overlap. So, when i use stitchMesh (I have tried the -perfect flag, the -partial flag and without any flag and these are the results of stitchMesh without any flag, as the other two threw some errors), i do not get both nFaces for both as 0, but some faces are left in the patches. How can I avoid this situation?

I am attaching the figures below of the patches to be stitched and the mesh after it is stitched
Attached Images
File Type: jpg patch1.jpg (38.7 KB, 121 views)
File Type: jpg patch2.jpg (40.1 KB, 104 views)
File Type: jpg aftermergemesh.jpg (50.9 KB, 111 views)
File Type: jpg leftofpatch1.jpg (10.9 KB, 87 views)
File Type: jpg leftofpatch2.jpg (10.6 KB, 71 views)
dhruv is offline   Reply With Quote

Old   October 15, 2011, 04:18
Default
  #2
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 259
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
Hi dhruv,

why don't you generate the meshes with shM, then use mergeMesh to merge them, and then stitch patches? I've described this for a very simple case here:

How to handle internal patches for p,T,U

Let me know if this is of any help...

Best regards,
Tomislav
tomislav_maric is offline   Reply With Quote

Old   October 17, 2011, 02:35
Default stitchMesh
  #3
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Hi Tomislav,

I had checked your post earlier, and this is exactly what I did. I just made the geometry in Salome, and generate the mesh in Snappy. However, when I stitchMesh between the two patches, there are always some residual faces. Although, they are few in number, I guess it would not be correct to delete them altogether.

Quote:
Originally Posted by tomislav_maric View Post
Hi dhruv,

why don't you generate the meshes with shM, then use mergeMesh to merge them, and then stitch patches? I've described this for a very simple case here:

How to handle internal patches for p,T,U

Let me know if this is of any help...

Best regards,
Tomislav
dhruv is offline   Reply With Quote

Old   October 17, 2011, 02:42
Default
  #4
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
I haven't checked whether this has already been mentioned: You could have a look at stitchMeshToleranceDict, e.g. the one attached (remove the .txt), which has to be put in the constant folder and controls whether points on the boundary patch are moved for stitching.

Arne
Attached Files
File Type: txt stitchMeshToleranceDict.txt (1.2 KB, 301 views)
Arnoldinho is offline   Reply With Quote

Old   October 17, 2011, 03:13
Default
  #5
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 259
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
Quote:
Originally Posted by dhruv View Post
Hi Tomislav,

I had checked your post earlier, and this is exactly what I did. I just made the geometry in Salome, and generate the mesh in Snappy. However, when I stitchMesh between the two patches, there are always some residual faces. Although, they are few in number, I guess it would not be correct to delete them altogether.
Hm....

have you tried the build compound mesh option in salome? This way you can merge the meshes before exporting them to .stl, and have multiple merged stl surfaces. If you do this, the internal overlapping patches should be gone (through the compounding) and shm can mesh the interior....

Check this out:

http://docs.salome-platform.org/salo...unds_page.html

The algorithm should allow for compounds without 3D algorithms, and even if it does not, if I remember correctly, exporting to .stl will only export the surface mesh anyway.

Tomislav
tomislav_maric is offline   Reply With Quote

Old   October 17, 2011, 07:10
Default stitchToleranceDict
  #6
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Quote:
Originally Posted by Arnoldinho View Post
I haven't checked whether this has already been mentioned: You could have a look at stitchMeshToleranceDict, e.g. the one attached (remove the .txt), which has to be put in the constant folder and controls whether points on the boundary patch are moved for stitching.

Arne
Hello Arnoldinho,

Thanks for your reply. I did what you said, and placed the file in case/constant folder but it seems that the file is not being read by stitchMesh. I am attaching here the logfile for stitchMesh. I did not make any changes to your file. Do I have to provide any other changes to the file, to make it working (like case name, or the path, etc. ). Moreover, these values suggest that there is a default stitchToleranceDict file located somewhere. How can I find that?

Quote:
Coupling patches geo_wallsfan and geo_wallsfan1
Resulting (internal) faces will be in faceZone geo_wallsfangeo_wallsfan1CutFaceZone

Note: the overall area covered by both patches should be identical ("integral" interface).
If this is not the case use the -partial option


Adding pointZone geo_wallsfangeo_wallsfan1CutPointZone at index 0
Adding faceZone geo_wallsfangeo_wallsfan1MasterZone at index 0
Adding faceZone geo_wallsfangeo_wallsfan1SlaveZone at index 1
Adding faceZone geo_wallsfangeo_wallsfan1CutFaceZone at index 2
Sliding interface parameters:
pointMergeTol : 0.05
edgeMergeTol : 0.01
nFacesPerSlaveEdge : 5
edgeFaceEscapeLimit : 10
integralAdjTol : 0.05
edgeMasterCatchFraction : 0.4
edgeCoPlanarTol : 0.8
edgeEndCutoffTol : 0.0001
Regards,
Dhruv
dhruv is offline   Reply With Quote

Old   October 18, 2011, 07:07
Default
  #7
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi Druv,

indeed, the command has an addition, e.g.

Quote:
stitchMesh -overwrite -toleranceDict stitchMeshToleranceDict st ts
with "-overwrite" overwriting the current time step, "-toleranceDict stitchMeshToleranceDict" giving the command and name, "st ts" are the patches.
Also, you might need to make some adjustments in the dict to see some changes in your case.

Arne
Arnoldinho is offline   Reply With Quote

Old   October 19, 2011, 07:07
Default stitchMeshToleranceDict
  #8
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Hi Arnoldinho,

Thanks for the reply. I tried running my case with the new stitchMeshToleranceDict. However, the results are still bad. One of the patches gets stitched nicely (6 faces still remains as residual, but its better that 120 faces previously), however, the other one shows no effect. (190 and 200 faces as residual in the two patches). I tried a range of values for the different entries, but the effect is quite negligible in the second case. I am not able to understand, whether it is the problem due to Salome or OpenFoam. I tried to model my surface in a different way in Salome, however the results are pretty much the same. I am now confused how to proceed further

Quote:
Originally Posted by Arnoldinho View Post
Hi Druv,

indeed, the command has an addition, e.g.

with "-overwrite" overwriting the current time step, "-toleranceDict stitchMeshToleranceDict" giving the command and name, "st ts" are the patches.
Also, you might need to make some adjustments in the dict to see some changes in your case.

Arne
dhruv is offline   Reply With Quote

Old   October 24, 2011, 03:10
Default
  #9
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Hi dhruv,

when using stitchMesh, you have to make sure that all of your patches get stitched (number of faces on the previous patches must be zero in the boundary file), a reduced number does not help you. Otherwise the solver will crash somewhen. You also have to make sure that your patches have (exactly) the same dimensions in x, y and z.

I tried a very (very) long time using Salome meshes, also in combination with engrid meshes for the boundary layer. Even after mergeMeshes and stitchMesh have worked, the results were very bad! Therefore, I changed back to sHM, which really works nice! The new 2.0 version seems to have edge mapping now, so it might be worth trying it!

Arne

Last edited by Arnoldinho; October 24, 2011 at 04:42.
Arnoldinho is offline   Reply With Quote

Old   October 25, 2011, 06:00
Default
  #10
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Hi Arne,

The problem is that I am using a mesh which has been generated in sHM using the edge feature of OF 2.0. I create only the geometry in Salome. Then, i export it as .stl in OF, and mesh it with sHM. Everything is exact till I do the meshing. After the meshing, the two adjacent faces (which are to be merged and stitched together), which have even the same .stl file for two cases, doesn't come out exactly the same.

Quote:
Originally Posted by Arnoldinho View Post
Hi dhruv,

when using stitchMesh, you have to make sure that all of your patches get stitched (number of faces on the previous patches must be zero in the boundary file), a reduced number does not help you. Otherwise the solver will crash somewhen. You also have to make sure that your patches have (exactly) the same dimensions in x, y and z.

I tried a very (very) long time using Salome meshes, also in combination with engrid meshes for the boundary layer. Even after mergeMeshes and stitchMesh have worked, the results were very bad! Therefore, I changed back to sHM, which really works nice! The new 2.0 version seems to have edge mapping now, so it might be worth trying it!

Arne
dhruv is offline   Reply With Quote

Old   October 25, 2011, 06:08
Default
  #11
Senior Member
 
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 8
Arnoldinho is on a distinguished road
Sorry, but then I don't get what you are doing... Using sHM and an .stl file e.g. to 'cut out' things from a surrounding mesh, creates only one mesh. Where are the others coming from? Can you upload a case including the meshes that you want to merge?

Arne
Arnoldinho is offline   Reply With Quote

Old   October 27, 2011, 04:51
Default Got it!!
  #12
Member
 
supercommandodhruv
Join Date: Sep 2011
Posts: 57
Rep Power: 5
dhruv is on a distinguished road
Hi Arne,

sorry for the late reply. I got all things in order, after modifying the stitchMeshToleranceDict several times. Thanks for the advice. I am however concerned that I had to do a lot of manipulations, for a relatively simple geometry, and one set of conditions were not enough to do the stitch for different faces.

Regards,

dhruv.

Quote:
Originally Posted by Arnoldinho View Post
Sorry, but then I don't get what you are doing... Using sHM and an .stl file e.g. to 'cut out' things from a surrounding mesh, creates only one mesh. Where are the others coming from? Can you upload a case including the meshes that you want to merge?

Arne
dhruv is offline   Reply With Quote

Old   October 27, 2011, 04:54
Default
  #13
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 259
Blog Entries: 5
Rep Power: 11
tomislav_maric is on a distinguished road
Hi,

I'm curious, why don't you use the compound mesh in Salome, since you are already using it to generate STLs for the shm, and feed the compounded stl surface to shm thus avoiding having to stitch the patches in the first place?

T.
tomislav_maric is offline   Reply With Quote

Old   February 23, 2012, 18:14
Default
  #14
New Member
 
tanzil tjhin
Join Date: Jan 2012
Posts: 4
Rep Power: 5
tanzil is on a distinguished road
Hello,

I also have a problem with stitchMesh and it could be related to this thread. Im working about flow simulation on a Tunnel and making my mesh purely with OF. Since i have a large number of cells, i managed to split the calculation area in two parts. The big box contains purely of hexaedra and will be generated with blockMesh. The small box located in the middle of the big box and contains the Object, that completely meshed with snappyHexMesh (exclusive the layer). Merging both boxes works well and stitching the patches at time directories 0 and time step 1 are fine. Issue is im not able to stitch patches with my latest meshtime directory. The geometry dimensions are identic and i've tried all flags from stitchMesh. Two different Errors occurs depend on the flag and they are:

- Zero length edge detected. Probable projection error: slave patch probably
does not project onto master.
- Points on patch sides do not match to within tolerance 2.561e-06 (this one
with -perfect)

I've played around with the toleranceDict but also without success. Indeed i found out in paraview that my slavepatch deviate from my masterpatch line when i enough zoom in. As you can see in the picture, the red line display the slavepatch, while the white one the masterpatch.

I dont understand why stitchMesh works fine before snapping procedure or why this small different line appear after snapping stage? Have anyone encounter such problem? Any reply is welcome
Attached Images
File Type: jpg zoomOut.jpg (100.6 KB, 49 views)
File Type: jpg zoomIn.JPG (12.7 KB, 48 views)
tanzil is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
stitchMesh and mergeMeshes removal of interfaces flowris OpenFOAM Mesh Utilities 6 July 16, 2010 12:06
stitchMesh marine OpenFOAM Mesh Utilities 1 April 27, 2010 10:59
Change in triangle::intersection breaks stitchMesh in 1.5 and 1.6 gschaider OpenFOAM Bugs 7 February 12, 2010 10:21
stitchMesh for uncongruent patches (stitch tolerance) beugold OpenFOAM 0 June 18, 2009 07:38
StitchMesh on OF15 error any fix flo OpenFOAM Bugs 0 August 20, 2008 10:27


All times are GMT -4. The time now is 23:27.