|
[Sponsors] |
October 6, 2009, 11:12 |
global face number
|
#1 |
New Member
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 17 |
Question:
Is it a feasible approach to determine if two cells of bordering threads are neighbours by finding out if they share a face? Lets say I have a cell A in thread A and I loop through the faces (four, since 2d). For every face of cell A I loop through all the cells of thread B and see if any one shares this face. Could this work? Or is the global face number (which can be retrieved with Code:
C_FACE(c,t,n) different for neighbouring cells if they are of different threads? |
|
October 7, 2009, 06:00 |
|
#2 |
New Member
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 17 |
It does not work, unfortunately.
But as an easy fix, I just compare the coords of the face centres to determine wether cell are neigbours or not. |
|
October 7, 2009, 10:07 |
|
#3 |
New Member
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 17 |
That also did not work. My solution (which works now):
Code:
int neighbourcell(cell_t cell0, Thread *thread0, cell_t cell1, Thread *thread1, int n) //put cell pointers and a face index (of cell 0) -> it is estimated if cell 0 is a neighbour of cell 1, connected via face { Thread *threadf; //face thread of face Thread *tc0; //cell threads of neighbours to face Thread *tc1; //cell threads of neighbours to face face_t face; cell_t c0; //neighbour to the face cell_t c1; //neighbour to the face face = C_FACE(cell0,thread0,n); //the face of cell 1 threadf = C_FACE_THREAD(cell0,thread0,n); //the face thread of this face c0 = F_C0(face,threadf); c1 = F_C1(face,threadf); tc0 = F_C0_THREAD(face,threadf); tc1 = F_C1_THREAD(face,threadf); if ( (c0 == cell0 && c1 == cell1 && tc0 == thread0 && tc1 == thread1) || (c0 == cell1 && c1 == cell0 && tc0 == thread1 && tc1 == thread0) ) { return 1; } else { return 0; } } |
|
October 20, 2009, 04:04 |
Adjacent cells macros
|
#4 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Did you try these macros:
Code:
F_C0(f,t) F_C1(f,t) |
|
October 20, 2009, 04:14 |
|
#5 |
New Member
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 17 |
Yes, see my code above. And they worked, too!
|
|
October 20, 2009, 04:24 |
|
#6 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Oh
Sorry for missreading your code. My bad |
|
|
|
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 |
Low Mach number Compressible jet flow using LES | ankgupta8um | OpenFOAM Running, Solving & CFD | 7 | January 15, 2011 14:38 |
Global courant number what mean | erica | FLUENT | 0 | November 24, 2007 06:41 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |
WARNING: non-positive face area exist. | Alan | Main CFD Forum | 4 | August 17, 2006 08:33 |