OpenFOAM【postProcessでsingleGraph】

OpenFOAMの結果の可視化・グラフ化についてす。

postProcessコマンドについての使い方です。まずはヘルプ。

$ postProcess -help

基本的には、foamGetを使って自分が実施したい解析に近いものを拾ってきます。singleGraphがsampleDictに近い気がした。

$ foamGet singleGraph

/system中にsingleGraphの名前のファイルができます。適当に修正。

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes graph data for specified fields along a line, specified by start
    and end points.

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

start   (0 0 0); 
end     (1 0 0); 
fields  (T X); 

// Sampling and I/O settings
#includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg"

// Override settings here, e.g.
setConfig
{
    type lineCell;
    axis x;        // y, z, xyz 
    nPoints 10; 
}

// Must be last entry
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"

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

続いて、実行コマンドです。

$ postProcess -func singleGraph

実行すると新しく/postProcessingのフォルダができ、中に結果が出力されます。

0.001   272.964   0.76112
0.003   272.965   0.761119
0.005   272.972   0.761114
0.007   273.027   0.761072
0.009   273.391   0.760795
0.011   275.494   0.7592
0.013   285.448   0.751737
0.015   319.736   0.72689
0.017   397.196   0.674006
0.019   510.768   0.619494

こんな感じのテキストデータ。あとはgnuplotで見るなりなんなり。

参考にしました

OpenFOAM v7 User Guide: 6.3 Graphs and Monitoring

OpenFOAMのpostProcessコマンドでVTK出力 - Qiita

PENGUINITIS - データのサンプリング

http://www.opencae.or.jp/wp-content/uploads/2015/06/20090513_imano_sampleAndPlot_v2.pdf