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

[blockMesh] mergePatchPairs reducing a face to less than 3 points

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 2 Post By yasasvi.harishkumar
  • 5 Post By aow

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 31, 2018, 22:12
Default mergePatchPairs reducing a face to less than 3 points
  #1
aow
Member
 
Andrew O. Winter
Join Date: Aug 2015
Location: Seattle, WA, USA
Posts: 78
Rep Power: 11
aow is on a distinguished road
Hello CFD Online,

I'm running into issues with simple test cases of the mergePatchPairs functionality of the blockMesh utility using identically-sized blocks that have different meshes and trying different ways of organizing 2 - 4 of these blocks.

For instance, shown below is an image of a successful example for 3 blocks that works when I use the mergePatchPairs function of the the blockMesh utility (see the blockMeshDict text below the image).



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

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

convertToMeters 1;

x1  0.0;
x2  10.0;
x3  20.0;
y1  0.0;
y2  10.0;
y3  20.0;
z1  0.0;
z2  10.0;

vertices
(
	//block1
    ($x1  $y1  $z1)
	($x2  $y1  $z1)
	($x2  $y2  $z1)
	($x1  $y2  $z1)
	($x1  $y1  $z2)
	($x2  $y1  $z2)
	($x2  $y2  $z2)
	($x1  $y2  $z2)
	//block 2
	($x2  $y1  $z1)
	($x3  $y1  $z1)
	($x3  $y2  $z1)
	($x2  $y2  $z1)
	($x2  $y1  $z2)
	($x3  $y1  $z2)
	($x3  $y2  $z2)
	($x2  $y2  $z2)
	//block3
	($x1  $y2  $z1)
	($x2  $y2  $z1)
	($x2  $y3  $z1)
	($x1  $y3  $z1)
	($x1  $y2  $z2)
	($x2  $y2  $z2)
	($x2  $y3  $z2)
	($x1  $y3  $z2)
);

blocks          
(
    hex (0 1 2 3 4 5 6 7)  (10 10 10)  simpleGrading (1 1 1)
	hex (8 9 10 11 12 13 14 15) (20 20 20) simpleGrading (1 1 1)
	hex (16 17 18 19 20 21 22 23) (20 20 20) simpleGrading (1 1 1)
);

edges           
(
);

boundary
(
    inlet
    {
        type wall;
        faces
        (
            (0 4 7 3)
			(16 20 23 19)
        );
    }
    outlet
    {
        type wall;
        faces
        (
            (9 13 14 10)
        );
    }
	top
    {
        type wall;
        faces
        (
            (4 5 6 7)
			(12 13 14 15)
			(20 21 22 23)
        );
    }
    bottom
    {
        type wall;
        faces
        (
            (0 1 2 3)
			(8 9 10 11)
			(16 17 18 19)
        );
    }
    right
    {
        type wall;
        faces
        (
			(0 1 5 4)
			(8 9 13 12)
        );
    }
    left
    {
        type wall;
        faces
        (
			(19 18 22 23)
			(17 21 22 18)
			(11 10 14 15)
        );
    }
	interface1
	{
		type wall;
		faces
		(
			(1 5 6 2)
		);
	}
	interface2
	{
		type wall;
		faces
		(
			(8 12 15 11)
		);
	}
	interface3
	{
		type wall;
		faces
		(
			(3 2 6 7)
		);
	}
	interface4
	{
		type wall;
		faces
		(
			(16 17 21 20)
		);
	}
);

mergePatchPairs
(
	(interface1 interface2)
	(interface3 interface4)
);
// ************************************************************************* //
However, when I edit the blockMeshDict to include a 4th block (see text below) in the empty corner of the 3 block configuration and try to use the mergePatchPairs function again, I get the following error report (after the modified blockMeshDict).

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

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

convertToMeters 1;

x1 0.0;
x2 10.0;
x3 20.0;
y1 0.0;
y2 10.0;
y3 20.0;
z1 0.0;
z2 10.0;

vertices
(
	//block1
    ($x1 $y1 $z1)
	($x2 $y1 $z1)
	($x2 $y2 $z1)
	($x1 $y2 $z1)
	($x1 $y1 $z2)
	($x2 $y1 $z2)
	($x2 $y2 $z2)
	($x1 $y2 $z2)
	//block 2
	($x2 $y1 $z1)
	($x3 $y1 $z1)
	($x3 $y2 $z1)
	($x2 $y2 $z1)
	($x2 $y1 $z2)
	($x3 $y1 $z2)
	($x3 $y2 $z2)
	($x2 $y2 $z2)
	//block3
	($x1 $y2 $z1)
	($x2 $y2 $z1)
	($x2 $y3 $z1)
	($x1 $y3 $z1)
	($x1 $y2 $z2)
	($x2 $y2 $z2)
	($x2 $y3 $z2)
	($x1 $y3 $z2)
	//block4
	($x2 $y2 $z1)
	($x3 $y2 $z1)
	($x3 $y3 $z1)
	($x2 $y3 $z1)
	($x2 $y2 $z2)
	($x3 $y2 $z2)
	($x3 $y3 $z2)
	($x2 $y3 $z2)
);

blocks          
(
    hex (0 1 2 3 4 5 6 7)  (10 10 10)  simpleGrading (1 1 1)
	hex (8 9 10 11 12 13 14 15) (20 20 20) simpleGrading (1 1 1)
	hex (16 17 18 19 20 21 22 23) (20 20 20) simpleGrading (1 1 1)
	hex (24 25 26 27 28 29 30 31) (10 10 10) simpleGrading (1 1 1)
);

edges           
(
);

boundary
(
    inlet
    {
        type wall;
        faces
        (
            (0 4 7 3)
			(16 20 23 19)
        );
    }
    outlet
    {
        type wall;
        faces
        (
            (9 13 14 10)
			(25 29 30 26)
        );
    }
	top
    {
        type wall;
        faces
        (
            (4 5 6 7)
			(12 13 14 15)
			(20 21 22 23)
			(28 29 30 31)
        );
    }
    bottom
    {
        type wall;
        faces
        (
            (0 1 2 3)
			(8 9 10 11)
			(16 17 18 19)
			(24 25 26 27)
        );
    }
    right
    {
        type wall;
        faces
        (
			(0 1 5 4)
			(8 9 13 12)
        );
    }
    left
    {
        type wall;
        faces
        (
			(19 18 22 23)
			(27 26 30 31)
        );
    }
	master1
	{
        type wall;
        faces
        (
			(1 5 6 2)
        );
    }
	master2
	{
        type wall;
        faces
        (
			(3 2 6 7)
        );
    }
	master3
	{
        type wall;
        faces
        (
			(24 28 31 27)
        );
    }
	master4
	{
        type wall;
        faces
        (
			(24 25 29 28)
        );
    }
	slave1
	{
        type wall;
        faces
        (
			(8 12 15 11)
        );
    }
	slave2
	{
        type wall;
        faces
        (
			(16 17 21 20)
        );
    }
	slave3
	{
        type wall;
        faces
        (
			(17 21 22 18)
        );
    }
	slave4
	{
        type wall;
        faces
        (
			(11 10 14 15)
        );
    }
);

mergePatchPairs
(
	(master1 slave1)
	(master2 slave2)
	(master3 slave3)
	(master4 slave4)
);
// ************************************************************************* //
Error Report
Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  5.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 5.0
Exec   : blockMesh
Date   : May 31 2018
Time   : 17:45:08
Host   : "n0536"
PID    : 6021
I/O    : uncollated
Case   : /civil/shared/motley/andrew25/OpenFOAM/5.0/buildings/olaDyMFoam/May29/B0-S0-Unbroken/test2
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "/civil/shared/motley/andrew25/OpenFOAM/5.0/buildings/olaDyMFoam/May29/B0-S0-Unbroken/test2/system/blockMeshDict"
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches

Creating block mesh topology

Check topology

        Basic statistics
                Number of internal faces : 0
                Number of boundary faces : 24
                Number of defined boundary faces : 24
                Number of undefined boundary faces : 0
        Checking patch -> block consistency

Creating block offsets
Creating merge list .

Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1
    Block 0 cell size :
        i : 0.5 .. 0.5
        j : 0.5 .. 0.5
        k : 0.5 .. 0.5

    Block 1 cell size :
        i : 0.25 .. 0.25
        j : 0.25 .. 0.25
        k : 0.25 .. 0.25

    Block 2 cell size :
        i : 0.25 .. 0.25
        j : 0.25 .. 0.25
        k : 0.25 .. 0.25

    Block 3 cell size :
        i : 0.5 .. 0.5
        j : 0.5 .. 0.5
        k : 0.5 .. 0.5

Creating merge patch pairs

Adding point and face zones
Creating attachPolyTopoChanger


--> FOAM FATAL ERROR:
Face 56180 reduced to less than 3 points.  Topological/cutting error B.
Old face: 2(10612 11053) new face: 2(19853 21825)

    From function void Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const
    in file slidingInterface/coupleSlidingInterface.C at line 1768.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so"
#2  Foam::slidingInterface::coupleInterface(Foam::polyTopoChange&) const in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so"
#3  Foam::polyTopoChanger::topoChangeRequest() const in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so"
#4  Foam::polyTopoChanger::changeMesh(bool, bool, bool, bool) in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so"
#5  Foam::attachPolyTopoChanger::attach(bool) in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/lib/libdynamicMesh.so"
#6  ? in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/bin/blockMesh"
#7  __libc_start_main in "/lib64/libc.so.6"
#8  ? in "/gscratch/motley/shared/OpenFOAM500/OpenFOAM-5.0/platforms/linux64GccDPInt32Opt/bin/blockMesh"
Aborted
I believe it is caused by one of two things. First, I am suspicious of the master and slave patches being specified incorrectly. Second, I may be violating some rule for face merging since the error message I get states that a face has been reduced to less than 3 points (i.e. it becomes a line?), which probably comes from some incorrectly specified points for a face definition.

If anyone has any idea as to what happened, I would appreciate your assistance and insight very much!
aow is offline   Reply With Quote

Old   June 1, 2018, 05:28
Default
  #2
New Member
 
Yasasvi Harish Kumar
Join Date: May 2018
Posts: 4
Rep Power: 8
yasasvi.harishkumar is on a distinguished road
Hey,


I just took a quick look at your blockMeshDict and from what I can see, your slave1 and slave4 patch have two common vertices. But since you've already merged slave1, the vertices are a part of master1. That's why you have that error. Try using another set of vertices with the same coordinates for slave4.
aow and sourav90 like this.
yasasvi.harishkumar is offline   Reply With Quote

Old   June 1, 2018, 18:37
Default
  #3
aow
Member
 
Andrew O. Winter
Join Date: Aug 2015
Location: Seattle, WA, USA
Posts: 78
Rep Power: 11
aow is on a distinguished road
Hey Yasasvi,

I tried to play with adding even more nodes; however, I think that didn't work because I was using node numbers that were not actually associated with any of my hexes.

I don't see how you can avoid having to reuse existing nodes in a 4 block configuration where you have to stitch together the blocks in 4 places and the middle corners present the problem of needing to be used twice as you pointed out where I was using a slave face node more than once, which is of course impossible as you also pointed out.

Instead of trying to play with the node and hex configuration, I found that there is a stitchMesh command that I had not tried before, which was perfect for what I was wanting to achieve when trying to combine the 4 hexes in a square pattern.

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

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

convertToMeters 1;

x1 0.0;
x2 5.0;
x3 10.0;
y1 0.0;
y2 5.0;
y3 10.0;
z1 0.0;
z2 5.0;

vertices
(
	//block1
    ($x1 $y1 $z1)
	($x2 $y1 $z1)
	($x2 $y2 $z1)
	($x1 $y2 $z1)
	($x1 $y1 $z2)
	($x2 $y1 $z2)
	($x2 $y2 $z2)
	($x1 $y2 $z2)
	//block 2
	($x2 $y1 $z1)
	($x3 $y1 $z1)
	($x3 $y2 $z1)
	($x2 $y2 $z1)
	($x2 $y1 $z2)
	($x3 $y1 $z2)
	($x3 $y2 $z2)
	($x2 $y2 $z2)
	//block3
	($x1 $y2 $z1)
	($x2 $y2 $z1)
	($x2 $y3 $z1)
	($x1 $y3 $z1)
	($x1 $y2 $z2)
	($x2 $y2 $z2)
	($x2 $y3 $z2)
	($x1 $y3 $z2)
	//block4
	($x2 $y2 $z1)
	($x3 $y2 $z1)
	($x3 $y3 $z1)
	($x2 $y3 $z1)
	($x2 $y2 $z2)
	($x3 $y2 $z2)
	($x3 $y3 $z2)
	($x2 $y3 $z2)
	//duplicates
	($x2 $y2 $z1)
	($x2 $y2 $z2)
	($x2 $y2 $z1)
	($x2 $y2 $z2)
);

blocks          
(
    hex (0 1 2 3 4 5 6 7)  (10 10 10)  simpleGrading (1 1 1)
	hex (8 9 10 11 12 13 14 15) (20 20 20) simpleGrading (1 1 1)
	hex (16 17 18 19 20 21 22 23) (20 20 20) simpleGrading (1 1 1)
	hex (24 25 26 27 28 29 30 31) (10 10 10) simpleGrading (1 1 1)
);

edges           
(
);

boundary
(
    inletA
    {
        type wall;
        faces
        (
            (0 4 7 3)
        );
    }
	inletB
    {
        type wall;
        faces
        (
			(16 20 23 19)
        );
    }
    outletA
    {
        type wall;
        faces
        (
            (9 13 14 10)
        );
    }
	outletB
    {
        type wall;
        faces
        (
			(25 29 30 26)
        );
    }
	topA
    {
        type wall;
        faces
        (
            (4 5 6 7)
			(12 13 14 15)
        );
    }
	topB
    {
        type wall;
        faces
        (
			(20 21 22 23)
			(28 29 30 31)
        );
    }
    bottomA
    {
        type wall;
        faces
        (
            (0 1 2 3)
			(8 9 10 11)
        );
    }
	bottomB
    {
        type wall;
        faces
        (
			(16 17 18 19)
			(24 25 26 27)
        );
    }
	rightA
    {
        type wall;
        faces
        (
			(0 1 5 4)
			(8 9 13 12)
        );
    }
	rightB
    {
        type wall;
        faces
        (
			(16 17 21 20)
			(24 25 29 28)
        );
    }
	leftA
    {
        type wall;
        faces
        (
			(3 2 6 7)
			(11 10 14 15)
        );
    }
    leftB
    {
        type wall;
        faces
        (
			(19 18 22 23)
			(27 26 30 31)
        );
    }
	masterA
	{
        type wall;
        faces
        (
			(1 5 6 2)
        );
    }
	masterB
	{
        type wall;
        faces
        (
			(17 21 22 18)
        );
    }
	slaveA
	{
        type wall;
        faces
        (
			(8 12 15 11)
        );
    }
	slaveB
	{
        type wall;
        faces
        (
			(24 28 31 27)
        );
    }
);

mergePatchPairs
(
	(masterA slaveA)
	(masterB slaveB)
);
// ************************************************************************* //
After executing the blockMesh command, all 4 hexes were generated individually and then the mergePatchPairs function was used with 2 pairs of master and slave faces to produce 2 combined hexes. Then I executed the command "stitchMesh leftA rightB" to combine the 2 hexes along their intersecting faces and got the result shown below.



This result is exactly what I was hoping for and even though it was not achieved purely with the blockMesh command, it gets the job done perfectly and only requires 1 additional step using the stitchMesh command.

Thanks again for pointing me in the correct direction to understand why my initial approach would not work! If you know a way to do it with just blockMesh, I would love to know, but for now this is perfect.

Best regards,

Andrew
karamiag, granzer, dzordz and 2 others like this.
aow 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
[snappyHexMesh] Layers not growing at all zonda OpenFOAM Meshing & Mesh Conversion 12 June 6, 2020 12:28
[snappyHexMesh] SHM Layer Addition Phase dickcruz OpenFOAM Meshing & Mesh Conversion 4 November 1, 2018 08:05
sample utility of OF2.3.1 provides less points aCFDuser OpenFOAM Post-Processing 7 May 1, 2017 22:25
[snappyHexMesh] crash sHM H25E OpenFOAM Meshing & Mesh Conversion 11 November 10, 2014 12:27
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 05:15


All times are GMT -4. The time now is 15:40.