Skip to content

Conversation

@eitan-weinstein
Copy link
Contributor

@eitan-weinstein eitan-weinstein commented Jan 5, 2026

Closes #200.
Closes #201.

This PR introduces some minor changes to the ALARA source code to calculate the initial number densities of the nuclides contained in the initial material compositions provided by the input file. Other response variables are also tracked at this pre-irradiation "time" (which is not strictly a singular time on the axis of cooling times, where shutdown would still correspond to t=0, but rather the static state before any neutron irradiation).

In response to these changes in the format of ALARA's output tables, updates are also made to processing and plotting modules in tools/alara_output_processing/ to both handle necessary data formatting adjustments (such as defining an imagined time of -1 for the pre-irradiation state to be able to filter times numerically still, even for an unconventional time metric like this), as well as implementations for appropriate physical plots (such as mandating that negative times are not included in time plots).

An interesting thing that I found when verifying my work to make sure that my methods were handling these calculations correctly was in looking at the increase in number density for each element in single element irradiation simulations run within ALARAJOYWrapper/alarajoy_QA_notebook.ipynb. Here are two plots of the percentage increase in total number density after irradiation as compared to the initial number density vs atomic number, for all elements with activation data in FENDL2:

% Increase in Number Density vs  Atomic Number % Increase in Number Density vs  Atomic Number (Li - Bi)

Some notes and observations:

  • Most elements exhibit some small percentage increase in number density after being irradiated, though the specific values are a function of the simulation parameters and neutron flux file, so could plausibly be higher for other geometries or neutron fluxes. During cooling, of course, total number density stays constant, but the provided neutron flux more or less consistently increases number density by a small fraction of a percent for most elements.
  • Hydrogen and helium have no increase in total number density, whereas there is a weak correlation for a negative exponential relationship between percentage increase and number density against atomic number in elements with stable isotopes that are heavier than the light gases (Li - Bi). My thinking is that this is due to the relative contribution of light gas production in lighter elements (seen especially clearly in the outlier of boron). That is, only gas producing reactions are changing the actual total number density in terms of new atoms existing in the system, and the relative contribution of gas producing reactions for light elements is higher for light elements than heavy elements (i.e. the shutdown number density from light gases for boron is one order of magnitude smaller than boron isotopes themselves, whereas for iron, the new gas number density is two orders of magnitude lower than iron isotopes).

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

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

I think this all looks OK. I am not sure if there is a reason you chose to store this all in atoms/kg rather than atoms/cm3.

I think this is another opportunity to think about breaking things like this up into more PRs. I guess there is a desire to make sure things don't break due to one PR. That may be a motivation for a feature branch, with individual PRs into that feature branch.

Comment on lines +400 to +408
double density = ptr->totalDensity; // g/cm^3

// Calculate number density in atoms/kg
double nd_per_kg = 0.0;
if (density > 0.0)
nd_per_kg = nd_cm3 * 1e3 / density; // atoms/kg

// Store the pre-irradiation ND in this root
root->setPreIrradND(ptr, nd_per_kg);
Copy link
Member

Choose a reason for hiding this comment

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

I think it's probably OK to store it in atoms/cm3 and not convert to atoms/kg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if I agree with that. Having made the change and testing it over all of the elements again, I'm seeing a 3-4 order of magnitude lower value in the pre-irradiation number densities as compared with the shutdown total number densities. I don't think that result is explainable from the physical response to the neutron flux just given the sheer order of magnitude change, but rather that it would not be computing the right value at all (see the comparison in the two charts below, with the first being the current code, the second being the code that would store it in atoms/cm3):

% Increase in Number Density vs  Atomic Number (Li - Bi) (1) % Increase in Number Density vs  Atomic Number (Li - Bi) (2) c7a-d14f-4bd4-8410-ba667072bdda" />

I put both with a log scale for the vertical axis for easier visualization.

Copy link
Member

@gonuke gonuke Jan 10, 2026

Choose a reason for hiding this comment

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

I think this just means we need to be more careful with which units we are comparing/recording. It shouldn't matter what units we use, if everything is consistent. My suggestion to use atoms/cm3 is just that this is a more common/natural unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code in the output processing to identify the initial nuclides Modify ALARA to give some indication of initial nuclides

2 participants