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/)
-   -   problem to make a UDF parallel, the "hello world version" (https://www.cfd-online.com/Forums/fluent-udf/85956-problem-make-udf-parallel-hello-world-version.html)

pilou March 10, 2011 08:19

problem to make a UDF parallel, the "hello world version"
 
I think my last post was a bit to long and the UDF way to complex to have an answer so I made a "Hello world" version of the problem.

#include <udf.h>

DEFINE_SR_RATE(my_rate_ox, f, t, r, mw, yi, rr)
{

face_t fr;
int ID1,ID2;

ID1=7;
ID2=21;

Domain *domain=Get_Domain(1);
Thread *tr=Lookup_Thread(domain,ID2);

if (THREAD_ID(t)==ID1)
{begin_f_loop(fr,tr)
{
printf("Hello world\n");
}
end_f_loop(fr,tr)
}

*rr = 0.000001;

}

It seems hard to make Fluent loop over a face thread different from the "t" defined on the DEFINE_SR_RATE's arguments. Do you know a way to overpass this problem.

Thanks in advance.
Pilou


All times are GMT -4. The time now is 17:40.