OpenFoam 后处理的使用

当模拟完成后,想使用OpenFoam -postProcess 提取自定义位置的变量数据的方法。

system 下 创建同 probes 相类似文件 probes_lines_0.1m 存储定义点集合

在system/controlDict 中 关联 probes_lines_0.1m

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes out values of fields from cells nearest to specified locations.

\*---------------------------------------------------------------------------*/

#includeEtc "caseDicts/postProcessing/probes/probes.cfg"

fields (p);
probeLocations
(
(3 6.1 0.01)
(3 6.1 0.5)
(3 6.1 1)
(3 6.1 1.5)
(3 6.1 2)
(3 6.1 2.5)
(3 6.1 3)
(3 6.1 3.5)
(3 6.1 4)
(3 6.1 4.5)
(3 6.1 5)
(3 6.1 5.5)
(3 6.1 5.99)
(3 5.99 6.1)
(3 5.5 6.1)
(3 5 6.1)
(3 4.5 6.1)
(3 4 6.1)
(3 3.5 6.1)
(3 3 6.1)
(3 2.5 6.1)
(3 2 6.1)
(3 1.5 6.1)
(3 1 6.1)
(3 0.5 6.1)
(3 0.01 6.1)
(3 -0.1 5.99)
(3 -0.1 5.5)
(3 -0.1 5)
(3 -0.1 4.5)
(3 -0.1 4)
(3 -0.1 3.5)
(3 -0.1 3)
(3 -0.1 2.5)
(3 -0.1 2)
(3 -0.1 1.5)
(3 -0.1 1)
(3 -0.1 0.5)
(3 -0.1 0.01)
);

// ************************************************************************* //

运行命令行指令

simpleFoam -postProcess -latestTime

在postProcessing文件夹下出现 probes_lines_0.1m 要提取的数据

注意:controlDict 中 functions 内所有项目均会重写覆盖原有数据文件,比如 residuals, probes

functions{

 #includeFunc  probes
 #includeFunc  probes_lines_0.1m
 #includeFunc  probes_lines_0.01m
 #includeFunc  probes_lines_0m
 #includeFunc  residuals

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值