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

rizkyibnu April 7, 2013 12:41

problem in compailing udf
 
hi, i want to simulate air flow through a loopwing wind turbine in fluent 14. i use anguler velocity variabel, i use MSVS 2010 to compile my udf

this is my udf file

#include "udf.h"
#include "dynamesh_tools.h"


DEFINE_SDOF_PROPERTIES(loopwing, prop, dt, time, dtime)
{
FILE *pf;

prop[SDOF_MASS]= 0.386;
prop[SDOF_IXX]= 7035.89e-6 ;
prop[SDOF_IYY]= 7689.16e-6 ;
prop[SDOF_IZZ]= 7689.16e-6;

prop[SDOF_ZERO_TRANS_X] = TRUE;
prop[SDOF_ZERO_TRANS_Y] = TRUE;
prop[SDOF_ZERO_TRANS_Z] = TRUE;
prop[SDOF_ZERO_ROT_Y] = TRUE;
prop[SDOF_ZERO_ROT_Z] = TRUE;
omega[0]=75;

if(NULL == (pf = fopen("omeega.txt","a")))
Error("File tidak dapat ditulis!\n");
fprintf(pf,"%f %f\n", time, DT_THETA(dt)[0]);
fclose(pf);

Message("\nposisi= %f rad/s\n", DT_THETA(dt)[0]);
}


when i build there was an error :

..\..\src\loopwing.c(20) : error C2065: 'omega' : undeclared identifier
..\..\src\loopwing.c(20) : error C2109: subscript requires array or pointer type

can you give me some advices?
thanks

vasava April 24, 2013 03:32

Do you compile it or interpret it?

Why do you have #include "dynamesh_tools.h"?

rizkyibnu April 26, 2013 11:47

Quote:

Originally Posted by vasava (Post 422741)
Do you compile it or interpret it?

Why do you have #include "dynamesh_tools.h"?

i compile it
because i use dynamic mesh for monitoring moment on my turbine
can you help me? is there any something wrong in my udf?

thanks

amit112amit May 1, 2013 11:47

As per the error message, it seems that you should have declared the variable 'omega' before you used it. You may need something like:
Quote:

double omega[number_of_cells];
If omega is a Fluent variable then it must be declared in some other header file that you have not included.

blackmask May 1, 2013 20:31

A simple syntax error. You have
omega[0]=75;
in your UDF but never declared it.
Put something like
real omega[ND_ND];
at the beginning of the function.


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