FLUENT UDF代码 - 颗粒(煤或生物质)床层多相流燃烧过程数值模拟-第2部分-完结

发布时间 : 星期二 文章FLUENT UDF代码 - 颗粒(煤或生物质)床层多相流燃烧过程数值模拟-第2部分-完结更新完毕开始阅读

Thread **pt = THREAD_SUB_THREADS(t); Thread *tp = pt[0]; /* gas phase */ double minR = 1.e+20, numerator = 0.; double denom =0.,ci;

int i;

double Amix = 4., Bmix = 0.5;

for(i=0; i< r->n_reactants; ++i) {

if(r->stoich_reactant[i] != 0.0) {

ci = C_R(c,tp)*yi[0][r->reactant[i]]/mw[0][r->reactant[i]]; SETMIN(minR, ci/r->stoich_reactant[i]); } }

for(i=0; i< r->n_products; ++i) {

if(r->stoich_product[i] != 0.0) {

ci = C_R(c,tp)*yi[0][r->product[i]]/mw[0][r->product[i]]; numerator +=ci*mw[0][r->product[i]];

denom +=r->stoich_product[i]*mw[0][r->product[i]]; } }

double rr_turb = Amix * C_D(c,tp)/C_K(c,tp) * MIN(minR, Bmix*numerator/denom); return rr_turb; }

void SolidFuel_Reactant(cell_t c, Thread *t, Hetero_Reaction *hr, double* y_carbon, double* mol_weight) {

Thread **pt = THREAD_SUB_THREADS(t); int i;

for(i=0; i< hr->n_reactants; ++i) {

if(hr->stoich_reactant[i] != 0.0) { int phase = DOMAIN_INDEX(hr->domain_reactant[i]); Thread *thread = pt[phase]; /* solid phase */

21

if(phase != 0) { *y_carbon = C_YI(c,thread,hr->reactant[i]); *mol_weight = mw[phase][hr->reactant[i]]; } } } }

22

联系合同范文客服:xxxxx#qq.com(#替换为@)