|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 13 ![]() |
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: ![]() 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) ); // ************************************************** *********************** // |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Mar 2011
Posts: 174
Rep Power: 14 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 13 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Mar 2011
Posts: 174
Rep Power: 14 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Join Date: Mar 2011
Posts: 174
Rep Power: 14 ![]() |
Did you finally make any progress on that?
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Peter Hauer
Join Date: Feb 2012
Posts: 3
Rep Power: 13 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Andreas Christl
Join Date: Mar 2009
Location: Cottbus, Brandenburg, Germany
Posts: 3
Rep Power: 16 ![]() |
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! |
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Sean Peterson
Join Date: May 2012
Posts: 2
Rep Power: 0 ![]() |
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 Last edited by sdpeterson; August 10, 2012 at 10:19. |
|
![]() |
![]() |
![]() |
![]() |
#9 |
New Member
Pol Pap
Join Date: Nov 2013
Posts: 5
Rep Power: 11 ![]() |
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) ); |
|
![]() |
![]() |
![]() |
![]() |
#10 | |
New Member
Jue Wang
Join Date: Apr 2014
Posts: 22
Rep Power: 10 ![]() |
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:
|
||
![]() |
![]() |
![]() |
![]() |
#11 |
New Member
Filippo
Join Date: May 2014
Posts: 27
Rep Power: 10 ![]() |
Hi Joe,
have you managed how to set up the boundary conditions of master and slave patches in "0" folder? Thank you, FS |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Jue Wang
Join Date: Apr 2014
Posts: 22
Rep Power: 10 ![]() |
||
![]() |
![]() |
![]() |
Tags |
blockmesh, mergepatchpairs |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 05:23 |
[ICEM] Problems with coedge curves and surfaces | tommymoose | ANSYS Meshing & Geometry | 6 | December 1, 2020 12:12 |
[mesh manipulation] mergePatchPairs with multiple areas | bjoern1 | OpenFOAM Meshing & Mesh Conversion | 1 | October 1, 2015 08:07 |
some problems about mergepatchpairs | hei@ge | OpenFOAM | 0 | November 28, 2011 07:14 |
Needed Benchmark Problems for FSI | Mechstud | Main CFD Forum | 4 | July 26, 2011 13:13 |