Fluent 嵌套网格(overset)功能讲解与实例操作

作者 | 张杨 

在流体仿真中,我们经常会遇到边界运动的问题,如:

生物医疗行业中血管的运动

航空航天行业中飞行器的分离

容积泵中齿轮的相对运动

在ANSYS Fluent 17.0之前的版本中,我们通常采用传统的MDM(Moving/Deforming Mesh)方式来解决这些问题。当然, MDM方法在进行仿真分析时,要求相对较高,出现问题的几率大,设置的条件也更为复杂,还可能出现负体积的情况,因此需要工程师具备较高的仿真水平和工程经验。

为了能够使边界运动的仿真问题得到有效的处理,更好的适应广大初级的流体仿真爱好者,ANSYS Fluent 在17.0之后的版本中新增了嵌套网格(overset)功能,很好的简化了流体仿真中包含边界运动的复杂问题。

嵌套网格(overset)又称重叠网格,如下图所示,该网格由两部分组成:

包含主要流体区域的背景网格(background)

围绕圆柱体的构建的单独的组件网格(component)

此时,部件网格的外边界指定为overset(特有的边界类型),其他的边界和通常的网格则没有区别。

通过观察,我们可以发现,嵌套网格和通常网格最大的区别就是有重叠的体网格区域,这在Fluent中是不能直接计算的。为此,Fluent 提供了一种专门的解决

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FLUENT 2020R2 tutorial guide PDF及案例源文件 1.What’s In This Manual The ANSYS Fluent Tutorial Guide contains a number of tutorials that teach you how to use ANSYS Flu- ent to solve different types of problems. In each tutorial, features related to problem setup and postpro- cessing are demonstrated. 2. How To Use This Manual Depending on your familiarity with computational fluid dynamics and the ANSYS Fluent software, you can use this tutorial guide in a variety of ways. 2.1. For the Beginner If you are a beginning user of ANSYS Fluent you should first read and solve Tutorial 1, in order to fa- miliarize yourself with the interface and with basic setup and solution procedures.You may then want to try a tutorial that demonstrates features that you are going to use in your application. You may want to refer to other tutorials for instructions on using specific features, such as custom field functions, mesh scaling, and so on, even if the problem solved in the tutorial is not of particular interest to you. 2.2. For the Experienced User If you are an experienced ANSYS Fluent user, you can read and/or solve the tutorial(s) that demonstrate features that you are going to use in your application. You may want to refer to other tutorials for instructions on using specific features, such as custom field functions, mesh scaling, and so on, even if the problem solved in the tutorial is not of particular interest to you. 3.Typographical Conventions Used In This Manual Several typographical conventions are used in this manual’s text to help you find commands in the user interface. • Different type styles are used to indicate graphical user interface items and text interface items. For example: Iso-Surface dialog box surface/iso-surface text command
以下是 Fluent 中使用动网格和弹簧力的 UDF 示例,其中包含了创建和初始化网格、计算弹簧力和更新网格的代码: ``` #include "udf.h" DEFINE_GRID_MOTION(my_grid_motion, domain, dt, time, dtime) { Thread *t; cell_t c; real x[ND_ND], dx[ND_ND]; real spring_force[ND_ND]; real spring_constant = 0.1; real displacement; /* Loop over all threads in the domain */ thread_loop_c (t,domain) { /* Loop over all cells in the thread */ begin_c_loop_all (c,t) { /* Get the current cell coordinates */ C_CENTROID(x, c, t); /* Calculate the displacement of the cell from its initial position */ displacement = x[0] - x[1]; /* Calculate the spring force based on the displacement */ spring_force[0] = -spring_constant * displacement; spring_force[1] = spring_constant * displacement; /* Apply the spring force to the cell */ C_UDMI(c, t, 0) += spring_force[0]; C_UDMI(c, t, 1) += spring_force[1]; /* Calculate the change in cell position based on the spring force */ dx[0] = C_UDMI(c, t, 0) * dtime; dx[1] = C_UDMI(c, t, 1) * dtime; /* Move the cell */ C_CENTROID(x, c, t); x[0] += dx[0]; x[1] += dx[1]; C_CENTROID(x, c, t); } end_c_loop_all (c,t); } } ``` 这个示例中,我们定义了一个名为 `my_grid_motion` 的网格运动 UDF,它会在每个时间步长中被调用。在这个 UDF 中,我们使用了动网格和弹簧力的概念来更新网格。 在循环中,我们首先获取当前单元格的坐标,并计算出它相对于初始位置的位移。然后,我们使用弹簧力公式计算出作用于单元格的力,并将其添加到单元格的 UDMI 中。接下来,我们基于弹簧力计算出单元格位置的变化,并将其应用到单元格上。最后,我们更新单元格的位置并结束循环。 请注意,这只是一个示例,具体实现可能因不同的应用而有所不同。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值