CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Neighbouring Cells (https://www.cfd-online.com/Forums/fluent/43531-neighbouring-cells.html)

 Carlos V. January 29, 2007 16:01

Neighbouring Cells

Hi everybody:

I'm simulating a reforming system. I need to access some variables (like a User - Defined Scalar quantity) in the neighbouring cells of each cell of my domain. Can anyone help me on this?

Thanks! Carlos V.

 Bogdan January 30, 2007 02:59

Re: Neighbouring Cells

 Carlos V. January 30, 2007 11:26

Re: Neighbouring Cells

Thank you very much Bogdan.Can you give an example of a code that uses that implementation to access a variable in a DEFINE_ADJUST macro? I've already tried to implement that in a original code, but had no success! Really need help on this. Thank you once again!

Carlos

 Bogdan January 31, 2007 12:05

Re: Neighbouring Cells

/************************************************** *******************************

**This function gets the neighboring cells and threads (if exists) for a given cell

**and thread. The order is left x, right x, back y, front y, bottom x, top z.

**Bogdan Nichita nov.2006****************************************** ****************

**

************************************************** *********************************/

face_t face;

int n;

real xc[ND_ND],xf[ND_ND];

real min_xf,max_xf,min_yf,max_yf,min_zf,max_zf;

min_xf=max_xf=xc[0];

min_yf=max_yf=xc[1];

min_zf=max_zf=xc[2];

{

if (xf[0]>max_xf){

max_xf=xf[0];

{

n_cell[1]=-1;

}else{

}

}

}

if (xf[0]<min_xf){

min_xf=xf[0];

{

n_cell[0]=-1;

}else{

}

}

}

if (xf[1]>max_yf){

max_yf=xf[1];

{

n_cell[3]=-1;

}else{

}

}

}

if (xf[1]<min_yf){

min_yf=xf[1];

{

n_cell[2]=-1;

}else{

}

}

}

if (xf[2]>max_zf){

max_zf=xf[2];

{

n_cell[5]=-1;

}else{

}

}

}

if (xf[2]<min_zf){

min_zf=xf[2];

{

n_cell[4]=-1;

}else{

}

}

}

} }

 Carlos V. February 1, 2007 09:45

Re: Neighbouring Cells

Thank you very much Bogdan!

I'll see if I can get this to work! Thank you once again.

Carlos Ventura

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