CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

global face number

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 6, 2009, 10:12
Default global face number
  #1
New Member
 
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 8
Häwimeddel is on a distinguished road
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?
Häwimeddel is offline   Reply With Quote

Old   October 7, 2009, 05:00
Default
  #2
New Member
 
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 8
Häwimeddel is on a distinguished road
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.
Häwimeddel is offline   Reply With Quote

Old   October 7, 2009, 09:07
Default
  #3
New Member
 
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 8
Häwimeddel is on a distinguished road
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;
    }
}
Häwimeddel is offline   Reply With Quote

Old   October 20, 2009, 03:04
Default Adjacent cells macros
  #4
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 647
Rep Power: 11
dmoroian is on a distinguished road
Did you try these macros:
Code:
F_C0(f,t)
F_C1(f,t)
?
dmoroian is offline   Reply With Quote

Old   October 20, 2009, 03:14
Default
  #5
New Member
 
Join Date: Apr 2009
Location: KA, Germany
Posts: 20
Rep Power: 8
Häwimeddel is on a distinguished road
Yes, see my code above. And they worked, too!
Häwimeddel is offline   Reply With Quote

Old   October 20, 2009, 03:24
Default
  #6
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 647
Rep Power: 11
dmoroian is on a distinguished road
Oh
Sorry for missreading your code.

My bad
dmoroian is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import netgen mesh to OpenFOAM hsieh Open Source Meshers: Gmsh, Netgen, CGNS, ... 32 September 13, 2011 05: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
Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00
WARNING: non-positive face area exist. Alan Main CFD Forum 4 August 17, 2006 07:33


All times are GMT -4. The time now is 20:48.