본문 바로가기

LAMMPS

Molecule을 이용한 Clump Simulation

# Simulation of clump using molecule

# 1. Setup simulation environments
units            si
dimension        3
atom_style       sphere
boundary         f f f
newton           off
processors       * * * grid numa

# 2. Setup Communication and Neighboring list
comm_modify      mode single vel yes
atom_modify      map array
neigh_modify     delay 0 every 1 check yes once no cluster no exclude none page 100000 one 2000 binsize 0.002

# 3. Setup Packages
package          intel 1 omp 4 mode mixed
package          omp 4
suffix           hybrid intel omp

# 4. Setup variables
variable         crit_dt      equal 0.0000005
variable         screen_nstep equal round(0.02/(v_crit_dt))

# 5. Read atom and molecule data
fix              addMolecule all property/atom mol ghost yes
read_data        m.data fix addMolecule NULL Molecules

# 6. Decalre mocules is composed of sphere : DOF adjust ment not to calculate DOF <=0
compute          adjustDOF all temp/sphere
thermo_modify    temp adjustDOF
fix              makeClumps all rigid molecule

# 7. Setup interactions btw atoms (molecule)
pair_style       gran/hertz/history/omp 200000.0 NULL 50.0 NULL 0.5 1
pair_coeff       * *

# 8. Apply gravity
fix              gravAcc all gravity 9.81 vector 0.0 0.0 -1.0
fix              viscousDamping all viscous 0.0001

# 9. Preparation for run
timestep         ${crit_dt}


# 10. Print out read_data informations (atoms, molecule)
dump             myDump  all  custom  1  atom_info.dat  id mol type diameter mass x y z
run              0

# 11. Setup dump
shell            if [ -d "post_1" ]; then rm -rf post_1; fi
shell            mkdir post_1

dump             dump_atoms all vtk ${screen_nstep} post_1/atoms*.vtk fx fy fz xu yu id type radius diameter x y z vx vy vz
dump             check all custom ${screen_nstep} check.txt id type diameter x y z
dump_modify      check sort id

run              3000000

quit


# 2) Set up sphere properties (diameter & mass) for atom type 1
set type 1 diameter 1.0
mass 1 5.0

# 3) Define interactions
#pair_style     lj/cut 2.5
#pair_coeff     * * 1.0 1.0
pair_style       gran/hertz/history/omp 200000.0 NULL 50.0 NULL 0.5 1
pair_coeff       * *


# 4) "Molecule" command reading from the same data file
#    We specify "data data_merged.lmp" plus offset arguments:
#    The "1" after "data" refers to the 'Molecules' ID = 1 in the file.
#    offset 0 0 0 0 => no shift in atom IDs, no shift in types, etc.
molecule       clump4 data m.data 1 offset 0 0 0 0

# 5) Define a region for insertion
region         my_insertion block 20 30 20 30 20 30

# 6) Deposit 2 copies of "clump4" into my_insertion region
fix deposit_mol all deposit 2 1 100 12345 region my_insertion mol clump4

# Explanation of fix deposit:
#   deposit 2    -> insert 2 total clumps
#   1            -> each inserted "atom" is type 1
#   100          -> max attempts per insertion
#   12345        -> random seed
#   region my_insertion -> region to insert into
#   mol clump4   -> which molecule definition to use (the one we just read)

# 7) Run some timesteps so insertion actually happens
timestep       0.01
thermo         100
run            2000

 

Molecule data file

LAMMPS data file with existing atoms and a "Molecules" section

4 atoms
1 atom types
#0 bonds
#0 bond types
#0 angles
#0 angle types
#0 dihedrals
#0 dihedral types
#0 impropers
#0 improper types

-0.1 0.1 xlo xhi
-0.1 0.1 ylo yhi
-0.1 0.1 zlo zhi

Atoms # You must have blank after "Atoms" : sphere : atom-ID atom-type diameter density x y z

1 1 0.01 1 0.003 0.0   0.0
2 1 0.01 1 0.0   0.003 0.0
3 1 0.01 1 0.0   0.0   0.003
4 1 0.01 1 0.0   0.0   0.0

Molecules # You must have blank after "Molecules" : Atom ID, Mol ID

1 1
2 1
3 1
4 1