CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming


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

LinkBack Thread Tools Display Modes
Old   February 23, 2015, 03:07
Default Udf
New Member
West Bengal
Join Date: Feb 2015
Posts: 1
Rep Power: 0
ramendra is on a distinguished road
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 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;

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;
F_PROFILE(f, thread, position)= 0;
end_f_loop(f, thread)
ramendra is offline   Reply With Quote

Old   February 23, 2015, 10:04
Senior Member
Join Date: Nov 2013
Posts: 1,086
Rep Power: 14
pakk will become famous soon enough
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?
pakk is offline   Reply With Quote


Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38

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