CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

MergeMesh and stitchMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 18, 2008, 10:16
Default Hi everybody, I would like
  #1
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi everybody,

I would like merge 2 meshes into 1 meshes. Both interface patches are circular and for both meshes geometrically equal (the have both 160 faces).

Merging:

mergeMeshes . rootCase . addCase

works ok, but using stitchMesh I am not able to put the interface patch of both meshes in the interior.....I just did:

stitchMesh . newCase interface2 interface1

The result is a number of faces for interface1 becomes 0 and for interface2 the number of faces becomes 320 (the sum of both...)

What am I doing wrong? Any ideas? It should be simple to put two meshes together....

Regards, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 18, 2008, 17:37
Default Heya guys, Not altogether
  #2
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Heya guys,

Not altogether please :-)

How do I get rid of the internal patches, after using mergeMeshes....It is possible with stitchMesh, right?

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 18, 2008, 18:00
Default Hi, Have you tried the -per
  #3
Member
 
Jason Dale
Join Date: Mar 2009
Location: UK
Posts: 80
Rep Power: 17
jason is on a distinguished road
Hi,

Have you tried the -perfect flag?

I don't think mergeMeshes actually joins two meshes together, ie - it doesn't merge the vertices/points into one single point.

I have used stitchMesh and that does actually 'merge' them together, take a look/view the the patches in paraFoam.

Admittedly, when it does work, it works really well, especially in blockMesh (see the mergePatchPairs bit at the end), Ive tried this with tet meshes but there is either some problems here and there or I was doing it wrong, probably the latter (from what I have read on here, there is a limit on the number of master/slave pairs, eg if you have 10 slave cells you cannot 'stich' them to 1 master cell. The limit seems to be 2 or 3 slave cells...but dont quote me on that) and also, tet quality seems to be an issue.

Im not at my desk for a couple of days but when I get back Ill find a case that does work and one that doesn't and try and post them on here. If you can post your case, it might help.

Jason
jason is offline   Reply With Quote

Old   February 18, 2008, 20:08
Default Hi, Frank, I have used merg
  #4
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi, Frank,

I have used mergeMeshes and stitMesh quite a few times.

OF-1.4.1 seemed to have changed how stitchMesh works. I posted on this topic before. Please search the forum for stitchMesh. If you still have problem, you can contact me.

Pei
phsieh2005@yahoo.com
hsieh is offline   Reply With Quote

Old   February 19, 2008, 04:23
Default Hi again :-) The perfect f
  #5
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi again :-)

The perfect flag does not work, since the points on the 'interface' are not matching. Here is a picture of both meshes merged with mergeMeshes:



So, the merging is successfull, but I can't get rid of both 'interfaces' from the two meshes......I tried different settings with stitchMesh, with one of the following resuls:
1) Nothing happens,
2) interface1 (160 faces) is summed to interface2 (160 faces), leaving interface1 with 0 patches and interface2 with 320.
3) Same as (2), but other way around.

Here are the rootCase and the addCase:





Thanks, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 04:27
Default Hi again :-) The perfect f
  #6
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi again :-)

The perfect flag does not work, since the points on the 'interface' are not matching. Here is a picture of both meshes merged with mergeMeshes:



So, the merging is successfull, but I can't get rid of both 'interfaces' from the two meshes......I tried different settings with stitchMesh, with one of the following resuls:
1) Nothing happens,
2) interface1 (160 faces) is summed to interface2 (160 faces), leaving interface1 with 0 patches and interface2 with 320.
3) Same as (2), but other way around.

Here are the rootCase and the addCase:
http://www.aero.lr.tudelft.nl/~frank/files/rootCase.tgz
http://www.aero.lr.tudelft.nl/~frank/files/addCase.tgz

Thanks, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 11:03
Default Hi, Frank, If the nodes on
  #7
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi, Frank,

If the nodes on the two interfaces do not match, then, I am not sure stitchMesh can work.

Pei
hsieh is offline   Reply With Quote

Old   February 19, 2008, 11:28
Default I thought that it should alway
  #8
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
I thought that it should always work, and when the points on both interfaces do match, they call it -perfect. And when the surfaces do not match, they call it -partial....

Could it be the case that I need to increase the number of points on both interfaces such that they will match better, geometrically ???

Anyone else?

Regards, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 11:28
Default It should work. When I tried i
  #9
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
It should work. When I tried it, I used two faces with the same area but with different discretizations, and stitchMesh created polihedral cells at the interface.
Maybe tomorrow I'll try your case, Frank.

Dragos
dmoroian is offline   Reply With Quote

Old   February 19, 2008, 11:40
Default No, it should just work - it i
  #10
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
No, it should just work - it is basically a static sliding interface that gets merged and thrown away.

Mesh resolution, type of cells etc does not make any difference, you just have to make sure the sliding interface is defined properly.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 19, 2008, 11:49
Default mergeMeshes worked beautifully
  #11
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
mergeMeshes worked beautifully, a layer of polyhedrals in inserted at the interface.

So now I have a completely valid new mesh, but with 2 interface patches which I want to get rid off :-(

So, merging: no problem! but wiping interface patches doesn't work....

Hrv, for this test, I don't want to define a sliding interface (that's one of my other interest), the merging is just a way to easily create a mesh with a very nice spherical innerMesh, which will be moved with the wing using setValues() :-)

Regards,
Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 11:58
Default How's this: Go to the bound
  #12
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
How's this:

Go to the boundary file and delete the little bastards - there should be no faces in the anyway (right?).

Hrv
basecase likes this.
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 19, 2008, 12:20
Default Off course, if it contains no
  #13
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Off course, if it contains no faces, I can simply remove it from the list. The problem is the after running stitchMesh, interface1 contains 0 faces, but interface2 contains twice as many (interface1 has 'consumed' interface1).....

I want to get rid of both interface patches, otherwise I have to specify the BCs on that internal patch, which I don't like.....

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 17:03
Default Hi again, Wiping both inte
  #14
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi again,

Wiping both interfaces with stitchMesh works for merging of 2 squares:



Here, the 2 interfaces (in the middle) contain 0 faces after stitching, the way it should be!

Could it be the case that for my previous case with 2 circular interfaces, those interfaces are not geometrically equal enough ??

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 19, 2008, 18:50
Default Just check them visibly - what
  #15
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Just check them visibly - what kind of intersection are you using. How come it couples my mixer vessel and it does not do your mesh? Is it a 1-cell slice + are you matching the edges. Have a look at it sideways...

It will be some simple, because as you can see the code is OK.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 19, 2008, 19:13
Default The interface is just two circ
  #16
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
The interface is just two circular patches with different point distributions. I haven't defined anything as sliding, slice or whatever. Just did "mergeMeshes . rootCase . addCase" with 1 mesh and 2 interface patches as a result.

When I zoom in, the different point distribution leads to both interface patches not to be geometrically lying on top of eachother.

You're right, it will be simple, possibly something with my setup, but I don't see it :-) Maybe, getting some sleep might help ;-)

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 20, 2008, 04:07
Default I know precisely what you did.
  #17
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
I know precisely what you did. The side of interface2 is wider than that of interface1 by more than a tolerance of x percent of minimum edge size. As a result, you will get internal faces from the overlapping part AND the remaining facets will remain in the boundary patch of interface2.

Do a picture showing faces in patches interface1 and interface2 in different colours before the coupling and after the coupling and post them here.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   February 20, 2008, 06:42
Default I was also thinking about that
  #18
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
I was also thinking about that. Here's a picture of the 2 interface patches before using stitchMesh:



The following picture shows the mesh at the interface after stitching, including on patch with the size of the sum of both old patches...... This is probably due to the reason mentioned by Hrv...



Now I will try a much denser point distribution on both initial patches, that should solve the problem, right? To me, the tolerance of stitchMesh is not that small, why?

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 20, 2008, 07:02
Default I put a lot of point refinemen
  #19
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
I put a lot of point refinement on the initial patches --> without success :-( the same problem arises: one interface with 0 size and one interface with doubled size.....

I use the grid converter fluentMeshToFoam, maybe it writes the faces of both interface in the wrong order or so, I don't know, I will test blockMesh.....

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 20, 2008, 07:15
Default Are you using integral match,
  #20
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33
hjasak will become famous soon enough
Are you using integral match, which adjusts for the boundary or partial match which does not. If you want correction, you should be using integral match.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply


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
[blockMesh] StitchMesh on two patches anita OpenFOAM Meshing & Mesh Conversion 31 April 4, 2013 12:51
[mesh manipulation] MergeMeshes and stitchMesh problem flo OpenFOAM Meshing & Mesh Conversion 6 May 10, 2010 11:40
StitchMesh on OF15 error any fix flo OpenFOAM Bugs 0 August 20, 2008 11:27
[mesh manipulation] Using stitchMesh for two pairs of patches kati OpenFOAM Meshing & Mesh Conversion 4 May 24, 2006 03:04


All times are GMT -4. The time now is 22:18.