木虫 (小有名气)
老木虫
|
[求助]
UDF的编译通不过
我从UDF的英文帮助中复制粘贴下面的内容成c程序,通过fluent的udf导入编译,(Define->user-defined->functions->interpreted)弹出下面的错误
cpp -I"C:\Fluent.Inc\fluent6.3.26/src" -I"C:\Fluent.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent.Inc\fluent6.3.26/client/src" -I"C:\Fluent.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="" "E:\计算\冷凝-重试\condensation-2.c"
Error: E:\\274\306\313\343\\300\344\304\375-\326\330\312\324\condensation-2.c: line 9: structure reference not implemented
我看了fluent的“dpm.h”的头文件,在其中存在这个结构,请问大侠,这个是什么原因造成的,怎样才能解决这个问题。
c程序在附件中也有一份。
/***********************************************************************
UDF for defining the heat and mass transport for
multicomponent particle vaporization
***********************************************************************/
#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 */
//以离散相P确定P所在的单元及线,以及单元,从而找到该单元连续相的信息。
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 molwt_bulk=0.0; /* average molecular weight in bulk gas */
//离散相的信息:温度、质量、粒径,表面积,普朗特数Pr,努赛尔德数Nu,表面对流系数,;
real Tp=P_T(p); /* particle temperature */
real mp=P_MASS(p); /* particle mass */
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.0/3.0); /* Nusselt number 可以从《传热传质基本原理》的P270的公式(7.56)*/
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;
//求1/平均分子量的值,在解释中为平均分子量,实际计算为其倒数,因此在引用时要注意
{
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
/* 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+0.6*sqrt(p->Re)*pow(Sc,1.0/3.0))*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.0
vap_rate=0.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;
}
}
}
1.jpg[ Last edited by llongtan on 2012-11-19 at 15:13 ] |
» 本帖附件资源列表
-
欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:libolin3@tal.com
- 附件 1 : condensation-2.c
2012-11-19 15:09:25, 3.11 K
- 附件 2 : 1.cas
2012-11-19 15:13:59, 892.03 K
- 附件 3 : 1.dat
2012-11-19 15:14:03, 2.54 M
» 收录本帖的淘贴专辑推荐
» 猜你喜欢
» 本主题相关价值贴推荐,对您同样有帮助:
|