|
[Sponsors] |
November 10, 2003, 09:49 |
deadly need help
|
#1 |
Guest
Posts: n/a
|
I have struggled for surface reaction UDF for one week, I even can not get the sample UDF in manual right. Please take a look and give me a help! Your time and kindness are greatly appreciate. The code is from 4-44 to 4-46 UDF manual.
The error is 'THREAD_STORE: undefined variable" in line of " *rr=reaction_rate(F_C0(f,fthread), F_C0_THREAD(f,fthread),mw,yi); " Thanks. include "udf.h" /* ARRHENIUS CONSTANTS */ #define PRE_EXP 1e+15 #define ACTIVE 1e+08 #define BETA 0.0 real arrhenius_rate(real temp) { real trate =PRE_EXP*pow(temp,BETA)*exp(-ACTIVE/(UNIVERSAL_GAS_CONSTANT*temp)) ; return trate ; } /* Species numbers. Must match order in Fluent panel */ #define HF 0 #define WF6 1 #define H2O 2 #define NUM_SPECS 3 /* Reaction Exponents */ #define HF_EXP 2.0 #define WF6_EXP 0.0 #define H2O_EXP 0.0 #define MW_H2 2.0 #define STOIC_H2 3.0 /* Reaction Rate Routine that is used in both UDFs */ real reaction_rate(cell_t c, Thread *cthread,real mw[],real yi[]) { real concenHF = C_R(c, cthread)*yi[HF]/mw[HF]; real tcrate = arrhenius_rate( C_T(c,cthread)) *pow(concenHF,HF_EXP) ; return tcrate; } DEFINE_SR_RATE(arrhenius,f,fthread,r,mw,yi,rr) { *rr = reaction_rate(F_C0(f,fthread), F_C0_THREAD(f,fthread),mw,yi); } real contact_area(cell_t c, Thread *t, int s_id, int *n) { int i = 0; real area = 0.0, A[ND_ND]; *n = 0; c_face_loop(c,t,i) { if(THREAD_ID(C_FACE_THREAD(c,t,i)) == s_id) { (*n)++; F_AREA(A, C_FACE(c,t,i), C_FACE_THREAD(c,t,i)); area += NV_MAG(A); } } return area; } |
|
November 10, 2003, 10:23 |
Re: deadly need help
|
#2 |
Guest
Posts: n/a
|
Please let us know, what error message you are getting?
Chendhil. |
|
November 10, 2003, 10:53 |
Re: deadly need help
|
#3 |
Guest
Posts: n/a
|
The error is 'THREAD_STORE: undefined variable" in line of
" *rr=reaction_rate(F_C0(f,fthread), F_C0_THREAD(f,fthread),mw,yi); " Thanks! |
|
November 11, 2003, 11:07 |
Re: deadly need help
|
#4 |
Guest
Posts: n/a
|
I am sorry I have not come across this type of error before.
Chendhil. |
|
November 11, 2003, 18:40 |
Re: deadly need help
|
#5 |
Guest
Posts: n/a
|
Solved the problem by using Compiled UDF rather than intepreted UDF.
|
|
|
|