The following script is for determining lattice thermal conductivity of SrTiO3 bulk. It requires data.lmp where i suppose i should provide unitcell structure of SrTiO3. I downloaded .cif from material project then converted it to lammps data file using atomsk. But running it giving a error that format is incerrect. What could be possible fix for this?
units real
variable T equal 1100 # temperature
variable Q equal 94275 # random number seed
variable dt equal 1.0 # timestep in fs
variable s equal 500 # screen output frequency
variable trop equal 3 # system isotropy, 1 = isotropic, 2 = anisotropic, 3 = triclinic
variable Ep equal 50000 # npt equilibriation steps
variable Ev equal 50000 # nvt equilibriation steps
variable NT equal 2 # data collection ensemble, 1 = NVE, 2 = NVT, 3 = NPT
variable N equal 5000000 # number of steps
variable d equal 10 # calculation frequency (equilibration lattice vectors and production heat-flux)
variable rep equal 0 # 0 = do not replicate cell, 1 = replicate cell
variable repx equal 12 # replication factor for x
variable repy equal 12 # replication factor for y
variable repz equal 12 # replication factor for z
variable xyz equal 0 # 1 = print xyz file during production phase
#######################################################################
#######################################################################
#system settings
atom_style full
pair_style buck/coul/long 8.5
processors * * * grid numa
read_data data.lmp
if "${rep} == 1" then "replicate ${repx} ${repy} ${repz}"
balance 1.0 shift xyz 20 1.0
#kcal/mol for unit style "real"
pair_coeff * * 0.000000 1.000000 0.000000
pair_coeff 1 3 335921.2159 0.245015 1885.767153
pair_coeff 2 3 546728.0894 0.18558 334.684293
pair_coeff 3 3 42541.68289 0.343645 4441.08738
kspace_style pppm 1.0e-5
#######################################################################
#######################################################################
#general settings
timestep ${dt}
thermo $s
thermo_style custom step temp etotal press vol lx ly lz xy xz yz
thermo_modify flush no
run_style verlet
#######################################################################
#######################################################################
#npt equi skipping
if "${Ep} == 0" then "jump input.lmp NVT"
#######################################################################
#######################################################################
#npt equi
variable myLx equal lx
variable myLy equal ly
variable myLz equal lz
variable myxy equal xy
variable myxz equal xz
variable myyz equal yz
variable repeat equal v_Ep/v_d
velocity all create $T $Q mom yes rot yes dist gaussian
fix A all momentum 100 linear 1 1 1
if "${trop} == 1" then "fix B all npt temp $T $T 100.0 iso 0.0 0.0 1000.0"
if "${trop} == 2" then "fix B all npt temp $T $T 100.0 aniso 0.0 0.0 1000.0"
if "${trop} == 3" then "fix B all npt temp $T $T 100.0 tri 0.0 0.0 1000.0"
fix C all ave/time $d ${repeat} ${Ep} v_myLx v_myLy v_myLz v_myxy v_myxz v_myyz mode
scalar ave one
run ${Ep}
variable newX equal f_C[1]
variable newY equal f_C[2]
variable newZ equal f_C[3]
variable newxy equal f_C[4]
variable newxz equal f_C[5]
variable newyz equal f_C[6]
if "${trop} == 1" then "change_box all x final 0.0 ${newX} y final 0.0 ${newY} z final 0.0 ${newZ}
remap units box"
if "${trop} == 2" then "change_box all x final 0.0 ${newX} y final 0.0 ${newY} z final 0.0 ${newZ}
remap units box"
if "${trop} == 3" then "change_box all x final 0.0 ${newX} y final 0.0 ${newY} z final 0.0 ${newZ} xy
final ${newxy} xz final ${newxz} yz final ${newyz} remap units box"
unfix A
unfix B
unfix C
write_data equi_vol.lmp
#######################################################################
#######################################################################
#nvt equi skipping
label NVT
if "${Ev} == 0" then "jump input.lmp RUN"
#######################################################################
#######################################################################
#nvt equi
velocity all create $T $Q mom yes rot yes dist gaussian
fix A all momentum 100 linear 1 1 1
fix B all nvt temp $T $T 100.0
run ${Ev}
unfix A
unfix B
#######################################################################
#######################################################################
#choose data collection type
label RUN
if "$N == 0" then "jump input.lmp END"
if "${NT} == 1" then "fix B all nve"
if "${NT} == 2" then "fix B all nvt temp $T $T 100.0"
if "${NT} == 3 && ${trop} == 1" then "fix B all npt temp $T $T 100.0 iso 0.0 0.0 1000.0"
if "${NT} == 3 && ${trop} == 2" then "fix B all npt temp $T $T 100.0 aniso 0.0 0.0 1000.0"
if "${NT} == 3 && ${trop} == 3" then "fix B all npt temp $T $T 100.0 tri 0.0 0.0 1000.0"
#######################################################################
#######################################################################
#output variables
variable V equal vol
shell echo $T >> variables.txt
shell echo $V >> variables.txt
shell echo ${dt} >> variables.txt
shell echo $d >> variables.txt
#######################################################################
#######################################################################
#heat-flux output
reset_timestep 0
compute myKE all ke/atom
compute myPE all pe/atom
compute myStress all stress/atom NULL virial
compute flux all heat/flux myKE myPE myStress
thermo_style custom step temp press pe ke etotal
thermo_modify flush no #flush output
#######################################################################
#######################################################################
#running output
variable timestep equal step
variable Xflux equal c_flux[1]
variable Yflux equal c_flux[2]
variable Zflux equal c_flux[3]
fix C all print $d "${timestep} ${Xflux} ${Yflux} ${Zflux}" append flux.txt screen no
if "${xyz} == 1" then &
"dump 1 all xyz $s structure.xyz" &
"dump_modify 1 element Sr Ti O"
#######################################################################
#######################################################################
#data collection
run $N
#######################################################################
#######################################################################
#new data generation
label END
write_data new_data.lmp
The data file: `
LAMMPS data file
5 atoms
0 bonds
0 angles
0 dihedrals
0 impropers
3 atom types
0.0 3.912701310000 xlo xhi
0.0 3.912701310000 ylo yhi
0.0 3.912701310000 zlo zhi
Masses
1 87.62000000 # Sr (example mass)
2 47.86700000 # Ti (example mass)
3 15.99900000 # O (example mass)
Atoms # full
1 1 2.000000 0.000000000000 0.000000000000 0.000000000000
2 2 4.000000 1.956350655000 1.956350655000 1.956350655000
3 3 -2.000000 1.956350655000 0.000000000000 1.956350655000
4 3 -2.000000 1.956350655000 1.956350655000 0.000000000000
5 3 -2.000000 0.000000000000 1.956350655000 1.956350655000
`