CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Parse Error for Surface Reaction UDF (http://www.cfd-online.com/Forums/main/114168-parse-error-surface-reaction-udf.html)

cgravell March 6, 2013 10:30

Parse Error for Surface Reaction UDF
 
I am having a few issues with my UDF for a surface reaction below. I am new to writting UDFs and using Fluent so the help is very much appreciated.

#include "udf.h"

#define K1 42.8236
#define K2 41831

#define CH2O 0
#define CO2 1
#define H2O 2
#define NUM_SPECIES 3

#define CH2O_EXP 1.0
#define CO2_EXP 0.0
#define H2O_EXP 0.0

real reaction_rate(cell_t c, Thread *cthread,real mw[],real yi[])
{
real concenCH2O = C_R(c,cthread)*yi[CH2O]/mw[CH2O]*K1/(1+K2);
}
DEFINE_SR_RATE(decomp_rate,f,fthread,r,mw,yi,rr)
{
*rr = reaction_rate(F_C0(f,fthread),THREAD_T0(fthread)mw ,yi);
}


This is the error message I am getting when I try to interpret the UDF:

cpp -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/cortex/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/client/src" -I"C:\PROGRA~1\ANSYSI~1\v140\fluent\fluent14.0.0/multiport/src" -I. -DUDF
ONFIG_H="<udfconfig.h>" "C:\Program Files\ANSYS Inc\v140\fluent\ntbin\win64\SR.c"
Error: C:\Program Files\ANSYS Inc\v140\fluent\ntbin\win64\SR.c: line 17: parse error.
udf limitation: decomp_rate: prototypes must appear outside the function body.
mw definition shadows previous definition
yi definition shadows previous definition
Error: C:\Program Files\ANSYS Inc\v140\fluent\ntbin\win64\SR.c: line 21: parse error.


All times are GMT -4. The time now is 21:05.