Osmotic pressure simulations using the pull code

GROMACS version: 2023.2
GROMACS modification: No
Hello fellow md simulators,
I am trying to do osmotic pressure simulations using gromacs’ pull code as suggested here:
gromacs_mailing_list
I have figured out a way to apply a flat-bottom and a flat-bottom-high potential to each ion by making two index groups for each ion and applying one potential to one and the other to the other index group. In total, I end up with 96 pull groups (46 ions * 2 potentials). When I run gmx grompp, I get warnings for all pull groups > 24 that look like

WARNING 1 [file osmotic.mdp, line 1183]:
Unknown left-hand ‘pull-group24-name’ in parameter file

WARNING 2 [file osmotic.mdp, line 1183]:
Unknown left-hand ‘pull-coord24-type’ in parameter file

WARNING 3 [file osmotic.mdp, line 1183]:
Unknown left-hand ‘pull-coord24-geometry’ in parameter file
… and so on which makes me wonder: Is gromacs unable to handle more than 23 pull groups?
What is going on there or is my methodology simply wrong? Using the pull code would be chill as I can easily write out forces from there. Any ideas are appreciated ;-) thanks

Hi @cheesecake

I can’t comment on the method, but the error you get is not related to GROMACS handling of pull groups. I think the problem is in the definition of the pull groups themselves in the mdp file. Can you share it as well?

Hi @obZehn, thanks for replying. Sure, here is my mdp file
osmotic.mdp (40.6 KB)

You are preparing GROMACS for 23 groups and coordinates

; Number of pull groups 
pull-ngroups             = 23
; Number of pull coordinates
pull-ncoords             = 23

but then you define 92 of them, so when GROMACS reads the definition of the 24th gives the error you got. Try to put 92 rather than 23, it should work!

thanks ah well that was dumb. In german we have a say: one doesn’t see the forest anymore through all the trees xD Let’s hope it works now

Update: I had to enlarge the water sections of my box. Now it consists of a 4x4x3 nm water section on which a 4x4x4 nm section with the ions in water is stacked and on top another 4x4x3 nm water section. The box was created using

gmx insert-molecules -ci confout_anion.pdb -box 4 4 4 -nmol 23 -o box.pdb
gmx insert-molecules -f box.pdb -ci confout_cation.pdb -box 4 4 4 -nmol 23 -o box.pdb
gmx solvate -cp box.pdb -p topol.top -box 4 4 4 -o box_solv.pdb

then energy-minimized and equilibrated, then extended

gmx editconf -f equi.pdb -o elongated_box.pdb -box 4 4 10 -translate 0 0 3

filled with water

gmx solvate -cp elongated_box.pdb -p topol.top -o longbox_solv.pdb -box 4 4 10

then energy-minimized and equilibrated with position restraints on the ions’ heavy atoms.
With the following settings, the simulation is now running, let’s see if this pull code abuse works
osmotic.mdp (40.5 KB)

The box size wasn’t the problem, but the pull-coord geometry with pressure coupling. Fixed it. Attached there’s a Jupyter notebook with supplementary coords and mdp files for anyone interested who also wants to abuse Gromacs’ pull code for osmotic pressure simulations. Happy simulating. gitrepo