24小时热门版块排行榜    

查看: 753  |  回复: 2
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

无极士

金虫 (小有名气)

[交流] 【求助】fluent udf 变热流边界【已解决】 已有2人参与

#include "udf.h"
DEFINE_PROFILE(unsteady_temperature, thread, position)
{
real t, temperature;
face_t f;
begin_f_loop(f, thread)
{
  t = RP_Get_Real("flow-time";

  if (0<(t/3600)<=10)
      temperature = 1470;
      F_PROFILE(f, thread, position) = temperature;
  else
      temperature = 0;
}     F_PROFILE(f, thread, position) = temperature;
end_f_loop(f, thread)
}
这时我的代码。
但是在运行的时候,老是提示 else这个有错误:pase error。
请问大侠帮忙解答一下?

在这在其中编辑取余数的符号“%”,为什么不能用?

[ Last edited by nono2009 on 2010-8-8 at 06:35 ]
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

无极士

金虫 (小有名气)

if (0<(t/3600)<=10)
此问题我已解决……
这个判断语句不对,应该为0<(t/3600)  &&  (t/3600)<=10
3楼2010-08-07 15:41:44
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 3 个回答

hiqun

禁虫 (正式写手)

★ ★ ★
无极士(金币+1):谢谢参与
robert2020(金币+2):多谢应助!欢迎常来仿真模拟版交流! 2010-08-05 19:47:26
修改为以下程序:可通过编译。
#include "udf.h"
DEFINE_PROFILE(unsteady_temperature, thread, position)
{
real t, temperature;
face_t f;
begin_f_loop(f, thread)
{
  t = RP_Get_Real("flow-time";

  if (0<(t/3600)<=10)
      temperature = 1470;
  else
      temperature = 0;
}     F_PROFILE(f, thread, position) = temperature;
end_f_loop(f, thread)
}
2楼2010-08-05 15:12:41
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见