Dear all,
I am attempting to run a coarse grained liquid/vapour simulation to find the effects of varying different paramaters on lammps on the surface tension. I have attached my script below:
------------ Create simulation box ----------------
units real
atom_style sphere
boundary p s p
lattice sc 3.1
region box block -10 10 -20 20 -10 10
create_box 1 box
region atoms block -2.5 2.5 -2.5 2.5 -2.5 2.5
region puddle block -10 10 -2.5 2.5 -10 10
-------------- Create Atom type 1 ----------------------
lattice sc 3.1
create_atoms 1 region puddle ratio 1.0 1234
------------------ Setup potential (Force field) -----------------
pair_style lj/cut 3.5
pair_coeff 1 1 10.0 2.3
gives good surface tension with values of 10.0 and 2.35
#----------------- Units --------------------------
variable A_in_m equal 1e-10 # Angstrom in meter
variable atm_in_Pa equal 101325 # note: 1 Pa = 1 N/m^2
variable N_in_mN equal 1e3 # Newton in milliNewton
variable convFac equal {A_in_m}*{atm_in_Pa}*${N_in_mN}
----------------- Paramaeteres ---------------------
thermo 2000
timestep 0.01
neighbor 3.5 bin
neigh_modify every 1 delay 0 check yes
group cold type 1
variable Ne equal 10
variable Nr equal 500
#variable Nf equal 100
------------------ Give velocity and fix commands ------------------
velocity all create 230 1234 # dist gaussian rot yes
fix 1 all nve/sphere
fix 2 all momentum 1 linear 1 1 1
fix temp all langevin 230 230 1000 1234 omega yes zero yes
fix 4 all npt temp 273.0 273.0 100 iso 1.0 1.0 1000 # works well at temp 100 press 1000
fix 3 all nvt temp 273.0 273.0 100.0
fix 4 cold gravity 100.0 vector 0 1 0
fix PAve all ave/time {Ne} {Nr} 1000 c_totT
fix totT all ave/time {Ne} {Nr} 1000 c_rotT
---------------- Density ---------------------
set group cold density 1.0
------- Pressure, temperature, tensor and surface tension ---------------
compute T all temp
compute P all pressure T
variable xPress equal c_thermo_press[1]
variable yPress equal c_thermo_press[2]
variable zPress equal c_thermo_press[3]
variable st equal 0.5lz(v_zPress-0.5*(v_xPress+v_yPress))*${convFac}
fix st all ave/time 1 2000 2000 v_st
#fix st all ave/time 10 100 100 v_st
#fix 3 st all ave/time c_myTemp c_thermo_temp file temp.profile
#------------------ Output --------------------
thermo_style custom step f_st temp press etotal
thermo_modify lost warn
dump trj all atom 2000 testcgoneatom.lammpstrj
run 2000000
However, upon running my simulation, the surface tension i get always seems to be negative. A negative number between zero and negative 30.
This is what the interface looks like on onvito
I am very unsure why i am getting a negative surface tension and would really love some help from anyone.
Kind regards,
Zakaria