CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   parse error HELP””” (https://www.cfd-online.com/Forums/fluent-udf/91898-parse-error-help.html)

danielf August 25, 2011 19:56

parse error HELP”””
 
Hi every one, I'm very new with UDF. I“m trying to do a heterogeneous rxn rate UDF, but when I interpret, I got the following error message:
Error: C:/DOCUME~1/ADMINI~1/temp/kinetic_gas.c.1.c:line 10: parse error.

This is my UDF

#include "udf.h"

/*constants*/

#define sec_index 1
#define A 6.8E8
#define Ea 155.6E6

DEFINE_HET_RXN_RATE(kinetic_gas, c, t, r, mw, yi, rr, rr_t)

{
THREAD **pt = THREAD_SUB_THREADS(t);
THREAD *tp = pt[0];
THREAD *ts = pt[1];

real T_sec = C_T(c,ts);
real V_t = C_VOLUME(c,t);
real V_sec = C_VOLUME(c,ts);
real den_sec = C_R(c,ts);

*rr = (V_sec/V_t) * (den_sec/mw[sec_index][0]) * A * exp(-Ea/UNIVERSAL_GAS_CONSTANT/T_sec);
}
-------------------------------------------------------
Can anyone help me?:confused:

Thanks.

Amir August 26, 2011 04:46

Did you also check that as compiled one?

fox000002 August 27, 2011 02:49

THREAD ==> Thread

danielf January 26, 2012 16:21

Thanks a lot
 
Many thanks for you help, it was really helpful for me”””

ksitdikov February 2, 2012 10:52

Quote:

Originally Posted by danielf (Post 341366)
Many thanks for you help, it was really helpful for me”””

Sorry, can you help me to?

=) I don't understand your answer or it not work.

"lcpp -I"D:\PROGRA~2\ANSYSI~1\v140\fluent\fluent14.0.0/src" -I"D:\PROGRA~2\ANSYSI~1\v140\fluent\fluent14.0.0/cortex/src" -I"D:\PROGRA~2\ANSYSI~1\v140\fluent\fluent14.0.0/client/src" -I"D:\PROGRA~2\ANSYSI~1\v140\fluent\fluent14.0.0/multiport/src" -I. -DUDFONFIG_H="<udfconfig.h>" "C:\fluent.inc\ntbin\ntx86\udf.c"
Error: C:\fluent.inc\ntbin\ntx86\udf.c: line 2: parse error."

This is my UDF:

#include "udf.h"
DEFINE_PROFILE(unsteady_pressure, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if(t<=0.005598691909) F_PROFILE(f, thread, position) = 0;
else F_PROFILE(f, thread, position) = 43416802218475500.0*t*t*t*t*t*t-8526498997927940.0*t*t*t*t*t+646794364209152.0*t*t *t*t-23849388922560.0*t*t*t+426766277739.25*t*t-2818813480.39*t+6000000.0;
}
end_f_loop(f, thread)
}

ksitdikov February 2, 2012 11:40

Ok, I solve it! =)
My UDF contain invisible symbols. But in WORD i find it.
Good luck.


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