はじめに
FrontFlow/red による並列計算の実行手順を示す。
バージョン
- FrontFlow/red Ver. 3.1.004 (2015.9.24 修正版)
- Ubuntu 14.04 LTS (Docker コンテナ 版, Docker 1.8.3, Windows 7 64 bit)
- ParaView 4.1.0 (可視化用)
サンプルの実行
FrontFlow/red に付属のサンプル NACA65410 を実行してみよう。
- ディレクトリを作り、そこにサンプルのファイルをコピーする。
$ mkdir NACA65410
$ cp OPEN_FFR/example-NACA65410/* NACA65410
- 用意したディレクトリに入る。
$ cd NACA65410
並列用に fflow.ctl を編集する。ここでは 2 CPU で計算することにする。"&hpc" で ncpu に 2 を指定。
&hpc
ncpu = 2
MONITOR = 10
/
その下に以下を追加。
&hpc_cntl
NPE = 2
mtsfil = 'test.m'
subdir = 'hpc'
hpc_vertex = 'Grid_hpc'
hpc_boundary = 'Bund_hpc'
hpc_comm = 'Comm_hpc'
hpc_source = 'source'
hpc_result = 'result'
hpc_restart = 'restart'
hpc_anim = 'animHPC'
hpc_initial = 'restart_1000'
hpc_probe = 'probe'
walflg = 0
wall = './wall.law'
ucdflg = 0
ucdfile = 'test.inp'
/
NPE は ncpu と同じ数にする。それ以外はあまり気にしなくてよい (というかよくわからない)。関係ありそうなのは subdir と hpc_initial で、subdir で指定されている名前のサブディレクトリを用意する必要があるのと、リスタートするときはリスタートファイルを hpc_initial で指定する。
- プロセスの個数分だけサブディレクトリを用意する。
$ mkdir hpc_0000 hpc_0001
- prefflow を実行する。
$ prefflow
- fflowHPC を実行する。計算が開始される。
$ mpirun -n 2 fflowHPC
- 計算が終わったら可視化の準備をする。可視化にはここでは ParaView を使う。可視化用の処理は ffr2viz で行うが、めんどくさいので、以下のようなスクリプト ffr2vtkP を作る。
#!/bin/sh
if [ $# -lt 1 ] ; then
echo "usage: ffr2vtkP <num cpu> <result>"
exit
fi
ffr2viz -m $1 -d hpc -r $2 -g geom.frontflow -gf FF -rf VTK -o $2
ParaView で見るためのデータ (VTK ファイル) を作るには、つぎのようにする。
$ ffr2vtkP 2 result.frontflow_5
result.frontflow_5.vtk ができる。
- ParaView で VTK ファイルを開き、結果をチェックする。
|