Using electric field in LAMMPS

Hi lammps users,

I am currently trying to model a system of solvent under external electric field. I am using OPLS-AA force field and NVT ensemble. The system is 100 methanol molecules and the simulation box is cubic with box length as 18.87 angstrom. However when I use 0.1 V/angstrom electric field, the simulation box expands dramatically and obviously it destroys the constant-volume limitation. So could anyone kindly help me check the input file? Many thanks!

The following is my input, and my data file is also attached.

units real

boundary p p p

neighbor 2.0 bin

neigh_modify every 1 delay 0 check yes

atom_style full

bond_style harmonic

angle_style harmonic

dihedral_style opls

improper_style cvff

pair_style hybrid lj/cut/coul/long 12 12

pair_modify mix geometric

kspace_style pppm 1e-5

special_bonds lj/coul 0.0 0.0 0.5

read_data data.lmp

pair_coeff 1 1 lj/cut/coul/long 0.030000 2.500000 # H00 H00

pair_coeff 2 2 lj/cut/coul/long 0.065999 3.500000 # C01 C01

pair_coeff 3 3 lj/cut/coul/long 0.030000 2.500000 # H02 H02

pair_coeff 4 4 lj/cut/coul/long 0.030000 2.500000 # H03 H03

pair_coeff 5 5 lj/cut/coul/long 0.170000 3.120000 # O04 O04

pair_coeff 6 6 lj/cut/coul/long 0.000000 0.000000 # H05 H05

fix SHAKE all shake 0.0001 20 0 b 1 2 3 5

velocity all create 298 298 dist gaussian

thermo_style custom step cpu etotal ke pe evdwl ecoul elong temp press vol density

thermo 1000

fix 1 all nvt temp 298 298 100 tchain 3 mtk yes

fix 2 all deform 1 x final 0.0 18.87 y final 0.0 18.87 z final 0.0 18.87 units box

run 10000

unfix 1

unfix 2

timestep 1

fix 8 all nvt temp 298 298 200 tchain 3 mtk yes

fix kick all efield 0.10 0.0 0.0

restart 10000 MeOH-NVT-E1.restart1 MeOH-NVT-E1.restart2

dump d1 all custom 10000 traj-MeOH-NVT-E1.lmp element xu yu zu

dump_modify d1 element H C H H O H

dump_modify d1 sort id

run 10000000

undump d1

unfix 8

data.lmp (125 KB)

Hi lammps users,

I am currently trying to model a system of solvent under external electric field. I am using OPLS-AA force field and NVT ensemble. The system is 100 methanol molecules and the simulation box is cubic with box length as 18.87 angstrom. However when I use 0.1 V/angstrom electric field, the simulation box expands dramatically and obviously it destroys the constant-volume limitation. So could anyone kindly help me check the input file? Many thanks!

how do you infer, that the volume is changed? you must be either using a different input from what you provided or not looking at the right property. there is nothing in your input that can change the simulation box except the fix deform command and that is “deforming” the box to the exact same dimensions that it already has, and thus will not change the volume. you can see that the volume and density is preserved by looking at the last two columns of the thermo output, which remain unchanged for the entire run.

axel.