24小时热门版块排行榜    

查看: 1917  |  回复: 4

jizna

新虫 (初入文坛)

[交流] UDF加载问题,加载在哪,如何设置 已有2人参与

这个UDF在complied完之后,怎么加载进去,大神如何设置,求指导
#include "udf.h"
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; /* 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 += dh_dt / ( mp * Cp );
dzdt->energy -= dh_dt;
{
Material *sp;
mixture_species_loop(gas_mix,sp,ns)
{
molwt = MATERIAL_PROP(sp,PROP_mwi); /* molecular weight of gas species */
molwt_bulk += C_YI(c0,t0,ns) / molwt; /* 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 / molwt_bulk / solver_par.molWeight;
/* vaporization rate */
real vap_rate = k * molwt * Ap * ( cvap_surf - cvap_bulk );
/* only condensation below vaporization temperature */
if( 0. < vap_rate && Tp < vap_temp )
vap_rate = 0.;
dydt -= vap_rate;
dzdt->species += vap_rate;
/* dT/dt = dh/dt / (m Cp)*/
dydt -= hvap * vap_rate / ( mp * Cp );
/* gas enthalpy source term */
dzdt->energy += hgas * vap_rate;
}
}
}
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Xaiver

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
就按这里加载。
UDF加载问题,加载在哪,如何设置
1.png


UDF加载问题,加载在哪,如何设置-1
2.png

2楼2016-10-22 20:24:27
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhouxman

金虫 (小有名气)


小木虫: 金币+0.5, 给个红包,谢谢回帖
这个是什么宏? 什么用处?
一般宏加载 你要知道是什么作用 才行
3楼2016-10-23 18:25:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jizna

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by Xaiver at 2016-10-22 20:24:27
就按这里加载。

1.png

2.png

complid一下就行?不用其他设置是么

发自小木虫IOS客户端
4楼2016-10-24 15:52:19
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

jizna

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by Xaiver at 2016-10-22 20:24:27
就按这里加载。

1.png

2.png

Load直接开始迭代?

发自小木虫IOS客户端
5楼2016-10-24 15:53:15
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 jizna 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见