CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   HELP! function airfoil has wrong type: 29 != 43 (

Alex March 28, 2006 23:33

HELP! function airfoil has wrong type: 29 != 43

I'm trying to run a simulation of a flapping 2-d airfoil in fluent. So far I'm having big problems.

I made an unstructured mesh and loaded my UDF into Fluent, but after I set up all my parameters and click on iterate it gives me the following error:

Error: get_udf_function: function airfoil has wrong type: 29 != 43 Error Object: ()

Can anyone help me please?! I need this for my thesis and I can't get it to work!

Thank you in advance


Ahmed March 28, 2006 23:40

Re: HELP! function airfoil has wrong type: 29 != 4
Error message is clear, there is a variable type definition error, you have to go through your function line by line and see what is wrong or you print a copy on the forum

Alex March 28, 2006 23:55

Re: HELP! function airfoil has wrong type: 29 != 4

The code follows. It tries to describe the motion in pitch and plunge of an airfoil. Can anyone please tell me if they see a mistake? Also, I'm not too sure if I defined the pressure force on the body properly. I just copied that from the DEFINE_CG_MOTION example in the tutorial.

Thanks for the help


PS. If you would like a prettier version (ie. in .txt) please write me an e-mail. Thanks

/************************************************** ********** * * Equations of Motion for a 2-D airfoil in pitch and plunge * compiled UDF * ************************************************** **********/

#include "udf.h"

static real v_prev = 0.0;

static real omega_prev = 0.0;

DEFINE_CG_MOTION(airfoil, dt, vel, omega, time, dtime)


Thread *t; face_t f; real NV_VEC (A); real force, dv, om, f, domega, delta;

f= 0.5;


delta =3.14/2;

/* reset velocities */

NV_S (vel, =, 0.0); NV_S (omega, =, 0.0);

if (!Data_Valid_P ())


/* get the thread pointer for which this motion is defined */ t = DT_THREAD (dt);

/* compute pressure force on body by looping through all faces */ force = 0.0; begin_f_loop (f, t)


F_AREA (A, f, t);

force += F_P (f, t) * NV_MAG (A);


end_f_loop (f, t)



v_prev += dv;

omega_prev +=domega;

Message ("time = %f, y_vel = %f, force = %f, omega=%f\n", time, v_prev, force, omega_prev);

/* set x-component of velocity */

vel[1] = v_prev;

/* set z-rotation axis for angular velocity */

omega[2] = omega_prev;


All times are GMT -4. The time now is 15:25.