CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   acceleration profile (http://www.cfd-online.com/Forums/fluent/78853-acceleration-profile.html)

huela August 4, 2010 02:32

acceleration profile
 
Hello,

I really need a udf for a acceleration profile!

The facts:

2sec acceleration with 0,5m/s
3sec constant velocity
2sec decelerate

I don`t know how it works but I need it for my disseration!
I`m so grateful for your help!!

huela August 5, 2010 04:57

This ist my udf, but it do not works! Can anywhere tell me what is wrong with the udf? Please!


#include <udf.h>
DEFINE_PROFILE(unsteady_v, t, pos)
{
real time, velocity;
real acceleration = 0.0835;
face_t f;
begin_f_loop(f, t)
{
time = RP_Get_Integer("time-step");

if( time <= 2)

velocity = acceleration * time;
F_PROFILE(f,t,pos) = velocity;
if( time > 2)

velocity = 2* acceleration;
F_PROFILE(f,t,pos) = velocity;

if( time > 5)
velocity = -acceleration * time;
F_PROFILE(f,t,pos) = velocity;

}

end_f_loop(f, t)
}

huela August 10, 2010 03:18

Hello,
is there no one who can help me???

It is very important for me!

jack1980 August 10, 2010 03:34

Perhaps:

if( time < 2.0)
velocity = acceleration * time;
F_PROFILE(f,t,pos) = velocity;
else if( time < 5.0)
velocity = 2.0* acceleration;
F_PROFILE(f,t,pos) = velocity;
else
velocity = 2.0*acceleration - acceleration * (time-5.0);
F_PROFILE(f,t,pos) = velocity;

coglione August 10, 2010 05:56

"time" suggest that you want to retrieve the current flow time in seconds. RP_Get_Integer(time-step) returns the number of timesteps computed in your transient simulation so far. As long as your timestep size is not set to exactly 1s these two will not be equal.
time = CURRENT_TIME will do the trick anyway.
cheers


All times are GMT -4. The time now is 22:48.