【OpenFOAM入门】How to create a grid with blockMesh


视频链接:

https://www.bilibili.com/video/BV1ga41157pp?p=4

版本:OpenFOAM 10,sonicFoam集成到rhoPimpleFoam
示例:$FOAM_TUTORIALS/compressible/rhoPimpleFoam/laminar/fforwardStep/

rhoPimpleFoam

Transient solver for turbulent flow of compressible fluids for HVAC and similar applications, with optional mesh motion and mesh topology changes.

Case Setup

.
├── 0
│   ├── T
│   ├── U
│   └── p
├── constant
│   ├── momentumTransport
│   └── physicalProperties
└── system
    ├── blockMeshDict
    ├── controlDict
    ├── fvSchemes
    └── fvSolution

controlDict:结果输出,每0.5秒输出一次

stopAt          endTime;

endTime         3;

writeControl    runTime;

writeInterval   0.5;

Mesh

blockMesh

  • convertToMeters 1:顶点坐标的数值以米为单位,若convertToMeters 0.001,则以毫米为单位,那么blockMesh会自动将坐标转化为以米为单位。
  • vertices
  • blocks:点按逆时针方向排
  • boundary:右手定则定义方向,法向量总是朝外;obstacle类型改成wall

查看网格

创建.foam文件,paraview打开,与blockMeshDict描述相符

touch forwardstep.foam

修改网格分辨率:拐角处

blocks // 均匀网格
(
    hex (0 1 3 2 8 9 11 10) (25 10 1) simpleGrading (1 1 1)
    hex (2 3 6 5 10 11 14 13) (25 40 1) simpleGrading (1 1 1)
    hex (3 4 7 6 11 12 15 14) (100 40 1) simpleGrading (1 1 1)
);

1. simpleGrading

  • 沿某一条边,终点单元宽度/起点单元宽度,边的方向看坐标轴正方向
blocks // 拐点加密:simpleGrading; num of cells
(
    hex (0 1 3 2 8 9 11 10) (50 20 1) simpleGrading (0.5 0.5 1)
    hex (2 3 6 5 10 11 14 13) (50 80 1) simpleGrading (0.5 2 1)
    hex (3 4 7 6 11 12 15 14) (200 80 1) simpleGrading (2 2 1)
);

2. edgeGrading

  • 显式定义每条边的refinement,而simpleGrading的refinement,对一个block的同一方向的每条边都是一样的
  • 主要用于三维网格
blocks // 均匀网格
(
//    hex (0 1 3 2 8 9 11 10) (25 10 1) simpleGrading (1 1 1)
    hex (0 1 3 2 8 9 11 10) (25 10 1) edgeGrading (1 1 1 1 0.5 2 2 2 1 1 1 1)
    hex (2 3 6 5 10 11 14 13) (25 40 1) simpleGrading (1 1 1)
    hex (3 4 7 6 11 12 15 14) (100 40 1) simpleGrading (1 1 1)
);

Simulation

rhoPimpleFoam

Post-Processing

  • refresh
  1. 初始设置,均匀网格
    在这里插入图片描述
    在这里插入图片描述
  2. simpleGrading细化,网格数也增加
    在这里插入图片描述
    在这里插入图片描述
  3. edgeGrading
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值