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

[blockMesh] MergePatchPairs within 2 pipes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2011, 06:34
Default MergePatchPairs within 2 pipes
  #1
Member
 
Rob
Join Date: Sep 2011
Posts: 55
Rep Power: 14
robbirobocop is on a distinguished road
Hello everybody, I'm trying to build a Mesh on 2 pipes, where one vertical pipe cuts the horizontal one. The Mesh actually works fine but the mergePatchPairs adjustment does not. I picked the horizontal one to be the master. But actually OpenFoam does it visa versa and rather stretches the vertical pipe instead of shortening it.

Any help or hints will be appreciated.

Enclosed you'll find the code.

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

convertToMeters 1;

vertices        
(

    /*horizontal pipe = 1*/   
   
    (0 0 -0.75)
    (0 -0.02598 -0.75)
    (0 -0.05 -0.75)    
    (0.0225 -0.0225 -0.75)
    (0.02598 0 -0.75)
    (0.0225 0.0225 -0.75)
    (0 0.02598 -0.75)
    (0.03535 -0.03535 -0.75)
    (0.05 0 -0.75)
    (0.03535 0.03535 -0.75)
    (0 0.05 -0.75)
    (0 0 0.75)
    (0 -0.02598 0.75)
    (0 -0.05 0.75)    
    (0.0225 -0.0225 0.75)
    (0.02598 0 0.75)
    (0.0225 0.0225 0.75)
    (0 0.02598 0.75)
    (0.03535 -0.03535 0.75)
    (0.05 0 0.75)
    (0.03535 0.03535 0.75)
    (0 0.05 0.75) 

    /*vertical pipe = 2*/ 

    (0 0 0)
    (0 0 -0.01299)
    (0 0 -0.025)    
    (0.01125 0 -0.01125)
    (0.01299 0 0)
    (0.01125 0 0.01125)
    (0 0 0.01299)
    (0.017175 0 -0.017175)
    (0.025 0 0)
    (0.017175 0 0.017175)
    (0 0 0.025)
    (0 0.3 0)
    (0 0.3 -0.01299)
    (0 0.3 -0.025)    
    (0.01125 0.3 -0.01125)
    (0.01299 0.3 0)
    (0.01125 0.3 0.01125)
    (0 0.3 0.01299)
    (0.017175 0.3 -0.017175)
    (0.025 0.3 0)
    (0.017175 0.3 0.017175)
    (0 0.3 0.025)

);

blocks          
(
 
    /*horizontal pipe = 1*/  
 
    hex (0 1 3 4 11 12 14 15) (5 5 5) simpleGrading (1 1 1)
    hex (1 2 7 3 12 13 18 14) (5 5 5) simpleGrading (1 1 1)
    hex (3 7 8 4 14 18 19 15) (5 5 5) simpleGrading (1 1 1)
    hex (4 8 9 5 15 19 20 16) (5 5 5) simpleGrading (1 1 1)
    hex (5 9 10 6 16 20 21 17) (5 5 5) simpleGrading (1 1 1)
    hex (0 4 5 6 11 15 16 17) (5 5 5) simpleGrading (1 1 1)

    /*vertical pipe = 2*/ 

    hex (22 23 25 26 33 34 36 37) (5 5 5) simpleGrading (1 1 1)
    hex (23 24 29 25 34 35 40 36) (5 5 5) simpleGrading (1 1 1)
    hex (25 29 30 26 36 40 41 37) (5 5 5) simpleGrading (1 1 1)
    hex (26 30 31 27 37 41 42 38) (5 5 5) simpleGrading (1 1 1)
    hex (27 31 32 28 38 42 43 39) (5 5 5) simpleGrading (1 1 1)
    hex (22 26 27 28 33 37 38 39) (5 5 5) simpleGrading (1 1 1)

);

edges           
(

    /*horizontal pipe = 1*/ 

    arc 2 7 (0.01710 -0.04698 -0.75)   
    arc 8 7 (0.04698 -0.01710 -0.75) 
    arc 8 9 (0.04698 0.01710 -0.75)
    arc 10 9 (0.01710 0.04698 -0.75) 
    arc 13 18 (0.01710 -0.04698 0.75)   
    arc 19 18 (0.04698 -0.01710 0.75) 
    arc 19 20 (0.04698 0.01710 0.75)
    arc 21 20 (0.01710 0.04698 0.75) 

    /*vertical pipe = 2*/ 

    arc 24 29 (0.00855 0 -0.02349) 
    arc 30 29 (0.02349 0 -0.00855)
    arc 30 31 (0.02349 0 0.00855)
    arc 32 31 (0.00855 0 0.02349)
    arc 35 40 (0.00855 0.3 -0.02349)  
    arc 41 40 (0.02349 0.3 -0.00855)
    arc 41 42 (0.02349 0.3 0.00855)
    arc 43 42 (0.00855 0.3 0.02349)

);

boundary
(

    outlet1 
    {
        type wall;
        faces
        (
            (0 4 3 1)
        (1 3 7 2)
        (3 4 8 7)
            (4 5 9 8)
        (5 6 10 9)
        (0 6 5 4)
        );
    }

   outlet2 
    {
        type wall;
        faces
        (
            (22 26 25 23)
        (23 25 29 24)
        (25 26 30 29)
            (26 27 31 30)
        (27 28 32 31)
        (22 28 27 26)
        );
    }

    inlet1 
    {
        type wall;
        faces
        (
            (11 15 14 12)
        (12 14 18 13)
        (14 15 19 18)
            (15 16 20 19)
        (16 17 21 20)
        (11 17 16 15)
        );
    }

    inlet2 
    {
        type wall;
        faces
        (
            (33 37 36 34)
        (34 36 40 35)
        (36 37 41 40)
            (37 38 42 41)
        (38 39 43 42)
        (33 39 38 37)
        );
    }

    leftWall1
    {
        type symmetryPlane;
        faces
        (
            (0 11 17 6)
            (6 17 21 10)
            (2 13 12 1)
            (1 12 11 0)
        );
    }

    leftWall2
    {
        type symmetryPlane;
        faces
        (
            (22 33 39 28)
            (28 39 43 32)
            (24 35 34 23)
            (23 34 33 22)
        );
    }

    rightWall1 
    {
        type wall;
        faces
        (
            (2 13 18 7)
            (7 18 19 8)
            (8 19 20 9)
            (9 20 21 10)
        );
    }

    rightWall2 
    {
        type wall;
        faces
        (
            (24 35 40 29)
            (29 40 41 30)
            (30 41 42 31)
            (31 42 43 32)
        );
    }
);

mergePatchPairs 
(

    (rightWall1 outlet2)
);

// ************************************************************************* //
robbirobocop is offline   Reply With Quote

Old   September 22, 2011, 17:07
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Rob,

it will not work this way. On the one hand the two pipes are not allowed to penetrate each other, on the other hand the contact surface between them must be exact.

It is possible to mesh your geometry with blockMesh, but it will be a really big effort.

You can use Salome for meshing these pipes.

Martin
MartinB is offline   Reply With Quote

Old   October 7, 2011, 04:54
Default
  #3
Member
 
Rob
Join Date: Sep 2011
Posts: 55
Rep Power: 14
robbirobocop is on a distinguished road
Hi Martin,

I finally got Salome and was working hard to get those two pipes connected.
Getting the geometries is not that hard. But unfortunately my mesh is not good.

The problem is that vertices of one pipe are in volumes of others.
In order to get the vertices projected on the second pipe I played around with the "Cut" commands. But when I do that I get more and more errors. And the Repair functions won't help on that one.

So maybe you have an idea of what to do to get a "good" mesh.
In order to avoid sharp angles, I created cuboids inside the pipes.
One mesh/geometry version is attached.

It would be very kind if you could help me out once again.
Of course if someone else has a hint, I would appreciate that aswell.
Attached Files
File Type: gz TPipe.py.tar.gz (3.4 KB, 8 views)
robbirobocop is offline   Reply With Quote

Old   October 7, 2011, 05:39
Default
  #4
Member
 
Rob
Join Date: Sep 2011
Posts: 55
Rep Power: 14
robbirobocop is on a distinguished road
Oh well, although I used "Dump Study" to put out the .py file. It seems that the Mesh is not loaded. But you just have to do the "Create Mesh" on "Compound 3" 3D Hexaeder and that's it.
robbirobocop is offline   Reply With Quote

Old   October 7, 2011, 18:54
Default
  #5
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Rob,

here are some comments... first of all: congratulations to your already gained experience in Salome!

If you want to keep your strategy (which would work in the end), you must rethink the block structure at the intersection of your two pipes. The topology must be correct here, too, so many more blocks are necessary. The smaller pipe's blocks must "penetrate" the bigger pipe, and the bigger pipe must form a "hole" around these blocks...

Ah, instead of providing the python dump you should save the study in .hdf format, I think.

Another way to get a cute mesh is this:
To keep things simple you only need Cylinder_1 and Cylinder_2 of your entities. Use the Operations->Boolean->Fuse operation to fuse them into one solid object. Explode the faces from this Fuse_1 object and name the faces like "inlet", "outlet", "wall" etc.

Then switch to the Meshing module and use the "Assign a set of hypothesis" function with "3D automatic Tetrahedralization" strategy. Use a global size of 7.5 or even smaller and compute the mesh.

Use the Mesh->Create Groups from Geometry function, and select the faces you exploded in the Geometry module.

Export the tetra mesh in .UNV format.

Use ideasUnvToFoam to convert the mesh. You will get a fine tetrahedral mesh, which will work fine. However you can improve it (and reduce the computational time, too) by converting it to a polyDualMesh:
polyDualMesh 75 -doNotPreserveFaceZones -concaveMultiCells -overwrite

You may want to transform your mesh to meters before starting the simulation with:
transformPoints -scale "(0.001 0.001 0.001)"

If you provide your email (via board mail) I can send you the intermediate steps.

Martin
Attached Images
File Type: jpg mesh_polyhedra.jpg (57.2 KB, 44 views)
File Type: jpg salome_screenshot.jpg (49.7 KB, 37 views)
MartinB is offline   Reply With Quote

Old   October 8, 2011, 02:59
Default
  #6
Member
 
Rob
Join Date: Sep 2011
Posts: 55
Rep Power: 14
robbirobocop is on a distinguished road
Hi Martin,

first of all: I sent you my email via board mail.

I tried to upload the .hdf file, but since its size is more than 1 MegaByte, it is not allowed to do so. Thus, I uploaded the .py file

Quote:
Originally Posted by MartinB View Post
If you want to keep your strategy (which would work in the end), you must rethink the block structure at the intersection of your two pipes. The topology must be correct here, too, so many more blocks are necessary. The smaller pipe's blocks must "penetrate" the bigger pipe, and the bigger pipe must form a "hole" around these blocks...
That did not work, I tried multiple ways to do so. But did not figure out a good "penetration" for the mesh.

Your ("other") way seems to work quite good. I want a hexahedral mesh by the way, but that won't be a great problem. That was also the reason why I had put some cuboids into the pipe.

I already did a mesh conversion to OpenFOAM for a simple pipe (with boundary i.e. inlet, wall...), so at least this works for me for now ^^ But don't worry, I'll stay patient. Because with every step you go further, CFD is more fun to work with.

It would be very kind of you if you would send me the intermediate steps. I guess integrating the cuboids won't be a big problem then. Therefor, would you make two Partitions of the Cylinder_1 & Hexahedral_Solid_1 and of course Cylinder_2 & Hexahedral_Solid_2 and then "Fuse" those two Partitions to finally do the other steps you said?

Rob
robbirobocop 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
[Other] Mesh and simulation two unconnected pipes pangasio OpenFOAM Meshing & Mesh Conversion 1 October 5, 2018 01:49
[blockMesh] mergePatchPairs reducing a face to less than 3 points aow OpenFOAM Meshing & Mesh Conversion 2 June 1, 2018 17:37
[mesh manipulation] mergePatchPairs with multiple areas bjoern1 OpenFOAM Meshing & Mesh Conversion 1 October 1, 2015 07:07
Flow around pipes - heat transfer coefficient on the wall of pipe doodek Main CFD Forum 2 November 23, 2009 08:48
cylindrical pipes Ben Siemens 4 June 16, 2004 11:25


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