CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

problem in compailing udf

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2013, 12:41
Default problem in compailing udf
  #1
New Member
 
rizky
Join Date: Mar 2013
Posts: 2
Rep Power: 0
rizkyibnu is on a distinguished road
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
rizkyibnu is offline   Reply With Quote

Old   April 24, 2013, 03:32
Default
  #2
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 545
Rep Power: 12
vasava will become famous soon enough
Do you compile it or interpret it?

Why do you have #include "dynamesh_tools.h"?
vasava is offline   Reply With Quote

Old   April 26, 2013, 11:47
Default
  #3
New Member
 
rizky
Join Date: Mar 2013
Posts: 2
Rep Power: 0
rizkyibnu is on a distinguished road
Quote:
Originally Posted by vasava View Post
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
rizkyibnu is offline   Reply With Quote

Old   May 1, 2013, 11:47
Default
  #4
New Member
 
Amit Singh
Join Date: Feb 2013
Posts: 4
Rep Power: 4
amit112amit is on a distinguished road
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.
amit112amit is offline   Reply With Quote

Old   May 1, 2013, 20:31
Default
  #5
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 11
blackmask will become famous soon enough
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.
blackmask is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM Rizwan Fluent UDF and Scheme Programming 32 May 8, 2015 06:05
what's the problem with my udf zzyan FLUENT 0 November 4, 2010 04:56
Problem with my udf july Fluent UDF and Scheme Programming 3 June 20, 2010 06:56
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


All times are GMT -4. The time now is 13:06.