Ansys Learning Forum › Forums › Discuss Simulation › Fluids › Importing the working torque into UDF › Reply To: Importing the working torque into UDF
I have once again adjusted my UDF. But still I can't find a way to retrieve the value of the working torque. Can someone give me a hint about this? Thank you very much
************************************************************************************
#include "udf.h"
DEFINE_TRANSIENT_PROFILE(testudf,CURRENT_TIME)
{
real omega_ts=0.0; /*starting omega*/
real omega_tf=600.0; /*final omega*/
real Jt=0.000554; /*Moment Inertia of the Turbin*/
real delta_t=0.0001; /*delta t simulation*/
real CURRENT_TIMESTEP;
real CURRENT_TIME;
real alpha_t; /*angular acceleration*/
Thread *t;
cell_t c;
t=Lookup_Thread(d,9); /*Zone ID = 9*/
Â
begin_c_loop (c,t)
{
alpha_t= Mt/Jt; /*M = J*alpha, but how can I retrieve the value of Mt?*/
omega_ts+=alpha_t*CURRENT_TIMESTEP;
Â
if (omega_ts > omega_tf)
{omega_ts = omega_tf;}
Â
THREAD_VAR(t).fluid.omega=omega_ts; /*I'm also not sure about this syntax or macro*/
}
end_c_loop (c,t)
Â
}