questions regarding fix deposit

Dear all,

I am trying to add some molecules with fix deposit. (version of 30Jul2016)

Adding was processed well but after it, there is an issue related to grouping.

I ran two run to compare.

group gas type 1 2 3

group C4 type 1 2

group C1 type 3

variable ngas equal count(gas)

variable nC1 equal count(C1)

variable nC4 equal count(C4)

fix insert1 C1 deposit 50 2 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert2 C4 deposit 50 0 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

fix rec1 all ave/time 1 1 50 v_ngas v_nC1 v_nC4 ave one file real1.txt

timestep 0.001

run 500

unfix rec1

the result for the above case was,

(real1.txt)

Time-averaged data for fix rec1

TimeStep v_ngas v_nC1 v_nC4

0 22 2 20

50 22 7 40

100 22 12 60

150 22 17 80

200 22 22 100

250 22 27 120

300 22 32 140

350 22 37 160

400 22 42 180

450 22 47 200

500 22 52 220

fix insert3 gas deposit 50 2 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert4 gas deposit 50 0 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

fix rec2 all ave/time 1 1 50 v_ngas v_nC1 v_nC4 ave one file real2.txt

run 500

the result for the above case was,

(real2.txt)

Time-averaged data for fix rec2

TimeStep v_ngas v_nC1 v_nC4

500 22 52 220
550 47 52 220
600 72 52 220
650 97 52 220
700 122 52 220
750 147 52 220
800 172 52 220
850 185 52 220
900 202 52 220
950 207 52 220
1000 212 52 220

In the first case, nC1 and nC4 increase as the new particles are added but ngas does not and the case 2 is opposite.
Of course, I tried to make them group after these RUNs but they are not grouped into new groups except the group in the Fix Deposit command.
I attached my files and would appreciate any comment.

Seunghwan Baek

C4_bulk_2000_10.txt (2.24 KB)

C4H10.txt (720 Bytes)

CH4.txt (207 Bytes)

test.in (1.85 KB)

Dear all,

I am trying to add some molecules with fix deposit. (version of 30Jul2016)

Adding was processed well but after it, there is an issue related to
grouping.

​not really. LAMMPS is behaving as documented.​

​[...]​

fix insert1 C1 deposit 50 2 10 ${seed} region mainroom near 5 id max

attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert2 C4 deposit 50 0 10 ${seed} region mainroom near 5 id max
attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

​here deposited atoms are added to the fix groups.​

​[...]

fix insert3 gas deposit 50 2 10 ${seed} region mainroom near 5 id max
attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert4 gas deposit 50 0 10 ${seed} region mainroom near 5
id max attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

​and here deposited atoms are added to the respective fix groups as well.​

​[...]​

In the first case, nC1 and nC4 increase as the new particles are added but
ngas does not and the case 2 is opposite.

​this is the expected behavior. groups in LAMMPS are static and they are
evaluated at the time they are defined.
if you want the "gas" group in the first case to be updated as well with
the deposition, you have to define it as a dyn​amic group. for more
details, please consult the documentation.

axel.

Thank you for the rapid advice, Dr. Axel

I have tested according to your advice and want you to read the below with more patience,

group gas type 1 2 3

group C4 type 1 2

group C1 type 3

variable ngas equal count(gas)

variable nC1 equal count(C1)

variable nC4 equal count(C4)

fix test gas nvt temp $t $t 10

fix_modify test temp mdtemp

***1) I added a dynamic group of the group gas, which is called dyngas below,

group dyngas dynamic gas every 1

variable ndyngas equal count(dyngas)

fix insert1 C1 deposit 50 2 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert2 C4 deposit 50 0 10 ${seed} region mainroom near 5 id max attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

***2) I made a new group including type 1 2 3 below,

group 2ndgas type 1 2 3

variable n2ndgas equal count(2ndgas)

fix rec1 all ave/time 1 1 50 v_ngas v_nC1 v_nC4 v_n2ndgas v_ndyngas ave one file real1.txt

timestep 0.001

run 500

The result (in real1.txt) is shown below,

Time-averaged data for fix rec1

TimeStep v_ngas v_nC1 v_nC4 v_n2ndgas v_ndyngas

0 22 2 20 22 22
50 22 7 40 22 22
100 22 12 60 22 22
150 22 17 80 22 22
200 22 22 100 22 22
250 22 27 120 22 22
300 22 32 140 22 22
350 22 37 160 22 22
400 22 42 180 22 22
450 22 47 200 22 22
500 22 52 220 22 22

v_ndyngas gives the same result to v_ngas.
v_n2ndgas does not include newly added particles with type 1 2 3 as I mentioned in the previous email,

“I tried to make them group after these RUNs but they are not grouped into new groups except the group in the Fix Deposit command.”

When I used the command, GCMC, the group defined prior to the gcmc command includes newly added particles even though the group was static.

Any comment would be grateful.
S. Baek

Thank you for the rapid advice, Dr. Axel

I have tested according to your advice and want you to read the below with
more patience,

​you need to read the documentation with more patience. again, the behavior
you describe is as documented.

group gas type 1 2 3

group C4 type 1 2

group C1 type 3

variable ngas equal count(gas)

variable nC1 equal count(C1)

variable nC4 equal count(C4)

fix test gas nvt temp $t $t 10

fix_modify test temp mdtemp

****1) I added a dynamic group of the group gas, which is called
dyngas below,*

group dyngas dynamic gas every 1

variable ndyngas equal count(dyngas)

fix insert1 C1 deposit 50 2 10 ${seed} region mainroom near 5 id max
attempt 100000 mol molC1 vx -2 2 vy -2 2 vz -2 2 units box

fix insert2 C4 deposit 50 0 10 ${seed} region mainroom near 5 id max
attempt 100000 mol molC4 vx -2 2 vy -2 2 vz -2 2 units box

****2) I made a new group including type 1 2 3 below,*

group 2ndgas type 1 2 3

variable n2ndgas equal count(2ndgas)

fix rec1 all ave/time 1 1 50 v_ngas v_nC1 v_nC4 v_n2ndgas
v_ndyngas ave one file real1.txt

timestep 0.001

run 500

The result (in real1.txt) is shown below,
# Time-averaged data for fix rec1
# TimeStep v_ngas v_nC1 v_nC4 v_n2ndgas v_ndyngas
0 22 2 20 22 22
50 22 7 40 22 22
100 22 12 60 22 22
150 22 17 80 22 22
200 22 22 100 22 22
250 22 27 120 22 22
300 22 32 140 22 22
350 22 37 160 22 22
400 22 42 180 22 22
450 22 47 200 22 22
500 22 52 220 22 22

v_ndyngas gives the same result to v_ngas.
v_n2ndgas does not include newly added particles with type 1 2 3 as I
mentioned in the previous email,
"I tried to make them group after these RUNs but they are not grouped into
new groups except the group in the Fix Deposit command."

When I used the command, GCMC, the group defined prior to the gcmc command
includes newly added particles even though the group was static.

​which is true for the C1 and C4 groups as well.​

Any comment would be grateful.

​please study the documentation more carefully.

axel.​