CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   rotating valve (https://www.cfd-online.com/Forums/main/80319-rotating-valve.html)

cfdhydraulic September 22, 2010 09:07

rotating valve
 
Hi friends,
I need some help, please.
I am trying to move a butterfly valve using UDF but even though I got a desired move, I canīt control when stop it.

the purpose is to open the valve and leave it opened and after 10 seconds, close de valve again.
My code makes the valve oscilate all the time without time control...
any idea to get it done?
thanks

butterfly move code

DEFINE_CG_MOTION(rotating_body, dt, vel, omega, time, dtime)
{
real ampl,disp,omg,count;

/* reset velocities */
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);

/* motion */
ampl = 0.785423 ; /* amplitude of rotation in radians (0.5deg) *///rad = deg * Pi /180
omg = 516.0219; /* angular frequency (18.465Hz) */
disp = ampl * sin(omg * time); /* resultant displacement */

omega[2] = 0.785423*sin(time);


}


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