当模拟完成后,想使用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
}