|
[Sponsors] |
August 4, 2010, 02:32 |
acceleration profile
|
#1 |
New Member
Andrè Hüllmann
Join Date: Mar 2010
Posts: 10
Rep Power: 16 |
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!! |
|
August 5, 2010, 04:57 |
|
#2 |
New Member
Andrè Hüllmann
Join Date: Mar 2010
Posts: 10
Rep Power: 16 |
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) } |
|
August 10, 2010, 03:18 |
|
#3 |
New Member
Andrè Hüllmann
Join Date: Mar 2010
Posts: 10
Rep Power: 16 |
Hello,
is there no one who can help me??? It is very important for me! |
|
August 10, 2010, 03:34 |
|
#4 |
Senior Member
Jouke de Baar
Join Date: Oct 2009
Posts: 127
Rep Power: 16 |
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; Last edited by jack1980; August 10, 2010 at 03:35. Reason: mistake in code |
|
August 10, 2010, 05:56 |
|
#5 |
Senior Member
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17 |
"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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D UDF Paraboilc Velocity Profile (Can't Maintain) | Sing | FLUENT | 12 | August 7, 2017 06:25 |
Problem with assigned inlet velocity profile as a boundary condition | Ozgur_ | FLUENT | 5 | August 25, 2015 04:58 |
problem with importing and exporting profile BC | Gui | CFX | 2 | July 26, 2007 08:50 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 12:14 |
Wind profile | tom | Phoenics | 2 | September 28, 2005 10:51 |