Hi, I am using Execute_at_end macro of fluent to print torque values in console window for unsteady simulation of wind turbine. 

Here is the udf code I am using

#include"udf.h"

DEFINE_EXECUTE_AT_END(torque_time)

{

Domain *d;

Thread *t;

face_t f;

real NV_VEC(A);

real NV_VEC(force);

real NV_VEC(torque);

real x[ND_ND];

real NV_VEC(radius);

real NV_VEC(torque_final);

real tor;

NV_S(force,= ,0.0);

NV_S(torque_final,= ,0.0);

NV_S(torque,= ,0.0);

d = Get_Domain(9);

begin_f_loop(f,t)

{

F_AREA(A,f,t);

F_CENTROID(x,f,t);

NV_S(force,= , F_AREA(A,f,t), * , F_P(f,t));

NV_D(radius,= ,x[0],x[1],x[2]);

NV_CROSS(torque,radius,force);

NV_VV(torque_final,= ,torque_final,+, torque);

tor= NV_MAG(torque_final);

}

end_f_loop(f,t)

printf("Value of torque at the blades is = %f", tor );

}

My zone is blade and its integer id is 9. I want to print torque values for blade zone only. The issue is its a face thread and I dont know how to pass on that particular thread pointer. 

This code is printing anything in console window. 

Any suggestions?

More Shashank Mishra's questions See All
Similar questions and discussions