CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF for velocity dependant of time (https://www.cfd-online.com/Forums/fluent-udf/90585-udf-velocity-dependant-time.html)

GOVIP July 14, 2011 12:32

UDF for velocity dependant of time
 
Hi,
im trying to create a UDF so that the velocity will be dependant of time

What i want to do exactly is:

At 0 seconds to 1 seconds, the velocity is at 0 m/s
and from 1 seconds to time x, the velocity will be at 2 m/s

This applies at the inlet, can anybody help me with this?

From the searching the forums, i have found an example similar to what i want to do, and i did a little modification to it, here it is:

DEFINE_PROFILE(velocity_magnitude,t,i);
{
real velocity;
real the_current_time;
face_t f;

the_current_time = CURRENT_TIME;

if ((the_current_time_time>=0) && (the_current_time<1))
{
velocity=0;
}
if ((the_current_time>=1))
{
velocity=2;
}

begin_f_loop(f,t)
{
F_PROFILE(f,t,i)=velocity;
}
end_loop(f,t)
}




but for some reason when i use interpret , it says parse error at line 5,

Can someone please help me with this?

thank you in advance for your time.

johnwinter August 12, 2011 03:34

i have few suggestions
1.use float/double instead of real
2. try compiling instead intrepret
3.chenge to end_f_loop(f,t) instead end_loop(f,t)

Erny August 22, 2011 10:15

if ((the_current_time_time>=0) && (the_current_time<1))

should this not read

if ((the_current_time>=0) && (the_current_time<1)) ??

niravtm007 August 29, 2011 02:27

velocity inlet udf
 
hiii friends i am entirely new to using udf's in fluent. I have a cubical geometry, with two inlets on perpendicular adjacent faces. i have to implement udf to only one of the conditions.
i have two cases
1) parabolic velocity inlet ( space varient)
2) sinusodial velocity velocity inlet ( time variant)
can any one pls send me the udf ( codes) ...


All times are GMT -4. The time now is 17:44.