Gcmc-lammps

Hi,

The LAMMPS-GCMC package is used for evaluating chemical equilibrium of one, two, or more, rigid molecule types in touch at a same thermal reservoir and one, two (or more) ideal-gas-like containers.
However, in the case of two and more molecule types, the idea of being in touch with a single thermal reservoir is not feasible in LAMMPS-GCMC, since GCMC fix does not select the desire molecule template wisely, and it selects the first one in the molecule template array, regardless of how many molecule template you defined.
So you have to do as below

molecule MOL1 moltemp1.txt
molecule MOL2 moltemp2.txt

fix RIG1 moltype1 rigid/nvt/small molecule mol MOL1 ...
fix RIG2 moltype2 rigid/nvt/small molecule mol MOL2 ...

fix GCMC1 moltype1 gcmc ... mol MOL1 rigid RIG1 ...
fix GCMC2 moltype2 gcmc ... mol MOL2 rigid RIG2 ...

Here, this way is not well defined and clean, since we define two distinct thermostats, one for each molecule type. People do it since they can not define a single thermostat for both molecule types, here we assume we have just a binary mixture.

However, we can modify the GCMC code via defining a new option keyword, named molindex, which selects the desire molecule template within the molecule template array, and we can modify our LAMMPS script as


molecule MOLs moltemp1.txt moltemp2.txt

fix RIG12 all rigid/nvt/small molecule mol MOLs ...

fix GCMC1 moltype1 gcmc ... mol MOLs molindex 1 rigid RIG12 ...
fix GCMC2 moltype2 gcmc ... mol MOLs molindex 2 rigid RIG12 ...

Here, we have a single rigid/nvt/small fix which supports both molecule template types.
The defined molindex option keyword selects the desire molecule template type based on our definitions.

here, you can find the edited code, I’ve tested it on LAMMPS 29-Aug-2024 (update 2).
Best, Russell.

fix_gcmc.cpp (84.5 KB)
fix_gcmc.h (5.1 KB)

1 Like