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

[mesh manipulation] Remove internal patch(es)

Register Blogs Community New Posts Updated Threads Search

Like Tree10Likes
  • 8 Post By stevenvanharen
  • 1 Post By prashant.A
  • 1 Post By SD@TUB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2011, 08:42
Default Remove internal patch(es)
  #1
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Dear FOAMers,

after searching the whole morning for an appropriate way to delete internal patches within this forum, i've decided to open a new thread according to this!
After chaining several grids together via mergeMeshes w/o stitchMesh, the associated interfaces will be left in the polyMesh description (e.g. boundary file). What would be the smartest procedure to remove them (just deleting the patches in the ./constant/polyMesh/boundary file isn't a good idea)? They aren't needed anymore, hence i don't want to specify a boundary condition for these internal patches!

Thanks in advance for helpful hints!
/Stefan
SD@TUB is offline   Reply With Quote

Old   January 19, 2011, 11:46
Default
  #2
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16
stevenvanharen is on a distinguished road
Just deleting is not a good idea. Just use stitchMesh.

After using stitchMesh you will see the boundaries are still present in the boundary file bu they will contain 0 faces. You can just delete them from this file in this case (don't forget to change the number of boundaries at the top of the boundary file).
PonchO, skeptik, yanxiang and 5 others like this.
stevenvanharen is offline   Reply With Quote

Old   January 20, 2011, 08:16
Default
  #3
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Thanks Steven,

but what about the following issue?
When joining two grids where the connecting interface is named equally, mergeMeshes will leave this interface in the boundary file. It is obvious that this patch will consist of several faces, points, etc. In this
case stitchMesh will not work, because the need of <masterPatch> and <slavePatch>. Selecting this interface for master and slave will cause an error:
Code:
--> FOAM FATAL ERROR:
Zero length edge detected. Probable projection error: slave patch probably does project onto master.
Is it possible to delete interfaces in the above-mentioned scenario?


/Stefan
BTW: I am using version 1.7.x !
SD@TUB is offline   Reply With Quote

Old   January 20, 2011, 08:36
Default
  #4
Senior Member
 
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16
stevenvanharen is on a distinguished road
I also had this problem.

I don't fully remember how I fixed it. I know I manually changed the names of the boundaries to not have two boundaries with the same name.

I think I did this before using mergeMeshes but I am not fully sure. But I suggest you try this.
stevenvanharen is offline   Reply With Quote

Old   January 20, 2011, 19:44
Default
  #5
New Member
 
Join Date: Dec 2010
Posts: 26
Rep Power: 15
prashant.A is on a distinguished road
Send a message via Skype™ to prashant.A
Well, its possible.
I would prefer stitchMesh, just because of the fact that mergeMeshes would also make one zone out of two which is sometimes not desired..

Remember a few things:

1. Before you "stitchMesh", move all the *Zones files to bak
2. After you have done "stitchMesh" successfully, a faceZone should appear with a name combination of the parts you have stitched. However, these bounday names still exist in the "boundary" file which need to be removed manually.
2. A new cellZone will be created, which you can conveniently ignore. Move cellZones.bak to cellZones so that you still have the different zone info intact in your mesh.
4. Run "checkMesh" once to ascertain that you followed all the steps correct !

Write back if you still see any issues...I hope I haven't missed anything in this regard.
DaveD! likes this.
prashant.A is offline   Reply With Quote

Old   January 21, 2011, 11:53
Default
  #6
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Terminating, stitchMesh plus removing the empty patches afterwards in the boundary file by hand seems to be the only way at the very least. The connecting interfaces from different grids have to be named differently! Thats a bit inconvenient. Maybe in future mergeMeshes would get an additionally option that simplify merging several grids.

/Stefan
SD@TUB is offline   Reply With Quote

Old   January 21, 2011, 13:42
Default
  #7
New Member
 
Join Date: Dec 2010
Posts: 26
Rep Power: 15
prashant.A is on a distinguished road
Send a message via Skype™ to prashant.A
Okay, I understand your problem. You can rename these interfaces in the boundary file itself, i.e. you need not go back to the mesher to be changed in the native format.
prashant.A is offline   Reply With Quote

Old   October 4, 2011, 23:05
Default
  #8
Member
 
HD
Join Date: Jul 2011
Posts: 56
Rep Power: 15
Rebecca513 is on a distinguished road
Hi Stefan,

I am also trying to use stitchMesh to remove internal faces. I used extrudeMesh first, then merged the extruded and original meshes. And now I need to remove the generated internal patches.

But I keep getting the error message saying that 'Duplicate point found in cut face'. I wonder how you used this utility.

Any comment and suggestion is appreciated.

Thank you!

Quote:
Originally Posted by SD@TUB View Post
Terminating, stitchMesh plus removing the empty patches afterwards in the boundary file by hand seems to be the only way at the very least. The connecting interfaces from different grids have to be named differently! Thats a bit inconvenient. Maybe in future mergeMeshes would get an additionally option that simplify merging several grids.

/Stefan
Rebecca513 is offline   Reply With Quote

Old   October 9, 2011, 07:09
Default
  #9
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
Hi Rebecca,

Did you use stitchMesh -perfect flag? I guess not from your posted error message...
You can use attachMesh for deleting internal faces after stitching (see if a file meshModifiers exist within constant/polyMesh directory.

Hope that helps!


Stefan
Liangyuan likes this.
SD@TUB is offline   Reply With Quote

Old   October 10, 2011, 12:41
Default
  #10
Member
 
HD
Join Date: Jul 2011
Posts: 56
Rep Power: 15
Rebecca513 is on a distinguished road
Hi Stefan,

Thank you for your reply. Yes I tried -perfect flag, then it works OK. Also, thank you for the suggestion on using attachMesh~But at this stage, it seems that after stitchMesh the faces become empty, and I could manually delete them.

Best,
Rebecca513 is offline   Reply With Quote

Old   March 2, 2012, 15:10
Default
  #11
Senior Member
 
Attesz's Avatar
 
Attesz
Join Date: Mar 2009
Location: Munich
Posts: 368
Rep Power: 17
Attesz is an unknown quantity at this point
Hi all,

I've problems with stitchMesh. I have 3 domains, with duplicate interfaces but the mesh points are coincident. When I want to stitch the interfaces using the -perfect option, i'm getting the following error message:

Quote:
--> FOAM FATAL ERROR:
Problem : Patch AMI_INROT1 starts at 33776699
Current face counter at 33704048
Are patches in incremental order?

From function polyTopoChange:olyTopoChange(const polyMesh& mesh, const bool strict)
in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 2459.

FOAM aborting
If I renumber the faces as it is said by OF, it seems to be working but why is it occurs?

Best,
Attila
__________________
I am doing CFD Consulting Services.
Ich biete CFD Strömungssimulationen an.
Attesz is offline   Reply With Quote

Old   March 23, 2012, 02:34
Default
  #12
Member
 
Elh. A2. BAH
Join Date: Jan 2012
Posts: 64
Rep Power: 14
ebah6 is on a distinguished road
Hello Attila,

I have a similar problem with pimpleDyMFoam.

-------------------------------------
--> FOAM FATAL ERROR:
Problem : Patch AMI1 starts at 1756182
Current face counter at 213326
Are patches in incremental order?

From function polyTopoChange:olyTopoChange(const polyMesh& mesh, const bool strict)
in file polyTopoChange/polyTopoChange/polyTopoChange.C at line 2459.

FOAM aborting
--------------------------

were you able to solve this problem?

Thanks for you help.
ebah6 is offline   Reply With Quote

Old   March 23, 2012, 04:30
Default
  #13
Member
 
Elh. A2. BAH
Join Date: Jan 2012
Posts: 64
Rep Power: 14
ebah6 is on a distinguished road
Hello everyone,

I think my problem is coming from the fact that snappyHexMesh is creating patches with nFaces=0 as below:

-----------------
blenderBlades
{
type wall;
nFaces 0;
startFace 211046;
}
blenderAMI
{
type wall;
nFaces 0;
startFace 211046;
}
-----------------------------

can someone help with this issue?
Thank in advance; any help is greatly appreciated.
ebah6 is offline   Reply With Quote

Old   March 23, 2012, 10:47
Default
  #14
Senior Member
 
Attesz's Avatar
 
Attesz
Join Date: Mar 2009
Location: Munich
Posts: 368
Rep Power: 17
Attesz is an unknown quantity at this point
Hi I generated the mesh in ICEM CFD, using 1 common face as internal patch. Then, I exported the stator and rotor parts separately. After that I used the fluent3DMeshToFoam app to convert it to OF format, and then I did mergeMeshes to put them together. Now it works fine. You need two patches at the same position, or you should cut your mesh there. Also it is possible for you to generate your mesh separately with snappy and then merge them.
__________________
I am doing CFD Consulting Services.
Ich biete CFD Strömungssimulationen an.
Attesz is offline   Reply With Quote

Old   May 17, 2012, 12:49
Default
  #15
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
ebah6:

If you are running your case based on a modification of the propeller tutorial, you need to adjust the starting faces for both AMI faces of the boundary file prior to running createBaffles. This is mandatory and unfortunately not taken care of by the tutorial, which will thus only work for the specific mesh given.

You can automate this process by running a command right before changeDictionary. Or if you use snappyHexMesh in a similar fashion than in the tutorial, automate the process by modifying the Allrun.pre file as follows,

Code:
# - create the inlet/outlet patches

runApplication createPatch -overwrite

# - fix the startFace value in changeDictionaryDict

AMI_startFace=`cat log.snappyHexMesh|grep "Snapped mesh"|sed s/^.*faces://|sed s/"  points.*$"//`
sed -i s/"startFace       0;"/"startFace       $AMI_startFace;"/g system/changeDictionaryDict

# - create the AMI faces by creating baffles, and then splitting the mesh

runApplication changeDictionary
(Notice that my changeDictionaryDict file initially has both startValue = 0; I think this should be added to the tutorial...


-Louis

Last edited by louisgag; May 17, 2012 at 17:59.
louisgag is offline   Reply With Quote

Old   May 17, 2012, 16:01
Default
  #16
Member
 
Elh. A2. BAH
Join Date: Jan 2012
Posts: 64
Rep Power: 14
ebah6 is on a distinguished road
Thanks Louis.
ebah6 is offline   Reply With Quote

Old   January 31, 2018, 17:43
Default
  #17
New Member
 
Sam
Join Date: Nov 2017
Posts: 24
Rep Power: 9
anufagbemi is on a distinguished road
Dear foamers,
I am performing a fluid structure interaction problem in a porous media from McT images which consists of both the solid and fluid domains. Where the solid is just an inversion of the fluid domain. I'm trying to mesh objects based on stl files by using snappyHexMesh as follows:

1. blockMesh operation
2. snappyHexMesh operation
3. SplitMeshRegions -cellZones -overwrite

Unfortunately some fragments form. I can't delete the fragments because they help ensure conformity at the interface. Otherwise I'll be having a "Master point Addressing" problem. You can find my preProcessing case file here https://yadi.sk/d/yXwpAv8_3Ry3W7
If you observe in the FLUID "boundary" file I'm supposed to just have the inlet, outlet, wall and interface conditions but there is an extra patch represents the fragments named "Out"
Code:
5
(
    Out
    {
        type            patch;
        nFaces          322;
        startFace       1101291;
    }
    inlet
    {
        type            patch;
        nFaces          8889;
        startFace       1101613;
    }
    outlet
    {
        type            wall;
        inGroups        1(wall);
        nFaces          6859;
        startFace       1110502;
    }
    wall
    {
        type            wall;
        inGroups        1(wall);
        nFaces          23046;
        startFace       1117361;
    }
    domain0_to_SOLID
    {
        type            mappedWall;
        inGroups        1(wall);
        nFaces          148834;
        startFace       1140407;
        sampleMode      nearestPatchFace;
        sampleRegion    SOLID;
        samplePatch     SOLID_to_domain0;
    }
)
And similar for the SOLID folder.

I've tried to stitch those fragments using both stitchMesh and stitchMesh -partial, but none seemed to be working.

Please can anyone help or show me another method to achieve this?

Thanks
Samuel

Last edited by anufagbemi; January 31, 2018 at 20:16.
anufagbemi is offline   Reply With Quote

Old   June 20, 2019, 14:05
Default
  #18
New Member
 
Varun Gadre
Join Date: Jun 2019
Posts: 2
Rep Power: 0
VarunG is on a distinguished road
Dear Attesz,



Can you please explain how did you renumber the faces ?




Thank you
Varun

Last edited by VarunG; June 20, 2019 at 14:07. Reason: Did not mention name
VarunG is offline   Reply With Quote

Reply

Tags
interface, internal, patch, remove


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
Cyclic boundary condition on SALOME mesh kandelabr OpenFOAM Pre-Processing 17 March 8, 2024 05:14
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
[snappyHexMesh] On which patches to set BC's for snappyHexMesh ? Talder OpenFOAM Meshing & Mesh Conversion 0 November 8, 2015 19:25
Regarding periodic BC in ICEM generated grid Tarak OpenFOAM 32 April 30, 2013 15:46
Internal Patches : Which boundary conditions? Gearb0x OpenFOAM Running, Solving & CFD 4 April 21, 2010 15:26


All times are GMT -4. The time now is 13:41.