Udf

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

 February 23, 2015, 03:07 Udf #1 New Member   West Bengal Join Date: Feb 2015 Posts: 1 Rep Power: 0 Dear friends, i want to give some velocity(which is non zero at t=0,t=10,t=20..likewise other wise it's zero ) as a input in inlet boundary condition . Would you guys please have a look on my code ...one more doubt can we use int function in "udf.h" #include "udf.h" DEFINE_PROFILE(inlet_z_velocity, thread, position) { real t; int t1,t3; real t2; /*float X; */ face_t f; /*X=10.0;*/ begin_f_loop(f, thread) { t= RP_Get_Real("flow time"); /*t_step = RP_Get_Real("Physical-time-step"); */ /*tup =((t-(t%X))/X); */ t1 = (t/100); t2 = (t/100.0)-t1; t3 = t2*10; if((t3==2) || (t3==4) || (t3==6) || (t3==8)|| (t3==0)) { F_PROFILE(f, thread, position) = 0.0007967; } else { F_PROFILE(f, thread, position)= 0; } } end_f_loop(f, thread) }

 February 23, 2015, 10:04 #2 Senior Member   Join Date: Nov 2013 Posts: 1,086 Rep Power: 14 Before you can make your code, your problem definition should be clear. Right now, it contains a mistake. "i want to give some velocity(which is non zero at t=0,t=10,t=20..likewise other wise it's zero )" If I read this literally, the velocity should be non-zero only when the time is exactly a multiple of 10 seconds. So for example: t=9 seconds: v=0 t=9.9 seconds: v=0 t=9.99 seconds: v=0 t=9.99999 seconds: v=0 t=9.999999999999 seconds: v=0 t=9.9999999999999999999999 seconds: v=0 t=10 seconds: v=100 t=10.000000000000000000001 seconds: v=0 and so on. Although there is nothing wrong mathematically with this, physically it makes no sense to define it in this way. The velocity is non-zero for an infinitesimally small time, so effectively it will have the same effect as saying v=0 always. That is probably not what you want, otherwise you would have said that. What do you want?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 08:37 acasas CFD Freelancers 1 January 23, 2015 08:26 pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 kim FLUENT 3 October 26, 2011 21:38

All times are GMT -4. The time now is 19:45.