DUMP stress tensors for each time step in LIGGGHTS

Submitted by astral1000 on Fri, 10/26/2018 - 21:35

Hello, Everybody

I have a problem with dumping stress for my shear stress simulation. Whenever I try dump pxy pressure component I get an error of Illegal thermo_style keyword (when I put pxy into thermo_style) or Illegal variable command (when I use pxy in the variable command)

Could you please help me dump stress components for each timestep?

atom_style granular
atom_modify map array
boundary m m m
newton off

communicate single vel yes

units si

region reg block 0 0.086 0 0.086 0. 0.085 units box
create_box 1 reg

neighbor 0.002 bin
neigh_modify delay 0

#Material properties required for new pair styles

fix m1 all property/global youngsModulus peratomtype 69.e7
fix m2 all property/global poissonsRatio peratomtype 0.26
fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
fix m5 all property/global thermalConductivity peratomtype 0.00135
fix m6 all property/global thermalCapacity peratomtype 2700

#New pair style
pair_style gran model hertz tangential history
pair_coeff * *

timestep 0.00001

fix gravi all gravity 9.81 vector 0.0 0.0 -1.0

fix xwalls1 all wall/gran model hertz tangential history primitive type 1 xplane 0
fix xwalls2 all wall/gran model hertz tangential history primitive type 1 xplane 0.086
fix ywalls1 all wall/gran model hertz tangential history primitive type 1 yplane 0
fix ywalls2 all wall/gran model hertz tangential history primitive type 1 yplane 0.086
fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zplane 0
fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 0.085

#particle distributions
fix pts1 all particletemplate/sphere 15485863 atom_type 1 density constant 2650 radius constant 0.003
fix pdd1 all particledistribution/discrete 15485867 1 pts1 1.0

fix ins all insert/pack seed 32452867 distributiontemplate pdd1 &
maxattempt 200 insert_every once overlapcheck yes all_in yes vel constant 0. 0. 0. &
region reg particles_in_region 3000 region reg

#apply nve integration to all particles
fix integr all nve/sphere

#output settings, include total thermal energy
compute rke all erotate/sphere
compute peratom all pe/atom
compute pperatom all stress/atom
compute myTemp all temp
compute myPress all pressure myTemp
compute propat all property/atom xs ys zs vx vy vz vx fx fy fz
compute p all reduce sum c_pperatom[1] c_pperatom[2] c_pperatom[3] c_pperatom[4] c_pperatom[5] c_pperatom[6]
variable p1 equal c_p[1]
variable p2 equal c_p[2]
variable p3 equal c_p[3]
variable p4 equal c_p[4]
variable p5 equal c_p[5]
variable p6 equal c_p[6]
thermo 100
thermo_style custom step lx ly lz c_myPress
thermo_modify lost ignore norm no

#insert particles
run 5000
unfix ins

#run
run 25000 upto

region lower block INF INF INF INF INF 0.010
region upper block INF INF INF INF 0.035 INF
region upper2 block INF INF INF INF 0.015 0.035
region upper3 block INF INF INF INF INF 0.015
group lower region lower
group upper region upper
group upper2 region upper2
group upper3 region upper3
group boundary union lower upper
group mobile subtract all boundary

set group lower type 1
set group upper type 1

communicate single vel yes

# Store final cell length for strain calculations
variable tmp equal "lx"
variable L0 equal ${tmp}
print "Initial Length, L0: ${L0}"

unfix xwalls1
unfix xwalls2
unfix zwalls2

velocity upper set 1.0 0 0
velocity upper2 set 0.7 0 0
velocity upper3 set 0.3 0 0

variable strain equal "(lx - v_L0)/v_L0"
variable p0 equal "v_strain"
#variable p7 equal "-pxy"
fix def1 all print 100 "${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6} " file STRESS-STRAIN.txt screen no

dump 4 all custom 150 dump.comp_*.cfg id mass type x y z ix iy iz vx vy vz fx fy fz xs ys zs

run 4000

# SIMULATION DONE
print "All done"