Restraining a water molecule on interface during simulation

Hello

I have preformed an air water interface simulation using lammps. However to analyze the dynamics of

interface I need to restrain atleast one molecule near interface (in a region of 3 angstrom along z axis) during entire simulation.

My system consist of only water. So how should I specify a fixed molecule and fix its dynamics in a two dimensional slab

near interface region.

I would highly appreciate any suggestion.

Best Regards

There are several options for this in LAMMPS. One could be using the Colvars module, and specifically the harmonicWalls flat-bottom restraint applied on a distanceZ-type variable.

http://colvars.github.io/colvars-refman-lammps/colvars-refman-lammps.html

Giacomo