question regarding group dynamic

Dear developers,

I am trying to use the command - group with dynamic region and have questions.

My system has two walls in x-direction and particles between them. While moving one of walls, I want to keep track of all particles with dynamic region keyword.

I am using the version of 30Jul2016.

The result is,

(v_ngas : number of particles defined by the type, v_nbulk : number of particles defined by group - dynamic - region)

(v_locpis3 : location of moving wall - x direction, v_piston : xhi of the region which is used in group-dynamic-region)

Time-averaged data for fix record_3

TimeStep c_mdtemp v_allpress v_allpress2 v_ngas v_nbulk v_locpis3 v_piston

0 379.295 159.573 322.344 702 702 49.9991 49.999

1000 372.641 169.695 336.07 702 702 51.0011 50.999

2000 372.019 155.715 298.871 702 699 52.0011 51.999

3000 369.721 140.362 264.055 702 697 53.0011 52.999

4000 353.437 151.541 271.718 702 683 54.0011 53.999

5000 349.328 119.439 202.502 702 668 55.0011 54.999

Log file has only warning,

WARNING: One or more dynamic groups may not be updated at correct point in timestep (…/fix_group.cpp:149).

v_ngas and v_nbulk are supposed to be same if it works. I need your help.

Baek

log.lammps (8.39 KB)

press.realtime.txt (2.68 KB)

test.in (3.38 KB)

test_data.txt (136 KB)

Did you read the doc page about the error message? (Section_errors.html)

“If there are other fixes that act immediately after the intitial stage
of time integration within a timestep (i.e. after atoms move), then
the command that sets up the dynamic group should appear after those
fixes. This will insure that dynamic group assignements are made
after all atoms have moved.”

If you reorder your fixes so the warning disappears, then maybe

that will fix it. Assuming you are updating the group assignments

every timestep, or at least every 1000 steps to match your thermo

output.

Steve

Thanks, Steve

Yes, I read the doc page. Still, confused with “reodering”.

What I understood according to the doc is that I need to put the command group-dynamic-region after fix-nvt or fix-nve. But it did not work and I doubt that there is another effective location I can put in the file. Also, changing into every 1000 cycles did not, either --> I accepted your advice as I should use the number more than 1000 for the command, group-dynamic region.

I would appreciate your further help.

Below is the part of the input file I attached.

fix 1 gas nvt temp $t $t 25

fix_modify 1 temp mdtemp

variable velpiston equal 1.0

velocity wall2 set v_velpiston 0.0 0.0 units box

fix enepiston wall2 nve

fix setforce wall2 setforce 0.0 0.0 0.0

variable ttime equal time

variable piston equal v_velpiston*(v_ttime-0.001*5000)+49.999

variable bulkvol equal (v_piston-{rxlo})*({ryhi}-{rylo})*({rzhi}-${rzlo})

region newbulk block {rxlo} {piston} {rylo} {ryhi} {rzlo} {rzhi} units box side in

group bulkgas dynamic gas region newbulk every 1000

variable pistonad equal v_piston+0.0001

fix wallright wall2 wall/reflect xlo v_pistonad units box

variable ngas equal count(gas)

variable nbulk equal count(bulkgas)

compute allperatom2 bulkgas stress/atom NULL

compute allp2 bulkgas reduce sum c_allperatom2[1] c_allperatom2[2] c_allperatom2[3]

variable allpress2 equal -(c_allp2[1]+c_allp2[2]+c_allp2[3])/(3*v_bulkvol)

compute locpis wall2 property/atom x

compute locpis2 wall2 reduce ave c_locpis

variable locpis3 equal c_locpis2

compute velpis wall2 property/atom vx

compute velpis2 wall2 reduce ave c_velpis

variable velpis3 equal c_velpis2

fix record_3 gas ave/time 1 1 100 c_mdtemp v_allpress v_allpress2 v_ngas v_nbulk v_locpis3 v_piston ave one file press.realtime

thermo_style custom step c_mdtemp v_allpress2 v_ngas v_nbulk

thermo_modify format float %12.10g

thermo 5000

timestep 0.001

run 50000