Dynamic Group Not Possible?

Hi everyone,

I’m have a system that deposits CO2 and Methane molecules on the surface of a substrate. I would like to calculate the temperature from the CO2 and Methane and also only time-evolve the CO2 and methane. The initial thought is to put them in the same dynamic group, populated by being specified as the group-id in the fix deposit commands. However, that makes it not possible to create different groups for the CO2 and the methane, which is need so that I can specify the CO2 as a rigid body. A simplified script is copied at the end of this message.

I guess the fundamental question is: Is it possible to have two ‘fix deposit’ commands deposit atoms which are somehow placed in three groups: one which is CO2, one which is methane, and one which is both? There is a commented line in the code which defines a compute called ‘t’ (type) and a variable called ‘tads’ (type adsorbate). I thought this would work, but it outputs the following error:

ERROR: Compute used in variable between runs is not current

Which, according to the user list and google, is because the simulation hasn’t been ‘run’ at all yet.

Any suggestions for how to accomplish this are greatly appreciated! Again, the criteria are: temperature should be calculated using CO2 and methane and CO2 should be held rigid.



Simulate mix of CH4 and CO2 on Graphene

#Set up units
units lj
atom_style full
atom_modify sort 1000 2.5
boundary p p f

Read CO2

molecule 1 Conf/CO2.molecule

Create spawn points

region co2_spawn block EDGE 6 EDGE EDGE 20 23 #system has lz = 25
region methane_spawn block 6 EDGE EDGE EDGE 20 23

#Define masses
mass 1 12.0107 #type 1 is carbon
mass 2 15.9994 #type 2 is oxygen
mass 3 16.0107 #type 3 is methane, weight of carbon + 4 hydrogens

Define interactions, normalized with carbon

pair_style lj/cut/coul/cut 2.5 2.5
pair_coeff 1 1 1 1
pair_coeff 1 2 1.67170954254 1.03571428571
pair_coeff 1 3 2.23230037924 1.16071428571
pair_coeff 2 2 2.79461279461 1.07142857143
pair_coeff 2 3 3.73175784579 1.19642857143
pair_coeff 3 3 4.98316498316 1.32142857143

bond_style harmonic
bond_coeff 1 5.0 1 #todo change
special_bonds lj/coul 0 0 0

angle_style harmonic
angle_coeff 1 5.0 180 #todo change

fix wall all wall/lj93 zhi EDGE 1 1 2.5

Computes for groups

#compute t all property/atom type
#variable tads atom c_t==1||c_t==2||c_t==3


#group methane type 3 #treat methane as single particle
#group co2 molecule 1 #dynamic adsorbate var tads
group adsorbate type 3

thermo_modify temp adsTemp
thermo 1000

Apply system fixes

fix rig co2 rigid/nve/small molecule mol 1
fix dep adsorbate deposit 50 0 1000 755 mol 1 vz -.5 -1.5 rigid rig &
region co2_spawn
fix dep2 adsorbate deposit 50 3 1000 755 vz -.5 -1.5 &
region methane_spawn
fix 1 adsorbate nve

run 100000

Are you sure this is your full script? It seems to me that adsTemp is not defined anywhere? This would in turn make it impossible for thermo to compute any temperature, as the compute does not exist?

Thanks for the reply. You’re correct, when simplifying the script, I accidentally left off the piece that defines that! I’ve added the following lines back in:

Can you please also attach your data file and molecule template? It is easier to see whats going on with an example that runs. :wink:

Attached is the CO2 file. The graphene file is unimportant other than actually creating the simulation box, so I have attached a version of it with a single atom, just to save space :wink:

Thanks again!


This data file is no good. Just send the ones you used when the error occured… With this one there is a “Masses not set” error so there is something still missing.