CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] defining and connecting two circular pipes using blockMesh (https://www.cfd-online.com/Forums/openfoam-meshing/121461-defining-connecting-two-circular-pipes-using-blockmesh.html)

Hale July 29, 2013 10:42

defining and connecting two circular pipes using blockMesh
 
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

Yosmcer July 29, 2013 17:22

4 Attachment(s)
You can make this with a block and some edges.
Here are two examples I just made. You can copy it and adapt to your needs:

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).

Hale July 30, 2013 05:43

Thank you very much Yosmcer. It was a great help :) Would you please tell me how you calculated the arc midpionts?

Yosmcer July 30, 2013 10:52

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.

http://pascal.cormier.free.fr/uploads/1203703306.jpg

Hale July 31, 2013 07:10

Thanks you very much for the explanation.


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