CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   parallelizing the udf for multi core machine (

aamer June 8, 2011 05:23

parallelizing the udf for multi core machine
Hello all.....

i have written a serial udf to give azimuth rotation to the wing. The code is as follows.

#include "udf.h"
static real psi_dot = 0.0; /* rotational velocity */
DEFINE_CG_MOTION(Re_34000ar6, dt, vel, omega, time, dtime)
Thread *t;
face_t f;
real gyration = 0.1927; /*second moment of area*/
real c = 0.101; /* wing chord in meters */
real t_A = 0.0269;
/* t_A is time required to accelerate wing from rest */
real pi = 3.14159;
real a;
real U = 5; /* constant velocity */
real constant = 0.35;
real psi_dot; /* rotational velocity */
real psi; /* azimuth angle */
real psi_not_dot = 25.947; /* constant rotational velocity*/

/*reset velocities*/
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
if (!Data_Valid_P ())
if (time <= t_A)
psi_dot = (12.97)* (1 - cos((pi*time)/(t_A)));
psi = (12.97)* (time - ((t_A/pi)*sin((pi*time)/(t_A))));
psi_dot = psi_not_dot;
psi = (psi_not_dot*time)-constant;
a= -(psi_dot);

Message("time:%f psi:%f psi_dot:%f\n",time,psi,a);

omega[0]= 0;
omega[1]= a;
omega[2]= 0;

I have a quad core processor machine. when i try to run my case file by giving "fluent -t4", it gives me error " the current working directory c:\users\aamer is not shared, this may cause file open issues accross network" " primitive error at NOde 0: open_udf_library:the system cannot find the file specified." similar error is displayed for other nodes.

the same file works perfectly fine in parallel when there is no udf, hooked to it. so i think i have to parallelize the udf for my multi processor machine...... can anybody help me parallelize this code. any suggestions or comments???????

Fateme.e August 22, 2013 03:03

hello aamer
I have the same problem with parallelizing of an udf!!:(
could you solve it?
please tell me what should i do for solving it.
thanks in advance.

vasava August 22, 2013 05:48

You have to use the macros #if RP_HOST and #if RP_NODE.

Reading this ( would help.

All times are GMT -4. The time now is 23:16.