这是我的UDF
/Heterogeneous net reaction/
include "udf.h"
//# include "mem.h"
//# include "sg_mphase.h"
define FLUID_ZONE_ID 3 /Zone ID of Reaction/
define R 8.31434 /Gas Constant J/mol-K/
define Pre 2.65 /Pre-exponential factor, 1/s-kPa/
define E1 538.2e5 /Activation Energy, J/mol/
define rho_ca2fe2o5 14.375 /Molar density of Ca2Fe2O5, kgmol/m3/
DEFINE_HET_RXN_RATE(het_rxn_rate, c, t, r, mw, yi, rr, rr_t)
{
//int zone_id;
Thread **pt = THREAD_SUB_THREADS(t);
Thread *prim_t = pt[0]; /Thread for primary Phase/
Thread *sec_t = pt[1]; /Thread for secondary Phase/
real T_SEC = C_T(c,sec_t); /Phase secondary temperature, K/
real P = C_P(c,prim_t)/1000; /Static pressure of the primary phase, kPa/
real y_h2 = C_YI(c,prim_t,0); /Mass fraction of gas species in primary phase/
real Nsum;
y_h2 *= 1/mw[0][0];
Nsum = y_h2 ;
y_h2 *= 1/Nsum;
rr = rho_ca2fe2o5Py_h2Preexp(-E1/(RT_SEC));
}