Hello:
I’m trying to simulate a bulk liquid in the presence of a rigid surface. Meaning that my system which is made out of liquid and the rigid surface is periodic along x and y axis but is rigid along z axis. I have done NVT and created a restart file. Following that, I want to do a NPT simulation, like having a piston along z axis to adjust the pressure inside. This piston is made out of carbon atoms. I have attached my code here as well. The error I get is that “Cannot use fix nvt/npt/nph on a non-periodic dimension (src/fix_nh.cpp:392)”.
variable temperature equal 298.00 # in K
variable HCtype equal 1
variable CTtype equal 2
variable YCtype equal 3
variable YNtype equal 4
variable HStype equal 5 #Hsurface
variable OBtype equal 6 #silanol O
variable SiBtype equal 7 #O
variable OxStype equal 8 #silanol Si
variable SiStype equal 9 #Si
variable Ctype equal 10 #hydrophobic wall
LJ parameters are from Rossky’s 1994 JCP paper
Note the unit conversion from kJ/mol to kcal/mol
variable HCeps equal 0.01570 # in kcal/mol
variable HCsig equal 2.649532788 # in Angstroms
variable CTeps equal 0.10940
variable CTsig equal 3.399669508
variable YCeps equal 0.13410
variable YCsig equal 3.545776898
variable YNeps equal 0.13310
variable YNsig equal 3.011237667
variable HSeps equal 0.0
variable HSsig equal 0.0
variable OBeps equal 0.15504
variable OBsig equal 3.15400
variable SiBeps equal 0.12753
variable SiBsig equal 3.79500
variable OxSeps equal 0.15504
variable OxSsig equal 3.15400
variable SiSeps equal 0.12753
variable SiSsig equal 3.79500
variable Ceps equal 0.066
variable Csig equal 2.53355
variable timestep equal 1.00 # in fs
variable dumptime equal 10 # output quantities every 5 time steps
variable thermotime equal 10 # output thermo quantities every 5 time steps
processors * * *
units real
boundary p p p # fixed boundaries along z to be simulated using a piston
atom_style full
bond_style harmonic
angle_style harmonic
special_bonds lj 0 0 0.5 coul 0 0 0.83
pair_style hybrid lj/cut/coul/long 14.0 lj/cut 14.0
pair_modify pair lj/cut shift yes # for the repulsive wall
kspace_style pppm 1.0e-5
#kspace_modify slab 3.0
read_restart tmp.restart.45000000
neighbor 3.0 bin
pair_coeff {HCtype} {HCtype} lj/cut/coul/long {HCeps} {HCsig}
pair_coeff {CTtype} {CTtype} lj/cut/coul/long {CTeps} {CTsig}
pair_coeff {YCtype} {YCtype} lj/cut/coul/long {YCeps} {YCsig}
pair_coeff {YNtype} {YNtype} lj/cut/coul/long {YNeps} {YNsig}
pair_coeff {HStype} {HStype} lj/cut/coul/long {HSeps} {HSsig}
pair_coeff {OBtype} {OBtype} lj/cut/coul/long {OBeps} {OBsig}
pair_coeff {SiBtype} {SiBtype} lj/cut/coul/long {SiBeps} {SiBsig}
pair_coeff {OxStype} {OxStype} lj/cut/coul/long {OxSeps} {OxSsig}
pair_coeff {SiStype} {SiStype} lj/cut/coul/long {SiSeps} {SiSsig}
pair_coeff * {Ctype} lj/cut {Ceps} ${Csig} 2.8438137 # Rmin = 2**(1/6)*Csig
pair_modify mix arithmetic
group sio2 type 5 6 7 8 9
group fluid type 2 1 3 4
group piston type 10
group pfluid union fluid piston
neigh_modify delay 10 every 1 check yes
neigh_modify exclude type 6 5
timestep ${timestep}
compute temp_pres all temp
compute fluid_temp fluid temp
compute Pres all pressure temp_pres
fix rigidwall piston rigid single force * off off on torque * off off off
fix 3 pfluid npt temp {temperature} {temperature} 10 z 1 1 100 dilate piston
fix_modify 3 temp fluid_temp
fix 2 sio2 setforce 0.0 0.0 0.0
velocity fluid create ${temperature} 502232 dist gaussian mom yes rot yes
dump dmp all custom ${dumptime} dump.lammpstrj id mol type x y z vx vy vz fx fy fz
dump_modify dmp flush yes sort id format line “%d %d d .6f .6f .6f .6f .6f .6f .6f .6f .6f”
thermo ${thermotime}
thermo_style custom step temp epair emol ecoul evdwl elong c_Pres
thermo_modify flush yes
run 1000 # run simulation for 250 ps