找回密码
 注册
查看: 2548|回复: 3

各位高手帮忙看看错误吧!

[复制链接]
发表于 2006-3-28 20:00:21 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
  face_t f;
begin_f_loop(f, thread)
    {
      real t = RP_Get_Real("flow-time");
  if(t<=1.57)
            F_PROFILE(f, thread, position) =0.2+0.1*sin(4*t);
  else
             F_PROFILE(f, thread, position)=0.2;
    }
  end_f_loop(f, thread)
}
一个小程序,想在入口处定义边界条件,在1,57秒前加一个小的扰动,以后就是常数,但是运行是出错误,各位高手帮忙看一下,小弟谢谢了
发表于 2006-4-6 19:36:48 | 显示全部楼层

各位高手帮忙看看错误吧!

没有问题吧
发表于 2006-4-9 16:58:52 | 显示全部楼层

各位高手帮忙看看错误吧!

real t = RP_Get_Real("flow-time");最好放在前面,且应包括&#35;include "unsteady.h"
发表于 2011-1-22 15:12:53 | 显示全部楼层
只是调整了下位置,提高下代码执行效率,其他貌似没问题,

#include "udf.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
        face_t f;
        real t = RP_Get_Real("flow-time");
        begin_f_loop(f, thread)
        {                  
                if(t<=1.57)
                        F_PROFILE(f, thread, position) =0.2+0.1*sin(4*t);
                else
                        F_PROFILE(f, thread, position)=0.2;
        }
        end_f_loop(f, thread)
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表