融液の初期構造作成ログ | 融液 | Packmol | Argon

Packmol

Packmol - Initial configurations for Molecular Dynamics
水和構造を作成し分子動力学シミュレーションを実行してみる - Qiita
概要本稿ではタイトルの通り水和構造を作成し,分子動力学シミュレーションを実行する手続きを紹介します.水和構造はpackmol プログラムを用いて作成します.分子動力学シミュレーションはLAMMPS…

分子シミュレーションの初期配置の作成:Packmolの利用
https://youtu.be/ZicO91E-NaM?si=G0G9_jOWwVpjQhsX

packmolの入手・コンパイル

wget https://github.com/m3g/packmol/archive/refs/tags/v20.14.4+docs1.tar.gz
tar -xzvf v20.14.4+docs1.tar.gz
cd packmol-20.14.4-docs1/
ls -CF

AUTHORS CMakeLists.txt LICENSE Makefile README.md app/ compile_cmake.sh configure* fpm.toml header release.sh* solvate.tcl* src/ testing/

./configure

Setting compiler to /usr/bin/gfortran

make

Compiling packmol with /usr/bin/gfortran
Flags: -O3 –fast-math -march=native -funroll-loops



Packmol succesfully built.


ls -CF

AUTHORS LICENSE README.md compile_cmake.sh fpm.toml packmol* solvate.tcl* testing/
CMakeLists.txt Makefile app/ configure* header release.sh* src/
morii-k@SurfaceLaptop-4:~/packmol-20.14.4-docs1$

packmolのインプットの作成

mkdir argon_melt_ini_coords_240620_1350
cd argon_melt_ini_coords_240620_1350/
touch packmol.in
touch Ar.xyz

cat packmol.in

tolerance 2.0
filetype xyz
output out.xyz

structure Ar.xyz
number 60
inside box 0 0 0 10 10 10
end structure

cat Ar.xyz

1
#Ar

Ar 0 0 0

$HOME/packmol-20.14.4-docs1/packmol < packmol.in

検証

  • VMD

  • VESTA

.xyz形式からLAMMPSの入力ファイル形式に変換

.xyzファイルに単位セルの情報を追記

アルゴン分子結晶の単位セルの情報(https://www.webelements.com/argon/crystal_structure.html)を、out.xyzファイルの2行目に追記する.:

  • a: 525.6 pm=5.256 Å
  • b: 525.6 pm=5.256 Å
  • c: 525.6 pm=5.256 Å
  • α: 90.000°
  • β: 90.000°
  • γ: 90.000°
pwd
/home/morii-k/packmol-20.14.4-docs1/argon_melt_ini_coords_240620_1350
ls -CF
Ar.xyz  out.xyz  packmol.in
head -5 out.xyz
         100
  Built with Packmol
  Ar           9.631477       -0.001898       17.061972
  Ar           0.007148        1.663943        2.039236
  Ar          10.244424       10.287318        3.820063
sed --in-place "2c 5.256 5.256 5.256 90 90 90" out.xyz
head -5 out.xyz
         100
5.256 5.256 5.256 90 90 90
  Ar           9.631477       -0.001898       17.061972
  Ar           0.007148        1.663943        2.039236
  Ar          10.244424       10.287318        3.820063

LAMMPSの入力ファイル形式に変換

phase0をインストール
wget https://azuma.nims.go.jp/ugdb/servlet/dl?f=phase0_2024.01.tar.gz

–2024-06-24 15:40:31– https://azuma.nims.go.jp/ugdb/servlet/dl?f=phase0_2024.01.tar.gz
Resolving azuma.nims.go.jp (azuma.nims.go.jp)… 144.213.7.64
Connecting to azuma.nims.go.jp (azuma.nims.go.jp)|144.213.7.64|:443… connected.
HTTP request sent, awaiting response… 302 302
Location: /cms1/downloads/software/phase0_2024.01.tar.gz [following]
–2024-06-24 15:40:31– https://azuma.nims.go.jp/cms1/downloads/software/phase0_2024.01.tar.gz
Reusing existing connection to azuma.nims.go.jp:443.
HTTP request sent, awaiting response… 200 OK
Length: 93830860 (89M) [application/x-tar]
Saving to: ‘dl?f=phase0_2024.01.tar.gz’

dl?f=phase0_2024.01.tar.gz 100%[=================================================>] 89.48M 2.63MB/s in 34s

2024-06-24 15:41:06 (2.61 MB/s) – ‘dl?f=phase0_2024.01.tar.gz’ saved [93830860/93830860]

tar -zxvf dl?f=phase0_2024.01.tar.gz
cd phase0_2024.01/
ls -CF

README      doc/            phase-system_COPYRIGHT.txt  samples/    src_phase_3d/  src_wan_interp/  tools/
band_symm/  install.sh*     phase-system_eula-en.pdf    src_bm/     src_spectrum/  src_workfunc/    util/
bin/        install_3d.sh*  phase-system_eula-ja.pdf    src_phase/  src_stm/       test/
ls -CF ~/phase0_2024.01/bin

animate.pl*                       dos.py*                    piou/
band.pl*                          dynm2tr2.pl*               plot_multiple_defect_formation_energy.py*
band_kpoint.pl*                   extract_slice.py*          prep_piezo.pl*
band_local_decomp.py*             freq.pl*                   prep_strfrc.pl*
band_orbital_proj.pl*             geninp.py*                 prep_zeff.pl*
band_unfold.pl*                   inpcheck.py*               surface_projected_bulk_band.py*
berry.pl*                         phonon_band.pl*            wfsq.py*
calc_defect_formation_energy.py*  phonon_band_atom_proj.py*  workfunc.pl*
conv.py*                          phonon_dos.pl*
dos.pl*                           phonon_energy.pl*

conv.pyのインストールが完了した.

conv.pyを用いてLAMMPSの入力ファイル形式に変換

$HOME/phase0_2024.01/bin/conv.py --batch --input_type=xyz --output_type=LAMMPS_input --input_file=out.xyz --output_file=config.atoms


atomic configuration converter utility.
Copyright (C) PHASE System Consortium
      INFO: the number of frames defined in this XYZ file : 1
      INFO: converting input file 'out.xyz' (xyz file) to output file 'config.atoms' (LAMMPS_input file)
      INFO: the number of frames to output : 1
      INFO: ... done
      INFO:
ls -CF

Ar.xyz  config.atoms  out.xyz  packmol.in


head -20 config.atoms

LAMMPS input file generated by the PHASE I/O utility
# created on : 06/24/24 16:00:47

100 atoms
1 atom types
0 5.256 xlo xhi
0 5.256 ylo yhi
0 5.256 zlo zhi
0 0 0 xy xz yz

Atoms

1 1 9.631477 -0.001898 17.061972
2 1 0.007148 1.663943 2.039236
3 1 10.244424 10.287318 3.820063
4 1 9.795622 13.242042 19.431851
5 1 4.052893 0.004867 5.66693
6 1 17.261808 3.34644 3.416667
7 1 7.052095 1.871045 20.066611
8 1 10.879357 6.768397 1.147721
(snip)

LAMMPSで分子動力学計算を実行

LAMMPSのインプットスクリプトの作成

touch lj.input
cat lj.input
# Ar crystallization

# 1) Initialization
# units         real
units         lj
atom_style    atomic

# 2) Setup simulation box
boundary      p p p

# 1') Initialization
read_data     config.atoms

# 3) Setup atoms
mass          1 39.95
velocity all  create 300.0 10

# 4) Force fields
pair_style    lj/cut 10.215
pair_coeff    1 1 0.01032 3.405

# 5) Settings
neighbor      0.3 bin
neigh_modify  every 1 delay 0 check yes
timestep      0.01

# 6) Operations within timestepping
fix           1 all nve
compute       myRDF all rdf 100
fix           2 all ave/time 100 50 5000 c_myRDF[*] file lj.rdf mode vector

# 7) Output
thermo        100
thermo_style  custom time ke pe etotal temp
dump          1 all xyz 100 lj.xyz
dump_modify   1 sort id element Ar

# 8) Actions
run           10000
# Ar crystallization

# 1) Initialization
# units         real
units         lj
atom_style    atomic

# 2) Setup simulation box
boundary      p p p
region        mybox1 block 0 3 0 3 0 3
create_box    1 mybox1

# 1') Initialization
read_data     config.atoms

# 3) Setup atoms
mass          1 39.95
velocity all  create 300.0 10

# 4) Force fields
pair_style    lj/cut 10.215
pair_coeff    1 1 0.01032 3.405

# 5) Settings
neighbor      0.3 bin
neigh_modify  every 1 delay 0 check yes
timestep      0.01

# 6) Operations within timestepping
fix           1 all nve
compute       myRDF all rdf 100
fix           2 all ave/time 100 50 5000 c_myRDF[*] file lj.rdf mode vector

# 7) Output
thermo        100
thermo_style  custom time ke pe etotal temp
dump          1 all xyz 100 lj.xyz
dump_modify   1 sort id element Ar

# 8) Actions
run           10000

LAMMPSの実行

mpirun -np 4 /lammps-2Aug2023/src/lmp_mpi -in lj.input

コメント

タイトルとURLをコピーしました