Dear All,
I am using Lammps (lammps/29sep2021) to compute the stresses and the pressure:
I did the following:
variable pr equal press/10000
variable sxx equal pxx/(10000)
variable syy equal pyy/(10000)
variable szz equal pzz/(10000)
variable sxy equal pxy/(10000)
variable sxz equal pxz/(10000)
variable syz equal pyz/(10000)
velocity all create 300.0 1972
thermo 1 #output thermodynamics every 1000 timesteps
thermo_style custom step temp pe press lx ly lz density
fix statdump all print 1 "${st} ${tm} ${Et} ${Ep} ${Ek} ${tmp} ${pr} ${sxx} ${syy} ${szz} ${sxy} ${sxz} ${syz}" screen no file dump.stat
run 0
The result obtained at the end of the simulation reading the dump.stat is the following:
average pressure (GPa): 27.46786
average stresstensor xx xy xz (GPa): 31.0318 -0.0100 -0.0095
average stresstensor yx yy yz (GPa): -0.0100 23.3890 0.0095
average stresstensor zx zy zz (GPa): -0.0095 0.0095 27.9827
I was expecting (31.0318 + 23.3890+27.9827 )/3=27.467833333333335 should be of the opposite sign with the average pressure.
It that correct? If yes, please, what could be the source of the mistake?
Thank you.