LIGGGHTS を使ってみる

2012年11月3日

はじめに

DEM 解析ソルバー LIGGGHTS を使ってみる。

使用バージョン

LIGGGHTS 2.2

ファイル

入力ファイル

入力ファイルのフォーマット

LIGGGHTS は分子動力学ソルバー LAMMPS と下位互換性がある。したがって入力ファイルのフォーマットは LAMMPS に準じる。

入力はコマンド形式になっている。ファイルの上の行から順に実行される。したがって

timestep 0.5
run 100
run 100
と
run 100
timestep 0.5
run 100
では挙動が異なる。下はまずデフォルトの時間刻み幅で 100 ステップ計算が実行されることになる。

実行は以下のように行う。

$ mpirun -np 4 liggghts < in.box

リダイレクトで入力するのでファイル名はなんでもよいが、"in.*" とする習慣があるらしい。

入力ファイルのコマンド

例題の入力ファイルを 1 つずつ見て行こう (box.tar.gz の in.box)。

#box

コメント。

atom_style granular

原子のタイプ。"atomic", "molecular" などが選べるが、DEM では "granular" を選ぶ。

atom_modify map array

原子の管理のしかた。

boundary m m m

境界タイプ。x, y, z 面それぞれに対して次のものが指定できる。

  • p : periodic
  • f : non-periodic and fixed
  • s : non-periodic and shrink-wrapped
  • m : non-periodic and shrink-wrapped with a minimum value
newton off

Newton の第 3 法則の ON/OFF の切り替え。"off" だとプロセッサ間で原子の相互作用のやり取りをしないらしい。

echo both

入力コマンド出力の設定。スクリーンとログファイルに出力するかどうかの設定で、"none", "screen", "log", "both" が選べる。

communicate single vel yes

プロセッサ間通信の設定。通信速度に関係するらしい。

units si

単位の設定。

region reg block -0.5 0.5 -0.5 0.5 -0.5 0.5 units box

箱領域の定義。

regin ID style args keyword value ...

  • ID : 任意の文字列
  • style : block など
  • block の引数 : xlo xhi ylo yhi zlo zhi (x, y, z の範囲の指定)
  • units box : 箱の中にジオメトリを定義
create_box 1 reg

計算用箱の定義。

create_box N region-ID

  • N : 原子タイプの数。
  • region-ID : 箱タイプの領域 ID
neighbor 0.01 bin

隣接ペアリスト作成の設定。

neighbor skin style

  • skin : 力のカットオフ距離
  • style : bin, nsq, multi (アルゴリズム、ふつうは bin でよい)
neigh_modify delay 0

隣接ペアリスト作成のタイミングの設定。

delay N

  • N : リスト作成後 N ステップ後にリストを作成する
fix m1 all property/global youngsModulus peratomtype 5e6
fix m2 all property/global poissonsRatio peratomtype 0.45
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5

特性の設定。"peratomtype" は原子タイプごとに値を指定する。原子タイプ数が 2 なら数値を 2 個指定する。"peratomtypepair" は行列の成分を入れるらしい。はじめの数字は行列の行数、そのあとが成分。原子タイプ数が 2 ならば 2x2 なので "peratomtypepair 2 0.5 0.5 0.5 0.5" などとなる。

fix ID group-ID style args

各種設定。以降もいくつか出てくる。

pair_style gran/hertz/history

原子同士の作用の扱い方の設定。DEM の場合はふつう "gran/hertz/history" を選ぶ。

pair_coeff * *

原子同士の力の係数の設定。パラメタ設定できるが、DEM の場合はこうしておく。

timestep 0.00001

時間刻み幅。

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

重力の設定。

fix boxwalls_x1 all wall/gran/hertz/history primitive type 1 xplane -0.5
fix boxwalls_x2 all wall/gran/hertz/history primitive type 1 xplane 0.5
fix boxwalls_y1 all wall/gran/hertz/history primitive type 1 yplane -0.5
fix boxwalls_y2 all wall/gran/hertz/history primitive type 1 yplane 0.5
fix boxwalls_z1 all wall/gran/hertz/history primitive type 1 zplane -0.5
fix boxwalls_z2 all wall/gran/hertz/history primitive type 1 zplane 0.5

壁の設定。

fix ID group-ID style wallstyle wallstyleargs general_keywords general_values model_keyword model_values ...

  • style : ここでは wall/gran/hertz/history
  • wallstyle : ここでは primitive
  • wallstyle args : type や xplane など
  • type の引数 : 原子タイプ
  • xplane などの引数 : 壁の位置と原子タイプ
fix inface all mesh/surface file insertion_face.stl type 1

粒子投入用の面の指定。

fix ID group-ID mesh/surface file filename type walltype mesh_keywords mesh_values surface_keyword surface_values

  • filename : STL か VTK 形式のファイルのファイル名
  • walltype : 原子タイプ
fix pts1 all particletemplate/sphere 1 atom_type 1 density constant 2500 radius constant 0.015
fix pts2 all particletemplate/sphere 1 atom_type 1 density constant 2500 radius constant 0.025

粒子の設定。

fix ID group-ID particletemplate/sphere seed keyword values ...

  • seed : 乱数の種 (整数)
  • density constant value : 密度
  • radius constant value : 半径
fix pdd1 all particledistribution/discrete 1 2 pts1 0.3 pts2 0.7

粒子分布の設定。

fix ID group-ID particledistribution/discrete seed ntemp t_id t_m

  • seed : 乱数の種 (整数)
  • ntemp : 指定する particle template の数
  • t_id : particletemplate/sphere タイプの fix の ID
  • t_m : 質量分率

上記の設定では pts1 と pts2 をそれぞれ質量分率で 3 : 7 の割合で入れる。

group nve_group region reg

原子のグループの作成。

group ID style args

  • style : region など
  • region の引数 : region-ID
fix ins nve_group insert/rate/region seed 1 distributiontemplate pdd1 maxattempt 100 mass 30. massrate 30. insert_every 10000 overlapcheck yes vel constant 0. 0. -1.0 region bc

粒子投入設定。

fix ID group-ID insert/rate/region seed seed_value distributiontemplate dist-ID general_keywoards general_values insert_rate_keywords insert_rate_values

  • seed : 乱数の種 (正の整数)
  • dist-ID : 粒子分布の ID
  • maxatempt value: 原子ごとの挿入試行の最大数の指定
  • mass value : 挿入質量
  • massrate value : 挿入質量流量
  • insert_every value : 何ステップごとに粒子を挿入するか
  • overlapcheck yes/no : 重なりのチェックの指定
  • vel values : 挿入速度
  • region region-ID : 挿入領域
fix integr nve_group nve/sphere

位置、速度、方向、各速度の更新のための積分実行の設定。

run 1

計算の実行。

run N

  • N : ステップ数
dump dmp all custom 500 post/dump*.box id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius

出力設定。

dump ID group-ID style N file args

  • style : custom など
  • N : 出力のタイミング (N イテレーションごとに出力)
  • file : 出力ファイル名
run 200000 upto

run N upto

  • upto : 現時点から N ステップ目まで計算
unfix ins

fix の設定を無効にする。

計算結果。

STL ファイルの使用

STL ファイルを使って壁条件を作ることもできる (box2.tar.gz の in.box)。

fix boxwalls all mesh/surface file box.stl type 1

粒子挿入用の面の設定と同じ。

fix wall all wall/gran/hertz/history mesh n_meshes 1 meshes boxwalls

壁の条件の設定。

fix ID group-ID style wallstyle wallstyleargs general_keywords general_values model_keyword model_values ...

  • style : ここでは mesh
  • n_meshes value : 設定するメッシュ数
  • meshes values : メッシュ ID リスト

壁の回転

壁を回転させることもできる。

fix moveboxwalls all move/mesh mesh boxwalls rotate origin 0. 0. 0. axis 0. 1. 0. period 2.

fix ID group-ID move/mesh mesh mesh-ID style args keyword values ...

  • mesh mesh-ID : 移動させるメッシュ ID
  • style : ここでは回転のために rotate を指定
  • origin value : 回転軸の原点
  • axis value : 回転軸ベクトル
  • period value : 回転周期 (1 回転する時間)

移動した壁を STL で出力させることができる。

dump dumpstl all stl 500 post/dump*.stl

箱の壁だけ出力させたいのだが、粒子投入用の面も一緒に出力されてしまうため、上記コマンドは粒子投入用面の設定 "fix inface ..." の前に入れておくとよい。

計算結果。

リスタート

計算のリスタートは以下のように行う (たぶん)。

まず、リスタートファイルを出力するようにしておく。

restart 100000 restart/restart*.box

たとえば、この状態で 100000 ステップまで計算する。

run 100000 upto

計算を実行すると、リスタートファイルができる。リスタートするために、"create_box ..." をコメントにして、リスタートファイルを読み込むようにする。

#create_box 1 reg
read_restart restart/restart*.box

200000 ステップまで計算する。

run 200000 upto

計算を実行すると、続きから計算される。

古い情報