Filter track file depending if a particle scored in a tally

Hello
I’m working on a filter for tracks file : I would like to filter tracks depending if a particle participate to score in a tally or not.

To do this, I need to know the particle’s IDs which participate to score in the tally. Is there a way to extract this information ?

For the moment, I can’t find this information in the documentation or in code source, I’ll keep searching but if someone have an idea it’s better :slight_smile:

Best regards

Julien

Hi Julien – there’s no easy way to determine which particles scored to a tally in general. However, depending on the specific tally, you may be able to get at that information. For example, if you have a tally with a cell filter specifying a particular cell, you could extract tracks that appear in that cell. See the example use of the filter method on openmc.Track here.

Hello Paul,

Thank you for your answer. I understand now, documentation and your example are clear, thanks :slight_smile: with your solution I can reach particles inside a cell, however they are going to both interact and not interact (reaction rate for example) with the associated material… I’m interested here only with particles that interact.

I’ve thought and here is a few reflexions about that. Moreover, some developments which could increase OPENMC capabilities need these informations. For example : IFP for effective kinetics parameters based on neutron importance, green functions, kij fission probability matrix, adjoint flux based on neutron importance,…

Like you said Paul, for the moment it is complex to get these informations, but a few points seems to show that additional developments (mainly cpp, and a little of python) are not so heavy. Indeed, currently :

  • If there is a problem with a particle track (overlapping for example), an h5 file is created with particle’s informations… I deduce that during simulation, for a given event, I can reach these informations. Looking at source code, they are reachable using particle object.
  • A ID attribute for a particle object can be reached using id() method
  • The tracks record allowed by the track option permit to follow and to store the track of few or all particles for a given batch. Born and death (scattering also) informations for a particle are so available during a batch.
  • During tallies filter tests : if a condition is complete there are tests to determine and ponderate tally with weight of each particle. I deduce that I can reach particle informations during tally testing.

Finally, the aim is : if a user chooses a « record option » in tally settings, tally algorithms are going to keep the particle informations for the tallies specified ==> in both tallies.out and tallies.h5 for each one, a list of particle’s IDs which participate to score will be add. In addition, tracks associated to these particles will be recorded and added in tracks.h5. Then, with post-treatment, user will be able to get especially both born and death informations.

An important point to bear in mind : it needs to be sure that ID particle aren’t reseted for each batch. I will ensure that in source code.

Actually, 2 possible solutions:

  • store during simulation all the particles informations,
  • store ID particles, and record associated tracks.
    Like I said before, I will code the second option because it seems to be easier and maybe with a lighter RAM need. But later for IFP calculations (for example), first solution could be required.

I am going to develop and test it : if I succeed I’d propose you a PR. I can’t garante to succeed and a deadline, but I will try to produce that by the end of 2022.

Hi Julien, I’ve recently been developing the IFP method in OpenMC, similar to the first solution you described. The code is now complete, but there are some areas I’m uncertain about. Would it be possible to discuss and exchange ideas with you?

Hi @Jason_Chen

The IFP code you developed, is it applicable to problems without fissile/fertile materials? Where fission neutrons aren’t produced? If yes, I would be interested in having the development in my openmc version.