# [lammps-users] How to calculate surface tension in LAMMPS.

Dear LAMMPS users,

I am using LAMMPS version 8 Apr 2021. I am trying to compute surface tension between a liquid and a gas using the Kirkwood Buff formula. My domain is 800 Å x 300 Å x 300 Å with periodic boundary in y and z direction. In the x direction I have wall boundary conditions. The gas-liquid interface is in the middle of the domain parallel to the y-z plane. The set-up is like the one given here : https://aip.scitation.org/doi/10.1063/1.3595260

Currently, I am using the following approach :

variable A2m equal 1e-10

variable atm2pa equal 101325

compute t_press all pressure thermo_temp ke pair

variable sig equal 0.5*{lx}*{A2m}\${atm2pa}(c_t_press[1]-0.5*(c_t_press[2]+c_t_press[3]))

thermo 100

thermo_style custom step temp press density enthalpy ke pe etotal pxx pyy pzz v_sig

I am taking the time average value of v_sig as the surface tension. If someone has experience with computing surface tension using Kirkwood Buff approach or the Irving Kirkwood approach, please help me with implementing it correctly in LAMMPS.

Thanks

Arijit Majumdar

PhD Student, Mechanical Engineering,

Stanford University

1 Like

You have to explain more specifically what kind of help you are looking for.
This is a forum for supporting the LAMMPS software, not a place to be trained in doing your research (or have it done for you).

In other words, if you have problems with the syntax or procedure of how to use certain commands or format of files they read or when LAMMPS is not behaving like the manual says or it crashes when it should not, then this is the right place.
If you need somebody to check your results or advise you on what to compute (not how), then you need to talk with your adviser/tutor/superviser/colleages or find some suitable publications describing a simple enough system and try to reproduce their results and follow the description in them. once you can correctly reproduce known results for a simple system, you can “graduate” to doing more complex calculations.

Hi Axel,

Thanks for your reply. I am trying to find the correct way of implementing Irving and Kirkwood method in a lammps script. I have calculated the surface tension and tried to validate it with experimental data. To reduce the error in my results, I tried changing system size, type of thermostat, time integration method etc. These improved the results to some extent, but there is still some significant difference between experiment and my simulations. I think that the error I am getting might be due incorrect implementation of the surface tension formula. That’s why I am looking for the correct way to calculate surface tension in lammps.

Thanks

Arijit

There are two missteps in your approach:

a) you are comparing your simulation results directly to experiment. how do you know that your force field parameters and settings are actually able to reproduce the experiment? there can be significant differences! empirical force fields are not the “exact truth” but some approximation and the type of potential and the choice of parameters can make a big difference. so to be certain that you are doing your computation correctly, you have to simulate a system for which simulation results exist in the published literature and you have to follow the settings and choices of that study (or those studies) and see if you can get the same results and also make tests on convergence and how certain simulation setting influence the results.

b) you are mixing what is a LAMMPS problem with what is a science problem and then are asking to get both solved at the same time. as I already alluded to, how to compute the surface tension by itself is something that you have to work out by yourself. there should be lots of published knowledge out there. once you know exactly what property you need to extract from LAMMPS, you implement it. now if you have difficulties with that, i.e. LAMMPS prints error messages, you cannot find how to access that property, or LAMMPS does not seem to do what the documentation says, then you could ask for help with that here. however, if you don’t get the same results as an experiment, that is a completely different thing and by itself not even proof that your simulation is wrong unless you are experienced and have validated your simulation approach by reproducing previous simulation results.