regarding strain calculation

Dear Lammpsers,

I am trying to calculate strain in LAMMPS but I cannot access to the Instant position of the sample even by “thermo_style custom step…lz” in order to calculate strain value.

in fact, the resulted lz accuracy is not enough to show the movement of lz. I defined lz as a real parameter but thermo results are in integer which do not show instant positions.

is this any other better ideas to access to the instant positions of the tensile test model?

Best regards,

—part of thee input file---------------------------------------
label loop

variable i loop 5

fix 5 top_edge move linear 0 0 0.001 units box

thermo 100
thermo_style custom step lz pzz temp pe etotal

variable stressp equal “pzz”
variable stressc equal “c_2”

fix fprint1 all print 20 " {stressp} {stressc}" file Stress_Strain.txt screen no
fix 6 middle nve
run 5000
unfix 5
unfix 6

fix 7 middle nvt temp 300.0 300.0 100.0

dump 3 all xyz 100 dump2_tensile.txt
undump 3

thermo 100
thermo_style custom step temp pe etotal

run 5000
next i

jump SELF loop

Dear Lammpsers,

I am trying to calculate strain in LAMMPS but I cannot access to the Instant position of the sample even by “thermo_style custom step…lz” in order to calculate strain value.

in fact, the resulted lz accuracy is not enough to show the movement of lz. I defined lz as a real parameter but thermo results are in integer which do not show instant

What is the order of magnitude of the changes in dimension you want to measure? Did you used “thermo_modify format” to increase the precision of the thermo output?

I suspect however your box dimensions to not change at all, because of other issues in your input script… lz will always give you the exact dimession of the box at the current timestep.

Julien

positions.

is this any other better ideas to access to the instant positions of the tensile test model?

Best regards,

—part of thee input file---------------------------------------
label loop

variable i loop 5

fix 5 top_edge move linear 0 0 0.001 units box

thermo 100
thermo_style custom step lz pzz temp pe etotal

variable stressp equal “pzz”
variable stressc equal “c_2”

fix fprint1 all print 20 " {stressp} {stressc}" file Stress_Strain.txt screen no
fix 6 middle nve
run 5000
unfix 5
unfix 6

fix 7 middle nvt temp 300.0 300.0 100.0

dump 3 all xyz 100 dump2_tensile.txt
undump 3

thermo 100
thermo_style custom step temp pe etotal

run 5000
next i

jump SELF loop

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

The box lengths (e.g. lz) are output in floating point. If it appears as an

integer, it must be b/c it is 3.0000000 or the like. My guess is your

box size is not changing.

Steve

Dear Steve,
The sample length in z direction is 60 which is almost half of the box_z size. You can find my input file here. the only problem I think is in calculation of the strain. please let me know you comments.

Yours Sincerely,
Bahman

#Phase 1 ------------------------------------------Simulation main setup-------------------------------------------------
dimension 3
units real
atom_style charge
boundary p p p

variable lz0 equal 60

#simulation box
region box block 0 37.86 0 11.358 0.0 114 units box
create_box 2 box #2 is number of atoms

it was very difficult to finally find these positions

lattice custom 1 a1 3.786 0.00000 0.00000 a2 0.0000 3.786 0.00000 a3 0 0 9.514 &
basis 0.0000 0.2500 0.3750 &
basis 0.0000 0.7500 0.6250 &
basis 0.5000 0.7500 0.8750 &
basis 0.5000 0.2500 0.1250 &
basis 0.0000 0.0000 0.1700 &
basis 0.0000 0.7500 0.4200 &
basis 0.5000 0.2500 0.3300 &
basis 0.5000 0.7500 0.0800 &
basis 0.500 0.5000 0.6700 &
basis 0.500 0.2500 0.9200 &
basis 0.000 0.7500 0.8300 &
basis 0.000 0.2500 0.5800
mass 1 47.86000
mass 2 15.99940

#Phase 2 -------------------------------------------------------tensile model design---------------------------------------------------------

region top_edge block 11.358 26.502 0 11.358 58 ${lz0} units box
create_atoms 2 region top_edge &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group top_edge region top_edge
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

region middle block 11.358 26.502 0 11.358 2 58 units box
create_atoms 2 region middle &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group middle region middle
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

region bottom_edge block 11.358 26.502 0 11.358 0 2 units box
create_atoms 2 region bottom_edge &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group bottom_edge region bottom_edge
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

#Phase 3----------------------------------------Buckingham Potential-----------------------------------------------

pair_style buck/coul/long 15.0
pair_coeff 1 1 717647.40 0.154 121.067
pair_coeff 1 2 391049.10 0.194 290.331
pair_coeff 2 2 271716.30 0.234 696.888

neighbor 2.0 bin # skin distance for real units is by default 2.0
neigh_modify every 1 delay 0 check yes

kspace_style pppm 0.0001

#Phase 4----------------------------------------Compute—how can I monitor Vparticle!!! ------------------------

compute 1 middle stress/atom NULL
compute 2 middle reduce sum c_1[3] # stress in z direction

#----Phase 5-------------------------------------Initial Equilibration at 300K ----------------------------------------
variable nstep1 equal 3000
variable itn equal 100
timestep 1.0 # or 2

velocity all create 300 12345 mom yes rot no

fix 1 middle nvt temp 300.0 300.0 100.0
fix 2 bottom_edge setforce 0.0 0.0 0.0
fix 3 top_edge setforce 0.0 0.0 0.0

thermo {itn} dump 2 all xyz 100 dump2_tensile.txt run {nstep1} #2ns=2000000

#----Phase 6---------------------------------------tensile test at the room temperature --------------------

variable counter1 equal 15
variable counter2 equal 10
variable counter3 equal 10

variable nstep2 equal 1000
variable nstep3 equal 3000
variable rate equal 0.001

label flag1
variable i loop ${counter1}

fix 5 top_edge move linear 0 0 ${rate} units box

thermo {itn} thermo_style custom step temp pe etotal pzz variable dlz equal "step*v_rate/(v_counter1*v_nstep2)" variable strain equal "v_dlz*100/v_lz0" variable stressp equal "pzz" variable stressc equal "c_2" fix fprint1 all print {itn} " {strain} {stressc} {stressp} " file Stress_Strain03.txt screen no run {nstep2}
unfix 5

fix 6 middle nvt temp 300.0 300.0 100.0
dump 3 all xyz 100 dump2_tensile.txt
undump 3
run ${nstep3}
next i
jump SELF flag1

unfix 6
unfix fprint1

Dear Steve,
The sample length in z direction is 60 which is almost half of the box_z size. You can find my input file here. the only problem I think is in calculation of the strain. please let me know you comments.

You apply the deformation to the sample directly (fix move command apply on the group top_edge). Why are you then monitoring the box dimension? There is no reason for the box to change…
I do not really understand your setup, but IMHO, monitoring the box size during a tensile test make sense only when you have a box AND a sample that are periodic.

Julien

Yours Sincerely,
Bahman

#Phase 1 ------------------------------------------Simulation main setup-------------------------------------------------
dimension 3
units real
atom_style charge
boundary p p p

variable lz0 equal 60

#simulation box
region box block 0 37.86 0 11.358 0.0 114 units box
create_box 2 box #2 is number of atoms

it was very difficult to finally find these positions

lattice custom 1 a1 3.786 0.00000 0.00000 a2 0.0000 3.786 0.00000 a3 0 0 9.514 &
basis 0.0000 0.2500 0.3750 &
basis 0.0000 0.7500 0.6250 &
basis 0.5000 0.7500 0.8750 &
basis 0.5000 0.2500 0.1250 &
basis 0.0000 0.0000 0.1700 &
basis 0.0000 0.7500 0.4200 &
basis 0.5000 0.2500 0.3300 &
basis 0.5000 0.7500 0.0800 &
basis 0.500 0.5000 0.6700 &
basis 0.500 0.2500 0.9200 &
basis 0.000 0.7500 0.8300 &
basis 0.000 0.2500 0.5800
mass 1 47.86000
mass 2 15.99940

#Phase 2 -------------------------------------------------------tensile model design---------------------------------------------------------

region top_edge block 11.358 26.502 0 11.358 58 ${lz0} units box
create_atoms 2 region top_edge &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group top_edge region top_edge
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

region middle block 11.358 26.502 0 11.358 2 58 units box
create_atoms 2 region middle &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group middle region middle
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

region bottom_edge block 11.358 26.502 0 11.358 0 2 units box
create_atoms 2 region bottom_edge &
basis 1 1 &
basis 2 1 &
basis 3 1 &
basis 4 1 &
basis 5 2 &
basis 6 2 &
basis 7 2 &
basis 8 2 &
basis 9 2 &
basis 10 2 &
basis 11 2 &
basis 12 2
group bottom_edge region bottom_edge
set type 1 charge 2.196
set type 2 charge -1.098
#group model union particle substrate

#Phase 3----------------------------------------Buckingham Potential-----------------------------------------------

pair_style buck/coul/long 15.0
pair_coeff 1 1 717647.40 0.154 121.067
pair_coeff 1 2 391049.10 0.194 290.331
pair_coeff 2 2 271716.30 0.234 696.888

neighbor 2.0 bin # skin distance for real units is by default 2.0
neigh_modify every 1 delay 0 check yes

kspace_style pppm 0.0001

#Phase 4----------------------------------------Compute—how can I monitor Vparticle!!! ------------------------

compute 1 middle stress/atom NULL
compute 2 middle reduce sum c_1[3] # stress in z direction

#----Phase 5-------------------------------------Initial Equilibration at 300K ----------------------------------------
variable nstep1 equal 3000
variable itn equal 100
timestep 1.0 # or 2

velocity all create 300 12345 mom yes rot no

fix 1 middle nvt temp 300.0 300.0 100.0
fix 2 bottom_edge setforce 0.0 0.0 0.0
fix 3 top_edge setforce 0.0 0.0 0.0

thermo {itn} dump 2 all xyz 100 dump2_tensile.txt run {nstep1} #2ns=2000000

#----Phase 6---------------------------------------tensile test at the room temperature --------------------

variable counter1 equal 15
variable counter2 equal 10
variable counter3 equal 10

variable nstep2 equal 1000
variable nstep3 equal 3000
variable rate equal 0.001

label flag1
variable i loop ${counter1}

fix 5 top_edge move linear 0 0 ${rate} units box

thermo {itn} thermo_style custom step temp pe etotal pzz variable dlz equal "step*v_rate/(v_counter1*v_nstep2)" variable strain equal "v_dlz*100/v_lz0" variable stressp equal "pzz" variable stressc equal "c_2" fix fprint1 all print {itn} " {strain} {stressc} {stressp} " file Stress_Strain03.txt screen no run {nstep2}
unfix 5

fix 6 middle nvt temp 300.0 300.0 100.0
dump 3 all xyz 100 dump2_tensile.txt
undump 3
run ${nstep3}
next i
jump SELF flag1

unfix 6
unfix fprint1

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