云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > fluent UDF第五章 使用宏存取FLUENT解算器变量

fluent UDF第五章 使用宏存取FLUENT解算器变量

  • 62 次阅读
  • 3 次下载
  • 2025/5/22 22:41:24

5.4.4单元格体积

在表5.4.4中列出的宏可以用于获得二维,三维和轴对称的模型的单元格的真实体积

表5.4.4在mem.h中的单元格体积宏

名称(参数) 参数类型 返回值

二维或是三维的单元格体积 C VOLUME(c,t) cell t c, Thread *t

单元格体积/2?是轴对称模型的体积

5.4.5 Cell-to-Cell and Cell-to-Face Centroid Macros

FLUENT provides macros that allow the vectors connecting cell centroids and the vectors connecting cell and face centroids to be readily defined. These macros return information that are helpful in evaluating face values of scalars which are generally not stored, as well as the diffiusive flux of scalars across cell boundaries. The geometry and gradients involved with these macros are summarized in Figure 5.4.1 below.

To better understand the parameters that are returned by these macros, it is best to consider how the aforementioned calculations are evaluated. Assuming that the gradient of a scalar is available, the face value of a scalar, _ can be approximated by,

?f?????.dr0? (5.4.1)

where ~ dr is the vector that connects the cell centroid with the face centroid. The gradient in this case is evaluated at the cell centroid where _0 is also stored.

where _f is the di_usion coe_cient at the face. In FLUENT's unstructured solver, the gradient along the face normal direction may be approximated by evaluating gradients along the directions that connect cell centroids and along a direction confined within the plane of the face. Given this, Df may be approximated as,

Df=?f???A (5.4.2)

where _f is the di_usion coe_cient at the face. In FLUENT's unstructured solver, the gradient along the face normal direction may be approximated by evaluating gradients along the directions that connect cell centroids and along a direction con_ned within the plane of the face. Given this, Df may be approximated as,

Df=?f??(???)A?A10???dsA?es?f????A?A(???A????eS??)

A?eS (5.4-3)

where the _rst term on the right hand side represents the primary gradient directed along the vector ~es and the second term represents the 'cross' di_usion term. In this equation, A is the area normal vector of face f directed from cell c0 to c1, ds is the distance between the cell centroids, and ~es is the unit normal vector in this direction. This is shown in Figure 5.4.1 below.

5.4.5单元格对单元格,单元格对表面重心宏

FLUENT提供的宏使得连接单元格重心的向量和连接单元格重心与表面重心的向量很容易定义。这些宏的返回信息对于估计那些不储存的表面的数量值是有帮助的,同时对于估计通过单元格边界的流体分散率的数值也有益。这些宏所包含的几何和梯度在下面的表5.4.1中总结出来了。 为了更好的理解由这些宏所返回的参数,最好的方法是考虑一下上述计算是如何估计的。假定可以得到一个向量的梯度可以得到,那么向量的表面值?可以用下式估计:

??

?f?????.dr (5.4.1)

0在这里dr是连接单元格重心和表面重心的向量。在这个例子中是在存储?处

0的单元格重心位置估计的。

通过表面f,向量?的流体分散率Df由下式给定

Df=?f???A (5.4.2)

这的?f是表面的分散系数。在FLUENT 的未定结构求解器中,沿表面标准方向的梯度可以由在一个沿单元格重心方向梯度和一个限定在表面的平面里的梯度方向来估计。按照这种规定,Df可以按下式近似:

Df=?f??(???)A?A10???dsA?es?f????A?A(???A????eS??)

A?eS (5.4-3)

在此右边的第一项代表沿着向量es方向的主梯度,第二项代表交叉分散率项。在这个方程中A是从单元格c0指向单元格c1的表面f的标准向量围成的面积,ds是两个单元格重心间的距离,这些在下面的图形5.4.1es是这个方向的单元向量。中表示出来了

图形5.4.1用定义的梯度和向量连接单元格c0和c1

??

The INTERIOR_FACE_GEOMETRY and BOUNDARY_FACE_GEOMETRY macros can be called to return some of the terms needed to evaluate Equations 5.4-1 and 5.4-3.

调用宏INTERIOR_FACE_GEOMETRY 和 BOUNDARY_FACE_GEOMETRY可以返回一些可以估计方程5.4_1和5.4_2的一项。

INTERIOR_FACE_GEOMETRY

INTERIOR_FACE_GEOMETRY(f,tf,A,ds,es,A_by_es,dr0,dr1) returns for the face, f, in face thread tf, the following variables:

A[ND_ND] 面积的单元向量

ds 单元格重心的距离

es[ND_ND] 从单元格c0到单元格c1方向的单元向量 A_by_es

??A?A??A?es的值

dr0[ND_ND] 连接单元格c0重心和表面重心的单元向量 dr1[ND-ND] 连接单元格c1重心和表面重心的单元向量

Note that the INTERIOR_FACE_GEOMETRY macro is defined in the sg.h header file. Since sg.h is not included in the udf.h file, you will need to add the include directive to your UDF.

注意宏INTERIOR_FACE_GEOMETRY在文件sg.h中定义,因为sg.h没有包含在udf.h文件中,所以你就必须把它加到你的UDF中。

BOUNDARY FACE GEOMETRY(f,tf,A,ds,es,A by es,dr0) returns for the face, f, in face thread tf, the following variables: A[ND_ND] 面积标准向量

ds 单元格重心和表面重心之间的距离 es[ND_ND] 从单元格c0重心到表面重心的单元向量 A_by_es

??A?A??A?ex的值

dr0[ND_ND] 连接单元格c0重心到表面重心的向量

The BOUNDARY_FACE_GEOMETRY 宏也被定义在sg.h文件中,它也没有被包含在udf.h中,你需要包含sg.h在UDF。

5.5 Node Macros

The macros listed in Tables 5.5.1 and 5.5.2 return the real Cartesian coordinates of the

cell node (at the cell corner), and the components of the velocity of the node, respectively. The node velocities are relevant in moving mesh simulations, for example. The argument Node *node for each of the variables defines a node. Definitions for these macros can be found in the referenced header file (e.g., mem.h).

Table 5.5.1: Node Coordinate Variable Macros in metric.h

Name(Arguments) Argument Types Returns

NODE X(node) NODE Y(node) NODE Z(node) Name(Arguments)

NODE GX(node) NODE GY(node) NODE GZ(node)

Node *node x coordinate of node Node *node y coordinate of node Node *node z coordinate of node

Table 5.5.2: Node Velocity Variable Macros in mem.h

Argument Types Returns Node *node x component of node velocity Node *node y component of node velocity Node *node z component of node velocity

5.5节点宏

表5.5.1和5.5.2列出的宏返回单元格节点的实数直角坐标(在单元格的拐角)和相应的节点速度的分量。例如在移动的网格模拟中节点速度是相对应的。每个变量的节点*节点的参数定义了一个节点。这些宏的定义可以在相关的.h文件中找到。(例如mem.h)

表5.5.1在 metric.h 中变量的节点坐标宏

名称(参数) 参数类型 返回值

节点的X坐标 NODE X(node) Node *node

节点的Y坐标 NODE Y(node) Node *node

节点的Z坐标 NODE Z(node) Node *node

表5.5.2在 metric.h中的节点速度变量宏

名称(参数) 参数类型 返回值

节点速度的X分量 NODE GX(node) Node *node

节点速度的Y分量 NODE GY(node) Node *node

节点速度的Z分量 NODE GZ(node) Node *node

5.6 Multiphase Macros

The macros listed in Table 5.6.1 return real variables associated with the general mul-

tiphase models. Definitions for these macros can be found in sg_mphase.h, which is included in udf.h.

Table 5.6.1: Multiphase Variable Macros in sg_mphase.h

Name(Arguments) Argument Types Returns C VOF(c,pt[0]) cell t c, Thread **pt volume fraction for primary phase C VOF(c,pt[n]) cell t c, Thread **pt volume fraction for nth secondary phase

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

5.4.4单元格体积 在表5.4.4中列出的宏可以用于获得二维,三维和轴对称的模型的单元格的真实体积 表5.4.4在mem.h中的单元格体积宏 名称(参数) 参数类型 返回值 二维或是三维的单元格体积 C VOLUME(c,t) cell t c, Thread *t 单元格体积/2?是轴对称模型的体积 5.4.5 Cell-to-Cell and Cell-to-Face Centroid Macros FLUENT provides macros that allow the vectors connecting cell centroids and the vectors connecting cell and face centroids to b

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com