# How to calculate the surface tension of a liquid?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769>\
**Category:** User discussions\
**Tags:** mdp-parameters\
**Created:** [March 17, 2021, 10:00pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769 "2021-03-17T22:00:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehsan](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ehsan/32/1345_2.png) [@ehsan](https://gromacs.bioexcel.eu/u/ehsan)\
**Post date:** [March 17, 2021, 10:00pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769/1 "2021-03-17T22:00:14Z")

</div>

GROMACS version: 2020.4  
GROMACS modification: No

Dear GROMACS users,

I know there are few topics related to this question but I couldn’t find a solution based on previous discussions. My question is how should we set up our system to get the surface tension of a liquid from gmx energy #Surf\*SurfTen?

Particularly, what are the mdp parameters for pressure coupling, which ensemble, should we have a vacuum/liquid interface or not? If yes, how can we maintain it through the NPT ensemble?

Thank you in advance,  
Ehsan

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [March 18, 2021, 6:29am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769/2 "2021-03-18T06:29:22Z")

</div>

Hello,

you need to set up your two-phase system (with normals pointing along Z, at least if you want to use the `#Surf*SurfTen` term in `gmx energy`) – if your second phase is vacuum you need to have that phase present, otherwise there is no surface to measure for. NVT ensembles at your target pressure is fine for liquid-liquid measurements (and indeed necessary for liquid-vacuum).

You should also take care that your phases are large enough to represent bulk matter and for one phase to not “see itself” behind the second phase. In vacuum it will always see itself due to the Coulomb interaction, so increase the vacuum size until you reach a converged value.

Regards,  
Petter

---

<div class="post-metadata">

**Author:** ![ehsan](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ehsan/32/1345_2.png) [@ehsan](https://gromacs.bioexcel.eu/u/ehsan)\
**Post date:** [March 18, 2021, 7:02am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769/3 "2021-03-18T07:02:44Z")

</div>

Thank you Petter for the reply.

Now my question is how can I have vacuum and liquid phase together because if I increase the box size in the Z direction, the moment the simulation is started, the box will shrink and eliminate the vacuum part.

I used these parameters which I found in a related topic:

; Temperature coupling is on  
tcoupl = V-rescale  
tc-grps = system  
tau\_t = 0.5  
ref\_t = 300  
; Pressure coupling is on  
pcoupl = no  
pcoupltype = semiisotropic (I tried both with and without this command)  
tau\_p = 5.0  
ref\_p = 0.0 1.0  
compressibility = 0.0 4.5e-5

Kind regards,

Ehsan

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [March 18, 2021, 7:54am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-the-surface-tension-of-a-liquid/1769/4 "2021-03-18T07:54:29Z")

</div>

If the box size is changing the simulation is not running in an NVT ensemble. Setting `pcoupl = no` as in your list should be sufficient to fix the volume, so I’d suggest to double check that it’s set like that in the `md.log` file from the simulation.

If it is still changing, please post your `md.log` file.
