CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (http://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   Number of cells in each direction (http://www.cfd-online.com/Forums/openfoam-meshing/106830-number-cells-each-direction.html)

IvanaS September 10, 2012 08:27

Number of cells in each direction
 
Hi,

I am trying to couple Fortran code with ReactingFoam. For this I need to extract number of cells in each direction.

Could someone please tell me if that's possible to do? And if yes, how?

Also, is it somehow possible to extract data from OpenFoam in form u(i,j,k), for example in case of velocity?

Thank you very much.

Regards,

Ivana

McCarra October 25, 2012 11:57

Hey Ivana,

Do you create the mesh using blockMesh? Then you can check (and modify) the number of cells you have in each direction in your mesh in constant/polyMesh/blockMeshDict. Check this.

And you can check all your vector variables in the form (Ux, Uy, Uz) at each time saved. Go to the folder of the time you want, for example 0.4 and open the file with the name of your variable, U for example.
If you want the values for a specific point you can use a probe. Then you can check this.

IvanaS April 16, 2013 05:22

Hi,

Thanks for your reply and sorry for my vary late answer, I was away.

I do use blockMesh. I know that you can modify number of cells in each direction and things are very simple when you have one block. But what confuses me is what happens when you have several blocks, something like this:
blocks
(
hex (0 1 2 3 4 5 6 7) (8 160 8) simpleGrading (1 1 1)//0
hex (8 0 3 11 9 4 7 10) (8 160 8) simpleGrading (1 1 1)//1
hex (1 12 15 2 5 13 14 6) (8 160 8) simpleGrading (1 1 1)//2
hex (4 5 6 7 9 13 14 10) (8 160 8) simpleGrading (1 1 1)//3
hex (8 12 15 11 0 1 2 3) (8 160 8) simpleGrading (1 1 1)//4
hex (16 8 11 19 17 9 10 18) (24 160 8) simpleGrading (0.333 1 1)//5
hex (12 20 23 15 13 21 22 14) (24 160 8) simpleGrading (3 1 1)//6
hex (9 13 14 10 17 21 22 18) (8 160 24) simpleGrading (1 1 3)//7
hex (16 20 23 19 8 12 15 11) (8 160 24) simpleGrading (1 1 0.333)//8
);

How do you then determine total number of cells in each direction?

Regarding the velocity field, I don't want to read velocity field from the file because I need it in my FORTRAN code at every time step but I would rather like to pass it on a fly. Do you maybe have some suggestion how to do that?

Thank you very much!

Best regards,

I.

McCarra April 16, 2013 06:05

Hey,

I would say that in that case the number of cells in each direction is the sum of cells of each block. I dont know other ways of figuring that out without working block by block.

I am afraid I cannot help you with the passing of the velocity to your FORTRAN code.

Good luck ;)


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