# How to construct the constant speed shear simulation?

**URL:** https://gromacs.bioexcel.eu/t/how-to-construct-the-constant-speed-shear-simulation/5474
**Category:** User discussions
**Tags:** grompp, mdp-parameters, mdrun, simulation-setup
**Created:** [December 23, 2022, 7:21am UTC](https://gromacs.bioexcel.eu/t/how-to-construct-the-constant-speed-shear-simulation/5474 "2022-12-23T07:21:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Fengxuan](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@Fengxuan](https://gromacs.bioexcel.eu/u/Fengxuan)
#### Post date: [December 23, 2022, 7:21am UTC](https://gromacs.bioexcel.eu/t/how-to-construct-the-constant-speed-shear-simulation/5474/1 "2022-12-23T07:21:14Z")

</div>

GROMACS version: GROMACS-2020.3-GPU  
GROMACS modification: No

Hi everyone,

Recently I want to do a constant spped shear simulation using GROMACS. So I construct a water box to test, but I meet some questions. The basic idea refers to the shear simulation in the Reference guide ([https://manual.gromacs.org/current/reference-manual/special/shearing.html](https://manual.gromacs.org/current/reference-manual/special/shearing.html)), where it mentions the possibility of using the free energy lambda-coupling method to achieve constant velocity shearing. And I tried this method in a test water. The system is in NVT ensemble, and there are two walls at z =0 and z = box length.The bottom 1 nm water layer is freezed in x/y/z directions, the top 1 nm water is freezed only in z-direction. And the restrain .gro file used in grompp command -r, in which the x-coordinates of water molecules in the top water layer are plus 1 to represent the B-state. However, the shear didn’t happend and I’m cofused. The mdp parameters is as below:

; Run Control  
integrator = md ; leap-frog integrator of Newton’s equations of motion  
tinit = 0 ; [ps] starting time for the run  
dt = 0.001 ; 2 fs - [ps] time step for integration  
nsteps = 100000 ; 1000 ps  
; Output Control  
nstxout = 1000 ; save coordinates every 10 ps  
nstvout = 1000  
nstenergy = 1000 ; save energies every 1 ps  
nstlog = 1000 ; update log file every 100 ps

; Bond parameters  
constraints = h-bonds ; convert all bonds to constraints  
constraint-algorithm = lincs ; holonomic constraints

; Neighbor searching and nonbonded interactions  
cutoff-scheme = verlet ; Cutoff-related parameters  
nstlist = 10 ; Frequency to update the neighbor list and the long-range forces  
ns\_type = grid ; Method to determine neighbor list (simple, grid)  
pbc = xy ; Use periodic boundary conditions in all directions  
rlist = 0.9 ; [nm] Cut-off for making neighbor list (short range forces)  
comm-mode = None  
; Electrostatics  
coulombtype = PME ; Treatment of long range electrostatic interactions  
rcoulomb = 0.9 ; [nm] Short-range electrostatic cut-off  
ewald-geometry=3dc

; Van der waals  
vdwtype = cutoff  
rvdw = 0.9 ; [nm] Short-range Van der Waals cut-off

; Temperature coupling  
tcoupl = v-rescale ; Temperature coupling, modified Berendsen thermostat  
tc\_grps = System ; Group to couple to separate temperature baths  
tau\_t = 0.1 ; [ps] Time constant for coupling  
ref\_t = 300 ; [K] Reference temperature for coupling

;non-equ  
;acc\_grps = top\_water  
;accelerate = 0 0 0  
freezegrps = top\_water bottom\_water  
freezedim = N N Y Y Y Y  
;deform = 0 0 0 0 0.1 0

nwall =2  
wall\_type = 12-6  
wall\_atomtype = O O  
wall\_r\_linpot = 1

free-energy = yes  
init-lambda = 0  
delta-lambda = 0.1

Maybe I don’t understand the key of this method or miss something important. I was hoping that someone can help me. Thank you so much! And if there’s any other method to inplement the constant speed shear simulation in GROMACS, please share with me. Thanks again!

Regards,  
Feng xuan
