# Setting temperature during the pure shear's run

Hi my friends!
I am using LAMMPS to simulate an eam system recently.My system was relaxed on 100 K, but when I applying pure shear , it has notable fluctuation and I don’t know how can I set it on my desired temp??!!

May anyone give some advice to make the system on the fix temp ?

regards,
Nili

velocity lower set 0 0 0 units box
velocity upper set 0.0006 0 0 units box

fix 3 lower setforce 0 0 0
fix 4 upper setforce 0 0 0

group middle subtract all upper lower

velocity middle ramp vx 0.0 0.0006 y {lim02} {lim03} sum yes

compute mystress middle stress/atom NULL virial
compute reducedstress middle reduce sum c_mystress[4] # press*volume

variable middleVolume equal ({length_x}*{midlength}{length_z}) variable stress equal (c_reducedstress)/(10^4*{middleVolume})
variable strain equal (0.5
(1-(1/((step0.0010.0006/(\${midlength}))+1)^2)))

fix 5 middle nvt temp 100 100 0.1
fix 6 lower nve
fix 7 upper nve
fix 8 temp/rescale 10 100 100 0.1 1

Hi my friends!
I am using LAMMPS to simulate an eam system recently.My system was
relaxed on 100 K, but when I applying pure shear , it has
notable fluctuation and I don't know how can I set it on my desired temp??!!

​there is no indication in the input lines below, that you are doing what
you claim you are doing.
i only see a one-time velocity assignment and a number of
integrator/thermostat assignments, the last of which is not correct syntax.
with the assignment of fix nvt to the "middle" group, you are effectively
if you want to thermostat a shearing system, you have to very carefully
think which degrees of freedom of your system, you need to thermostat, if
at all.

also, in microscopic simulations, instantaneous temperature *always*
fluctuates and the magnitude of the fluctuation depends on the size of the
system. question is, does it fluctuate suitable around the desired average.
...and are you monitoring the correct temperature?

axel.

p.s.: fix temp/rescale is very bad for a production simulation and should
not be used

Thanks for your help, but the same as my code is in lammps example(shear),and I got idea from there…

My temp after relax is 100,99,101… but after I apply velocity it fix on 85 K.

echo both
units metal
atom_style atomic
boundary s s p

region simbox block -300 300 -300 300 -300 300 units box
create_box 2 simbox

lattice fcc 4.0500
region cube block -30 30 -30 30 -30 30 units box
create_atoms 1 region cube
set group all type/fraction 2 1 12393
mass 1 63.546
mass 2 26.9815

pair_style eam/alloy
pair_coeff * * AlCu.eam.alloy Cu Al

velocity all create 100 123456 mom yes rot yes
fix 1 all nvt temp 100 100 0.1
timestep 0.001

min_style cg
minimize 1.0e-8 1.0e-8 1000 10000

velocity all create 100 123456 mom yes rot yes
reset_timestep 0
run 100000
unfix 1

Thanks for your help, but the same as my code is in lammps
example(shear),and I got idea from there...

​your code is *not* the same as in the shear example. the shear example
uses a temperature bias, i.e. the thermostat is not applied to the shearing
direction (x) but only in y and z.

examples in LAMMPS are **examples** to quickly show how to set up a
particular kind of simulation. they are by no means to be interpreted as
demonstrating the best practice for these kind of runs. that contradicts
with the "quickly" part.

you can set up the same thing with a suitable thermostat and/or integrator.

My temp after relax is 100,99,101... but after I apply velocity it fix on
85 K.

​you input below is *still* no​t having correct syntax. and there is no
need to define a velocity ramp, that should develop from the shearing
interaction automatically.
in fact, the resulting ramp and its linearity is a quality control for your
simulation.

axel.

Dear Dr.Axel ;
I corrected my coad and got desired results…
What’s your idea? Is it acceptable?

echo both
units metal
atom_style atomic
boundary s s p

region simbox block -300 300 -300 300 -300 300 units box
create_box 2 simbox

lattice fcc 4.0500
region cube block -30 30 -30 30 -30 30 units box
create_atoms 1 region cube
set group all type/fraction 2 1 12393
mass 1 63.546
mass 2 26.9815

pair_style eam/alloy
pair_coeff * * AlCu.eam.alloy Cu Al

velocity all create 100 123456 mom yes rot yes
fix 1 all nvt temp 100 100 0.1
timestep 0.001

min_style cg
minimize 1.0e-8 1.0e-8 1000 10000

velocity all create 100 123456 mom yes rot yes
reset_timestep 0
run 100000
unfix 1

Forwarded conversation