  It is important to study contact angle of a liquid on a solid surface to
understand its wetting properties, capillarity and surface interaction energy.
While performing transient molecular dynamics (MD) simulations it requires
calculating the time evolution of contact angle. This is a tedious effort to do
manually or with image processing algorithms. In this work we propose a new
algorithm to estimate contact angle from MD simulations directly and in a
computationally efficient way. This algorithm segregates the droplet molecules
from the vapor molecules using Mahalanobis distance (MND) technique. Then the
density is smeared onto a 2D grid using 4th order B-spline interpolation
function. The vapor liquid interface data is estimated from the grid using
density filtering. With the interface data a circle is fitted using Landau
method. The equation of this circle is solved for obtaining the contact angle.
This procedure is repeated by rotating the droplet about the vertical axis. We
have applied this algorithm to a number of studies (different potentials and
thermostat methods) which involves the MD simulation of water.
