SPARTA WWW Site - SPARTA Documentation - SPARTA Commands

compute reaction/tally command

Syntax:

compute ID reaction/tally group-ID mix-ID value1 value2 ... 

Examples:

compute 1 reaction/tally all all id/pre id/post id/post2 type/pre type/post type/post2 id/surf time xc yc zc 

This command will dump the tallies in the previous command to a dump file every 10 steps:

dump 1 tally all 10 tmp.tally c_1[*] 

Description:

Tally various values for each gas-phase reaction of two particles during the current timestep. Only gas collisions which result in a chemical reactions are tallied by this command, as enabled by the react command. See the related compute gas/collide/tally command to tally collisions which do not induce reactions. It provides different tally value options than this compute.

Only collisions within grid cells in the grid group specified by group-ID and pairs of particles with both species in the mixture specified by mix-ID are included. See the group grid command for info on how grid cells can be assigned to grid groups.

The results of this compute can be used by different commands in different ways. The values for a single timestep can be output by the dump tally command. Currently this is the only option for accessing the tallied values.

Note that if a gas-phase reaction takes place then a collision of two particles can result in 1, 2, or 3 particles being produced. The species of the 1, 2, or product particles may be different than the species of the reactants. All of these attributes can be tallied using the values explained next.


The reaction value is the index of which reaction occurred. It is a number from 1 to N, where N is the number of reactions defined by the react command.

The id1/pre and id2/pre values are the IDs of the reacting particles before the reaction. Note that particle IDs are generated randomly. Thus multiple particles in the system can potentially have the same ID. See Section 6.17 for more details on particle IDs.

The id1/post, id2/post, and id3/post values are the post-reaction IDs of the 1, 2, or 3 resulting particles. If one of the particles vanished in the reaction, then id2/post will be 0. If id3/post is 0, no 3rd particle was created by the reaction, otherwise it is the random ID assigned to the newly created particle.

The type1/pre and type2/pre value are the integer indices for the species of the reacting particles before the reaction. They are values from 1 to Nspecies. The values correspond to the order in which species were defined via the species command. See Section 6.17 for more details on particle types.

The type1/post, type/post2, and type/post3 values are the post-collision integer indices for the particle species of the 0, 1, or 2 resulting particles. If one of the particles vanished in the reaction, then type2/post will be 0. If type/post3 is 0, no 3rd particle was created by the reaction, otherwise it is the species index of the newly created particle.

The values starting with v for particles 1 and 2 with a pre suffix are the velocity components of the two reacting particles before the reaction.

The values starting with v for particles 1 and 2 and 3 with a post suffix are the velocity components of the 1, 2, or 3 resulting particles after the reaction. Velocity components will be zero if the 2nd or 3rd particle does not exist due to the reaction.


Output info:

This compute calculates a per-tally array, with the number of columns equal to the number of values.

The array can be accessed by any command that uses per-tally values from a compute as input. See Section 6.4 for an overview of SPARTA output options.

The per-tally array values will be in the units appropriate to the individual values as described above. All the velocity components are in velocity units.


Restrictions: none

Related commands:

compute gas/collision/tally, dump tally

Default: none