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

[blockMesh] Problems using mergePatchPairs

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2012, 18:57
Default Problems using mergePatchPairs
  #1
New Member
 
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 14
Peter83 is on a distinguished road
Hi there,

I am new user of OpenFOAM and managed to simulate simple 2D cases, like a flow in a single channel, so far. Now I am trying to build a little bit more complex geometries using blockMesh.

I want to start easy and so I just tried to build a geometry consisting of two rectangular blocks of different size and mesh. On the left of the big block there should be the inlet, on the right of the small block should be the outlet. The other sides are either walls or empty (see below). Like I read in the user manual, I can use mergePatchPairs to do so. Unfortunately the mesh I get looks not exactly like I want it. Why do these diagonal cells appear (see attached pictures)? They disappear if the meshsize of the two blocks are the same.

I also get this warning when running blockMesh:

Default patch type set to empty
--> FOAM Warning :
From function polyMesh:olyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 888
Found 10 undefined faces in mesh; adding to default patch.

and this fatal error when running icoFoam after:

--> FOAM FATAL IO ERROR:
keyword interface2 is undefined in dictionary "/home/phauer/OpenFOAM/phauer-2.1.0/run/tutorials/incompressible/icoFoam/2Dpore_paper/0/p::boundaryField"

Why should I define the pressure on interface2? I defined it already as zeroGradient on fixedwalls.

I know, it's not a very challenging geometry and the actual case I try to simulate is more complex, but if I can't even bring this to run ...

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1e-03;

vertices
( //block1
(-10 -5 0)
(0 -5 0)
(0 5 0)
(-10 5 0)
(-10 -5 1)
(0 -5 1)
(0 5 1)
(-10 5 1)
//block2
(-10 -50 0)
(-10 50 0)
(-50 50 0)
(-50 -50 0)
(-10 -50 1)
(-10 50 1)
(-50 50 1)
(-50 -50 1)
);

blocks
(
hex (0 1 2 3 4 5 6 7) (30 10 1) simpleGrading (1 1 1)
hex (11 8 9 10 15 12 13 14) (50 50 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
inlet
{
type patch;
faces
(
(10 11 15 14)
);
}

outlet
{
type patch;
faces
(
(1 5 6 2)
);
}

fixedWalls
{
type wall;
faces
(
(2 3 7 6)
(0 1 5 4)
(9 10 14 13)
(8 12 15 11)
(8 9 13 12)
);
}

frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
(8 11 10 9)
);
}
);

patches
(
patch master
(
(0 4 7 3)
)

patch slave
(
(8 9 13 12)
)
);

mergePatchPairs
(
(master slave)
);

// ************************************************** *********************** //
Attached Images
File Type: jpg Merging2Blocks.jpg (75.6 KB, 246 views)
File Type: jpg Merging2Blocks_detail.jpg (69.0 KB, 254 views)
Peter83 is offline   Reply With Quote

Old   February 14, 2012, 03:45
Default
  #2
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
Good morning

About the diagonal lines:
They are non-hexagonal cells, created to avoid "hanging nodes".

Are you sure you are using this blockMeshDict?
The warning message about the undefined faces is that you have not declared them in boundary section of blockMeshDict, but you seem to have declared everything.
Also, you have no surface called "interface2" here. You should define in the 0 directory files all the entries of the "boundaries" section.
anon_a is offline   Reply With Quote

Old   February 14, 2012, 22:56
Default
  #3
New Member
 
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 14
Peter83 is on a distinguished road
Thanks very much for your answer!

That's good that I don't have to worry about the diagonal cells. And you are right, I renamed the patches and posted the wrong error message.
This is the right one:

--> FOAM FATAL IO ERROR:
keyword slave is undefined in dictionary "/home/phauer/OpenFOAM/phauer-2.1.0/run/tutorials/incompressible/icoFoam/2Dpore_paper_xx/0/p::boundaryField"

I don't really understand, why I should define the patches I want to merge in the 0 file. It's just an interface between two blocks where I can't really define a boundary condition. Where should I define the master and slave patch? They are also not declared in the boundary section of blockMeshDict because they are not a boundary in my understanding, or am I completely wrong?
Thats my 0/P file so far.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0.01;
}

outlet
{
type fixedValue;
value uniform;
}

fixedWalls
{
type zeroGradient;
}

frontAndBack
{
type empty;
}
}

// ************************************************** *********************** //

Thanks again for your quick answer!

Peter
Peter83 is offline   Reply With Quote

Old   February 15, 2012, 17:27
Default
  #4
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
I think that the last time I used this "mergePatchPairs" functionality, I declared both "master" and "slave" in the "boundary" section (I don't know about "patches", is this in 2.1?). Then, you don't have to specify slave in the 0 directory but off course the master boundary patch remains and you have to give a BC.

I hope that helps.
anon_a is offline   Reply With Quote

Old   February 20, 2012, 08:16
Default
  #5
Disabled
 
Join Date: Mar 2011
Posts: 174
Rep Power: 15
anon_a is on a distinguished road
Did you finally make any progress on that?
anon_a is offline   Reply With Quote

Old   February 20, 2012, 19:48
Default
  #6
New Member
 
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 14
Peter83 is on a distinguished road
Hi,

Didn't made any progress with the merging. Seems that works different in 2.1. than in older versions.

However, I could manage to simulate my geometry by dividing the big block in three blocks and match the blocks instead of merging them. It works, but its not ideal as I can only match blocks with the same mesh size at the interface now.
If you have any idea how to match blocks with different mesh sizes (I guess that doesn't make much sense in most cases), please let me know.

Thanks very much!

Peter
Peter83 is offline   Reply With Quote

Old   May 30, 2012, 11:05
Default mergePatchPairs
  #7
New Member
 
Andreas Christl
Join Date: Mar 2009
Location: Cottbus, Brandenburg, Germany
Posts: 3
Rep Power: 17
andy is on a distinguished road
Hi FOAMers,

i tried to patch two cylinders (axis: 1 0 0 & 0 1 0) on a main cylindric system (axis: 0 0 1). I knew it would be difficult to patch these curvy patches with mergePatchPairs. But i never expected struggling for weeks. When I was sure that there was no mistake in my meshCalcultionScript I was looking for other reasons. One of many, many ideas was to check all available OF-versions.
Finally it turned out that only OpenFOAM-1.7.0 does the job. All other versions (i tested 1.5 - 2.x, included OpenFOAM-1.7.1) aborted blockMesh with error messages.
I would be delighted if someone tells me the different of mergeMatchPairs in OF170.
I guess there exist other tolerances. Finally I want to underline that merging rectangular patches together is no problem for all OF versions.

bye then!
andy is offline   Reply With Quote

Old   August 9, 2012, 18:12
Default Any solutions to merging yet?
  #8
New Member
 
Sean Peterson
Join Date: May 2012
Posts: 2
Rep Power: 0
sdpeterson is on a distinguished road
Hello,

I'm trying to do roughly the same thing as in the original post and have not had any success (using 2.x). I've found several posts of people dealing with this issue, but haven't come across a good solution yet. I'm using OpenFOAM on a cluster where I'm not the admin, so getting other versions of OF is difficult (as suggested above). Has anyone had success merging meshes in 2.x, and if so, could you post a description of the steps? In my case, the interface I need to merge needs to be considered internal, thus having to supply a boundary condition to a face that should be internal is not acceptable, for obvious reasons. For reference, a simplified version of my blockMeshDict is below. Any help is much appreciated.

Best regards,
Sean
Attached Files
File Type: txt blockMeshDict.txt (2.0 KB, 73 views)

Last edited by sdpeterson; August 10, 2012 at 09:19.
sdpeterson is offline   Reply With Quote

Old   December 31, 2013, 09:20
Default
  #9
New Member
 
Pol Pap
Join Date: Nov 2013
Posts: 5
Rep Power: 12
zatralias is on a distinguished road
This worked for me in OF 2.1.0

I defined master and slave in the 'boundary' section setting them to type 'patch', and then merge them in the 'mergePatchPairs' section. I don't have a 'patches' section.
e.g. in the above blockMeshDict
...
boundary
(
...
master
{
type patch;
faces
(
(2 6 5 1)
);
}

slave
{
type patch;
faces
(
(15 11 8 12)
);
}
);

mergePatchPairs
(
(master slave)
);
zatralias is offline   Reply With Quote

Old   June 27, 2014, 00:22
Default
  #10
New Member
 
Jue Wang
Join Date: Apr 2014
Posts: 23
Rep Power: 12
Joe Wang is on a distinguished road
Hi,
I also did it in your ways. But how to set up the boundary conditions of master and slave patches in "0" folder? Thanks.

Joe

Quote:
Originally Posted by zatralias View Post
This worked for me in OF 2.1.0

I defined master and slave in the 'boundary' section setting them to type 'patch', and then merge them in the 'mergePatchPairs' section. I don't have a 'patches' section.
e.g. in the above blockMeshDict
...
boundary
(
...
master
{
type patch;
faces
(
(2 6 5 1)
);
}

slave
{
type patch;
faces
(
(15 11 8 12)
);
}
);

mergePatchPairs
(
(master slave)
);
Joe Wang is offline   Reply With Quote

Old   November 18, 2014, 10:50
Default
  #11
New Member
 
Filippo
Join Date: May 2014
Posts: 27
Rep Power: 11
fs.chemech is on a distinguished road
Hi Joe,

have you managed how to set up the boundary conditions of master and slave patches in "0" folder?

Thank you,

FS
fs.chemech is offline   Reply With Quote

Old   November 19, 2014, 02:34
Default
  #12
New Member
 
Jue Wang
Join Date: Apr 2014
Posts: 23
Rep Power: 12
Joe Wang is on a distinguished road
Hi,
I just set the master and slave patches parameters with the same value of internalField.
Joe

Quote:
Originally Posted by fs.chemech View Post
Hi Joe,

have you managed how to set up the boundary conditions of master and slave patches in "0" folder?

Thank you,

FS
Joe Wang is offline   Reply With Quote

Reply

Tags
blockmesh, mergepatchpairs

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] mergePatchPairs problem when migrating from OFext1.6 to OFext3.1 ma-tri-x OpenFOAM Meshing & Mesh Conversion 2 January 12, 2021 04:23
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 11:12
[mesh manipulation] mergePatchPairs with multiple areas bjoern1 OpenFOAM Meshing & Mesh Conversion 1 October 1, 2015 07:07
some problems about mergepatchpairs hei@ge OpenFOAM 0 November 28, 2011 06:14
Needed Benchmark Problems for FSI Mechstud Main CFD Forum 4 July 26, 2011 12:13


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