variable T equal 0.83 variable p equal 0.094 variable eps equal 0.5 boundary p p f pair_style lj/cut 2.5 lattice fcc 1.0 region mybox block 0.0 12.0 0.0 12.0 -2.0 17.0 create_box 2 mybox region wall_bottom block INF INF INF INF -1.1 0.1 create_atoms 2 region wall_bottom group wall_bottom region wall_bottom region wall_top block INF INF INF INF 13.9 15.1 create_atoms 2 region wall_top group wall_top region wall_top group wall type 2 region liquid block INF INF INF INF 0.9 13.1 create_atoms 1 random 5206 9735598 liquid group liquid type 1 mass * 1.0 pair_coeff * * 1.0 1.0 pair_coeff 1 2 ${eps} 1.0 neigh_modify delay 0 fix 1 liquid nvt temp $T $T 0.5 compute Tliq liquid temp fix_modify 1 temp Tliq variable fext equal -$p*lx*ly/count(wall_top) fix 2 wall_top aveforce NULL NULL ${fext} fix 3 wall_top setforce 0.0 0.0 NULL fix 4 wall_top nve fix 5 all balance 1000 1.05 shift z 10 1.01 fix freeze wall_bottom setforce 0.0 0.0 0.0 minimize 1.0e-4 1.0e-6 100 1000 unfix freeze reset_timestep 0 thermo 1000 dump 1 all atom 1000 dump.lammpstrj variable Pliq equal -fcm(wall_bottom,z)/lx/ly variable h equal xcm(wall_top,z)-xcm(wall_bottom,z) fix 6 all ave/time 10 100 1000 c_Tliq v_Pliq v_h file ave.time velocity liquid create $T 684532 rot yes dist gaussian run 10000 variable piston_z equal xcm(wall_top,z) fix piston_z_ave all ave/time 10 1 10 v_piston_z ave running run 10000 variable piston_dz equal f_piston_z_ave-v_piston_z displace_atoms wall_top move 0.0 0.0 v_piston_dz units box unfix piston_z_ave unfix 2 unfix 3 unfix 4 compute bin7 all chunk/atom bin/1d z 0.0 0.05 units box fix 7 liquid ave/chunk 10 100 1000 bin7 density/number temp vx ave running overwrite file chunk_liquid.time run 10000 unfix 6 unfix 7 fix 8 wall aveforce 0.0 0.0 NULL fix 9 wall setforce NULL NULL 0.0 fix 10 wall nve velocity wall set 0.0 0.0 0.0 dump 2 all atom 100 dump2.lammpstrj run 1000 run 10000