LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] The difference between compute pressure andcompute stress/atom
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] The difference between compute pressure andcompute stress/atom


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Mon, 28 Aug 2017 19:45:40 -0400



On Mon, Aug 28, 2017 at 7:21 PM, 709832702 <709832702@...2872.....> wrote:
Hi Axel,
 
use the units metal, here we compare output v_p4 (black line) with c_stressz1 (red line), the compute progress is as follows,

​i didn't ask about the value for the units command in your LAMMPS input script, but the units for the output in your plot!​ i am surprised that you are not embarrassed by sending such a plot without proper units and descriptors to the public and thus showing your disregard for common scientific practice.

​what you have below shows that what you are computing from the pressure compute is not comparable to what you compute from stress/atom. the output from compute pressure is the one that is "more correct". the other has an unphysical weighting included. remember pressure is an "intensive" property.

as i already pointed out, the documentation for compute stress/atom gives an example how you correctly compute the total pressure from compute stress/atom. it is trivial to adapt this to getting the individual components.

axel.
 
 
                             

compute strs all stress/atom NULL

compute vol all voronoi/atom

variable stress1 atom "c_strs[1]/10000/c_vol[1]"

variable stress2 atom "c_strs[2]/10000/c_vol[1]"

variable stress3 atom "c_strs[3]/10000/c_vol[1]" 

compute stressx1 all reduce ave v_stress1

compute stressy1 all reduce ave v_stress2

compute stressz1 all reduce ave v_stress3

# Store final cell length for strain calculations

variable tmp equal "lx"

variable L0 equal ${tmp}

print "Initial Length, L0: ${L0}"

variable tmp equal "ly"

variable L1 equal ${tmp}

print "Initial Length, L1: ${L1}"

variable tmp equal "lz"

variable L2 equal ${tmp}

print "Initial Length, L2: ${L2}"

######################################

# DEFORMATION

reset_timestep 0

fix 1 all nve

fix 3 all langevin 10 10 0.1 48279

variable srate equal 1.0e8

variable srate1 equal "v_srate / 1.0e12"

fix 2 all deform 1 y erate ${srate1} units box remap x

# p2, p3, p4 are in GPa

variable strain0 equal "(lx - v_L0)/v_L0"

variable strain1 equal "(ly - v_L1)/v_L1"

variable strain2 equal "(lz - v_L2)/v_L2"

variable p0 equal "v_strain0"

variable p1 equal "v_strain1"

variable p11 equal "v_strain2"

variable p2 equal "-pxx/10000"

variable p3 equal "-pyy/10000"

variable p4 equal "-pzz/10000"

thermo_style custom step v_strain0 v_strain1 v_strain2 temp v_p2 v_p3 v_p4 c_stressx1 c_stressy1 c_stressz1

 

Best wishes!



------------------ 原始邮件 ------------------
发件人: "Axel Kohlmeyer";<akohlmey@...24...>;
发送时间: 2017年8月28日(星期一) 晚上7:28
收件人: "709832702"<709832702@...6558...com>;
抄送: "lammps-users"<lammps-users@lists.sourceforge.net>;
主题: Re: [lammps-users] The difference between compute pressure andcompute stress/atom



On Mon, Aug 28, 2017 at 12:49 AM, 709832702 <709832702@...1204...> wrote:
 
Hi Axel,
 
Both of the two curves represent the normal stress along tensile direction.

?in what units??
 
The black line is that I used the "compute pressure" command to calculate the normal stress(pzz), while the red line I used the command "compute stress/atom" and use the "compute reduce" to calculate the normal stress(sigmazz), I think they are should be the same, but the result does not. I use these two method in the other materials, they are the same. So which method is better to calculate the normal stress during the tensile test.

?impossible to say. both should give *identical* output, if computed correctly. since you don't provide enough information to assess how you computed them, there is no way to tell. they could be both wrong.

axel.?


 
 
Best wishes!


------------------ 原始邮件 ------------------
发件人: "Axel Kohlmeyer";<akohlmey@...24...>;
发送时间: 2017年8月28日(星期一) 凌晨4:18
收件人: "709832702"<709832702@...6558...com>;
抄送: "lammps-users"<lammps-users@lists.sourceforge.net>;
主题: Re: [lammps-users] The difference between compute pressure andcompute stress/atom



On Sat, Aug 26, 2017 at 11:41 PM, 709832702 <709832702@...1204...> wrote:

Hi,

Recently, I adopted the compute pressure and compute stress/atom to calculate normal stress under uniaxial tensile as shown in the attached Figure, here the tensile direction is with the periodic boundary, and the other two direction are the free surface, I found that the stresses are not equal at the beginning, although they are in agreement at the end of progress, so what is the reason, they are all based on the virial theory. I also test under all three directions are the periodic boundaries, this time they are nearly coincident.

first rule about ?figures in science: *always* include units!
?
since you don't explain with sufficient detail what you are computing for the figure, there is little to comment. if you did it correctly, both graphs should be identical, since they should show the identical information. the fact, that they don't coincide hints at you don't computing one of them correctly.

axel.



 

Best wishes!


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...655....net
https://lists.sourceforge.net/lists/listinfo/lammps-users




--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.



--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.



--
Dr. Axel Kohlmeyer  akohlmey@...24...  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.