CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Multiple Surface Reaction DPM_PR_RATE

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   January 5, 2009, 11:39
Default Multiple Surface Reaction DPM_PR_RATE
Posts: n/a
I used a UDF code from Fluent manual directly but cannot compile. it report an error in syntax correction. What is wrong with the CODE from FLUENT company ? Does anyone know about this, please help?


#include "udf.h" #define c1 5e-12 #define A1 0.002 #define E1 7.9e7 #define tolerance 1e-4 #define order 0.9 real reaction_rate(real rate, real ruser[], int iuser[], cxboolean buser[], char *cuser) { return (ruser[2]*pow(MAX(0.,(ruser[0]-rate/ruser[1])),order) -rate); } DEFINE_PR_RATE(user_rate,c,t,r,mw,pp,p,sf,dif_i,ca t_i,rr) { if (!strcmp(r->name, "reaction-2")) { cxboolean ifail=FALSE; real ash_mass = P_INIT_MASS(p)*(1.-DPM_CHAR_FRACTION(p)-DPM_VOLATILE_FRACTION(p)); real one_minus_conv = MAX(0.,(P_MASS(p) -ash_mass) / P_INIT_MASS(p)/ DPM_CHAR_FRACTION(p));

c Fluent Inc. September 11, 2006 2-55 DEFINE Macros real ruser[3]; int iuser[1]; cxboolean buser[1]; char cuser[30]; real ratemin, ratemax, root; ruser[0] = pp[dif_i]; ruser[1] = MAX(1.E-15, (c1*pow(0.5*(P_T(p)+C_T(c,t)),0.75)/P_DIAM(p))); ruser[2] = A1*exp(-E1/UNIVERSAL_GAS_CONSTANT/P_T(p)); strcpy(cuser, "reaction-2"); ratemin=0; ratemax=ruser[1]*pp[dif_i]; /* arguments for auxiliary function zbrent_pr_rate */ root = zbrent_pr_rate(reaction_rate, ruser, iuser, buser, cuser, ratemin, ratemax, tolerance, &ifail); if (ifail) root=MAX(1.E-15,ruser[1]); *rr=-root*P_DIAM(p)*P_DIAM(p)*M_PI*sf[0]*one_minus_conv; Message("Fail status %d\n", ifail); Message("Reaction rate for reaction %s : %g\n", cuser, *rr); } }
  Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple domain interfaces on a single surface mike CFX 2 January 26, 2009 18:03
udf:surface reaction:volumetric reaction: compile Ali FLUENT 2 February 18, 2007 04:20
Selecting multiple surface in ICEM CFD 4 CFX Ahmed CFX 4 March 15, 2004 11:06
surface monitor - multiple lines in one chart? jx FLUENT 6 January 12, 2004 06:51
about UDF,VOF, surface reaction Burley Wang FLUENT 10 March 13, 2000 08:08

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