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 面それぞれに対して次のものが指定できる。
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 ...
create_box 1 reg 計算用箱の定義。 create_box N region-ID
neighbor 0.01 bin 隣接ペアリスト作成の設定。 neighbor skin style
neigh_modify delay 0 隣接ペアリスト作成のタイミングの設定。 delay 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 ...
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
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 ...
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
上記の設定では pts1 と pts2 をそれぞれ質量分率で 3 : 7 の割合で入れる。 group nve_group region reg 原子のグループの作成。 group ID style args
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
fix integr nve_group nve/sphere 位置、速度、方向、各速度の更新のための積分実行の設定。 run 1 計算の実行。 run 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
run 200000 upto run N upto
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 ...
壁の回転壁を回転させることもできる。 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 ...
移動した壁を 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 計算を実行すると、続きから計算される。 古い情報 | |
PENGUINITIS |