CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Parse error

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

LinkBack Thread Tools Display Modes
Old   March 4, 2009, 14:15
Default Parse error
Posts: n/a
Hello friends

While interpreting my UDf I am finding a problem. The Problem says as shown below.

cpp -IC:\Fluent.Inc\fluent6.2.16/src -IC:\Fluent.Inc\fluent6.2.16/cortex/src -IC:\Fluent.Inc\fluent6.2.16/client/src -IC:\Fluent.Inc\fluent6.2.16/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" C:\Fluent.Inc tbin tx86\source.c

Error: C:\Fluent.Inc\ntbin\ntx86\source.c: line 33: parse error.

my UDf goes like this

/* UDF for the Energy Source Term */


C_UDMI(c,t,0) - x(hydroegn concentration)

C_UDMI(c,t,1) - dx/dt

C_UDMI(c,t,2) - P_eq

C_UDMI(c,t,3) - k */

#include "udf.h" #include "mem.h" #include "stdio.h"

#define R 8.314 /*Universal Gas Constant- J/mol K */

#define Ea 21170 /* Activation Energy - J/ mol K */

#define xi 0.0 /* Initial Concentration */

#define xf 1 /* Final concentration */

#define dh 28000 /* Enthalpy, J/mol */

#define ds 107.2 /* Entropy - J/mol K */

#define RR 75 /* Reaction Rate - /sec */

#define Na 4 /* Number of atoms/molecule */

#define Mol 400 /* Molecular weight of metal hydride, kg/Kmol */

#define fs 0.35 /* plateau slope factor */

#define fhys 0.12 /* hysterisis factor */

#define Ps 5*e5 /* supply pressure, Pa */

#define Pb 5*e5 /* Bed Pressure,Pa */

#define e 0.5 /* void fraction */

#define Rho 8400 /* density of metal hydride, kg/m3 */

DEFINE_SOURCE(energy_source,c,t,ds,eqn) /* LINE NO:33 */ {

real energy_source;

real time = RP_Get_Real("flow-time");



C_UDMI(c,t,0) = xi;

C_UDMI(c,t,1) = 0;


energy_source = (1-e)*Rho*dh*500*Na/Mol *C-UDMI(c,t,1);

return energy_source; }

DEFINE_EXECUTE_AT_END(execute-at_end) {

double temp,K,P_eq;

Cell_t c;

Thread *t;

int ID= ; /* Zone ID of Porous Zone */

Domain *domain = Get_Domain(ID);





Temp= C_T(c,t);

P_eq= exp((-dh/(R*Temp))+(ds/R)+fs+fhys);

C_UDMI(c,t,2) = P_eq;

K = RR*((Pb-P_eq)/P_eq)*exp(-Ea/(R*Temp));


C_UDMI(c,t,1) = K*((C_UDMI(c,t,0)-xf)/(xi-xf));

c_UDMI(c,t,0) = C_UDMI(c,t,0)+(C_UDMI(c,t,1)*RP_Get_Real("Physical-time-step"));



} }

please help me.

Thanks in advance Vamsee
  Reply With Quote

Old   March 5, 2009, 00:39
Default Re: Parse error
Posts: n/a
hello friends...

anyone please help me in this problem

regards Vamsee
  Reply With Quote

Old   March 5, 2009, 04:42
Default Re: Parse error
Posts: n/a
hello Vamsee,

you really should take some time to have a look on both, Fluent's UDF User Guide and maybe some basic C-Programing book. Some things will then be straight forward for you, for example that you must not use something like C_UDMI() outside the body of any Macro (Define_.....)

cheers Max
  Reply With Quote

Old   March 5, 2009, 05:09
Default Re: Parse error
Posts: n/a
Hello Max,

the statement which your talking about are comments just written for my convenience. They are not defined. sh0oludn't I write like that? please help me if there are any more.
  Reply With Quote

Old   March 5, 2009, 06:00
Default Re: Parse error
Posts: n/a
Sorry Vamsee,

i was too blind to see. One thing you can try is to compile your udf instaed of using interpreted mode. Maybe the compiler directives "#" are causing the troubles.

cheers Max
  Reply With Quote


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
parse error brusly FLUENT 0 February 1, 2007 13:09
ERROR MESSAGE: line 1: parse error Lourival FLUENT 1 February 18, 2006 02:35
parse error Tajul FLUENT 5 February 17, 2006 05:24
Parse error Fernando FLUENT 2 January 21, 2006 13:55
Parse error in udf Karthick FLUENT 6 March 30, 2004 11:35

All times are GMT -4. The time now is 12:00.