ユーザ用ツール

サイト用ツール


サイドバー


最近の更新




タグ一覧

タグ#
1
1
1
1
1
1
1
1
1
1
openfoam:tutorial

Tutorial

動作確認済み:v8

Dam Break (Serial)

OpenFOAM実行用のディレクトリを作成.

mkdir -p $FOAM_RUN
$ run
$ cp -r $FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak/damBreak ./
$ cd damBreak
$ blockMesh
$ setFields
$ interFoam | tee log
$ paraFoam

Thirdpatryに付属するParaViewをビルドには時間がかかるため,あらかじめ用意したバイナリのParaViewで可視化できる. ParaViewでは*.foamの形式でOpenFOAMの結果を読み込むことができる.

$ touch result.foam 
$ paraview result.foam

Dam Break (Parallel)

Dam Break (Serial)を並列実行用にコピーする.

$ foamCloneCase damBreak damBreakFine

Dam Break (Serial)で実行したモデルのメッシュ分割数を変更ため,system/blockMeshDictを以下のように編集.

blocks
(
    hex (0 1 5 4 12 13 17 16) (46 10 1) simpleGrading (1 1 1)
    hex (2 3 7 6 14 15 19 18) (40 10 1) simpleGrading (1 1 1)
    hex (4 5 9 8 16 17 21 20) (46 76 1) simpleGrading (1 2 1)
    hex (5 6 10 9 17 18 22 21) (4 76 1) simpleGrading (1 2 1)
    hex (6 7 11 10 18 19 23 22) (40 76 1) simpleGrading (1 2 1)
);

領域分割で割り当てられたプロセスを可視化するため,system/controlDictの末尾に以下を記述.

libs
(
    "libfieldFunctionObjects.so"
);

functions
{
    func
    {
        type processorField;
        outputControl outputTime;
        outputInterval 1;
    }
}

実行.

$ rm 0/alpha.water
$ blockMesh
$ setFields
$ decomposePar
$ mpirun -np 4 interFoam -parallel > log &
$ reconstructPar

結果を確認.

$ paraFoam

Dam Break (Parallel and Scotch)

$ foamCloneCase damBreakFine/ damBreakFineScotch

system/decomposeParDictの領域分割方法を'scotch'に変更する.

- method          simple;
+ method          scotch;

残りの手順はDam Break (Parallel)と同様である.

openfoam/tutorial.txt · 最終更新: 2021/01/09 14:37 (外部編集)