0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

OpenFOAMの結果をblenderで可視化してみる#02 OpenFOAMの実行

Posted at

はじめに

前回までに,openfoamのインストールを行ったので,
可視化する元データを作成する。
例として, interIsoFoamのチュートリアルを試してみる。

interIsoFoamはinterFoamの拡張版で,2相流(水と空気)を扱うソルバー

解析ケース

対象は下記の2ケースいずれも計算時間は10分もかからない程度の問題

  • damBreak
  • iobasin

実行方法

mkdir ~/openfoam
cd openfoam
#チュートリアルのデータをもってくる
cp -r $FOAM_TUTORIALS/multiphase/interIsoFoam/damBreak .
cp -r $FOAM_TUTORIALS/multiphase/interIsoFoam/iobasin .

#チュートリアルの実行
cd damBreak
./Allrun

cd ../iobasin
./Allrun

interIsoFOAMは並列計算するように設定されているため,下記のようrに
Allrunを修正している。

#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
#------------------------------------------------------------------------------
restore0Dir
runApplication blockMesh
runApplication createPatch -overwrite
runApplication setFields
runApplication $(getApplication)
#runApplication decomposePar
#runParallel $(getApplication)
#runApplication reconstructPar
#------------------------------------------------------------------------------

実行結果

各フォルダーでこんな感じで,0.01, 0.02といったフォルダが生成されていればOK。フォルダ名が時間を表していて,そこに計算結果が入っている。
image.png

各ケースでの計算期間はそれぞれ下記のとおり。iobasinsが一応3次元なのに,思ったより時間かからなかった。

case 計算期間 計算時間
dambreak 1.0s 133s
iobasins 3.0s 483s
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?