Water in a box

Hello, I’m new to lammps and recently I’m trying to simulate water in a box and extract some thermodynamic information such as temperature, pressure and enthalpy from the system to generate a phase diagram later. Below is the script.

variable T equal 273.15+20 # temperature in Kelvin

variable A2m equal 1e-10 # Angstrom to meter

variable atm2Pa equal 101325 # Atmosphere to Pascal

variable N2mN equal 1e3 # Newton to milliNewton

boundary p p p

units real

atom_style full

bond_style harmonic

angle_style harmonic

pair_style lj/cut/tip4p/long 1 2 1 1 0.1546 12.0

kspace_style pppm/tip4p 1.0e-4

pair_modify shift yes mix arithmetic

read_data conf.data

include PARM.lammps

dynamics

velocity all create ${{T}} 4928459 mom yes rot yes dist gaussian # give an initial temperature to the molecules

fix mynve all nve

fix myber all temp/berendsen {{T}} {{T}} 100

fix myshk all shake 1.0e-4 200 0 b 1 a 1 # maintain the shape of the water molecule

timestep 1.0

thermo 100

thermo_style custom step temp press etotal

run 10000

I’m not sure there’s a question here – but in the meantime please note that you should use backticks to “fence off” your input script

```
like this
```

so that the forum will format it properly as “source code”.

1 Like