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

2025/5/4 16:41:26

= value; if (strcmp(var,\ == 0) A_soot_h2_gasification = value; if (strcmp(var,\ == 0) E_soot_h2_gasification = value; if (strcmp(var,\== 0) Annealing_soot_h2_gasification = value; if (strcmp(var,\ == 0) N_soot_h2_gasification = value; if (strcmp(var,\ if (strcmp(var,\ if (strcmp(var,\ == 0) A_c_combustion = value; if (strcmp(var,\ == 0) E_c_combustion = value; if (strcmp(var,\ == 0) N_c_combustion = value; if (strcmp(var,\ if (strcmp(var,\ if (strcmp(var,\ if (strcmp(var,\ if (strcmp(var,\

/* if (strcmp(var,\ == 0) c3m_ae5 = value; pan : Oct 2012 ... should not be used */ }

void read_c3m_data() {

CX_Message(\ FILE * pFile; char line[80]; char field1[80]; char field2[80]; char *pch; int i , field_index; pFile = fopen(\ if (pFile != NULL) {

17

CX_Message(\ char * pEnd = line; while (pEnd != NULL) {

/* CX_Message(\ pEnd = fgets(line,80,pFile); if (pEnd != NULL) { for (i=0; i<80; ++i) line[i] = tolower(line[i]); pch = strtok(line,\ field_index = 0; while (pch != NULL) { if (field_index == 0) { strcpy(field1,pch); field_index = 1;

/* CX_Message(\%s \\n\*/ } else { strcpy(field2,pch); field_index = 0; SetValue(field1,field2); SetBooleanValue(field1,field2); /* pan : Oct 2012 */ /* CX_Message(\

CX_Message(\ CX_Message(\ */ } pch = strtok(NULL,\ } } } fclose(pFile); }

18

}

/* pan c3m end */ #endif

DEFINE_EXCHANGE_PROPERTY(Heat_Trans_Coal, c, t, i, j) {

Thread *ti = THREAD_SUB_THREAD(t,i); Thread *tj = THREAD_SUB_THREAD(t,j); double val;

val = heat_gunn_udf(c,ti, tj); return val; }

DEFINE_EXCHANGE_PROPERTY(Heat_Trans_Recy, c, t, i, j) {

Thread *ti = THREAD_SUB_THREAD(t,i); Thread *tj = THREAD_SUB_THREAD(t,j); double val;

val = heat_gunn_udf(c,ti, tj); return val; }

double heat_gunn_udf(cell_t c, Thread *ti, Thread *tj) { double h;

double d = C_PHASE_DIAMETER(c,tj); double k = C_K_L(c,ti); double vf = C_VOF(c,ti); double vf2 = vf*vf; double vel, Re, Pr, Nu; #if RP_2D vel = pow(((C_U(c,tj)-C_U(c,ti))*(C_U(c,tj)-C_U(c,ti)) + (C_V(c,tj)-C_V(c,ti))*(C_V(c,tj)-C_V(c,ti))),0.5); #endif

#if RP_3D

vel = pow(((C_U(c,tj)-C_U(c,ti))*(C_U(c,tj)-C_U(c,ti)) + (C_V(c,tj)-C_V(c,ti))*(C_V(c,tj)-C_V(c,ti)) +

(C_W(c,tj)-C_W(c,ti))*(C_W(c,tj)-C_W(c,ti))),0.5); #endif

19

Re = RE_NUMBER(C_R(c,ti),vel,d,C_MU_L(c,ti)); Pr = PR_NUMBER (C_CP(c,ti),C_MU_L(c,ti),k); Pr = pow (Pr,1./3.);

Nu = (7. - 10*vf + 5.*vf2)*(1. + 0.7*pow(Re,0.2)*Pr) + (1.33 - 2.4*vf + 1.2*vf2)*pow(Re,0.7)*Pr;

h =IP_HEAT_COEFF(C_VOF(c,ti),C_VOF(c,tj),k,Nu,d); return h; }

double satPressure(double T) {

const double Tstd = 273.15; double TT = T - Tstd; double p_sat;

p_sat = (100.0 * 6.1121 * exp((18.678-TT/234.5)*(TT/(257.14+TT)))); return p_sat; }

double Get_Phase_Index(Hetero_Reaction *hr) {

/* This routine brings back the phase index of the secondary phase for the following reaction

A(s) + B(g) ---> ....

If there is more than one secondary phase in the reactant, the phase index obtained below will always be the phase index of the last secondary species in the reactant list */

Domain **dr = hr->domain_reactant; int i, index_phase = 0, iphase; for (i = 0; i < hr->n_reactants; i++) {

iphase = DOMAIN_INDEX(dr[i]); if(iphase > 0)

index_phase = iphase; }

return index_phase; }

double Turbulent_rr(cell_t c, Thread *t, Hetero_Reaction *r, real yi[MAX_PHASES][MAX_SPE_EQNS]) {

20


FLUENT UDF代码 - 颗粒(煤或生物质)床层多相流燃烧过程数值模拟-第2部分.doc 将本文的Word文档下载到电脑
搜索更多关于: FLUENT UDF代码 - 颗粒(煤或生物质)床层多相流燃 的文档
相关推荐
相关阅读
× 快捷下载通道(下载后可以自由复制和排版)

开通会员免费下载

开通会员后百万份文档资料免费自由复制和下载,是您最优的选择,赶快来试试吧!

单篇下载:10元 点击下载

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219