|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
以下是我编的程序,物理问题是把日平均温度赋给空气温度。日平均温度是随时间变化,会有不同的数值。在此UDF程序中,我只列出了两天的日平均温度。
#include "udf.h"
#define c 24;
Domain*domain;
face_t f;
Thread*t;
real n,current_time;
DEFINE_PROFILE(air_temp,t,i)
{
domain=Get_Domain(1);
t=Lookup_Thread(domain,4);
current_time=RP_Get_Real("flow-time");
begin_f_loop(f,t)
{
for(n=0;n<=10;n++)
{
if(current_time>=n*8760&¤t_time<=n*8760+c)
F_PROFILE(f,t,i)= 0.47;
else if(current_time>(c+n*8760)&¤t_time<=(n*8760+2*c))
F_PROFILE(f,t,i)= 1.91;
}
}
end_f_loop(f,t)
}
这个程序运行之后出现错误,错误提示如下:
.\..\src\air_temprature.c(19) : error C2143: syntax error : missing ')' before ';'
..\..\src\air_temprature.c(19) : error C2059: syntax error : ')'
..\..\src\air_temprature.c(22) : error C2181: illegal else without matching if
..\..\src\air_temprature.c(22) : error C2143: syntax error : missing ')' before ';'
..\..\src\air_temprature.c(22) : error C2059: syntax error : ')'
有哪位高手帮我看一下,我的程序是哪里出了问题? |
|