CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Help Me, what's the Cell Above any given cell in 3D. (https://www.cfd-online.com/Forums/main/92336-help-me-whats-cell-above-any-given-cell-3d.html)

gomane8 September 10, 2011 19:17

Help Me, what's the Cell Above any given cell in 3D.
 
Hi evryone!
iam writing an UDF and iam bloked in.
i Have a small problem ( isn't small for me)!!
i have a Cell in 3D domaine (any given Cell)!! i wana to get the cell just above it!
i know in 3D domaine there is about 20 cells around my Cell (the cell is chosen just like that in 3d domaine), so what is the instruction that can give me the Cell just abouve my cell.
i have found some instruction to give the faces of any given Cell!
but i wana to Get the cell Above mine in the Z direction!!
any Help is very apreciated

gomane8 September 11, 2011 14:26

i still waiting!
 
i am waiting for any instruction, and in the same time iam looking by my self to resolve my problm, so if i find the answer i will put it here!!!!
A+

otd September 11, 2011 21:10

Short answer:
The z-direction cell stacks are consecutively indexed in the k index

cell center coordinates are as follows for cell (i,j,k) and cell(i,j,k+1):

so cell (i,j,k) -> x(i), y(j), z(k)
and cell (i,j,k+1) -> x(i), y(j), z(k+1) is just 'above' it in the z direction.

cell centered variables
p(i,j,k) -> p(i,j,k+1), rho(i,j,k) -> rho(i,j,k+1)
p(xi,yj,zk) -> p(xi,yj,zk+dz), rho(xi,yj,zk) -> rho(xi,yj,zk+dz)

At least, it was that way in the mid-90's when I used the code. The version number was much lower then!

gomane8 September 11, 2011 21:29

thx
 
Quote:

Originally Posted by otd (Post 323717)
Short answer:
The z-direction cell stacks are consecutively indexed in the k index

cell center coordinates are as follows for cell (i,j,k) and cell(i,j,k+1):

so cell (i,j,k) -> x(i), y(j), z(k)
and cell (i,j,k+1) -> x(i), y(j), z(k+1) is just 'above' it in the z direction.

cell centered variables
p(i,j,k) -> p(i,j,k+1), rho(i,j,k) -> rho(i,j,k+1)
p(xi,yj,zk) -> p(xi,yj,zk+dz), rho(xi,yj,zk) -> rho(xi,yj,zk+dz)

At least, it was that way in the mid-90's when I used the code. The version number was much lower then!

thk you Otd,
well inside my UDF, i try to copy the velocity vector from the cell above my cell (can be any cell)!
and as you know we can not find evry thg in manuals or the internet, specially thx related to CFD!!! so thx again,
i will try the way you have interpret thniks and i hope that work!
A+


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