[lammps-users] together fix nvt and fix deform

Dear lammps users,

I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3.
The program were giving the error (nans) for region box block 0 8 0 8 0 8 and density=0.3 before.
I use fix_deform to compress the box. The target length of the box is determined by the concentration:

Vbox_target = N / rho = 512 / 0.3 = 1706.7

Lbox_target = pow(Vbox_target, 1/3) = 11.95

Now I have input script the following after some change. When I run it I don’t have any error.But I have doubts it’s correct or not.

For example:
1-I am using together fix nvt and fix deform???
2-I have specified compute ids as 1_temp, 3_temp, 4_temp for compute_modify command???

Could any tell me it’s correct or not or any suggest?

Thanks in advance

units lj

atom_style ellipsoid

lattice sc 0.01

region box block 0 8 0 8 0 8

create_box 1 box

create_atoms 1 box

set group all quat/random 982381

mass 1 1.5

shape 1 1 1 3

compute rot all temp/asphere

group spheroid type 1

variable dof equal count(spheroid)+2

compute_modify rot extra ${dof}

velocity all create 2.0 41787 loop geom

pair_style gayberne 1.0 3.0 1.0 4.0

pair_coeff 1 1 1.0 1.0 1.0 1.0 0.2 1.0 1.0 0.2 4.0

neighbor 0.3 bin

timestep 0.002

thermo_style custom step temp etotal vol epair press pe

thermo 100

Do the box rescaling with an NVT thermostat for 5 million time steps or longer to avoid overlapping while compressing because the initial box length is now 37.1

fix 1 all nvt/asphere 2.0 2.0 1.0 drag 1.0

fix 2 all deform 10 x final 0 11.95 y final 0 11.95 z final 0 11.95 units box

compute_modify 1_temp extra ${dof}
restart 1000000 restart_*.dat
run 5000000 upto

This unfix is to remove the box rescaling

unfix 1
unfix 2

Now actually run the simulation at the target concentration

fix 3 all npt/asphere 2.0 2.0 0.1 xyz 0.0 8.0 0.1

compute_modify 3_temp extra ${dof}

run 5100000 upto

unfix 3

fix 4 all npt/asphere 2.0 2.0 0.1 xyz 8.0 8.0 0.1

compute_modify 4_temp extra ${dof}

run 5200000 upto

I have a comment on your first query on using fix deorm an nvt together. Here is my take on it but I would like to invite further comments from the developers of LAMMPS:

Fixed volume is not implemented in a active way like thermostatting (for fixing temperature) and barostatting (for fixing pressure) in MD codes. I wonder tough how volume dependent quantities are calculated inside LAMMPS in such a situation. Moreover, I would “fix deform” in tandem with “fix nvt/sllod” so that the streaming velocity due to the fix deform is removed from the thermostatting.

Best Regards,
Manoj

2009/8/28 ahmet yıldırım <ahmedo047@…24…>

Dear manoj thanks for your response.

I would like to invite further comments from the developers of LAMMPS.

other suggest?
Could any tell me it’s correct or not or any suggest?

Thanks in advance

28 Ağustos 2009 14:18 tarihinde Manoj Warrier <manoj.warrier@…24…> yazdı:

Manoj is correct. If you want to thermostat with fix deform,
you should use fix nvt/sllod (if you are shearing) or fix langevin,
rather than fix nvt. You can also take a look a compute temp/deform
whcih can be coupled with a thermostat like fix langevin and which
takes out the deformation component of velocity.

Steve

2009/8/28 ahmet yıldırım <[email protected]...>:

Hi,

I corrected/adjusted as the following but it is giving the error.

LAMMPS (7 Jul 2009)
Lattice spacing in x,y,z = 4.64159 4.64159 4.64159
Created orthogonal box = (0 0 0) to (37.1327 37.1327 37.1327)
1 by 1 by 1 processor grid
Created 512 atoms
Setting atom values …
512 settings made for quat/random
512 atoms in group spheroid
ERROR: Using fix nvt/sllod with inconsistent fix deform remap option

İNPUT SCRİPT

units lj

atom_style ellipsoid

lattice sc 0.01

region box block 0 8 0 8 0 8

create_box 1 box

create_atoms 1 box

set group all quat/random 982381

mass 1 1.5

shape 1 1 1 3

compute rot all temp/asphere

group spheroid type 1

variable dof equal count(spheroid)+2

compute_modify rot extra ${dof}

velocity all create 2.0 41787 loop geom

pair_style gayberne 1.0 3.0 1.0 4.0

pair_coeff 1 1 1.0 1.0 1.0 1.0 0.2 1.0 1.0 0.2 4.0

neighbor 0.3 bin

timestep 0.002

thermo_style custom step temp etotal vol epair press pe

thermo 100

Do the box rescaling with an NVT thermostat for 5 million time steps or longer to avoid overlapping while compressing because the initial box length is now 37.1

fix 1 all nvt/sllod 2.0 2.0 1.0 drag 1.0

fix 2 all deform 10 x final 0 11.95 y final 0 11.95 z final 0 11.95 units box

compute_modify 1_temp extra ${dof}
restart 1000000 restart_*.dat
run 5000000 upto

This unfix is to remove the box rescaling

unfix 1
unfix 2

Now actually run the simulation at the target concentration

fix 3 all npt/asphere 2.0 2.0 0.1 xyz 0.0 8.0 0.1

compute_modify 3_temp extra ${dof}

run 5100000 upto

unfix 3

fix 4 all npt/asphere 2.0 2.0 0.1 xyz 8.0 8.0 0.1

compute_modify 4_temp extra ${dof}

run 5200000 upto

28 Ağustos 2009 17:10 tarihinde Steve Plimpton <sjplimp@…43…4…> yazdı:

Please read the doc pages for fix nvt/sllod and
fix deform. It discusses the remap option.

Steve

2009/8/29 ahmet yıldırım <[email protected]...>:

I readed the doc pages for fix nvt/sllod and
fix deform before
I used fix 2 all deform 1 xy erate 0.001 remap v but it is giving the error again

31 Ağustos 2009 16:51 tarihinde Steve Plimpton <sjplimp@…24…> yazdı:

Take a look at examples/nemd/in.nemd
It uses both those commands and gives no error.

Steve

2009/8/31 ahmet yıldırım <[email protected]...>:

I am confused. I don’t want to triclinic box.

I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3.
The program were giving the error (nans) for region box block 0 8 0 8 0 8 and density=0.3 before.
I use fix_deform to compress the box. The target length of the box is determined by the concentration:

Vbox_target = N / rho = 512 / 0.3 = 1706.7

Lbox_target = pow(Vbox_target, 1/3) = 11.95

That is, I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3.

ERROR: Fix deform tilt factors require triclinic box

input script:

units lj

atom_style ellipsoid

dimension 3

boundary p p p

lattice sc 0.01

region box block 0 8 0 8 0 8

create_box 1 box

create_atoms 1 box

set group all quat/random 982381

mass 1 1.5

shape 1 1 1 3

compute rot all temp/asphere

group spheroid type 1

variable dof equal count(spheroid)+2

compute_modify rot extra ${dof}

velocity all create 2.0 41787 loop geom

pair_style gayberne 1.0 3.0 1.0 4.0

pair_coeff 1 1 1.0 1.0 1.0 1.0 0.2 1.0 1.0 0.2 4.0

neighbor 0.3 bin

timestep 0.002

#thermo_style custom step temp etotal vol epair press pe

thermo 100

Do the box rescaling with an NVT thermostat for 5 million time steps or longer to avoid overlapping while compressing because the initial box length is now 37.13.

fix 1 all nvt/sllod 2.0 2.0 1.0 drag 1.0

#fix 2 all deform 10 x final 0 11.95 y final 0 11.95 z final 0 11.95 units box
fix 2 all deform 1 xy erate 0.01 remap v

compute_modify 1_temp extra ${dof}
restart 1000000 restart_*.dat
run 5000000 upto

This unfix is to remove the box rescaling

unfix 1
unfix 2

Now actually run the simulation at the target concentration

fix 3 all npt/asphere 2.0 2.0 0.1 xyz 0.0 8.0 0.1

compute_modify 3_temp extra ${dof}

run 5100000 upto

unfix 3

fix 4 all npt/asphere 2.0 2.0 0.1 xyz 8.0 8.0 0.1

compute_modify 4_temp extra ${dof}

run 5200000 upto

31 Ağustos 2009 17:09 tarihinde Steve Plimpton <[email protected]> yazdı:

I used the command region box prism 0 8 0 8 0 8 0 0 0 instead of region box block 0 8 0 8 0 8.
Now the input script is running but Volume value remains constant as a 51200( for density=0.01).Furthermore it is giving the error after 5000000 steps

ERROR: Cannot use fix npt with triclinic box

I think I could not tell my troubles. I want to simulation a system for region box block 0 8 0 8 0 8 and density=0.3 but the input script is giving the error (nans) when I used density=0.3.

What should I do? I’m dealing with it for 2-3 month. please help me

31 Ağustos 2009 17:29 tarihinde ahmet yıldırım <ahmedo047@…24…> yazdı:

If you're shearing a box with fix deform, you have to use a triclinic box.
Shearing is a volume preserving operation, so the volume won't change.
If you want to use fix nvt (as you said earlier), then you shouldn't use
fix npt as well. Fix npt is not smart enough to work with the
appropriate dimensions of a triclinic box. Someone would have to
extend the command to do that.

Steve

2009/8/31 ahmet yıldırım <[email protected]...>:

Dear plimpton,

I used the following input script(using NPT method) before. I did not have problems(for density=0.02 and N=4096).

Now I want to try by using the values in literature its.

The values in literature.
N=512 (8x8x8) or N=1024
Density=0.3
Pressure=8
Method:NPT

That is, I want to try to simulate by using above literature values and NPT method.

The program is giving the error (nans) for region box block 0 8 0 8 0 8 and density=0.3

This is my whole problem.

What should I do?

Sincerely Yours

İnput Script:

units lj
atom_style ellipsoid

lattice sc 0.02
region box block 0 16 0 16 0 16
create_box 1 box
create_atoms 1 box
set group all quat/random 982381

mass 1 1.5
shape 1 1 1 3
compute rot all temp/asphere
velocity all create 2.0 41787 loop geom

pair_style gayberne 1.0 3.0 1.0 4.0
pair_coeff 1 1 1.0 1.0 1.0 1.0 0.2 1.0 1.0 0.2 4.0
neighbor 0.3 bin

timestep 0.002
thermo_style custom step temp etotal vol epair press pe
thermo 100

fix 1 all npt/asphere 2.0 2.0 0.1 xyz 0.0 8.0 0.1
run 50000
unfix 1
fix 1 all npt/asphere 2.0 2.0 0.1 xyz 8.0 8.0 0.1
run 50000

01 Eylül 2009 17:27 tarihinde Steve Plimpton <[email protected]> yazdı:

You need to figure out why you are getting NaNs - maybe your
particles overlap, maybe your box is oscillating too rapidly
(a damping constant of 0.1 is quite small for pressure in LJ units).
Have you visualized your system? Are you printing out
lots of diagnostics every time step?

Steve

2009/9/1 ahmet yıldırım <[email protected]...>:

I printed out lots of diagnostics every time step.
thermo 1 setting:

The Result:

Step Temp TotEng Volume E_pair Press PotEng
0 2 3.8689479e+24 1706.6667 3.8689479e+24 -1.2642773e+27 3.8689479e+24
1 inf inf 0 0 nan 0
2 nan nan nan 0 nan 0
3 nan nan nan 0 nan 0
4 nan nan nan 0 nan 0
5 nan nan nan 0 nan 0
6 nan nan nan 0 nan 0
7 nan nan nan 0 nan 0

I tried another way. I didn’t thermostat with fix deform. I Just used it to get the correct density. unfix deform. Then run with thermostat. The input script and the result are attachment. İt is giving the error (NaNs) again when I ran with thermostat its.

What should I do?

Thanks in advance

02 Eylül 2009 17:23 tarihinde Steve Plimpton <[email protected]> yazdı:

in.ellipse.gayberne (1 KB)

log.lammps (4.24 MB)

If your thermo output is (near) INF on step 0,
then your initial configuration is bad. Fix
it and the problem should go away.

Steve

2009/9/3 ahmet yıldırım <[email protected]...>: