CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   How to Extract neighbors? (https://www.cfd-online.com/Forums/fluent-udf/152203-how-extract-neighbors.html)

sphoenix09 April 26, 2015 02:32

How to Extract neighbors?
 
Hi all,

I am new to this forum as well as fluent programming. I am working on single phase flow and need to extract neighbors of each cells through udf and store it in data file. Please lead me.
In this code I want loop over entire cells.

Code:

#include "udf.h"
#include "mem.h"
#include "sg.h"

DEFINE_ON_DEMAND(neighbors)
{
        Domain *d;
        cell_t c;
        Thread *t;
       
        int c0;
        int c1;
       
        thread_loop_c(t,d)
        {
                begin_c_loop(c,t)
                {
                        F_C0(c,t)=c0;
                        F_C1(c,t)=c1;
                        C_UDMI(c,t,1)=c0;
                        C_UDMI(c,t,2)=c1;
                       
                }
                end_c_loop(c,t)
        }
}

Thanks in advance


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