Compute heat/flux for small groups

Dear LAMMPS users and developers,

I am trying to calculate heat flux vector in different groups in my simulation sample. I divided the box to different groups and did the ke/atom, pe/atom and stress/atom computes for all the atoms and did the heat/flux for each of the groups.

1 - Is this procedure is correct or I need to do the pe, ke and stress for each group? (I know it slows down the simulation and a little confused when reading the documentation which way is correct).

2- When I have some groups with 0 atoms inside, LAMMPS still calculates a flux for that.

I appreciate your valuable time and thank you in advance for your help.

Best,
Morteza

Dear LAMMPS users and developers,

I am trying to calculate heat flux vector in different groups in my
simulation sample. I divided the box to different groups and did the
ke/atom, pe/atom and stress/atom computes for all the atoms and did the
heat/flux for each of the groups.

1 - Is this procedure is correct or I need to do the pe, ke and stress for
each group? (I know it slows down the simulation and a little confused when
reading the documentation which way is correct).

indeed, neither the documentation, nor the code seem to make any
checks for this.
however, for as long as the group used in the compute is a superset of
the group used in the heat/flux compute, there should not be a
problem. the corresponding computes don't do any computation by
themselves, but simply make already computed data accessible (and
trigger that it is been accumulated). so passing computes for group
"all" should work.

2- When I have some groups with 0 atoms inside, LAMMPS still calculates a
flux for that.

for groups without atoms the value of the various J vector components
are going to be zero. no atoms, no flux. :wink:

axel.

I’ll add a clarification note to the compute heat/flux doc page.

The command only computes and sums the per-atom heat flux

in its equation for atoms in the specified group. it relies

on the lower-level computes (stress, pe, ke) to provide those

values. So if they don’t (because you used a more restrictive
group in those comands), you messed up.

Steve

Dear Axel and Steve,

Thank you very much for your response. I do not know why, but I am getting non-zero numbers for groups with zero atoms in them. I am still working on that problem. I might doing something wrong.

Best,
Morteza