CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Udf

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 23, 2015, 03:07
Default Udf
  #1
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 ...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)
}
ramendra is offline   Reply With Quote

Old   February 23, 2015, 10:04
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 670
Rep Power: 9
pakk is on a distinguished road
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

Reply

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
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 2 April 29, 2015 12:01
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
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27


All times are GMT -4. The time now is 06:15.