Fix gcmc does not absorb gas

Good morning, everyone.
I was using fix gcmc of LAMMPS 64-bit 3Aug2022-MPI to calculate the gas adsorption isotherm, and the number of N2 molecules adsorbed was always 0. The system is a polymer.
When I tried to use sorption module of MS software for adsorption, I could see that the number of adsorbed gases increased significantly with the pressure. I put the in file below. What is the problem?
With best wishes!
in.adsorption (4.7 KB)

1 Like

Please read Please Read This First: Guidelines and Suggestions for posting LAMMPS questions and specifically the notes about formatting of quoted input files. Your file is in parts unreadable.

a) have you run the system without fix gcmc? does it give a reasonable results and conserve energy etc.?
b) have you tried fix gcmc with an empty system? does it insert gas molecules then?

Some issues I noticed in your input script:

  1. I didn’t see any time integration fixes for the polymer, so it’ll not move during MD (and you explicitly set its force as 0). Is this really what you want?
  2. note that fix rigid/small already has time integration, so adding fix nvt on the same group will integrate them twice, which is usually not a good idea (fix rigid command — LAMMPS documentation, search “You should not update”). Also search “If your simulation is a hybrid model” in that page to see how to integrate such systems properly.
  3. you also need proper dynamic/dof settings on the fixes, not only the thermo outputs. For fix nvt it’s like (fix gcmc command — LAMMPS documentation, search this code snippet)
compute mdtemp mdatoms temp
compute_modify mdtemp dynamic/dof yes
fix mdnvt mdatoms nvt temp 300.0 300.0 10.0
fix_modify mdnvt temp mdtemp

for fix rigid/nvt/small, however, use fix_modify dynamic/dof yes instead (fix_modify command — LAMMPS documentation, search “The dynamic/dof keyword”)

  1. this is not directly related, but is there any reason for you to use kspace_style ewald instead of kspace_style pppm (the latter is usually faster at the same accuracy level)?

I will pay attention to the lammps issue next time. I stretched the polymer model in lammps and preserved the energy changes of each part of the stretching process, which was the same as the energy changes in the literature. Before the fixed and stretched structure was saved and N2 adsorption isotherms were output and fix gcmc was performed, N2 molecules were not present in the system and N2 molecules were not counted during the process. Also, I have tried fix widom on the structure and the excess chemical potential has always been zero. Below is my fix widom file. So I am very upset.
Have a nice day
in.widom (4.1 KB)

I want to output N2 adsorption isotherm by stretching the polymer model in lammps to preserve the structure after fixed stretching. This file was modified by me with reference to lammps examples. I used fix rigid/nvt/small command. kspace_style ewald is a reference to the use of literature. Thank you for your advice. It’s very important.

Please don’t mix topics. You have started a topic on fix wisdom and this one on fix gcmc.
One small tip: place a few gas molecules into your system manually. I vaguely recall, there is a fundamental problem otherwise.

You also need to address the issues pointed out by @initialize. I don’t see how you can have a meaningful simulation without fix gcmc, so your claims that you get good agreement are unexpected.

Thanks for your comments, I have revised it.
I’m sorry that I didn’t explain it clearly. I fixed the model before, filled it with gas, and observed the diffusion coefficient of the gas, which was no problem compared with the literature. Now if fix gcmc is removed, the polymer is fixed, and the system will remain static.
Before fix gcmc, I filled 200 gas molecules in the system, and after running one step, the number of gas molecules was only one, which I did not understand.
log.lammps (14.3 KB)
in.adsorption (4.8 KB)