【2017年整理】FLUENT udf中文资料ch6

上传人:爱****1 文档编号:989201 上传时间:2017-05-24 格式:DOC 页数:28 大小:189KB
返回 下载 相关 举报
【2017年整理】FLUENT udf中文资料ch6_第1页
第1页 / 共28页
【2017年整理】FLUENT udf中文资料ch6_第2页
第2页 / 共28页
【2017年整理】FLUENT udf中文资料ch6_第3页
第3页 / 共28页
【2017年整理】FLUENT udf中文资料ch6_第4页
第4页 / 共28页
【2017年整理】FLUENT udf中文资料ch6_第5页
第5页 / 共28页
点击查看更多>>
资源描述

《【2017年整理】FLUENT udf中文资料ch6》由会员分享,可在线阅读,更多相关《【2017年整理】FLUENT udf中文资料ch6(28页珍藏版)》请在金锄头文库上搜索。

1、1第六章. Utilities (工具)FLUENT公司提供的针对 FLUENT变量性能计算的预处理工具列表 6.1 Introduction 简要 6.2 General-Purpose Looping Macros 一般目的的宏 6.3 Multiphase-Specific Looping Macros 多项组分的宏 6.4 Setting Face Variables ( F_PROFILE) 设置面变量 6.5 Accessing Variables That Are Not Passed as Arguments 访问没有作为 Argument 传递的变量 6.6 Accessin

2、g Neighboring Cell and Thread Variables 访问邻近单元(网格点和线)上的变量 6.7 User-Defined Memory for Cells ( C_UDMI) 用户为网格定义内存(CUDMI) 6.8 Vector Utilities 矢量工具 6.9 Macros for Time-Dependent Simulations 与时间相关的数值模拟宏 6.10 Miscellaneous Utilities 其他各种工具6.1 简要Fluent Inc.提供了针对 Fluent 变量操作的一系列工具。这些工具中大部分可以作为宏直接执行。2许多宏可以用

3、于单相和多相模型的 UDFs 中,但是有些是只针对多相流的。回想一下当你为多相流模型写 UDFs 时,你将记住 FLUENT 的结构的层次。(详细参考 3.11.1)。从求解器中导入到你的 UDFs 中特殊的控制区和线性结构,依赖于你所使用的DEFINE 宏和相关的控制区函数。(通过图形用户界面和用户定义的源代码)它或许也依赖于你所使用的多相流模型。将控制区的结构传递给 DEFINE_INIT 和 DEFINE_ADJUST 函数,但是它与多相流模型是相互独立的。这些函数始终被传递给与混合物有关的控制区结构。DEFINE_ON_DEMAND UDFs 没有被传递给任何控制区。如果你的 PDF

4、没有显式地传给你的函数所需要的线性的或者控制区的结构,那么你可以利用本章提供的宏工具修复。提供的许多宏使你的函数可以寻找到给定线和区的所有的网格点和面。6.2 一般目的的循环宏下面这些循环的宏可以用于 FLUENT 单相和多相模型的 UDFs 中。这些宏的定义包含再 mem.h 头文件中。 6.2.1 Looping over Cell Threads in a Domain ( thread_loop_c) 查询控制区的单元线 6.2.2 Looping over Face Threads in a Domain ( thread_loop_f) 查询控制区的面 6.2.3 Looping

5、over Cells in a Cell Thread ( begin.end_c_loop) 查询单元线中的单元 6.2.4 Looping over Faces in a Face Thread ( begin.end_f_loop) 查询面单元中的面 6.2.5 Looping over Faces on a Cell ( c_face_loop) 查询单元面 6.2.6 Looping over Nodes of a Cell ( c_node_loop) 查询单元节点62.1 查询控制区的单元线3当你想查询给定控制区的单元线时,你可以用 thread_loop_c。它包含单独的说明,

6、后面是对控制区的单元线所做操作,正如下面显示的包含在 中。注意:thread_loop_c 在执行上和 thread_loop_f 相似,参考 6.2.2 部分。Domain *domain;Thread *c_thread;thread_loop_c(c_thread, domain) /*loops over all cell threads in domain*/ 6.2.2 查询控制区的面当你想要查询给定控制区的面时,你可以应用 thread_loop_f。它包含单独的说明,后面是对控制区的面单元所做操作,正如下面显示的包含在 中。注意:thread_loop_f 在执行上和 thre

7、ad_loop_c 相似,参考 6.2.1 部分。Thread *f_thread;Domain *domain;thread_loop_f(f_thread, domain)/* loops over all face threads in a domain*/6.2.3 查询单元线中的单元当你想要查询给定单元线 c_thread 上所有的单元时,你可以应用begin_c_loop 和 end_c_loop。它包含 begin 和 end loop 的说明,完成对单元线中单元所做的操作,定义包含在 中。当你想查找控制区单元线的单元时,应用的 loop 全嵌套在 thread_loop_c 中

8、。cell_t c;Thread *c_thread;begin_c_loop(c, c_thread) /* loops over cells in a cell thread */ end_c_loop(c, c_thread)例子:/* Loop over cells in a thread to get information stored in cells. */begin_c_loop(c, c_thread)4/* C_T gets cell temperature. The += will cause all of the cell temperatures to be add

9、ed together. */temp += C_T(c, c_thread);end_c_loop(c, c_thread)6.2.4 查询面线中的面当你想要查找给定面线 f_thread 的所有的面时,你可以用 begin_f_loop and end_f_loop。它包含 begin 和 end loop 的说明,完成对面线中面单元所做的操作,定义包含在 中。当你想查找控制区面线的所有面时,应用的 loop 全嵌套在 thread_loop_f 中。face_t f;Thread *f_thread;begin_f_loop(f, f_thread) /* loops over face

10、s in a face thread */ end_f_loop(f, f_thread)例子:/* Loop over faces in a face thread to get the information stored on faces. */begin_f_loop(f, f_thread)/* F_T gets face temperature. The += will cause all of the face temperatures to be added together. */temp += F_T(f, f_thread);end_f_loop(f, f_thread)

11、6.2.5 查询单元中的面下面函数用以查询给定单元中所有面。包含单独的查询说明,后面是所做的操作包含在。 5face_t f;Thread *tf;int n;c_face_loop(c, t, n) /* loops over all faces on a cell */.f = C_FACE(c,t,n);tf = C_FACE_THREAD(c,t,n);.这里,n 是当地面的索引号。当地面的索引号用在 C_FACE 宏中以获得所有面的数量(e.g., f = C_FACE(c,t,n)。另一个在 c_face_loop 中有用的宏是 C_FACE_THREAD。这个宏用于合并两个面线。

12、(e.g., tf = C_FACE_THREAD(c,t,n). 查找与 c_face_loop 有关的宏参考 6.10 部分。6.2.6 查询单元节点( c_node_loop)下面函数用以查询给定单元中所有节点。包含单独的查询说明,后面是所做的操作包含在。 cell_t c;Thread *t;int n;c_node_loop(c, t, n).node = C_NODE(c,t,n);.6.这里,n 是当地节点的索引号。当地面的索引号用在 C_NODE 宏中以获得所有面的数量(e.g., node = C_NODE(c,t,n)6.3 多相组分查询宏下面这些宏用于多相模型的 UDFs

13、。关于 FLUENT 里的结构的层次的讨论参考3.11 部分尤其是图 3.11.1。 6.3.1 Looping over Phase Domains in a Mixture ( sub_domain_loop) 查询混合物中的相控制区 6.3.2 Looping over Phase Threads in a Mixture ( sub_thread_loop) 查询混合物中的相线 6.3.3 Looping over Phase Cell Threads in a Mixture ( mp_thread_loop_c) 查询混合物中的相单元线 6.3.4 Looping over Pha

14、se Face Threads in a Mixture ( mp_thread_loop_f) 查询混合物中的相的面线6.3.1 Looping over Phase Domains in a Mixture 6.3.1 查询混合物中相的控制区( sub_domain_loop)sub_domain_loop 宏用于查询混合物控制区的所有相的子区。这个宏查询并在混合物控制区给每个相区定义指针以及相关的 phase_domain_index。正如 3.11部分所讨论的,控制区需要指针,在每个相中都有权访问部分数据。注意:sub_domain_loop 宏在执行中和 sub_thread_loo

15、p 宏是相似的,参考 6.3.2 部分。int phase_domain_index; */ index of subdomain pointers */Domain *mixture_domain;Domain *subdomain;sub_domain_loop(subdomain, mixture_domain, phase_domain_index)7sub_domain_loop 的变量是 subdomain,mixture_domain 和phase_domain_index。Subdomain 是 phase-level domain 的指针, mixture_domain 是 mixture-level domain 的指针。当你想用 DEFINE 宏时,mixture_domain(包含控制区变量 e.g., DEFINE_ADJUST)通过 FLUENT 求解器自动传递给你的 UDF,混合物就和你的 UDF 相关了。如果mixture_domain 没有显式地传递给你的 UDF,你应用另外一个宏来恢复它 (e.g., Get_Domain(1) before calling sub_domain_loop (参考 6.5.1 部分)。ph

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号