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

由温度控制速度边界条件!求救

[复制链接]
发表于 2010-5-20 16:00:54 | 显示全部楼层 |阅读模式

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

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

x
问题是这样的,根据ID为7的面上的温度来控制速度边界条件,当温度小于923k是速度入口为17。5,温度大于923k时速度入口为o。

#include "udf.h"
DEFINE_PROFILE(INLRT_L_velocity,thread,position)
{
        real temp;
        face_t f;
        int ID_bottom=7;
        Domain *domain;
        Thread *thread_bottom = Lookup_Thread(domain, ID_bottom);
        begin_f_loop(f,thread_bottom)
        {
           temp=F_T(f,thread_bottom);         
           if (temp<923)
           {F_PROFILE(f,thread,position) = 17.5;}
          else
           {F_PROFILE(f,thread,position) = 0;}
        }
         end_f_loop(f,thread_bottom)      
}
编译通过了,可是材边界条件中已选择,就会出现Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()

求高手指点
发表于 2010-5-21 09:00:33 | 显示全部楼层
不用另外定义thread_bottom,DEFINE_PROFILE里面有thread传进来的。begin_f_loop(f,thread)就可以了
 楼主| 发表于 2010-5-21 12:59:35 | 显示全部楼层
试了还是不行!虽然不报错了,但是速度入口始终为0,就是先用常数计算既不后,带入udf入口速度就变为0了。但是区域温度明显小于923k
发表于 2010-5-21 16:36:45 | 显示全部楼层

回复 1# 学习交流 的帖子

temp=F_T(f,thread_bottom);
查看TEMP返回值,或者你的边界温度是多少?
if (temp<923)
数值请用浮点型表示!!!

[ 本帖最后由 mayo_0 于 2010-5-22 00:47 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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