CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   backwards surface reaction (

Andrew Garrard May 14, 2003 11:23

backwards surface reaction
Is it possible to model a reversible surface reaction, for example A <-> B? The option is enabled in fluent5 but disabled in fluent6, which leads me to believe that it was not working in fluent5. I have tried creating two wall reactions, i.e. A -> B and B -> A at the same wall using UDF:

DEFINE_SR_RATE { if (!strcmp(r->name, "reaction-1")) { printf ("Reaction 1 being executed"); *rr = 500;} /* or any other value */ if (!strcmp(r->name, "reaction-2")) { printf ("Reaction 2 being executed"); *rr = 500;} /* or any other value */ }

When run, the value for reaction-1 can be used to vary the species concentration whereas the value in reaction-2 has no effect. Also the message that reaction is being executed does not appear.

Any help would be gratefully received.

cg May 15, 2003 07:50

Re: backwards surface reaction
It seems that the UDF is never beign called with "reaction-2". Try to put this...

Message("%s\n",r->name); at the top of the UDF to see the reaction name.

Andrew Garrard May 15, 2003 08:14

Re: backwards surface reaction
Thanks for the help, I am trying that right now. I also through a face =%d in the massage so I could see what face number it was accessing. For each iteration it prints reaction-1 for all the faces on all of the iterations, so is it not recognisng the second reaction I explicity specified in the Fluent GUI? Also here is another question about the reaction model that may be a way around the problem: The rate of creation/destruction of species is given by: R = k [conc] when you set *rr in the SR_RATE UDF are you setting k or k[conc]? I assumed it was k but in the UDF manual section 4.3.16 there was this example:

DEFINE_SR_RATE(my_rate, f, t, r, mw, yi, rr) { Thread *t0=t->t0; cell_t c0=F_C0(f,t); real sih4 = yi[0]; /* mass fraction of sih4 at the wall */ real si2h6 = yi[1]; real sih2 = yi[2]; real h2 = yi[3]; real ar = yi[4]; /* mass fraction of ar at the wall */

real rho_w = 1.0, site_rho = 1.0e-6, T_w = 300.0;

real si_s = yi[6]; /* site fraction of si_s*/ real sih_s = yi[7]; /* site fraction of sih_s*/

T_w = F_T(f,t); rho_w = C_R(c0,t0)*C_T(c0,t0)/T_w;

sih4 *= rho_w/mw[0]; /* converting of mass fractions to molar concentrations */ si2h6 *= rho_w/mw[1]; sih2 *= rho_w/mw[2]; h2 *= rho_w/mw[3]; ar *= rho_w/mw[4];

si_s *= site_rho; /* converting of site fractions to site concentrations */ sih_s *= site_rho;

if (STREQ(r->name, "reaction-1"))

*rr = 100.0*sih4; else if (STREQ(r->name, "reaction-2"))

*rr = 0.1*sih_s; else if (STREQ(r->name, "reaction-3"))

*rr = 100*si2h6*si_s; else if (STREQ(r->name, "reaction-4"))

*rr = 1.0e10*sih2;


where the concentrations are put in explicity. Any advise on this matter would be apprciated.

All times are GMT -4. The time now is 15:43.