/Monte_Carlo

Grand Canonical Monte Carlo program for the simulation of a truncated Lennard-Jones or monatomic water fluid either in bulk, confined to a slit or in contact with a solute. Supports Lennard-Jones like external potentials applied to the fluid from the walls of the slit or the solute.

Primary LanguageC++MIT LicenseMIT

Grand Canonical Monte Carlo Program for Truncated Lennard-Jones Fluid and Monatomic Water

Mary Coe
January 2022

This is a grand canonical Monte Carlo program to simulate truncated Lennard-Jones fluids and a monatomic water model wither in bulk, in contact with a solute or confined to an infinite slit. This program was written as part of my PhD and is made available under the MIT license in the hope that it will be useful for other students in the future.

How does the program work and what has it been used for?

Details of exactly how the program works and the theory behind it can be found in Section 4.2 of my thesis, available here. It currently supports (click the links for details)

Fluids: Truncated Lennard-Jones fluid and monatomic water.

Geometries: Bulk fluid, small solutes and an infinite slit.

External Potentials: Solutes and the walls of infinite slits are impenetrable to fluid particles. There is an option for these to interact with fluid particles via an attractive Lennard-Jones tail.

Sampling: Insertion and deletion moves, multicanonical biasing, either with preset weights or with weights determined through the course of the simulation using the transition matrix method.

Measures: Density of particles within system, density profiles (radial distribution function for bulk fluids, distribution between slit walls or distribution around solute), local compressibility and thermal susceptibility profiles (see tutorial 4, section 4.2.10 of my thesis or this paper).

This program has been used for:

M. K. Coe, R. Evans and N. B. Wilding, Density depletion and enhanced fluctuations in water near hydrophobic solutes: Identifying the underlying physics. Phys. Rev, Lett. 128 045501

M. K. Coe, R. Evans and N. B. Wilding, The coexistence curve and surface tension of a monatomic water model. (Submitted to J. Chem. Phys.)

M. K. Coe, "Hydrophobicity across length scales: The role of surface criticality", PhD thesis, (University of Bristol, 2021)

How is it structured?

The Monte Carlo program is written in C++ for efficiency. This is compiled via a Makefile, so you shouldn't have to interact with the C++ code much (the exception to this is adding a random number generator, see tutorial 1 for details). In addition to the Monte Carlo code, there is also a folder called tools, which contains several Python modules. These modules contain functions to set up Input files, organise and run simulations in parallel, and process, analyse and visualise results. It is recommended that you use these functions, and write any scripts to run the Monte Carlo in Python.

What will be available and when?

The source code for the Monte Carlo, the associated Makefile and a selection of the Python tools are already available within the repository. In addition, there will be several tutorials to help you understand what the program can be used for an how. These are

Tutorial 1 - Getting Started: (available now) This tutorial teaches you how to add a random number generator and test the program is working.

Tutorial 2 - Bulk Fluids:(available soon) This tutorial will teach you how to use the program to study bulk fluids, particularly at the critical point and at liquid-vapour coexistence. It will also introduce biased sampling techniques.

Tutorial 3 - Introducing Solute and Surfaces: (tbc) This tutorial will teach you how to add a solute or a slit to the system and measure density profiles.

Tutorial 4 - Measures: (tbc) This tutorial will explain some of the other measures available within the program and toolkit, and how to implement them.

Any known problems?

Current known issues are:
  1. At the end of the simulation, the program calculates the average move acceptance ratio incorrectly.