UDF code

  • 21 Views
  • Last Post 22 February 2019
yehiaismail posted this 22 February 2019

I wrote this code but I got a parse error in line 7 where t_local=t - 0.1*int(t/0.1) so what maybe the reason for that parse error?Any help is appreciated

UDF:

#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
real t_local;
t_local = t - 0.1*int(t/0.1);

begin_f_loop(f, thread)
{
if ( t_local < 0.033 )
F_PROFILE(f, thread, position) = 172.47*sin(94.25*t_local);
else
F_PROFILE(f, thread, position) = 0;
}
end_f_loop(f, thread)
}

abenhadj posted this 22 February 2019

Try using ceil function 

Best regards,

Amine

Close