Lammps using fix gcmc with pressure

I am using fix gcmc in lammps to try to generate isotherms for small hydrocarbons (methane, ethane) in zeolite. I want to run an isotherm at several pressures from something like 0.1 to 10 atm.

I have a question about what exactly using the pressure keyword is doing. In other MC codes you can specify a pressure and the code uses an equation of state or directly simulates a reservoir to estimate the probability of accepting an insertion into the zeolite. How does lammps handle this? As far as I can tell there is no EOS or actual reservoir. What exactly does specifying the pressure mean? How does lammps account for the energy required to remove the molecule from the reservoir?

I cannot really tell you much more than what is written in the fix gcmc documentation (please have another look at it). The pressure keyword, or the fugacity are alternative ways to specify the chemical potential, which determines the acceptance for insertions/deletions.

When comparing LAMMPS to pure MC codes, please keep in mind, that LAMMPS is designed to primarily run MD simulations. Its MC features are often inefficient and mainly conceived for running hybrid MD/MC calculations, where you combine an occasional MC step with predominantly executing MD. This way the overhead is reduce, that is mainly due to the domain decomposition parallelization (which is effective for MD).

If you want to know more details, you probably will need to look at the source code (beware, this is not exactly an easy to read piece of LAMMPS) or hope that @athomps sees this and can provide more details.

“What exactly does specifying the pressure mean?” It says on the doc page exactly what it means: “As an alternative to specifying mu directly, the ideal gas reservoir can be defined by its pressure P using the pressure keyword” Which part of this statement is unclear to you?

Aidan and Axel, thanks for your replies.

I think what is unclear to me is how the reservoir works. The doc page says it is ideal. So does this mean by definition there are no inter-particle interactions in the reservoir? That would not work for interacting systems like water.

The doc page gives the relation for mu_id to fugacity and pressure but not mu_ex. So what I am asking is: if I want to do a non-ideal adsorbate reservoir, can I do that by specifying pressure alone or do I need to specify a chemical potential in that case? Probably from something like a Gibbs ensemble calculation and extracting the interaction energy.

The reservoir does not “work,” it is an abstract concept, like a thermal reservoir (used to define a thermostat), or a volume reservoir (used to define barostats). Once the reservoir is defined (whether that be by specifying chemical potential, ideal gas pressure, or fugacity), the only role it plays is to define the chemical potential. If you are finding the equations on the doc page difficult to understand, then you are free to run your own experiments e.g. run a series of pure water muVT simulations with different values of chemical potential, pressure, or fugacity, and measure the resultant average pressure in each case.