# [blockMesh] defining and connecting two circular pipes using blockMesh

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

 July 29, 2013, 11:42 defining and connecting two circular pipes using blockMesh #1 Member   Hale Join Date: May 2013 Posts: 53 Rep Power: 11 Hi, I'm having trouble in defining two circular pipes that are connected with an angle of 90 degrees using blockMesh. Is there any tutorials or any example that shows how to define such a L-shaped circular pipe in openfoam? thanks alot

July 29, 2013, 18:22
#2
Member

Yosmcer Mocktai
Join Date: Apr 2013
Location: Behind a computer
Posts: 50
Rep Power: 15
You can make this with a block and some edges.

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

convertToMeters 1;

vertices
(
(0 1.292893219 0.707106781)//0
(0 2.707106781 0.707106781)//1
(0 2.707106781 -0.707106781)//2
(0 1.292893219 -0.707106781)//3
(2.707106781 0 0.707106781)//4
(1.292893219 0 0.707106781)//5
(1.292893219 0 -0.707106781)//6
(2.707106781 0 -0.707106781)//7
);

blocks
(
hex (5 4 7 6 0 1 2 3) (50 50 50) simpleGrading (1 1 1)
);

edges
(
arc 0 1 (0 2 1)
arc 1 2 (0 3 0)
arc 2 3 (0 2 -1)
arc 3 0 (0 1 0)

arc 4 5 (2 0 1)
arc 5 6 (1 0 0)
arc 6 7 (2 0 -1)
arc 7 4 (3 0 0)

arc 0 5 (0.914213563 0.914213563 0.707106781)
arc 3 6 (0.914213563 0.914213563 -0.707106781)
arc 1 4 (1.914213562 1.914213562 0.707106781)
arc 2 7 (1.914213562 1.914213562 -0.707106781)
);

boundary
(

);

mergePatchPairs
(
);

// ************************************************** *********************** /```
or

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

convertToMeters 1;

vertices
(
(0 1 0)//0
(0 2 1)//1
(0 3 0)//2
(0 2 -1)//3
(3 0 0)//4
(2 0 1)//5
(1 0 0)//6
(2 0 -1)//7
);

blocks
(
hex (5 4 7 6 1 2 3 0) (50 50 50) simpleGrading (1 1 1)
);

edges
(
arc 0 1 (0 1.292893219 0.707106781)
arc 1 2 (0 2.707106781 0.707106781)
arc 2 3 (0 2.707106781 -0.707106781)
arc 3 0 (0 1.292893219 -0.707106781)

arc 4 5 (2.707106781 0 0.707106781)
arc 5 6 (1.292893219 0 0.707106781)
arc 6 7 (1.292893219 0 -0.707106781)
arc 7 4 (2.707106781 0 -0.707106781)

arc 0 6 (0.707106781 0.707106781 0)
arc 1 5 (1.414213562 1.414213562 1)
arc 2 4 (2.121320344 2.121320344 0)
arc 3 7 (1.414213562 1.414213562 -1)
);

boundary
(

);

mergePatchPairs
(
);

// ************************************************** *********************** //```
Theses two edge pipe are are quite similar, but depending of how you made the pipes you want to connect, you may prefer one way to the other.

Theses case are quite general with pipes of radius 1 and small curve radius to 1 too (you may need to not have this curve).
Attached Images
 img.jpg (21.8 KB, 144 views) img2.jpg (12.5 KB, 97 views) imgsec.jpg (22.1 KB, 119 views) imgsec2.jpg (14.2 KB, 100 views)

Last edited by Yosmcer; July 30, 2013 at 05:48.

 July 30, 2013, 06:43 #3 Member   Hale Join Date: May 2013 Posts: 53 Rep Power: 11 Thank you very much Yosmcer. It was a great help Would you please tell me how you calculated the arc midpionts?

 July 30, 2013, 11:52 #4 Member   Yosmcer Mocktai Join Date: Apr 2013 Location: Behind a computer Posts: 50 Rep Power: 15 I used the Pythagoras theorem with the simplified fact that the triangles were isosceles. So basically, for a radius circle (hypotenuse) of 1, I have sqrt(2)/2. For more general shapes, you can use trigonometry. ramakant and m.b. like this.

 July 31, 2013, 08:10 #5 Member   Hale Join Date: May 2013 Posts: 53 Rep Power: 11 Thanks you very much for the explanation.