|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我的udf程序,编译时出错,请各位帮忙看看,帮忙解决下
DEFINE_UDS_FLUX(my_uds_flux,f,t,i)
{
real dens;
int judge;
cell_t c0,c1 = -1;
Thread *t0,*t1 = NULL;
real NV_VEC(psi_vec),NV_VEC(A),flux= 0.0;
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
F_AREA(A,f,t);
/* If face lies at domain boundary, use face values; */
/* If face lies IN the domain, use average of adjacent
cells. */
judge = BOUNDARY_FACE_THREAD_P(t);
if (judge==1)
{
/* Depending on its BC, density may not be set on face
thread*/
dens=1.2;
NV_DS(psi_vec, =, F_U(f,t), F_V(f,t), F_W(f,t), *,
dens);
flux = NV_DOT(psi_vec, A); /* flux through Face */
}
else
{
c1 = F_C1(f,t); /* Get cell on other side of face
*/
t1 = THREAD_T1(t);
NV_DS(psi_vec, =, C_U(c0,t0),C_V(c0,t0),C_W
(c0,t0),*,C_R(c0,t0));
NV_DS(psi_vec, +=, C_U(c1,t1),C_V(c1,t1),C_W
(c1,t1),*,C_R(c1,t1));
flux = NV_DOT(psi_vec, A)/2.0; /* Average flux through
face */
}
/* Fluent will multiply the returned value by phi_f (the
scalar's
value at the face) to get the "complete'' advective
term. */
return flux;
}
编译后说下面这句是parse error
judge = BOUNDARY_FACE_THREAD_P(t); |
|