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 problem (urgent) (https://www.cfd-online.com/Forums/fluent-udf/63546-udf-problem-urgent.html)

marttini April 12, 2009 12:05

udf problem (urgent)
 
I am working on a vof case in which i have a tank filled with water up to 50%. i want to define a function to put a sinusoidal velocity for the first 30 seconds. I have tryed with the function showed bellow, but it does not work. I have two question:
Is this the correct way to get variable time?
Do you have to define in your source code, x_velocity if you know that it already exist for fluent program?

#include"udf.h"
real current_time;
real x_velocity;
current_time=CURRENT_TIME;
if(current_time<30.)
{x_velocity=0.3*sin(0.8*current_time)};
else
{x_velocity=0};

thanks in advance


All times are GMT -4. The time now is 21:16.