# Constraining two water droplets at constant distance between their COMs using pull code

**URL:** <https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329>\
**Category:** User discussions\
**Tags:** mdp-parameters, umbrella-sampling, pull-code\
**Created:** [May 3, 2023, 9:53am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329 "2023-05-03T09:53:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 3, 2023, 9:53am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/1 "2023-05-03T09:53:02Z")

</div>

GROMACS version: 2021.3  
GROMACS modification: No

Hello all,

I need to constrain two water droplets, each having 5000 molecules with different residue names (SOL1 and SOL2) and atom names. I have recently tried pull code with the following MDP options:

pull = yes  
pull\_ngroups = 2  
pull\_ncoords = 1  
pull\_group1\_name = SOL1  
pull\_group2\_name = SOL2  
pull\_coord1\_type = umbrella ; harmonic biasing force  
pull\_coord1\_geometry = distance ; simple distance increase  
pull\_coord1\_groups = 1 2  
pull\_coord1\_dim = Y Y Y  
pull\_coord1\_k = 1000 ; kJ mol^-1 nm^-2  
pull\_coord1\_start = yes ; define initial COM distance \> 0

The initial configuration is shown below at the left side:

 ![Pic_combined_conf](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/a/a44ba0c315aafe0ff612af1f590866eee2cbbe31.jpeg)

The water droplet on the right side is evaporating fast and the distance between the COMs are not being constrained as the initial configuration. The final configuration is shown at right side after 1380 ps.

Kindly help me constrain the COMs of both the droplets at their initial configurations. I plan to find the free energy at such constratined distances between their COMs.

Thanks and regards,  
Tonmoy Sharma

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 3, 2023, 11:10am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/2 "2023-05-03T11:10:09Z")

</div>

What is the deviation of the distance? I can’t see that from your picture.  
What distance does the pull coord report in pullx.xvg?

It could be that your force constant is too low.

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 4, 2023, 6:14am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/3 "2023-05-04T06:14:46Z")

</div>

Hello hess,

Thank you for your reply.

Please see the image below which is after 6.5 ns. Here, the smaller droplet is droplet which was towards the right side. It has evaporated and all the water molecules have been scattered inside the box. I have checked the pullx.xvg file, the distances are almost constant at the start but increases towards the end. The main problem is the evaporation. Kindly suggest regarding this.

 ![Screenshot 2023-05-04 113705](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/4/46ac4238dd16c41ecda1ebeabac1b4e1c46d55f1.png)

I have also checked for pull force values, i.e., 10, 1000, 10000 kJ mol^-1 nm^-2. But the behaviour remains almost the same for all.

Thanks and regards  
Tonmoy Sharma

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 4, 2023, 8:21am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/4 "2023-05-04T08:21:42Z")

</div>

If a droplet evaporates, its COM is no longer well defined as the distance of evaporated molecules jumps up and down with periodic boundary conditions.

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 4, 2023, 12:50pm UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/5 "2023-05-04T12:50:18Z")

</div>

So, how can I prevent this undesired evaporation? Only the right side droplet is evaporating with huge fluctuations in positions of water molecules, while the left side droplet is moving about the right droplet with comparatively much less fluctuations and no evaporation. I am using OPC water model for the simulations. Kindly suggest any changes to be made in the MDP file.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 4, 2023, 3:52pm UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/6 "2023-05-04T15:52:44Z")

</div>

I don’t know why your droplet is evaporating. Did you equilibrate the droplets properly?

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [May 5, 2023, 10:04am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/7 "2023-05-05T10:04:39Z")

</div>

I remember that we also experienced problems with evaporating droplets when system sizes got very large. If a box had a long extension in, say, the x-direction, then water droplets near the origin would behave as expected, while droplets with high x positions would heat up, start to rotate and evaporate. Also, if you take an exact same droplet that runs fine in a small box, and you put it into a far corner of a much (factor 100) larger box, it would start to evaporate. This all happens in single precision, but not in double precision. I think single precision might not be enough to calculate differences of positions (as e.g. needed to fulfil the constraints within each water molecule) accurately enough for molecules with large x-, y-, or z coordinates when using floating point. So you could try to check whether running in double precision solves the issue. Are you running with or without thermostat and barostat?

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 5, 2023, 10:37am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/8 "2023-05-05T10:37:49Z")

</div>

Hi, if you are running single precision and setting `tc-grps=system`, you could also look at the temperature of each group (`SOL1` and `SOL2`) separately (e.g. by using `gmx traj`). Another ‘signature’ of the single-precision issue that Carsten highlighted is the unphisical transfer of thermal energy from one group to the other, i.e. you should see a droplet heating up and the other cooling down.

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 5, 2023, 10:44am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/9 "2023-05-05T10:44:53Z")

</div>

Yes, the droplets were created individually by NVT for 50ns and later merged together into the same GRO file. The radial density of the droplets was around 1 g/cc.

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 5, 2023, 11:00am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/10 "2023-05-05T11:00:11Z")

</div>

Dear Carsten,

Thank you for your suggestion.

Yes, I am using Nose-Hoover thermostat but no barostat. Would you kindly guide me how to execute mdrun in double precision.

Thanks an regards  
Tonmoy Sharma

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [May 5, 2023, 11:13am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/11 "2023-05-05T11:13:05Z")

</div>

Hi Tonmoy,

you have to use the GROMACS version that is compiled in double precision. If it is provided on the cluster you use, it is probably named gmx\_d instead of just gmx. Or did you compile it yourself? Then you will have to make an extra double precision build.

Best,  
Carsten

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 5, 2023, 11:14am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/12 "2023-05-05T11:14:57Z")

</div>

You could also try to thermostat each group separately. Maybe that’s enough to kill unphysical evaporation.

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [May 5, 2023, 11:22am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/13 "2023-05-05T11:22:30Z")

</div>

I think a bit of evaporation is physical at 300K :)

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 5, 2023, 11:38am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/14 "2023-05-05T11:38:14Z")

</div>

Exactly. This might be an unavoidable issue.

But check the actual temperature of the droplets.

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 5, 2023, 11:49am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/15 "2023-05-05T11:49:41Z")

</div>

Sure, but I had expereinced quite extreme heating/cooling of water droplets when running single-precision in large domain. So I wouldn’t be surpised if the temperature of one of the two droplets is much greated than 300K (and consequently the other may be even frozen).

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 5, 2023, 11:56am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/16 "2023-05-05T11:56:04Z")

</div>

That happens at distance larger than 100 nm. I guess the distances are smaller here, but I can’t really say from the images.

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 6, 2023, 3:33am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/17 "2023-05-06T03:33:53Z")

</div>

Dear Carsten

We have installed the GROMACS version 2021.3 in single precision. Would you kindly share how to make an extra double precision build or share any available source in internet. It will be really helpful for me.

With regards,  
Tonmoy

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 6, 2023, 3:42am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/18 "2023-05-06T03:42:09Z")

</div>

Dear Michele,

I have simulated two systems based on your suggestions:

1. With the mdp option “tc-grps=System” and “ref\_t = 300”
2. With the mdp option “tc-grps=SOL1 SOL2” & “ref\_t = 300 300”, i.e., separate for both droplets.

Kindly observe the results of the temperature of both droplets with time. For case 1, as the temperature of one droplet is rising, the temperature of the other droping. Whereas, the temperature of both remains almost same (about 150K) thoguhout the simulation for case 2. However, the sum of the temperatures of both the droplets is about 300K.

 ![Combined analysis](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/c/cf43519cc80efd52f71c3c8dc07e1365cd5466f5.png)

Kindly shed some light as to why both the droplets are not maintained at 300K even though I have set the reference temperature as 300K for both.

Thanks and regards,  
Tonmoy Sharma

---

<div class="post-metadata">

**Author:** ![tonmoy](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tonmoy](https://gromacs.bioexcel.eu/u/tonmoy)\
**Post date:** [May 6, 2023, 4:12am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/19 "2023-05-06T04:12:31Z")

</div>

Dear Hess,

I have encountered recently that as I use separate tc-grps for SOL1 and SOL2, the droplet with SOL1 residues breaks into 2 droplets after 4.3 ns of the simulation. The splitting takes place within 1.2 ns. I have used the following mdp options:

;TEMPERATURE coupling  
Tcoupl = nose-hoover  
tc-grps = SOL1 SOL2 ; Groups to couple separately  
nsttcouple = -1  
tau\_t = 0.5 0.5 ; Time constant (ps) and  
ref\_t = 300.0 300.0 ; reference temperature (K)  
; PULL CODE  
pull = yes  
pull\_ngroups = 2  
pull\_ncoords = 1  
pull\_group1\_name = SOL1  
pull\_group2\_name = SOL2  
pull\_coord1\_type = umbrella ; harmonic biasing force  
pull\_coord1\_geometry = distance ; simple distance increase  
pull\_coord1\_groups = 1 2  
pull\_coord1\_dim = Y Y Y  
;pull\_coord1\_rate = 0 ; nm/ps (-ve means in the -ve Z direction)  
pull\_coord1\_k = 10 ; kJ mol^-1 nm^-2  
pull\_coord1\_start = yes ; define initial COM distance \> 0

 ![Droplet spliting while constraining](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/d/d65c8f7a9404eeed3921c2ddd405506a4812f502.jpeg)

Kindly suggest what might be the problem here.

Thanks and regards,  
Tonmoy Sharma

---

<div class="post-metadata">

**Author:** ![Carsten](https://avatars.discourse-cdn.com/v4/letter/c/f14d63/32.png) [@Carsten](https://gromacs.bioexcel.eu/u/Carsten)\
**Post date:** [May 6, 2023, 4:41am UTC](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329/20 "2023-05-06T04:41:44Z")

</div>

You add the `-DGMX_DOUBLE=on` cmake flag to build GROMACS in double precision, see the installation instructions at [https://manual.gromacs.org/current/install-guide/index.html](https://manual.gromacs.org/current/install-guide/index.html). There will however be no GPU support in double precision.

[Next page](https://gromacs.bioexcel.eu/t/constraining-two-water-droplets-at-constant-distance-between-their-coms-using-pull-code/6329.md?page=2)
