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

Error UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2016, 05:28
Default Error UDF
  #1
Member
 
ERMACORA Florian
Join Date: May 2016
Posts: 39
Rep Power: 9
flo90000 is on a distinguished road
Hello

I write some UDfs. I have some errors when I compile it and I don't know to resolve the last ones.

My code where I have this errors is:

Code:
#include "udf.h"
#include "math.h"

DEFINE_SDOF_PROPERTIES(valve2, prop, dt, time, dtime)
{
#if !RP_HOST
  prop[SDOF_MASS] = 0.016624115;
  prop[SDOF_IYY] = 0.000010947;
  prop[SDOF_ZERO_TRANS_X] = TRUE;
  prop[SDOF_ZERO_TRANS_Y] = TRUE;
  prop[SDOF_ZERO_TRANS_Z] = TRUE;
  prop[SDOF_ZERO_ROT_X] = TRUE;
  prop[SDOF_ZERO_ROT_Y] = FALSE;
  prop[SDOF_ZERO_ROT_Z] = TRUE;
  prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt[1])*0.045);
printf("\n 3d : Update 6DOF properties DT_THETA_Z:%e, Mz:%e, Mass:%e\n", DT_THETA (dt)[1],prop[SDOF_LOAD_M_Z], prop[SDOF_MASS]);
#endif;
}
The errors which I have are:

Code:
valve2.c: In function valve2:
valve2.c:15: error: invalid type argument of -> (have Dynamic_Thread)
valve2.c:17:7: warning: extra tokens at end of #endif directive
Thanks for your help
flo90000 is offline   Reply With Quote

Old   July 23, 2016, 00:42
Default
  #2
D.M
Member
 
Davoud Malekian
Join Date: Jan 2016
Posts: 53
Rep Power: 10
D.M is on a distinguished road
Hi,
your problem actually apeared in this line:

prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt[1])*0.045);

try to use prantesis for dt , cause the way you have used dt[1] seems to be that you have used it as an array!!(and thats wrong!) so type like this:

prop[SDOF_LOAD_M_Y] = -9.81*0.045*sin(DT_THETA (dt)[1]*(0.045));

and enother problem is that u shouldnt use semicolon after #endif

regards.
D.M is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 19:30.