Question about set up step potential in gcmc lammps

Dear Lammps-users
I am a new user Lammps and would like to perform gcmc using fix gcmc command in lammps. My system is a cylinder in which the middle region is put a deeper potential then outer region. As the definition of chemical potential in gcmc:
mu=ln(particle density) + beta*potential.
I would like to control mu constant by gcmc but the middle region has deeper potential so that the particles will be more in this region. I wonder can lammps support this feature which we can set up the different potential for different region (so that the obtained density particles will be different too) in gcmc (chemical potential is controlled to be constant)?
As I look in the manual, we can set up different pressure but in this case, I would like to use the step potential for my system. Is it possible? Thank you very much.

Best,

Phuong

Dear Lammps-users
I am a new user Lammps and would like to perform gcmc using fix gcmc command
in lammps. My system is a cylinder in which the middle region is put a
deeper potential then outer region. As the definition of chemical potential
in gcmc:
mu=ln(particle density) + beta*potential.
I would like to control mu constant by gcmc but the middle region has deeper
potential so that the particles will be more in this region. I wonder can
lammps support this feature which we can set up the different potential for
different region (so that the obtained density particles will be different
too) in gcmc (chemical potential is controlled to be constant)?
As I look in the manual, we can set up different pressure but in this case,
I would like to use the step potential for my system. Is it possible? Thank

you can define two target regions (the inside and the outside of your
cylinder) and then set up two fix gcmc commands with different
parameters, each restricted to one of the two regions.

axel.

Hello Axel,

Thank you for your help. As I read in the manual, I can set up region with different parameters (pressure, chemical potential). However, in this case, I want to keep these parameters same in two regions. In stead of set up different pressure or chemical potential, could I set up an external potential within a certain region that can help my lennard-jones particles confined in that region? Could I use the fix addforce command to do this? I plan to add an external force for particles if they move into particular region and without external force for other region. Is it possible?

Thank you very much!

Best,

Phuong

Hello Axel,
Thank you for your help. As I read in the manual, I can set up region with
different parameters (pressure, chemical potential). However, in this case,
I want to keep these parameters same in two regions. In stead of set up
different pressure or chemical potential, could I set up an external
potential within a certain region that can help my lennard-jones particles
confined in that region? Could I use the fix addforce command to do this? I
plan to add an external force for particles if they move into particular
region and without external force for other region. Is it possible?

this is different from what you asked before.
sure you can define an additional confinement potential.
fix addforce is one option, fix wall/region is another.

axel.

Dear Axel,

Thank you very much for your help. I have made an input and set up an extra force. I would like to see the different number of particles in different regions so I use the command count(ID, region). However, the error was shown that no atoms in group ch4. Could you please help me to figure out this? I try to take a look in the manual as well as other questions but everything seems normal.

Here is my input (I just set up all the values randomly because I just want to check how it works)

units real
atom_style atomic
boundary p p p
lattice sc 0.5
region r1 cylinder z 0 0 5 0 100
region outer1 cylinder z 0 0 5 0 35
region inner cylinder z 0 0 5 35 70
region outer2 cylinder z 0 0 5 70 100
create_box 1 r1
mass 1 16.0425
pair_style lj/cut 10.0
pair_coeff 1 1 0.2943 3.81 10.0
group ch4 type 1
thermo 1000
compute_modify thermo_temp dynamic yes
variable chempot equal -2000
variable density equal atoms/vol
variable num1 equal count(ch4,outer1)
variable num2 equal count(ch4,outer2)
variable num3 equal count(ch4,inner)
variable chempotkcal equal {chempot}/503.219 fix 1 all addforce 0 0 -2.0 region inner fix 2 all gcmc 1 100 100 1 29494 300.0 {chempotkcal} 0.5
thermo_style custom step atoms temp pe ke etotal press vol v_chempot density atoms num1 num2 num3
run 10000

Thank you very much.

Phuong.

Dear Lammps-users,

I just noticed that my input has problem with the variable num (it should be v_num). However, the results seems do not look like what I expect. I would like to create an extra force only in the inner region, then if the atoms move out of other regions, this force will be disappeared. Therefore, if everything is fine, the number of atoms in the inner region has be to larger than others. That’s why I am so confused

  1. How can I set up the extra force only for the inner region?

  2. Why the total number of all region (r1) is not equal when I sum them all from different regions (outer and inner)?
    units real
    atom_style atomic
    boundary p p p
    lattice sc 0.5
    region r1 cylinder z 0 0 5 0 100
    region outer1 cylinder z 0 0 5 0 35
    region inner cylinder z 0 0 5 35 70
    region outer2 cylinder z 0 0 5 70 100
    create_box 1 r1
    mass 1 16.0425
    pair_style lj/cut 10.0
    pair_coeff 1 1 0.2943 3.81 10.0
    #group ch4 type 2
    thermo 1000
    compute_modify thermo_temp dynamic yes
    variable chempot equal -2000
    #variable density equal atoms/vol
    variable num equal count(all,outer1)
    variable num2 equal count(all,outer2)
    variable num3 equal count(all,inner)
    variable chempotkcal equal {chempot}/503.219 fix 1 all addforce 0 0 -100.0 region inner fix 2 all gcmc 1 100 100 1 29494 300.0 {chempotkcal} 0.5
    thermo_style custom step atoms temp pe ke etotal press vol v_chempot density atoms v_num v_num2 v_num3
    run 100000

Thank you very much and so sorry for my question. It may be obvious but I just start with Lammps and still feel confused. I have tried but cannot solve them by myself.

Best,

Phuong.

in.mc (1.08 KB)

log.lammps (19.9 KB)

Dear Lammps-users,
I just noticed that my input has problem with the variable num (it should be
v_num). However, the results seems do not look like what I expect. I would
like to create an extra force only in the inner region, then if the atoms
move out of other regions, this force will be disappeared. Therefore, if
everything is fine, the number of atoms in the inner region has be to larger
than others. That's why I am so confused
1. How can I set up the extra force only for the inner region?

you did.

2. Why the total number of all region (r1) is not equal when I sum them all
from different regions (outer and inner)?

because your simulation box is *not* the volume of region r1 but the
orthogonal volume enclosing it.

axel.

Dear Lammps-users,
I just noticed that my input has problem with the variable num (it should be
v_num). However, the results seems do not look like what I expect. I would
like to create an extra force only in the inner region, then if the atoms
move out of other regions, this force will be disappeared. Therefore, if
everything is fine, the number of atoms in the inner region has be to larger
than others. That's why I am so confused

i cannot follow your reasoning here. you are adding a constant force
in z-direction to the atoms in the inner region.
that will accelerate all of them in z-direction. nothing more. the
result should be to induce a flow in z-direction.
if you want to compress the atoms in the inner region, you have to add
forces to the atoms in the two *outer* regions with opposite sign.

axel.

Dear Axel,

So sorry that confusing you. Yes, I want to compress the atoms in the inner region. I will describe them again. I would like to see the condensation (or higher density of particles) in the inner regions so I use fix addforce for atoms only in the inner region. I have add forces to the outer regions also with opposite sign. However, the obtained output shows me that the number of atoms in the inner region is not higher than outer1 region. Could you suggest me which wrong with my assumption and is there any possible way or command in Lammps that I could do it?

Thank you very much.

Here is my input
units real
atom_style atomic
boundary p p p
region r1 cylinder z 0 0 5 0 100
region outer1 cylinder z 0 0 5 0 35
region inner cylinder z 0 0 5 35 70
region outer2 cylinder z 0 0 5 70 105
create_box 1 r1
mass 1 16.0425
pair_style lj/cut 10.0
pair_coeff 1 1 0.2943 3.81 10.0
#group ch4 type 2
thermo 1000
compute_modify thermo_temp dynamic yes
variable chempot equal -2000
variable num equal count(all,outer1)
variable num2 equal count(all,outer2)
variable num3 equal count(all,inner)
variable chempotkcal equal {chempot}/503.219 fix 1 all addforce 0 0 20 region inner fix 3 all addforce 0 0 -10 region outer1 fix 4 all addforce 0 0 20 region outer2 fix 2 all gcmc 1 100 100 1 29494 300.0 {chempotkcal} 0.5
thermo_style custom step atoms temp pe ke etotal press vol v_chempot density atoms v_num v_num2 v_num3
run 100000

Have a good day.

Phuong

Dear Axel,

So sorry that some mistake in the input file, I mean addforce in the inner region -20, outer 10 and 10. Anyway, I try my input file with and without fix addforce command and the results are exactly the same. I think maybe my system is unphysical or some thing else? I am so confused. Could you please suggest me any simple example that can work well with fix_addforce command for region?

Thank you very much and wish you a good day.

Best,

Phuong.

gcmc.xyz (37.5 KB)

in.mc (1.18 KB)

log.lammps (4.88 KB)

Dear Axel,
So sorry that some mistake in the input file, I mean addforce in the inner
region -20, outer 10 and 10. Anyway, I try my input file with and without
fix addforce command and the results are exactly the same. I think maybe my
system is unphysical or some thing else? I am so confused.

i think you may be underestimating the strength of interactions in a
dense system.

Could you please
suggest me any simple example that can work well with fix_addforce command
for region?

there are examples in the obstacle and flow folders that used fix
addforce. it is easy to modify them to use regions.
if you want to be productive as a researcher, you have to devise your
own examples. i suggest you start with a diluted system with purely
repulsive interactions and then try simple manipulations unless you
have a sense for what you can do and how the system reacts. then you
can gradually change it to more closely resemble your system of
interest.

axel.