向各位大佬请教一下气固反应的UDF
-
请问一下各位大佬,我像如图定义了一个多相流的化学反应,并且编写了一个UDF来定义他的反应速率,可是遇到问题,计算过程中化学反应不能发生并且总是发散,想请问一下各位是否我的设置有错误还是UDF编写有错误?感谢各位大佬的指教。
-
这是我的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));
} -
@hustzzw 你这是
*
号都被格式化吃掉了吧。。看起来奇奇怪怪的可以加些输出语句,看看
y_h2
这些量算的对不对。(小心除零)