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

problem in compailing udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2013, 13: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, 04:32
Default
  #2
Senior Member
 
Paritosh Vasava
Join Date: Oct 2012
Location: Lappeenranta, Finland
Posts: 732
Rep Power: 23
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, 12: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, 12:47
Default
  #4
New Member
 
Amit Singh
Join Date: Feb 2013
Posts: 4
Rep Power: 13
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, 21:31
Default
  #5
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
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


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 Off
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 40 March 18, 2018 07: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 07:56
udf compiling problem akr FLUENT 3 August 22, 2007 08:14
UDF problem chiseung FLUENT 4 January 10, 2002 10:58


All times are GMT -4. The time now is 22:42.