CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   cubic mesh (https://www.cfd-online.com/Forums/openfoam/102957-cubic-mesh.html)

 ofslcm June 7, 2012 05:04

cubic mesh

1 Attachment(s)
Hi,

I'm trying to mesh a sphere with blockMesh. I would like to have a mesh with hexahedral cells, so the solution of my problem is to construct a cubic sphere.

I found in many papers that many users of OpenFOAM employ this kind of mesh configuration. However, I don't know how to construct this mesh in my sphere using blockMesh. Could you help me, please?

Thanks!!!

In the following link you'll find an image of a cubic sphere.

 anon_a June 7, 2012 05:34

If you understand how to do it for a cylinder (for some ideas and the main concept check the web page below)

http://www.cfd-online.com/Forums/ope...nder-mesh.html

then you can also do it for a sphere. Just replace the middle rectangle with a cube and the rest of the parts with their 3D equivalent.

 ofslcm June 8, 2012 05:48

Thank you. Now the problem is that I don't know how to define a spherical element in 3D. It means: I can define two arcs for the front and back surfaces, however I cannot join such surfaces with an arc as well, since In blockMesh you cannot define the union of these elements. Any suggestion?

Thank you

 anon_a June 8, 2012 06:52

Quote:
 Thank you. Now the problem is that I don't know how to define a spherical element in 3D. It means: I can define two arcs for the front and back surfaces, however I cannot join such surfaces with an arc as well, since In blockMesh you cannot define the union of these elements. Any suggestion?
I am not sure I understand what you mean. Which are the front and back surfaces that you mention? What union must take place? It would be best to show your difficulties in a figure, with letters on the surfaces or some other way to describe it.

In order to construct this, I would
- build a cube
- build other similar cubes attached on each of its faces
- adjust the dimensions of the outer cubes (--> hexahedrals) so that their outer vertices are on the sphere radius and they touch each other (you should have a large hexahedral at this point)
- convert the outer edges to arcs and you are finished. The 3D outer elements should be similar to 1/6th of a sphere (well, minus the middle cube).

Alternatively, you can try SALOME to make your mesh.

 ofslcm June 10, 2012 07:03

Thank you.

What I mean is that if I have an hexahedron, i define:
1) points 1,2,3,4,5,6,7,8 (the front face is composed by 1 2 3 4 and the back by 5 6 7 8)
2)surface hex(1 2 3 4 5 6 7 8)

If I have a 3D curvilinear surface between points 3,4, 5 and 6 I can define an arc on the front surface and on the back surface in the following way:

arc (3 4)
arc(5 6)

But how can I define the arc between 4,5 and between 3 6?

If I define
arc(4 5)
arc(3 6)

blockMesh is not working....

Thanks!

 anon_a June 10, 2012 07:05

The one that is not working.
I can check this for you but I can not start from zero.

 ofslcm June 11, 2012 05:39

It seems that I did something wrong, but now everything is working. Thank you for your help!

 ofslcm June 11, 2012 08:24

Hi,

I'm using blockMesh and I have a problem with the connectivities of my mesh. I've defined 2 different dominies but paraFoam seems not to properly connect them. Could you help me with this error please?

This is my blockMeshDict

vertices
(
(-7.2175 -7.2175 7.2175) //point 0
(7.2175 -7.2175 7.2175) //point 1
(7.2175 7.2175 7.2175) //point 2
(-7.2175 7.2175 7.2175) //point 3
(-36.0875 -36.0875 36.0875)//point 4
(36.0875 -36.0875 36.0875)//point 5
(36.0875 36.0875 36.0875)//point6
(-36.0875 36.0875 36.0875)//point7
(-72.1750 -72.1750 72.1750) //point 8
(72.1750 -72.1750 72.1750) //point 9
(72.1750 72.1750 72.1750) //point 10
(-72.1750 72.1750 72.1750) //point 11
(-8.8387 -8.8387 0) //point 12
(8.8387 -8.8387 0) //point13
(-44.1937 -44.1937 0) //point14
(44.1937 -44.1937 0) //point15
(-88.3875 -88.3875 0)//point 16
(88.3875 -88.3875 0)//Point 17
);

blocks
(
hex (0 1 2 3 4 5 6 7) (10 10 20) simpleGrading (1 1 1) //Block 0
hex (4 5 6 7 8 9 10 11) (10 10 10) simpleGrading (1 1 1) //Block 1
hex (0 1 13 12 4 5 15 14) (10 10 20) simpleGrading (1 1 1) //Block 2
hex (4 5 15 14 8 9 17 16) (10 10 10) simpleGrading (1 1 1) //Block 3
);

 anon_a June 11, 2012 08:44

You should always pay attention to the warning messages of OpenFOAM.
One of your volumes is defined inside-out (therefore it appears black in paraFoam).
The corresponding sequence of vertex numbers in the hex block declaration is in the wrong order.