加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Fluent学习笔记(18)----DEFINE_PROFILE

(2013-01-16 20:32:59)
标签:

杂谈

内径为r,长度为L 的圆管,给出入口流速的分布,来模拟实际的工作过程。

1.gambit

简化为2d对称模型,inlet长度为0.02m,wall长度为0.4m,axis——symm 为对称轴。

http://s14/mw690/c041a1eb4d36715e7943d&690

入口水流速度为 u=0.5-0.5x(y/0.02)2

2.fluent

编写udf

#include"udf.h"

DEFINE_PROFILE(velocity_inlet,thread,position)

{

 real x[ND_ND];

 real y;

 face_t f;

 begin_f_loop(f,thread)

 {

   F_CENTROID(x,f,thread);

   y=x[1];

   F_PROFILE(f,thread,position)=0.5-y*y/(0.02*0.02)*0.5;

 }

 end_f_loop(f,thread)

}

其中宏的有两自变量thread 和 position,thread 是一个指向面的thread的指针,position是一个整数,它是每一个循环(loop)内为变量设置的数字标签。

 begin_f_loop(f,thread) 是用来扫描整个区域内所有面。在每个循环中,通过fluent提供的函数F_CENTROID(x,f,thread);得到面f的质心,并且把质心的坐标值赋值给x。

 注意:

基本求解器中space项变为axisymmetric,

 udf的编译

define—user defined –function –interpreted

http://s15/mw690/c041a1eb4d367a280fade&690

boundary condition

 zone 下inlet中,velocity magnitude(m/s)后面的小三角即可找到udf velocity_inlet

http://s8/mw690/c041a1eb4d3671b173147&690

initialize, compute from 为inlet。

solve即可

后处理

plot---xy plot

http://s12/mw690/c041a1eb4d3671d9e1e7b&690

得到出口处的速度分布。同时点击write to file 即可得到数据文件,用记事本就可以打开。

http://s8/bmiddle/c041a1eb4d367ae4d6697&690

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有