Skip to content

Add forward vs adjoint flux comparison to FW-CADIS task#473

Merged
shimwell merged 2 commits into
mainfrom
fw-cadis-forward-adjoint-flux
Jul 1, 2026
Merged

Add forward vs adjoint flux comparison to FW-CADIS task#473
shimwell merged 2 commits into
mainfrom
fw-cadis-forward-adjoint-flux

Conversation

@jon-proximafusion

Copy link
Copy Markdown
Collaborator

What

Adds a forward vs adjoint flux comparison to tasks/task_14_variance_reduction/5_shielded_room_fw_cadis.ipynb.

The notebook previously plotted only the FW-CADIS weight windows and left a placeholder markdown cell for plotting the flux. This change:

  • attaches the mesh flux tally to the random ray model so that both the forward and the adjoint solve record it;
  • adds a side by side plot of the forward flux (where neutrons actually go) and the adjoint flux (neutron importance), read from the forward and adjoint statepoints produced by the single FW-CADIS run;
  • expands the surrounding text to explain what each flux represents, why the random ray solver runs a forward pass before the adjoint pass, and how the weight windows relate to the adjoint flux.

Why

Seeing the forward and adjoint flux together is the clearest way to build intuition for FW-CADIS: the forward flux collapses by orders of magnitude into the shield (which is why an analog run starves those regions), while the adjoint flux is highest in exactly those hard to reach regions, and the weight windows follow the adjoint importance.

Note

The forward solve statepoint is read from statepoint.forward.<batch>.h5. This relies on OpenMC writing the forward solve output during an adjoint (FW-CADIS) random ray run, so the notebook needs a recent OpenMC.

The FW-CADIS notebook previously only plotted the adjoint-derived weight
windows and left a placeholder markdown cell for plotting the flux. This
attaches the mesh flux tally to the random ray model so that both the forward
and adjoint solves record it, then adds a side by side plot of the forward flux
and the adjoint (importance) flux, read from the forward and adjoint
statepoints written by the single FW-CADIS run.

The surrounding text is expanded to explain what each flux represents, why the
random ray solver runs a forward pass before the adjoint pass, and how the
weight windows relate to the adjoint flux.
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@shimwell shimwell merged commit 4e32e81 into main Jul 1, 2026
1 of 2 checks passed
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.

2 participants