time dependent boundary condition
Hi,
I am trying to model turbulent pulsed jet flow and I am trying to plot cycle average centerline velocity and the flow has a ratio of on and off equal 1:2. I want to write a UDF for the t inlet velocity varying with time 172.47*sin(94.248*t) with 0<t<0.033 so anyone can help me in this?Thanks in advance |
ansys fluent customization manual
look for define_profile macro best regards |
Thank you for your help.I managed to write this udf
#include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; t-local= t - int(t/0.1)*0.1; begin_f_loop(f, thread) { if (t-local < 0.033) Uin=36.6*sin(94.24*t-local) esle Uin=0 else F_PROFILE(f, thread, position) = Uin; } end_f_loop(f, thread) } however I received an error saying "line 6: local: undeclared variable" which is the line defining the t-local so do you an idea on how could I fix this?Thank you for your help |
log describes your error
Quote:
t-local is not defined ( no type) best regards |
Udf
I wrote this code but I get a parse error in line 7 where the t_local=t - 0.1*int(t/0.1) .Do you have any idea why could be the reason for that?
#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) } |
Code:
(int)number |
All times are GMT -4. The time now is 09:34. |