I am trying to use a UDF for velocity input in the room from a fan. I have created a UDF but when I am trying to load the UDF it shows an error stating that it is not compiled for parallel processing. Can anyone help me how to do it ? My UDF code is as follows:
#include "udf.h"
DEFINE_PROFILE(inlet_x1_velocity, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
real z;
real Vx_s;
real r;
real r1;
real r2;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread); /* en C la première position est y(0) */
z = x[1]-1.315;
y = x[2]-3.5;
r1=0.115;
r2=0.15;
r= pow(y*y+z*z,0.5);
Vx_s=7.22/0.15*r;
{F_PROFILE(f, thread, index)=Vx_s;}
}
end_f_loop(f, thread)
}
DEFINE_PROFILE(inlet_y1_velocity, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread); /* en C la première position est y(0) */
z = x[1];
F_PROFILE(f, thread, index) = -(z-1.315)*138*0.23;
}
end_f_loop(f, thread)
}
DEFINE_PROFILE(inlet_z1_velocity, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[2]; /* en C la première position est y(0) */
F_PROFILE(f, thread, index) = -(3.5-y)*138*0.23;
}
end_f_loop(f, thread)
}