Skip to content

Temperature and density fields#173

Merged
valeriaRaffuzzi merged 37 commits intoCambridgeNuclear:mainfrom
ChasingNeutrons:temp_and_density_fields
Mar 1, 2026
Merged

Temperature and density fields#173
valeriaRaffuzzi merged 37 commits intoCambridgeNuclear:mainfrom
ChasingNeutrons:temp_and_density_fields

Conversation

@ChasingNeutrons
Copy link
Collaborator

Using the pieceConstantField, I have added the capability to super-impose temperature and density-scaling fields on the geometry. Both surface and delta tracking agree with each other for temperature and density changes, and they agree with reference calculations without imposed fields.

The distance calculations are done inside move. They work well for the most part, with one uncomfortable bit: fuzziness needed to be added to ensure that distance to the field does not take precedence over distance to the boundary. If there are any better suggestions for this it would be great.

This necessitated make the initMajorant function part of the nuclearDatabase, allowing it to be called in the physicsPackages which can receive the relevant field information from geometry.

I have updated the docs and added an integration test to geometry for obtaining values from the fields and distance calculations.

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.
Field which have values that are piecewise constant. Endowed with a
distance calculation. Added a simple version which allows a lattice to
be specified.
Can overlay temperature and density fields on the geometry. Supports
both surface and delta tracking.
@ChasingNeutrons
Copy link
Collaborator Author

I have also added a new map to allow tallying on a given field definition. Currently this is limited to pieceConstantFields until we unify the interface.

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.

That was a lot!!!! The nuclear data bit seemed to make sense but I have to admit it will be good to give it another look post revisions.

There are a couple of bigger issues that I wrote in specific comments, but in general it looks good! It was a massive effort so well done.



! This check is really awful - can we do something better?
else if (fieldDist < dist .and. abs(fieldDist - dist) > 10*NUDGE) then ! Stays within the same cell, but crosses field boundary
Copy link
Member

Choose a reason for hiding this comment

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

Can't you just do
else if (maxDist < dist .and. maxDist >= fieldDist)?
in this case you're not crossing any geometrical boundary but a field boundary.

@ChasingNeutrons
Copy link
Collaborator Author

Made some changes to this:

  1. I removed the fieldMap. It is unnecessary just for the moment and I don't think I had a good idea of how it would be used just yet. It might require a few more changes to fields to make it work well.
  2. I made the temperature and density fields much more like other fields, i.e., they are kept in the geometry registry, not in the geometry. This was just my ignorance before. I think this is much neater. I made some small changes to the registry to improve performance for these fields, because the character map can have a bit of overhead.

Otherwise, I think I have addressed most of the comments.

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.

All good to merge! Excited to have multi-physics coupling soon!

@valeriaRaffuzzi valeriaRaffuzzi merged commit 91da9e1 into CambridgeNuclear:main Mar 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants