Fluent UDF 第一章 概述

上传人:野鹰 文档编号:2983242 上传时间:2017-07-29 格式:PDF 页数:22 大小:282.95KB
返回 下载 相关 举报
Fluent UDF 第一章 概述_第1页
第1页 / 共22页
Fluent UDF 第一章 概述_第2页
第2页 / 共22页
Fluent UDF 第一章 概述_第3页
第3页 / 共22页
Fluent UDF 第一章 概述_第4页
第4页 / 共22页
Fluent UDF 第一章 概述_第5页
第5页 / 共22页
点击查看更多>>
资源描述

《Fluent UDF 第一章 概述》由会员分享,可在线阅读,更多相关《Fluent UDF 第一章 概述(22页珍藏版)》请在金锄头文库上搜索。

1、UDF Manual 1. Introduction Translated by jddmsh; Contact 9875374 1 译者之所以要制作本书乃纯粹出于个人的喜好和需要其中或有大量谬误实在和本人的学识与英语水准有关请勿见笑还请共勉改进译本 马世虎 20034.3 1.介绍 本章简要地介绍了用户自定义函数(UDFs)及其在Fluent中的用法关于什么是UDFs如何使用它们以及为什么要使用它们将会在1.1-1.6中具体说明1.7中将介绍一个step-by-step的UDF例子 1.1什么是用户自定义函数 1.2为什么要使用UDFs 1.3UDFs的局限 1.4Fluent5到Flue

2、nt6UDFs的变化 1.5UDF基础 1.6 Interpreted vs. Compiled UDFs 1.7一个step-by-stepUDF例子 1.1 什么是用户自定义函数 用户自定义函数或UDF是用户自编的程序它可以被动态的连接到Fluent求解器上来提高求解器性能用户自定义函数用C语言编写使用DEFINE宏来定义UDFs中可使用标准C语言的库函数也可使用预定义宏Fluent Inc.提供通过这些预定义宏可以获得Fluent求解器得到的数据 UDFs使用时可以被当作解释函数或编译函数解释函数在运行时读入并解释而编译UDFs则在编译时被嵌入共享库中并与Fluent连接解释UDFs用起

3、来简单但是有源代码和速度方面的限制不足编译UDF Manual 1. Introduction Translated by jddmsh; Contact 9875374 2 UDFs执行起来较快也没有源代码限制但设置和使用较为麻烦 1.2 为什么要使用 UDFs 标准的FLUENT界面并不能满足每个用户的需要UDFs的使用可以定制FLUENT代码来满足用户的特殊需要UDFs有多种用途它的一些功能如下 定制边界条件定义材料属性定义表面和体积反应率定义FLUENT输运方程中的源项用户自定义标量输运方程UDS中的源项扩散率函数等等 在每次迭代的基础上调节计算值 方案的初始化 需要时UDFs的异步

4、执行 后处理功能的改善 FLUENT模型的改进例如离散项模型多项混合物模型离散发射辐射模型 1.3UDFs 的局限 尽管UDF在FLUENT中有着广泛的用途但是并非所有的情况都可以使用UDFs UDFs并不能访问所有的变量和FLUENT模型例如它不能调节比热值调节该值需要使用求解器的其它功能如果您不知道是否可以用UDFs解决某个特定的问题您可以求助您的技术支持 1. 4Fluent5 到 Fluent6UDFs 的变化 UDF Manual 1. Introduction Translated by jddmsh; Contact 9875374 3 If you have experien

5、ce with UDFs from FLUENT 5, note the following changes to UDFs in FLUENT 6: A number of general multiphase models have been added to FLUENT 6. When one of these general multiphase models is enabled, storage must be set aside for the mixture as well as the individual phases. This functionality is man

6、ifested in the code through the use of additional thread and domain data structures. Consequently, some predefined macros have been added that allow access to data contained within mixture-level and phase-level domain and thread structures. See Section 3.11 for details on writing UDFs for multiphase

7、 applications. If you have a FLUENT 5 UDF with an external domain declaration that you want to use in FLUENT 6, then the extern statement must be replaced by a call to the Get_Domain utility and assignment to a Domain pointer as shown below. The Fluent-provided utility, Get_Domain(1), returns the po

8、inter to the mixture-level domain. See Section 6.5.1 for more details on Get_Domain. Example UDF Manual 1. Introduction Translated by jddmsh; Contact 9875374 4 extern Domain *domain; DEFINE_ON_DEMAND(my_udf) . is to be replaced by DEFINE_ON_DEMAND(my_udf) Domain *domain; domain = Get_Domain(1); . T

9、he macro C_VOF accesses volume fraction values from the FLUENT solver. C_VOF(c, pti) has two arguments, c and pti. c is the cell identifier. pti is the pointer to the corresponding phase-level thread for the ith phase, where i is the phase_domain_index. For example, C_VOF(c,pti) can be used to retur

10、n the volume fraction of the ith phase fluid at cell c. The pointer pti can UDF Manual 1. Introduction Translated by jddmsh; Contact 9875374 5 also be retrieved using THREAD_SUB_THREAD, discussed in Section 6.5.4, using i as an argument. For compiled UDFs, the makefile called Makefile.udf that was

11、provided in previous FLUENT releases has been renamed to makefile.udf2. See Section 7.3.2 for more details. For multiphase flow problems, you will need to supply your own user-defined scalar flux function instead of using the default function provided by FLUENT. DEFINE_PROPERTY is to be used to defi

12、ne UDFs for particle or droplet diameter for the mixture model, previously the Algebraic Slip Mixture Model (ASMM), instead of the DEFINE_DRIFT_DIAM macro. 1.5UDF 基础 1.5.1输运方程 1.5.2单元Cells ,面区域Zones和线Threads 1.5.3操作 1.5.4求解器数据 1.5.5运行 1.5.1 输运方程 UDF Manual 1. Introduction Translated by jddmsh; Conta

13、ct 9875374 6 FLUENT 求解器建立在有限容积法的基础上这种方法将计算域离散为有限数目的控制体或是单元网格单元是FLUENT 中基本的计算单元这些单元的守恒特性必须保证也就是说普通输运方程例如质量动量能量方程的积分形式可以应用到每个单元 (1.5.1) 此处 是描述普通输运数量的变量a general transportable quantity ,根据所求解的输运方程它可取不同的值下面是在输运方程中可求解的的子集 Transport Equation Variable for continuity 1 x momentum velocity ( u) y momentum v

14、elocity ( v) z momentum velocity ( w) energy enthalpy ( h) turbulent kinetic energy k turbulent dissipation rate species transport mass fraction of species ( Y i) 守恒与否需要知道通过单元边界的通量因此需计算出单元和面上的属性值properties 1.5.2 单元 Cells ,面 区域 Zones 和线 Threads UDF Manual 1. Introduction Translated by jddmsh; Contact

15、 9875374 7 单元和单元棉被组合为一些区域zones这些区域规定了计算域例如入口出口壁面的物理组成physical components当用户使用FLUENT 中的UDF 时用户的UDF 可调用流体区域或是边界区域的计算变量solution variables UDFs需要获得适当的变量比如说是区域参考a zone reference和单元ID以便标定各个单元 区域A zone是一群单元或单元面的集合它可以由模型和区域的物理特征比如入口出口壁面流体区域来标定例如一些被指定为面域a face zone的单元面可以被指定为velocity-inlet 类型由此速度也就可指定了线A thread是FLUENT 数据结构的内部名称可被用来指定一个区域Thread 结构可作为数据储存器来使用这些数据对于它所表示的单元和面来说是公用的The Thread structure acts as a container for data that is common to the group of cells or faces that it represents 1.5.3 操作 多数的UDF任务需要在一个线的所有单元和面上重复执行比如定义一

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

最新文档


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

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