I always struggled in finding a good algorithm for pulling in GROMACS, the tool is good but the documentation is awful.
Here I’m just sharing a good script that work for pulling in 1 dimension (x-axis), with a constant force, just one group (WATER) in relation to the simulation box, with periodic boundary conditions (pbc).
; ---------- constant‑force pulling (one coordinate) ----------
pull = yes
pull-ncoords = 1 ; one reaction coordinate
pull-ngroups = 1 ; one group is enough – reference is the box
pull-group1-name = WATER ; must match the name in index.ndx
; What type of force?
pull-coord1-type = constant-force ; linear potential → constant F
; Geometry: along a fixed vector that respects PBC
pull-coord1-geometry = direction-periodic
pull-coord1-groups = 1 0 ; WATER vs. absolute reference
pull-coord1-vec = 1 0 0 ; +x
pull-coord1-dim = Y N N ; only x component is active
; Magnitude of the force (kJ mol⁻¹ nm⁻¹)
; k (mdp units) = F(pN) = F(10-12N)/ 1.66054
pull-coord1-k = 300 ; ≈ 500 pN on the COM
pull-pbc-ref-prev-step-com = yes
pull-group1-pbcatom = 17996 ; reference atom from the WATER group
; this helps with the size of the box problem for PBC
pull-coord1-start = yes ; take current COM as zero
pull-print-ref-values = yes ; handy for analysis
; ---------------------------------------------------------------
Hopes it can help anyone…