CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

HELP----Surface Reaction UDF

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

Like Tree1Likes
  • 1 Post By Ashi

LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2009, 09:39
Default HELP----Surface Reaction UDF
New Member
Join Date: May 2009
Posts: 1
Rep Power: 0
Ashi is on a distinguished road
Hi to all,,

I am finding difficulty to define the "Surface Reaction" UDF for "Ethanol steam reforming reaction'.

I have tried to define it on face but it doesn't work. Its is giving error.

I request you to kindly help me regarding the same, so that I can proceed with my work further.
Hope for your kind reply.

#include "udf.h"
#include "math.h"
/* This function defines the volumetric rate of reaction mechanism*/
DEFINE_SR_RATE( rate,f,t,r,my,yi,rr)

/*Pre-exponential factors and Activation energies. The pre-exponential factors are multiplied by the density of the
catalyst multiplied by the effectiveness factor final for Ethanol*/
#define A1 33*1400*.001
#define A2 297*1400*.001
#define A3 7.31e12*1400*.001
#define A4 2.10e10*1400*.001
#define E1 10.1e3
#define E2 21e3
#define E3 2e3
#define E4 13.9e3

/* Species numbers. Must match order in Fluent panel*/
#define CO 0
#define H2 1
#define C2H6O 2
#define H2O 3
#define CO2 4
#define N2 5

#define NUM_SPECS 6

/* Mol. Wt of Species */
#define MW_CO 28
#define MW_H2 2
#define MW_C2H6O 46
#define MW_H2O 18
#define MW_CO2 44
#define MW_N2 28

/*Heats of adsorption (J/kmol)
#define HCO -70.65e3
#define HH2 -82.9e3
#define HC2H6O -38.28e3/*(same)*/
#define HH2O 88.68e3

/*Universal Gas Constant (J/mol*K) */
#define UGC 8.314
/*Adsorption pre-exponential constants */
#define ACO 8.23e-5
#define AH2 6.12e-9
#define AC2H6O 6.65e-4
#define AH2O 1.57e4

/*Adsorption coefficient final for ethanol*/
real KCO=ACO*exp(-HCO/(UGC*F_T(f,t)));
real KH2=AH2*exp(-HH2/(UGC*F_T(f,t)));
real KC2H6O=AC2H6O*exp(-HC2H6O/(UGC*F_T(f,t)));
real KH2O=AH2O*exp(-HH2O/(UGC*F_T(f,t)));
real KCO2=ACO2*exp(-HCO2/(UGC*F_T(f,t)));
/*Mass fractions final for ethanol*/
real mC2H6O=F_YI(f,t,0);
real mH2O=F_YI(f,t,1);
real mCO2=F_YI(f,t,2);
real mN2=F_YI(f,t,3);
real mCO=F_YI(f,t,4);
real mH2=F_YI(f,t,5);
/*Partial pressures final for ethanol*/
real pOp=1.01; /*operating pressure (bar)*/
real sum=(mC2H6O/46+mH2O/18+mCO2/44+mN2/28+mCO/28+mH2/2);
real pC2H6O=mC2H6O/46/sum*pOp;
real pH2O=mH2O/18/sum*pOp;
real pCO2=mCO2/44/sum*pOp;
real pN2=mN2/28/sum*pOp;
real pCO=mCO/28/sum*pOp;

/* Initialize equilibrium constants final for ethanol*/
real K1=2.33e+09;
real K2=1.49e+4;
real K3=3e+09;
real K4=K3;

if (!strcmp(r->name, "reaction-2"))
else if (!strcmp(r->name, "reaction-1"))
else if (!strcmp(r->name, "reaction-3"))
else if (!strcmp(r->name, "reaction-4"))
if (*rate>10) /* stops reaction rate from becoming unreasonable high; facilitates convergence */
else if (*rate<-10)
Adel abaidi likes this.
Ashi is offline   Reply With Quote

Old   May 19, 2020, 21:13
New Member
Join Date: Apr 2020
Posts: 9
Rep Power: 5
WZX is on a distinguished road
Hello,friend.My doctoral project is aslo about Steam Reforming of ethanol by using CFD.
I also face the same problem. How did you solve it?
WZX is offline   Reply With Quote


help -sr_ udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Surface Reaction Senthil FLUENT 1 July 2, 2012 07:40
problem about porous media and surface reaction Jeff Lee FLUENT 3 November 24, 2011 13:46
Surface reaction source definition. windhair CFX 0 March 17, 2008 05:36
Surface reaction in porous region shuailin FLUENT 0 November 10, 2005 10:57
backwards surface reaction Andrew Garrard FLUENT 2 May 15, 2003 08:14

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