LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] Ask fix spring/self problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] Ask fix spring/self problem

From: Axel Kohlmeyer <akohlmey@...24...>
Date: Fri, 18 May 2018 14:25:02 -0400

On Fri, May 18, 2018 at 11:46 AM, Jeong, Jae Young <JaeyoungJeong@...1598...> wrote:

Hi, the lammps user

I'm currently calculating VACF as a function of the distance between two materials
I used "fix spring/self" to restrain the center of mass distance between the two groups.

​please note, that fix spring/self restrains *all* atoms to there initial *individual* positions.​
this will also restrain the COM distance between two groups implicitly, but to *only* restrain that distance, you should use plain fix spring in couple mode.

As below my scripts, I used "fix spring/self" at the equilibrium without the calculation of VACF and it worked.
It means that two groups had the initial position. 
However, I added the calculation part of VACF, two groups close to each other. They did not keep initial position while calculating VACF.
If you tell me what's wrong, I'd really appreciate it.

​using fix spring/self together with the intention to compute VACFs makes no sense. you are significantly manipulating atomic velocities​ with this.
also, using fix momentum in this case pointless and very likely creating issues as well.



Jaeyoung Jeong

#  This is the control script for LAMMPS
echo both
# Input file for phonon density of state
units           metal
atom_style      atomic
boundary        p p p


group           C  type 1
group           Cu  type 2

# Define interatomic potential
pair_style       hybrid eam lj/cut 20.0 tersoff
pair_coeff       * * eam Cu_u3.eam
pair_coeff       * * tersoff tersoff.coeffs C NULL
pair_coeff       1 2 lj/cut 0.02578 3.6

neighbor        2.0 bin
neigh_modify    delay 0 every 1 check yes

# Minimization

thermo 50
thermo_style custom step temp pe ke etotal press vol
min_style       cg
minimize        1.0e-8 1.0e-8 5000 10000

# Relaxation of the lattice to the potential in NPT
velocity        all create 300.00 156467 rot yes mom yes dist gaussian
timestep 0.0005
fix             1 all npt temp 300.00 300.00 0.02 iso 0.0 0.0 0.2
reset_timestep 0
run 500000
unfix           1

# Equilibriate the system in NVE #
reset_timestep  0
fix             2 all nve
fix             3 all momentum 1000 linear 1 1 1
variable        tt0 equal step
fix 4 C spring/self 5
dump DUMP_NVE all xyz 100000
dump_modify DUMP_NVE element C Cu
run             500000

# Calculation of properties velocity autocorelation  in NVE #
variable        tt1 equal ${tt0}
compute 1 C  vacf
compute 2 Cu vacf
variable        Cxxvacf equal c_1[1]
variable        Cyyvacf equal c_1[2]
variable        Czzvacf equal c_1[3]
variable        Callvacf equal c_1[4]
variable        Cuxxvacf equal c_2[1]
variable        Cuyyvacf equal c_2[2]
variable        Cuzzvacf equal c_2[3]
variable        Cuallvacf equal c_2[4]
variable        tt equal (step)*0.0005

reset_timestep 0
thermo          10
thermo_style    custom step c_1[1] c_1[2] c_1[3] c_1[4] c_2[1] c_2[2] c_2[3] c_2[4]
fix             vacfresult all print 10 "${tt} ${Cxxvacf} ${Cyyvacf} ${Czzvacf} ${Callvacf} ${Cuxxvacf} ${Cuyyvacf} ${Cuzzvacf} ${Cuallvacf}" screen no file vacf.txt title "# Velocity Autocorrelation"

run             100000

write_restart   graphene.restart

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
lammps-users mailing list

Dr. Axel Kohlmeyer  akohlmey@...12...24...
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.