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

求助udf边界命令

[复制链接]
发表于 2016-11-15 09:05:57 | 显示全部楼层 |阅读模式
10金钱
平时用的边界条件都是施加在面上,用face循环,但是这个例子里这种用法想不通。请问有谁懂这第二种功能吗?DEFINE_PROFILE(XXXX, thread, np)到底是干啥,怎么作用?是给边界相邻网格里的流体变量赋常数值还是什么的,简单通俗点,希望各位不吝赐教,谢谢!

DEFINE_PROFILE is usually used to specify a profile condition on a boundary face zone, it can also be used to specify, or fix, flow variables that are held constant during computation in a cell zone.

#define va1 3.1131e-2
#define va2 -10.313
#define va3 9.5558e2
#define va4 -2.0051e4
#define va5 1.1856e5

DEFINE_PROFILE(fixed_v, thread, np)
{
cell_t c;
real x[ND_ND];
real r;
begin_c_loop (c,thread)      //请问这个cell循环的作用,一般边界条件都用face循环?
{

C_CENTROID(x,c,thread);
r =x[1];
F_PROFILE(c,thread,np) =
va1+(va2*r)+(va3*r*r)+(va4*r*r*r)+(va5*r*r*r*r);
}
end_c_loop (c,thread)
}

最佳答案

查看完整内容

/* FLUENT UDF中关于二维和三维网格的术语请参见fluent->Customization Manual->1.6. Mesh Terminology,二维网格中的cell就是三维网格中的face,所以,首先要明确你的网格是二维的还是三维的 。 一般情况下,DEFINE_PROFILE()用于边界条件的设定,但是也可用于区域条件的设定。 下面udf定义的就是一个区域的参数,示意图参见fluent->Customization Manual->6.2.5. Fixing the Values of Variables */ // 定义常量 #define va ...
发表于 2016-11-15 09:05:58 | 显示全部楼层
/* FLUENT UDF中关于二维和三维网格的术语请参见fluent->Customization Manual->1.6. Mesh Terminology,二维网格中的cell就是三维网格中的face,所以,首先要明确你的网格是二维的还是三维的 。
一般情况下,DEFINE_PROFILE()用于边界条件的设定,但是也可用于区域条件的设定。
下面udf定义的就是一个区域的参数,示意图参见fluent->Customization Manual->6.2.5. Fixing the Values of Variables */
// 定义常量
#define va1 3.1131e-2
#define va2 -10.313
#define va3 9.5558e2
#define va4 -2.0051e4
#define va5 1.1856e5
//定义区域条件
DEFINE_PROFILE(fixed_v, thread, np)
{
cell_t c;
real x[ND_ND];
real r;
begin_c_loop (c,thread)      //对给定区域的单元进行循环
{

C_CENTROID(x,c,thread); // 获取单元质心坐标
r =x[1];                             //令r等于单元质心纵坐标
F_PROFILE(c,thread,np) =
va1+(va2*r)+(va3*r*r)+(va4*r*r*r)+(va5*r*r*r*r); //赋值
}
end_c_loop (c,thread)
}
回复

使用道具 举报

发表于 2016-11-15 09:54:53 | 显示全部楼层
这个既可以用来定义边界,也可以用来定义流体域个网格中的材料属性,如粘度,比热等;
你这个是用来固定速度,在帮助中讲到可以用来定义如下参数:
velocity, pressure, temperature, turbulence kinetic energy, turbulence dissipation rate

mass flux

target mass flow rate as a function of physical flow time

species mass fraction (species transport)

volume fraction (multiphase models)

wall thermal conditions (temperature, heat flux, heat generation rate, heat transfer coefficients, and external emissivity, etc.)

wall roughness conditions

wall shear and stress conditions

porosity

porous resistance direction vector

wall adhesion contact angle (VOF multiphase model)

source terms

fixed variables
回复

使用道具 举报

 楼主| 发表于 2016-11-16 09:47:03 | 显示全部楼层
谢谢各位,之前查看的是中午教程,后来仔细查看了一下用户手册差不多明白了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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