I am simulating an all-atom model of a polymer composite under NPT ensemble using fix deform command. I want to calculate the Young’s modulus of the system. I have done this in two different ways.
compute newT all temp
compute press1 all pressure newT
compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable strx equal -c_p[1]/vol
etc…
For each of the diagonal components, I observe a difference of
{ pxx pyy pzz
-577.14688 959.23879 779.16382
1360.0821 -81.16043 43.83924
1979.5383 507.0162 1777.9576
1092.6076 385.68412 -2001.5068
-2188.5087 -363.71055 -2862.8444
-1539.617 693.65343 2.58046
}
{ strx stry strz # these are components from stress/atom
313.86507 1850.2507 1670.1758
2246.1962 804.95368 929.95336
2865.6528 1393.1307 2664.0721
1981.1298 1274.2063 -1112.9846}
as mention in the manual that the -(c_p[1]+c_p[2]+c_p[3])/3/vol) will be equal to v_press
but in my case, the values are different
-(c_p[1]+c_p[2]+c_p[3])/3/vol) v_press
1278.0972 387.08524
1327.0344 440.92031
2307.6185 1421.504
714.11721 -174.40501
-919.56401
I am attaching a portion of my script and data file. I am currently using the LAMMPS version August 29, 2024
thank you so much
I also noticed that when I added a negative sign to c_p[1]…, the stress values became more negative. This is opposite to what is mentioned in the manual
“The per-atom stress does not include any Lennard-Jones tail corrections to the pressure added by the pair_modify tail yes command, since those are contributions to the global system pressure.”
Thank you so much, Dear @stamoor, for your reply. Yes, you are right. I read this note in the manual, and then I commented the tail yes in the pair_modify command, but still, the v_press and stress are inconsistent.
got it Dear @stamoor thank you so much for your help
i have last question.
In calculating stress, do we need to add a negative sign to the stress/atom components (e.g., -p1[1]), or is the negative sign only necessary when converting stress into pressure?
Dear @stamoor, I have read the manual, but I still have some doubts. However, I will go through it more thoroughly to gain a deeper understanding
thank you so much for your time.