# Time varying velocity BC

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 22, 2011, 11:29 Time varying velocity BC #1 New Member   Tejasvi Krishna Join Date: Sep 2010 Location: College station,Tx, USA Posts: 12 Rep Power: 15 Hello, I need a sinusoidal time varying UDF for my problem , I am kind of new to fluent , please direct me , any time varying BC tutorial is helpful but couldnt find any on google Thankyou Tejasvi

 March 22, 2011, 12:27 #2 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 735 Blog Entries: 1 Rep Power: 22 Hi, if you are new in UDF, it will be better to use other ways like defining a profile. refer to: in user guide (7.1.9 in FLUENT 6.3.26)

 March 22, 2011, 13:06 #3 New Member   Tejasvi Krishna Join Date: Sep 2010 Location: College station,Tx, USA Posts: 12 Rep Power: 15 thanks for the reply, I will try that out , meanwhile I have written an UDF , does this look reasonable #include "udf.h" DEFINE_PROFILE(transient_velocity, thread, position) { float t, velocity; face_t f; t = RP_Get_Real("flow-time"); velocity = Sin(40*3.14*t); begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = velocity; } end_f_loop(f, thread)

March 22, 2011, 13:41
#4
Senior Member

Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 22
it needs some changes:
Quote:
 #include "udf.h" #include "math.h" DEFINE_PROFILE(transient_velocity,thread,position) { face_t f; float t, velocity; t = CURRENT_TIME; velocity = sin(40*3.14*t);//argument should be in radian begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = velocity; } end_f_loop(f, thread) }