|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
关于DUF 运行出现错误 请大家帮帮忙 看看怎么错了
(chdir "libudf")()
(chdir "ntx86\3d")()
6.c
..\..\src\6.c(2) : warning C4002: too many actual parameters for macro 'DEFINE_DPM_VP_EQUILIB'
..\..\src\6.c(44) : error C2065: 'Z' : undeclared identifier
..\..\src\6.c(44) : error C2100: illegal indirection
我的UDF 为
#include <udf.h>
DEFINE_DPM_VP_EQUILIB (raoult_vpe,p,cvap_surf,Z)
{
int is;
real molwt[MAX_SPE_EQNS];
Thread *t0 = P_CELL_THREAD(p); /* cell thread of particle location */
Material *gas_mix = THREAD_MATERIAL(t0); /* gas mixture material */
Material *cond_mix = P_MATERIAL(p); /* particle mixture material */
int nc = TP_N_COMPONENTS(p); /* number of particle components */
real Tp = P_T(p); /* particle temperature */
real molwt_cond = 0.; /* reciprocal molecular weight of the particle */
for (is = 0; is < nc; is++)
{
int gas_index = TP_COMPONENT_INDEX_I(p,is); /* index of vaporizing
component in the gas phase */
if (gas_index >= 0)
{
/* the molecular weight of particle material */
molwt[gas_index] =
MATERIAL_PROP(MIXTURE_COMPONENT(gas_mix,gas_index),PROP_mwi);
molwt_cond += TP_COMPONENT_I(p,is) / molwt[gas_index];
}
}
/* prevent division by zero */
molwt_cond = MAX(molwt_cond,DPM_SMALL);
for (is = 0; is < nc; is++) {
/* gas species index of vaporization */
int gas_index = TP_COMPONENT_INDEX_I(p,is);
if( gas_index >= 0 )
{
/* condensed material */
Material * cond_c = MIXTURE_COMPONENT( cond_mix, is );
/* condensed component molefraction */
real xi_cond = TP_COMPONENT_I(p,is)/(molwt[gas_index]*molwt_cond);
/* particle saturation pressure */
real p_saturation = DPM_vapor_pressure(p, cond_c, Tp);
if (p_saturation < 0.0)
p_saturation = 0.0;
/* vapor pressure over the surface, this is the actual Raoult law */
cvap_surf[is] = xi_cond * p_saturation / UNIVERSAL_GAS_C*****TANT / Tp;
}
}
/* compressibility for ideal gas */
*Z = 1.0;
} |
|