1
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.

水の分子動力学シミュレーション -lammpsコードの意味①

Last updated at Posted at 2023-04-30

tip4pの水分子sim用lammpsコードを上から少しづつ学習していきます。

コードは以下サイトのものを使用しています。
https://lammpstutorials.github.io/

units real
atom_style full
bond_style harmonic
angle_style charmm
dihedral_style charmm
pair_style lj/cut/tip4p/long 1 2 1 1 0.105 12.0
kspace_style pppm/tip4p 1.0e-4

units style:

・行うシミュレーションの単位系を設定する。このコマンドによって設定した単位系と読み込む dataファイルの単位系を合わせないと、意図しない数値でlammpsが動作してしまう。
styleの種類はreal, lj, metal, Si, cgs, erectron, micro, nanoがある。
real⇒ここではreal使用
マニュアル該当部分 https://docs.lammps.org/units.html

↓各styleまとめ
image.png

atom_style [追加オプション]:

・dataファイル等からatomの情報をインプットする際に読み込み形式を指定する。
このコマンドはread_data(データ読み込み)やcreate_box(計算領域設定)を行なう前に実行すう必要がある。

※各読み込み形式で何をdataファイルに記述する必要があるかはread_dataのマニュアル部分に書いてある。
ex.)full atom-ID molecule-ID atom-type q x y z
ex.)body atom-ID atom-type bodyflag mass x y z

 このstyleは変更ができないので、できるだ包括的なstyleをつかうのがいいらしい。なので大抵の場合fullでいいのではないか。各atom_styleを使うにあたって、必要なパッケージがあるので確認が必要(fullの場合はMOLECULEパッケージ)。

マニュアル該当部分:https://docs.lammps.org/atom_style.html

bond_style ~ kspace_style

・この5行は使用する力場の関数形に合わせて設定を行う必要がある。
例えばCHAMM力場の場合

E=E_{bond}+E_{angle}+E_{dihedral}+E_{nonbond}

 E_{bond}=\Sigma K_l (l-l_{eq})^2  
 E_{angle}=\Sigma K_{\theta} ({\theta}-{\theta }_{eq})^2 
 E_{dihedral}=\Sigma\Sigma \frac{V}{2}[1 + cos(n \phi -\gamma) ]
 E_{nonbond}=\Sigma \left[ \frac{A_{ij}}{r^{12}_{ij}}-\frac{B_{ij}}{r^{6}_{ij}} +\frac{q_i q_j}{\varepsilon r_{ij}} \right]

だいだいこのような関数系をしているので、合致するように選ぶ必要がある。

上の力場をコードに直すと
bond_style:harmonic
angle_style charmm
dihedral_style charmm

pair_style lj/cut/tip4p/long 1 2 1 1 0.105 12.0
kspace_style pppm/tip4p 1.0e-4

となる。
最後の2行が非分子結合相互作用の設定を表しており、pair_styleでレナードジョーンズとクーロン相互作用を設定している。(クーロン相互作用にはtip4pモデルを使っている。)
kspace_styleは長距離クーロン力の計算を行うための設定。EwaldやPPPM法が使える。

1
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
1
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?