在fluent中编译UDF时中,为何老在 else那一行出现parse error,难道UDF不能使用else语句么
代码如下:#include"udf.h"DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t){realmu_t;realrho=C_R(c,...
代码如下:
#include "udf.h"
DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real mu_t;
real rho=C_R(c,t);
real velocity_x=C_U(c,t);
real velocity_y=C_V(c,t);
real dist=C_WALL_DIST(c,t);
if (dist>=0.3);
mu_t=0.03874*rho*dist*sqrt(velocity_x*velocity_x+velocity_y*velocity_y);
return mu_t;
else;
mu_t=rho*0.419*dist*0.419*dist*sqrt(2*0.5*(C_DUDX(c,t)+C_DUDY(c,t))*0.5*(C_DVDX(c,t)+C_DVDY(c,t)));
return mu_t;
}
错误即为:else那一行的:parse error 展开
#include "udf.h"
DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real mu_t;
real rho=C_R(c,t);
real velocity_x=C_U(c,t);
real velocity_y=C_V(c,t);
real dist=C_WALL_DIST(c,t);
if (dist>=0.3);
mu_t=0.03874*rho*dist*sqrt(velocity_x*velocity_x+velocity_y*velocity_y);
return mu_t;
else;
mu_t=rho*0.419*dist*0.419*dist*sqrt(2*0.5*(C_DUDX(c,t)+C_DUDY(c,t))*0.5*(C_DVDX(c,t)+C_DVDY(c,t)));
return mu_t;
}
错误即为:else那一行的:parse error 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询