Parse Error
Hello friends,
please help me. When I am interpreting my UDF, the following problem (parse error) is arising. please help me to solve it. C:\Fluent.Inc tbin tx86\cpp.exe -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>" source1.c Error: source1.c: line 33: parse error. My udf is #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 33 { real energy_source; real time = RP_Get_Real("flow-time"); if(time==0) { 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=3 ; /* Zone ID of Porous Zone */ Domain *domain = Get_Domain(ID); thread_loop_c(t,domain) { begin_c_loop(c,t) { 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,3)=K; 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")); } end_c_loop(c,t) } } |
All times are GMT -4. The time now is 01:18. |