Obtaining fast and reliable contact angles in molecular dynamics simulations is crucial for screening surface wettability. Traditional methods rely on bidimensional density profile analysis to localize the liquid/vapor interface, which may not be optimal at the nanoscale, especially for nonsymmetrical droplets. Herein, 3DDA, a Python‐based code that uses the 3D droplet geometry to determine contact angles and analyze dynamic changes during spreading processes at the nanoscale, is presented. The 3D density profile of liquid molecules is enveloped using the Euclidean 3D convex hull algorithm to locate the contact line at the solid‐, liquid‐, and vapor‐phase boundaries. By fitting a general ellipsoidal function and optimizing it with the limited‐memory Broyden–Fletcher–Goldfarb–Shanno method, the best candidate function is analytically obtained, describing the interface. The angle derived from the ellipsoidal function and the solid boundary is used to gather a collection of contant angles, which are then fed into a kernel density estimator to determine the most probable angle along the contact line during the spreading process. This methodology is tested on systems such as liquid water and metals, demonstrating its efficacy and reliability. Herein, valuable insights are provided into the behavior of liquids, considering droplet asphericity induced by liquid/solid interactions.
Read full abstract