24小时热门版块排行榜    

Znn3bq.jpeg
查看: 1017  |  回复: 0

llongtan

木虫 (小有名气)

老木虫

[求助] Define_DPM_Heat_Mass的UDF中 solver_par.molWeight[gas_index]的意义

这两天看UDF的英文帮助中,看到DEFINE_DPM_HEAT_MASS的一个例子,对于solver_par.molWeight的含义不太清楚,请哪位大侠能够解释下。

谢谢了。

DEFINE_DPM_HEAT_MASS(multivap,p,Cp,hgas,hvap,cvap_surf,dydt,dzdt)
{
int ns;
int nc = TP_N_COMPONENTS( p ); /* number of particle components */
cell_t c0 = RP_CELL(&(p->cCell)); /* cell and thread */
Thread *t0 = RP_THREAD( &(p->cCell) ); /* where the particle is in */
Material *gas_mix = THREAD_MATERIAL( t0 ); /* gas mixture material */
Material *cond_mix = p->injection->material;/* particle mixture material */
cphase_state_t *c = &(p->cphase); /* cell info of particle location */
real molwt[MAX_SPE_EQNS]; /* molecular weight of gas species */
real Tp = P_T(p); /* particle temperature */
real mp = P_MASS(p); /* particle mass */
real molwt_bulk = 0.; /* average molecular weight in bulk gas */
real Dp = DPM_DIAM_FROM_VOL( mp / P_RHO(p) ); /* particle diameter */
real Ap = DPM_AREA(Dp); /* particle surface */
real Pr = c->sHeat * c->mu / c->tCond; /* Prandtl number */
real Nu = 2.0 + 0.6 * sqrt( p->Re ) * pow( Pr, 1./3. ); /* Nusselt number */
real h = Nu * c->tCond / Dp; /* Heat transfer coefficient */
real dh_dt = h * ( c->temp - Tp ) * Ap; /* heat source term */
dydt[0] += dh_dt / ( mp * Cp );
dzdt->energy -= dh_dt;
{
Material *sp;
mixture_species_loop(gas_mix,sp,ns)
{
molwt[ns] = MATERIAL_PROP(sp,PROP_mwi); /* molecular weight of gas species */
molwt_bulk += C_YI(c0,t0,ns) / molwt[ns]; /* average molecular weight */
}
}
/* prevent division by zero */
molwt_bulk = MAX(molwt_bulk,DPM_SMALL);
for( ns = 0; ns < nc; ns++ )
{
/* gas species index of vaporization */
int gas_index = TP_COMPONENT_INDEX_I(p,ns);
if( gas_index >= 0 )
{
/* condensed material */
Material * cond_c = MIXTURE_COMPONENT(cond_mix, ns );
/* vaporization temperature */
real vap_temp = MATERIAL_PROP(cond_c,PROP_vap_temp);
/* diffusion coefficient */
real D = MATERIAL_PROP_POLYNOMIAL( cond_c, PROP_binary_diffusivity, c->temp);
/* Schmidt number */
real Sc = c->mu / ( c->rho * D );
/* mass transfer coefficient */
real k = ( 2. + 0.6 * sqrt(p->Re) * pow( Sc, 1./3. ) ) * D / Dp;



/* bulk gas concentration */
real cvap_bulk = c->pressure / UNIVERSAL_GAS_CONSTANT / c->temp
* c->yi[gas_index] / molwt_bulk / solver_par.molWeight[gas_index];

/* vaporization rate */
real vap_rate = k * molwt[gas_index] * Ap * ( cvap_surf[ns] - cvap_bulk );
/* only condensation below vaporization temperature */
if( 0. < vap_rate && Tp < vap_temp )
vap_rate = 0.;
dydt[1+ns] -= vap_rate;
dzdt->species[gas_index] += vap_rate;
/* dT/dt = dh/dt / (m Cp)*/
dydt[0] -= hvap[gas_index] * vap_rate / ( mp * Cp );
/* gas enthalpy source term */
dzdt->energy += hgas[gas_index] * vap_rate;
}
}
}

[ Last edited by llongtan on 2012-11-12 at 08:49 ]
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 llongtan 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 295分求调剂 +13 ?要上岸? 2026-04-10 13/650 2026-04-12 15:37 by laoshidan
[考研] 339求调剂 +8 hanwudada 2026-04-11 9/450 2026-04-12 15:36 by laoshidan
[考研] 211本科材料化工求调剂 +15 YHLAH 2026-04-11 16/800 2026-04-12 12:44 by BruceLiu320
[考研] 求调剂,262机械专硕 +8 嗯yyl 2026-04-08 8/400 2026-04-12 02:31 by 秋豆菜芽
[考研] 0854调剂 +8 长弓傲 2026-04-11 9/450 2026-04-11 21:44 by 蓝云思雨
[考研] 303求调剂 +14 SereinQ 2026-04-10 15/750 2026-04-11 20:43 by 蓝云思雨
[考研] 材料工程085601,270求调剂 +30 @ASDF1234 2026-04-08 32/1600 2026-04-11 10:30 by Delta2012
[考研] 还有化工二轮调剂的学校吗 5+14 化工人999 2026-04-09 48/2400 2026-04-11 10:27 by 89436494
[考研] 复试调剂 +9 积极向上; 2026-04-10 11/550 2026-04-11 09:25 by 猪会飞
[考研] 本9 一志愿西工大085601 324求调剂 +5 wysyjs25 2026-04-10 5/250 2026-04-10 16:57 by luoyongfeng
[考研] 一志愿京区985,085401电子信息,本科电子信息 +3 阳光开朗的男孩 2026-04-10 3/150 2026-04-10 16:29 by sophia_93
[考研] 0702物理学学硕299求调剂 +6 祁柒连 2026-04-06 6/300 2026-04-10 11:10 by Roomoo
[考研] 08工学 309分求调剂 +6 Yin DY 2026-04-08 6/300 2026-04-10 09:18 by Delta2012
[考研] 本科郑州大学,一志愿华东师范大学282求调剂 +23 熊哥xtk 2026-04-07 26/1300 2026-04-09 17:17 by 18446523
[考研] 085801 总分275 本科新能源 求调剂 +8 bradoner 2026-04-08 9/450 2026-04-09 13:43 by only周
[考研] 266调剂 +8 daya sun 2026-04-07 9/450 2026-04-08 20:27 by yutian743
[考研] 327求调剂 +12 Xxjc1107. 2026-04-06 12/600 2026-04-08 16:46 by luoyongfeng
[考研] 307求调剂 +14 超级伊昂大王 2026-04-06 14/700 2026-04-08 07:03 by 无际的草原
[考研] 求助 +3 卡卡东88 2026-04-06 4/200 2026-04-06 15:28 by going home
[考研] 一志愿河北工业大学材料工程,初试344求专硕调剂 +6 15933906766 2026-04-05 6/300 2026-04-06 13:21 by 无际的草原
信息提示
请填处理意见