<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Post-Processing the Results of Metastable States Molecular Dynamics Simulation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andrey Sozykin</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Natalia Neustroeva</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vladimir Baidakov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sergey Protsenko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vasiliy Brukhanov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Konstantin Ushenin</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Arsenii Krasnobaev</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Thermophysics, Ural Branch of the Russian Academy of Sciences</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Krasovskii Institute of Mathematics and Mechanics</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Ural Federal University</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>11</fpage>
      <lpage>16</lpage>
      <abstract>
        <p>Molecular dynamics simulation should be combined with modern supercomputer technologies to obtain meaningful results in reasonable time. Widely used simulation software in MD is LAMMPS. It produces a dump with computational results of simulation, and such a large amount of data should be post-processed. However, LAMMPS does not provide ready-to-use utilities that would do it. In this paper we present the developed algorithm for LAMMPS output data processing for nucleation process. The analysis of implementation performance shows that it is shading that takes most of the time, hence, it should provide the greatest room for future optimization.</p>
      </abstract>
      <kwd-group>
        <kwd>parallel computing systems</kwd>
        <kwd>supercomputers</kwd>
        <kwd>LAMMPS</kwd>
        <kwd>MD simulation</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        One of the problems to be solved with the use of modern supercomputer
technologies is the molecular dynamics (MD) simulation of metastable phase states
and phase transitions. The rst stage of a new thermodynamic phase formation is
nucleation. Nucleation is widespread in both nature and technological processes
during which the phase transitions occur [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. There are two types of nucleation:
homogeneous and heterogeneous. Homogeneous nucleation is a process|with
which the formation of a new thermodynamic phase begins|in substances free
of impurities. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Heterogeneous nucleation is a process|with which the
formation of a new thermodynamic phase begins|on a surface consisting of foreign
particles.
      </p>
      <p>
        A popular method of nucleation study is molecular dynamics (MD)
simulations [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ]. This method allows to compute the change of the particles'
coordinates and their velocities in time by the numerical solution of Newton's
equations of motion. The initial velocity and the coordinates of particles as well
as the potential of their interaction must be de ned. The most common model
of interaction among nonpolar molecules is the Lennard-Jones (LJ) potential.
      </p>
      <p>
        Using the coordinates and velocities of the particles at a speci c point of time,
one can compute [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] various physical quantities (temperature, pressure, etc.).
For the study of nucleation, additional parameters should be calculated, for
example, the volume of the biggest bubble, the contact angle, and components of
the pressure tensor.
      </p>
      <p>
        The most widely used MD simulation software is the LAMMPS system [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
LAMMPS is a classical molecular dynamics open source code with the parallel
computing support. However, LAMMPS does not provide ready-to-use utilities
for analysis of appearance and growth of new phases. Therefore, one has to
implement the procedures for post-processing of the nucleation simulation results.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Description of Nucleation Study Experiments</title>
      <p>Several computational experiments for studying the nucleation properties were
conducted at the Institute of Thermophysics. For modeling homogeneous
nucleation, the Lennard-Jones (LJ) liquid gas mixture of methane and nitrogen
is considered. The system under study contains N = 32000 LJ particles. The
particles are placed in a cubic box with periodic boundary conditions (PBC) as
presented in Fig. 1. Isothermal entry into metastable states of mixture is
implemented by lowering the density through stretching the whole cell and then
scaling the particles' coordinates accordingly.</p>
      <p>For study of heterogeneous nucleation, the system of LJ particles (model
liquids consisting of monocenter molecules) placed between two at crystalline
walls is used, as shown in Fig. 2. The appearance of the vapor phase on the walls
simulates the heterogeneous nucleation (Fig. 3).</p>
      <p>
        An important property of nucleation is the rate of nucleation, which equals
the average number of nuclei of a new phase formed per unit volume per unit
time [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Rate of nucleation, according to the classical nucleation theory (CNT),
is determined by the contact angle [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], which is the angle between a solid surface
and the tangent to the curved boundary of the drop (bubble) at the point of its
contact with the solid (Fig. 4).
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Post-Processing Algorithm and Implementation</title>
      <p>As a result of numerical experiments in simulation of molecular dynamics, the
LAMMPS system produces a text le with the coordinates of the particles. It is
required to post-process these results to calculate the various characteristics of
the models. For the homogeneous nucleation experiment with the gas mixture
in cells with the periodic boundaries, we need to nd an empty cluster with the
maximum radius and then evaluate the parameters of the cluster such as volume,
center of mass coordinates, and particles' density distribution.</p>
      <p>We developed a four-step (Fig. 5) algorithm for detecting empty spaces:
1. Discretization of space. The model space is partitioned into equal cells,
which are cubes with sides parallel to the model sides. The number of cubes
is pre-selected so that each single particle of the model \gets" nclast partition
cubes.
2. Shading non-empty cubes. The cubes the centers of which are less than
the distance Rnearest away from some particle are shaded.
3. Clustering empty cubes. Unmarked cubes are clustered using the
breadth- rst search (BFS) algorithm. We assume that the two cubes belong
to the same cluster if they share at least one edge.
4. Finding the cluster center. We determine the cells with the most distance
from each other for the clusters in all three dimensions and calculate the
center of the cluster.</p>
      <p>The algorithm was implemented using C++ with Intel Compiler. The current
implementation is capable of processing existing LAMMPS output les with
particle coordinates. The advantage of such an approach is the ability to process
the data from previously conducted experiments.</p>
      <p>To analyze the performance of the implementation, the numerical
experiments on specially prepared test data were carried out. The Intel Xeon X5675
processor was used during the experiments. Our implementation processed one
frame with 1000000 particles and 300 partition cubes per particle (nclast) in 440
seconds (including input/output time). The achieved performance is practical
for frame numbers between 100 and 200.</p>
      <p>The performance of the implementation was studied with the help of the
Intel VTune Ampli er pro ler software. Shading takes 94% of the time on test
data, 2% are occupied by BFS, and 1% by other tasks (discretization of the
space, nding the cluster center, data input/output, etc.). Hence, shading o ers
the greatest room for optimization.
We presented an algorithm for post-processing the MD simulation results: nding
the biggest empty cluster and evaluating its parameters|the radius, the volume,
the center of coordinates, and the particles' density distribution. Directions of
future work include improving the performance of the algorithm implementation
using parallel computing in order to process frames with millions of particles.
In addition, we plan to develop and implement algorithms for post-processing
of heterogeneous nucleation simulation results (contact angle, tensor of
pressure, etc.). The post-processing programs will be implemented as plugins for
LAMMPS.</p>
      <p>Acknowledgements The work was supported by the Research Program of Ural
Branch of RAS, project no. 15-7-12-8 and the Russian Foundation for Basic
Research, project no. 15-08-03399. Our study was performed using the Uran
supercomputer of the Krasovskii Institute of Mathematics and Mechanics.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Kashchiev</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Nucleation: Basic Theory with Applications</article-title>
          .
          <source>ButterworthHeinemann</source>
          , Oxford,
          <volume>30</volume>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Novak</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maginn</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McCready</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Comparison of heterogeneous and homogeneous bubble nucleation using molecular simulations</article-title>
          .
          <source>Physical Review B</source>
          , Volume
          <volume>75</volume>
          ,
          <string-name>
            <surname>Issue</surname>
            <given-names>8</given-names>
          </string-name>
          ,
          <issue>5413</issue>
          {
          <fpage>5423</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Nagayama</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsuruta</surname>
          </string-name>
          , T., Cheng, P.:
          <article-title>Molecular dynamics simulation on bubble formation in a nanochannel</article-title>
          .
          <source>International Journal of Heat and Mass Transfer</source>
          , Volume
          <volume>49</volume>
          ,
          <source>Issue</source>
          <volume>23</volume>
          ,
          <issue>4437</issue>
          {
          <fpage>4443</fpage>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Rapaport</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <source>The Art of Molecular Dynamics Simulation 2nd Edition</source>
          . Cambridge university press, Cambridge,
          <volume>11</volume>
          {
          <fpage>20</fpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>LAMMPS</given-names>
            <surname>Molecular Dynamics</surname>
          </string-name>
          <article-title>Simulator</article-title>
          . http://codeblue.umich.edu/hoomdblue/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Skripov</surname>
          </string-name>
          , V.:
          <article-title>Metastable liquids</article-title>
          . Wiley, New York,
          <volume>15</volume>
          (
          <year>1974</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Blander</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Katz</surname>
          </string-name>
          , J.:
          <article-title>Bubble nucleation in liquids</article-title>
          .
          <source>AIChE Journal</source>
          , Volume
          <volume>21</volume>
          ,
          <string-name>
            <surname>Issue</surname>
            <given-names>5</given-names>
          </string-name>
          ,
          <issue>833</issue>
          {
          <fpage>848</fpage>
          (
          <year>1975</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>