77范文网 - 专业文章范例文档资料分享平台

FLUENT udf中文资料ch4(6)

来源:网络收集 时间:2019-04-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

}

end_f_loop(f, t) }

/* profile for kinetic energy */

DEFINE_PROFILE(k_profile, t, i) {

real y, del, h, ufree, x[ND_ND]; real ff, utau, knw, kinf; face_t f;

h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.);

ff = 0.045/pow(ufree*del/VISC,0.25); utau=sqrt(ff*pow(ufree,2.)/2.0); knw=pow(utau,2.)/sqrt(CMU); kinf=0.002*pow(ufree,2.);

begin_f_loop(f, t) {

F_CENTROID(x,f,t); y=x[1];

if (y <= del)

F_PROFILE(f,t,i)=knw+y/del*(kinf-knw); else

F_PROFILE(f,t,i)=knw+(h-y)/del*(kinf-knw); }

end_f_loop(f, t) }

/* profile for dissipation rate */

DEFINE_PROFILE(dissip_profile, t, i) {

real y, x[ND_ND], del, h, ufree; real ff, utau, knw, kinf;

real mix, kay; face_t f;

h = YMAX - YMIN; del = DELOVRH*h; ufree = UMEAN*(B+1.);

ff = 0.045/pow(ufree*del/VISC,0.25); utau=sqrt(ff*pow(ufree,2.)/2.0); knw=pow(utau,2.)/sqrt(CMU); kinf=0.002*pow(ufree,2.);

begin_f_loop(f, t) {

F_CENTROID(x,f,t); y=x[1];

if (y <= del)

kay=knw+y/del*(kinf-knw); else

kay=knw+(h-y)/del*(kinf-knw);

if (VKC*y < 0.085*del) mix = VKC*y; else

mix = 0.085*del;

F_PROFILE(f,t,i)=pow(CMU,0.75)*pow(kay,1.5)/mix; }

end_f_loop(f,t) }

例子: 3

在下面的例子中:, DEFINE_PROFILE is used to fix flow variables that are held constant during computation in a cell zone. Three separate UDFs named fixed_u, fixed_v, and fixed_ke are defined in a single C source file. They specify fixed velocities that simulate the transient startup of an impeller in an impeller-driven mixing tank. The physical impeller is simulated by fixing the velocities and turbulence quantities using the fix option. See Section 6.26 of the User's Guide for more information on fixing variables.

/***********************************************************************/

/* Concatenated UDFs for simulating an impeller using fixed velocity */

/***********************************************************************/

#include \

#define FLUID_ID 1 #define ua1 -7.1357e-2 #define ua2 54.304 #define ua3 -3.1345e3 #define ua4 4.5578e4 #define ua5 -1.9664e5

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

#define ka1 2.2723e-2 #define ka2 6.7989 #define ka3 -424.18 #define ka4 9.4615e3 #define ka5 -7.7251e4 #define ka6 1.8410e5

#define da1 -6.5819e-2 #define da2 88.845 #define da3 -5.3731e3 #define da4 1.1643e5 #define da5 -9.1202e5 #define da6 1.9567e6

DEFINE_PROFILE(fixed_u, thread, np) {

cell_t c;

real x[ND_ND]; real r;

begin_c_loop (c,thread) {

/* centroid is defined to specify position dependent profiles*/

C_CENTROID(x,c,thread); r =x[1];

F_PROFILE(c,thread,np) =

ua1+(ua2*r)+(ua3*r*r)+(ua4*r*r*r)+(ua5*r*r*r*r); }

end_c_loop (c,thread) }

DEFINE_PROFILE(fixed_v, thread, np) {

cell_t c;

real x[ND_ND]; real r;

begin_c_loop (c,thread) {

/* centroid is defined to specify position dependent profiles*/

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) }

DEFINE_PROFILE(fixed_ke, thread, np) {

cell_t c;

real x[ND_ND]; real r;

begin_c_loop (c,thread) {

/* centroid is defined to specify position dependent profiles*/

C_CENTROID(x,c,thread); r =x[1];

F_PROFILE(c,thread,np) =

ka1+(ka2*r)+(ka3*r*r)+(ka4*r*r*r)+(ka5*r*r*r*r)+(ka6*r*r*r*r*r);

}

end_c_loop (c,thread) }

Activating a Profile UDF in FLUENT

Once you have compiled and linked your profile UDF, you can activate it by selecting it in the appropriate boundary condition panel in FLUENT (e.g., the Velocity Inlet panel). See Section 8.2.1 for more details.

4.3.6 DEFINE_PROPERTY 功能和使用方法的介绍

你可以使用DEFINE_PROPERTY macro to specify a custom material property in FLUENT. Some of the properties you can customize are

? ? ? ? ? ? ? ?

density (as a function of temperature only) viscosity

thermal conductivity mass diffusivity

absorption and scattering coefficients laminar flow speed rate of strain

particle or droplet diameter (multiphase mixture model)

!! UDFs cannot be used to define specific heat properties; specific heat data can only be accessed, not modified in FLUENT.

Macro: DEFINE_PROPERTY ( name, c, t) Argument types: cell_t c Thread *t Function returns: real

There are three arguments to DEFINE_PROPERTY: name, c, and t. name is the name of the UDF, specified by you. 当你的UDF编译和连接时,你为函数所选择的名字会在FLUENT图形用户界面中变得可见,且可被选择。 c and t are variables that are passed by the FLUENT solver to your UDF.

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库FLUENT udf中文资料ch4(6)在线全文阅读。

FLUENT udf中文资料ch4(6).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/607046.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: