|
[Sponsors] |
January 29, 2007, 16:01 |
Neighbouring Cells
|
#1 |
Guest
Posts: n/a
|
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. |
|
January 30, 2007, 02:59 |
Re: Neighbouring Cells
|
#2 |
Guest
Posts: n/a
|
See the answer http://www.cfd-online.com/Forum/fluent.cgi?read=45754
|
|
January 30, 2007, 11:26 |
Re: Neighbouring Cells
|
#3 |
Guest
Posts: n/a
|
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 |
|
January 31, 2007, 12:05 |
Re: Neighbouring Cells
|
#4 |
Guest
Posts: n/a
|
void neighboringCells(cell_t* n_cell,Thread* n_thread[],cell_t cell,Thread* cell_thread){
/************************************************** ******************************* **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; Thread *face_thread; int n; real xc[ND_ND],xf[ND_ND]; real min_xf,max_xf,min_yf,max_yf,min_zf,max_zf; C_CENTROID(xc,cell,cell_thread); min_xf=max_xf=xc[0]; min_yf=max_yf=xc[1]; min_zf=max_zf=xc[2]; c_face_loop(cell,cell_thread,n) { face=C_FACE(cell,cell_thread,n); face_thread=C_FACE_THREAD(cell,cell_thread,n); F_CENTROID(xf,face,face_thread); if (xf[0]>max_xf){ max_xf=xf[0]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[1]=-1; n_thread[1]=NULL; }else{ n_cell[1]=F_C1(face,face_thread); n_thread[1]=THREAD_T1(face_thread); if (n_cell[1]==cell && n_thread[1]==cell_thread){ n_cell[1]=F_C0(face,face_thread); n_thread[1]=THREAD_T0(face_thread); } } } if (xf[0]<min_xf){ min_xf=xf[0]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[0]=-1; n_thread[0]=NULL; }else{ n_cell[0]=F_C1(face,face_thread); n_thread[0]=THREAD_T1(face_thread); if (n_cell[0]==cell && n_thread[0]==cell_thread){ n_cell[0]=F_C0(face,face_thread); n_thread[0]=THREAD_T0(face_thread); } } } if (xf[1]>max_yf){ max_yf=xf[1]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[3]=-1; n_thread[3]=NULL; }else{ n_cell[3]=F_C1(face,face_thread); n_thread[3]=THREAD_T1(face_thread); if (n_cell[3]==cell && n_thread[3]==cell_thread){ n_cell[3]=F_C0(face,face_thread); n_thread[3]=THREAD_T0(face_thread); } } } if (xf[1]<min_yf){ min_yf=xf[1]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[2]=-1; n_thread[2]=NULL; }else{ n_cell[2]=F_C1(face,face_thread); n_thread[2]=THREAD_T1(face_thread); if (n_cell[2]==cell && n_thread[2]==cell_thread){ n_cell[2]=F_C0(face,face_thread); n_thread[2]=THREAD_T0(face_thread); } } } if (xf[2]>max_zf){ max_zf=xf[2]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[5]=-1; n_thread[5]=NULL; }else{ n_cell[5]=F_C1(face,face_thread); n_thread[5]=THREAD_T1(face_thread); if (n_cell[5]==cell && n_thread[5]==cell_thread){ n_cell[5]=F_C0(face,face_thread); n_thread[5]=THREAD_T0(face_thread); } } } if (xf[2]<min_zf){ min_zf=xf[2]; if (BOUNDARY_FACE_THREAD_P(face_thread)) { n_cell[4]=-1; n_thread[4]=NULL; }else{ n_cell[4]=F_C1(face,face_thread); n_thread[4]=THREAD_T1(face_thread); if (n_cell[4]==cell && n_thread[4]==cell_thread){ n_cell[4]=F_C0(face,face_thread); n_thread[4]=THREAD_T0(face_thread); } } } } } |
|
February 1, 2007, 09:45 |
Re: Neighbouring Cells
|
#5 |
Guest
Posts: n/a
|
Thank you very much Bogdan!
I'll see if I can get this to work! Thank you once again. Carlos Ventura |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |
[snappyHexMesh] snappyHexMesh aborting | Tobi | OpenFOAM Meshing & Mesh Conversion | 0 | November 10, 2010 04:23 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 01:32 |