CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF problem (http://www.cfd-online.com/Forums/fluent/46435-udf-problem.html)

mansha goraya October 29, 2007 01:31

UDF problem
 
i have to define a UDF function for the displacement of diaphragm deflection of a chamber. the chamber is filled of liquid. Due to movement of diaphragm the liquid flows out from the chamber. the velocity of the diaphragm is given in the following UDF function.

#include "udf.h"

static float V_Prev=0.0;

DEFINE_CG_MOTION(unsteady_velocity, dt,vel, omega,time,dtime) {

thread *t;

face_t f;

float NV_VEC(A);

float velocity;

NV_S(vel, =, 0.0);

NV_S(omega, =, 0.0);

if (!Data_Valid_P());

return;

t=DT_THREAD(dt);

velocity = (0.0000004*2.*3.1415926*300 cos (2.*3.1415926*time*300.));

begin_f_loop(f, t) {

V_Prev(A, f, t) = velicty; }

end_f_loop(f, t)

message ("time = %f, z_vel= %f", time, V_Prev);

vel[0]=V_Prev;

}

i write this udf function with the help of CG motion udf given in the manual. this UDF function gives so many errors when i try to compile this function. i shall be very very thankful to any one who will help me in this regard.



All times are GMT -4. The time now is 12:40.