Skip to content

Conversation

@ChasingNeutrons
Copy link
Collaborator

This adds a non-standard tally which records individual events. This can be used for, e.g., detector modelling. It does not use scoreMemory, but instead keeps a record of all events and periodically outputs them to a file.

This could be improved with a change to the tally interface or the particle to send information about the colliding nuclide to the tally.

Future complementary developments might include more analogue features in the collisions, e.g., more physical multiplicity models and fission neutron correlations.

If this looks good I will write some tests.

Added in the BEAVRS model with the D-bank partially inserted. Also fixed
a flaw in the geometry where the outermost cell was defined such that
there could be a rare particle lost between it and the geometry
boundary.
Records events in a given region of phase space.
Copy link
Member

@valeriaRaffuzzi valeriaRaffuzzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very nice, will be cool to have! Just minor comments and questions

NS3 { type simpleCell; id 12; surfaces (-4 5 -10 11); filltype mat; material SS304;}
NS4 { type simpleCell; id 13; surfaces (-4 5 10 -11); filltype mat; material SS304;}

<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damn BEAVRS!!! It's everywhere

factor rather than an integer due to constraints on the dictionary.
- freq (*optional*): an integer determining how often events are written to the file.
More often will incur more parallel overhead, less often will incur a larger memory
footprint. Set to 500k by default.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an estimate for the memory overhead of these input, i.e., 500k, and how big a file is with 10M events?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about 960MB with these settings. I have now included it in the docs.

associate(ev => self % scores(:,id))


! Open the file and append the event info
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe giving the option to write a binary rather than ascii might be useful, according to the application. It's easy enough in fortran, I think you just need to add access='stream'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added an option to write a binary output, but this will require creating some sort of post-processing script in the future.



! Open the file and append the event info
open(newunit=u, file=trim(self % outputFile), status='unknown', &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are either creating the file or opening it, right? Is append happy with either?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems to be. I think the status='unknown' and append both allow me to get away with it.

! Collision info
real(defFlt) :: Edeposit
integer(shortInt) :: MT
!integer(shortInt) :: ZAID ! Don't yet have available data in interface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this would be a hassle but not a massive one: might be worth it! It would take adding the ZAID to collDat in the collisionProcessor, and modifying the interface of reportOutColl.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question here is maybe deciding what to do for MG. Let me make an issue and we can add that easily enough if needs be.

!!
!! Send events in a thread's bank to a binary output file
!!
subroutine outputScoresBinary(self, id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to be annoying but this could have been done more compactly: the only difference between procedures is access. It could have been one function called outputScores (noting that form = 'unformatted' is default):

if (self % binary):
accessType = 'stream'
else
accessType = 'sequential'
end if

open(newunit=u, file=trim(self % outputFile), status='unknown', &
access=accessType, position='append', &
action='write', iostat=ios)

Copy link
Member

@valeriaRaffuzzi valeriaRaffuzzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicer and compact now, looks good to me!

@valeriaRaffuzzi valeriaRaffuzzi merged commit 2831d8c into CambridgeNuclear:main Dec 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants