Dear lammps developers and users,
I have problems with temperature-control and pressure-control in fix-gcmc.
I started with argon, the mono-atomic system, for which nvt, npt, nvt+gcmc have been tested. For these three types of simulations, temperature T, pressure P, and density rho, agree with each other very well. Here the main commands in nvt+gcmc, related to T and P, are as follows:
timestep 1.0
fix fixmomentum all momentum 100 linear 1 1 1
compute mdtemp all temp
compute_modify mdtemp dynamic yes
fix mdnvt all nvt temp 140.46 140.46 100.0
fix_modify mdnvt temp mdtemp
fix fixgcmc all gcmc 10 20 10 1 666 140.46 0.0 0.5 pressure 50.0
compute_modify thermo_temp dynamic yes
When I turn to CO2, the molecular system, the results from nvt and npt still agree with each other (also agree with the experimental values).
As for nvt+gcmc, the results seem not correct although I use the same commands above to control T and P, sometimes T and P go extremely high.
To me, the problems may comes from the fluctuation of the number of molecules in the simulation box, and thus temperature and pressure and even some potentials were not calculated correctly (but why it is not a problem for mono-atomic system?). After some tests, I use the following method:
timestep 0.5
compute mdtemp all temp
compute_modify mdtemp dynamic yes
compute_modify thermo_pe dynamic yes
compute_modify thermo_press dynamic yes
compute_modify thermo_temp dynamic yes
fix tc all temp/rescale 1 280 280 10 1
compute_modify tc_temp dynamic yes
fix fixmomentum all momentum 100 linear 1 1 1
fix fixgcmc all gcmc 10 1 1 0 779877 280 -0.0 0.1 maxangle 30 mol CO2 pressure 5.0 tfac_insert 0.5
fix mdnvt all nvt temp 280 280 100
fix_modify mdnvt temp mdtemp
In this way, the temperature fluctuate between 260-300 (set to 280 K), but the pressure has a average about 15 (set to 5 bar), the density fluctuates around 0.015 (the experimental value is 0.02 g/cm^3). Note that I used tail correction and “pair_style lj/cut/coul/cut 10.0”
It seems, I am very close to the correct results but there are still some parameters to be improved (although I have done many tests).
Could you please give me some help with this? Thanks!
Yongbiao