CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   surface reaction rate with udf (http://www.cfd-online.com/Forums/fluent/71239-surface-reaction-rate-udf.html)

 yellow-stuff December 21, 2009 08:26

surface reaction rate with udf

hello everybody
i'm facing a problem getting the surface reaction rate after my simulations.
i wrote an udf for the reaction rate, but fluent is not able to compute the reaction rate. the output says zero everytime.
do anyone of you know how to get the surface reaction rate, so i can plot it?

 t.krishnamohan December 21, 2009 19:24

Surface Reaction Rate

Please post the UDF that you have written.
Thanks

 yellow-stuff December 22, 2009 00:14

oh this is the udf:

#include "udf.h"
#define R 83140000
#define p 1013250
#define pi 3.14159

DEFINE_SR_RATE(my_rate,f,t,r,mw,yi,rr)
{
Thread *t0 = t -> t0;
cell_t c0=F_C0(f,t);

real c3h8 = yi[0];
real o2 = yi[1];
real co2 = yi[2];
real h2o = yi[3];
real n2 = yi[4];

real rho_w = 1.0, sd = 2.49e-9, T_w;
real o_s,o_vac;
real xc3h8 = 1.0, xo2 = 1.0;
real tn,Tg,Ea3, Ea4, Ea5;
real rA3, rA4, rA5,rk3, rk4, rk5;
real ro,rate;

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

c3h8 *= rho_w/mw[0];
o2 *= rho_w/mw[1];
co2 *= rho_w/mw[2];
h2o *= rho_w/mw[3];
n2 *= rho_w/mw[4];

/* Mole fraction of CH4 and O2 */

xc3h8 = c3h8/(c3h8+o2+co2 +h2o+n2);
xo2 = o2/(c3h8+o2+co2 +h2o+n2);

Tg = C_T(c0,t0);
tn = T_w/300;

/* Activation energies */
Ea3 = 0.0;
Ea4 = 0.126*tn*tn*tn*tn - 1.849*tn*tn*tn + 9.124*tn*tn - 13.253*tn + 23.903;
Ea5 = 4.0; //7.3 + 1.9*tn;

Ea3 *= 4184e7;
Ea4 *= 4184e7;
Ea5 *= 4184e7;

rA3 = (0.0542)*pow(tn,0.766);
rA4 = (8.41e12)*pow(tn,-0.796);
rA5 = (0.06)*pow(tn,0.154);

rk3 = (rA3/(sd*sd))*sqrt(R*T_w/(2*pi*mw[1]))*(p/(R*T_w));
rk4 = (rA4/sd)*exp(-Ea4/(R*T_w));
rk5 = (rA5/(sd*sd))*sqrt(R*T_w/(2*pi*mw[0]))*(p/(R*T_w))*exp(-Ea5/(R*T_w));

ro = sqrt(rk3*xo2/rk4);
o_s = ro/(1+ro);
o_vac = 1-o_s;
rate = rk5*xc3h8*(sd*sd)*pow(o_vac,2);

if (STREQ(r->name, "reaction-1"))
*rr = rate*pow(10,1)*1.7; // mol/cm2s --> kgmol/m2s * effectiveness
/* else if (STREQ(r->name, "reaction-2"))
*rr = -2*rate;
else if (STREQ(r->name, "reaction-3"))
*rr = rate;
else if (STREQ(r->name, "reaction-4"))
*rr = 2*rate; */
}

 yellow-stuff December 26, 2009 10:34

does nobody has a solution or suggestions?
the udf is correct, but i can't display the surface reaction rate, although fluent is calculating it.

 gkmih January 29, 2010 13:53

use "User Defined Memory"

It doesn't work to display the surface reaction rate in Contours panel under Reactions directly.

You can save the reaction rate in "User Defined Memory", then you can see the reaction rate in Contours panel under -> Contours of ->User Defined Memory -> User Memory #.

 All times are GMT -4. The time now is 08:17.