CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF & MDM (http://www.cfd-online.com/Forums/fluent/31685-udf-mdm.html)

 paolo June 19, 2003 08:28

UDF & MDM

Hi all, can someone tell me why this udf doesn't work? I'using that to simulate an impuse shaped plunge velocity in time for a profile and I want to calculate the CL for the profile. the udf works when I use for qdot the function sinus. As soon as I use the exponential function fluent doesn't seem to understand it in the sense that the resulting CL is zero, so for him I'm inputting a zero amplitude velocity.....

#include "udf.h" #include "dynamesh_tools.h" #include "stdio.h" #include "math.h"

DEFINE_CG_MOTION(plunge, dt, vel, omega, time, dtime) { real pi; real Timp; real Amp; real qdot; Amp = 0.000088363; Amp = 0.0000088363; Timp = 0.08; pi = 3.145926; NV_S (vel, =, 0.0); NV_S (omega, =, 0.0); qdot = 0.0; /* if (time < 1*Timp) */ if (time == dtime)

{

qdot = Amp*exp(time);

qdot = Amp*exp(-((time-Timp/2)/(0.1*Timp))*((time-Timp/2)/(0.1*Timp)));

qdot = Amp*pi/Timp*sin(2*pi*time/Timp);

qdot = Amp*exp(-pow((time-Timp/2)/(0.1*Timp),2));

qdot = 100*Amp;

} else

{

qdot = 0.0;

} vel[1]= qdot; }

 All times are GMT -4. The time now is 05:33.