Update: kinetic Monte Carlo simulation code example

I had an old blog post linking to a walkthrough of the code developed and used during my PhD on phase separation of polydisperse colloids. It’s now a little deprecated, partly because I’ve done further work on that topic since then, and because a link it contained had become dead.

Now, here is a short post to provide a quick-and-dirty runnable example of the latest code. I’ll provide a link to the repository, and then mention a new EXAMPLE folder which contains a minimal working simulation setup. Finally I’ll briefly overview what the code and analysis tools can do.

Repository: https://bitbucket.org/johnjosephwilliamson/phd-code-clone-bitbucket

EXAMPLE folder:

Screen Shot 2016-04-15 at 15.54.48

  • The README.txt contains instructions
  • preinit.txt controls the initialiser program, which is run in order to pack the simulation box with particles of the required volume fraction, polydispersity… This file is set to make a simple cubic box (XLATTICE 0 etc.), without the fancy crystal templating algorithm we used in some applications
  • simconfig.txt controls the main simulation, and in this case is set to simulate hard spheres (DEPTH and RANGE of square wells is set to 0)
  • The other files are binaries to be run from the command line, which I suppose might run as is if you have a mac configured similarly to mine. Else, they can be compiled from the source code in the repository. The appropriate source code folders are mentioned in the README. In the top-level-directory of the repository, there is another README which provides compilation flags (linking to “math” and “boost” libraries) which may be necessary, but for me on this computer were not
  • XYZ_converter allows converting the output to .xyz format for visualisation in OVITO
  • Profit…

Screen Shot 2016-04-15 at 16.04.19


Naturally, let me know if you have any trouble compiling or running the code. See my publications page for examples of what we have done with it. If you are interested in using or adapting the code, I am always happy to explain it in more detail. Briefly, the existing capabilities/purposes:

  • kinetic Monte Carlo simulation of noninteracting, hard-sphere or square-well colloidal particles
  • Gaussian or Schulz polydispersity, with two choices of how the square well polydispersity relates to the hard-core polydispersity
  • geared toward study phase-separation kinetics in polydisperse systems, local characterisation and structural information
  • isotropic simulation box, or a special cuboidal geometry in which a crystal is templated at one end (choice of two crystal faces), to study crystal growth kinetics
  • XYZ_converter to produce standard .xyz files, for OVITO visualisation
  • a wide suite of analysis programs: structure factors (including intermediate scattering functions and partial versions thereof for polydisperse cases), polydisperse fractionation measurement, coarse-grained-Voronoi local volume fraction analysis, crystal interface-tracking, kymographs…