Skip to content

add raw activator for quicker runs#41

Open
jbae11 wants to merge 1 commit intomainfrom
raw
Open

add raw activator for quicker runs#41
jbae11 wants to merge 1 commit intomainfrom
raw

Conversation

@jbae11
Copy link
Owner

@jbae11 jbae11 commented Mar 2, 2026

This PR attempts to accelerate depletion runs by:

  1. removing superfluous steps associated with OpenMC API (e.g., creating material, reading hdf5 output, checking same values multiples times)
  2. Vectorizing time consuming processes (e.g., getting microxs from multigroup flux)

Because this is a less elegant (in terms of code writing) approach, a new file is created instead of overwritting the existing openmc_activator.py

On my MacBook Pro, it took me 127 mintues wall clock time using the previous method, and now it takes ~7 mintues. YMMV, do let me know.

The input/output call is the same, so to test this, just change the first cell in the compare.ipynb notebook:

from openmc_activator import OpenmcActivator, write_markdown_file, read_experimental_data

to:

from openmc_activator_raw import OpenmcActivator, write_markdown_file, read_experimental_data

@jbae11 jbae11 self-assigned this Mar 2, 2026
@jbae11 jbae11 requested a review from shimwell March 2, 2026 15:12
@yrrepy
Copy link

yrrepy commented Mar 14, 2026

Hello, me again!

Took a browse:

    # no negative numbers please 
    atom_arrs[atom_arrs < 0] = 0.0
    return atom_arrs

I am also encountering negative atom densities, which I want to purge.
I have this which I am just about ready to PR into OpenMC
(https://github.com/yrrepy/openmc/tree/CRAM_clip-neg-atoms)

My solution:
https://github.com/yrrepy/openmc/blob/CRAM_clip-neg-atoms/openmc/deplete/abc.py#L747:~:text=nuclides&text=clip%5Fnegative%5Fdensities&text=clip&text=False%2C-,clip%5Fnegative%5Fdensities&text=self%2Eclip%5Fnegative%5Fdensities&text=clip%5Fnegative%5Fdensities,-self&text=if-,self%2Eclip%5Fnegative%5Fdensities

Demo:
demo.py

Side-bar:
This may also be a convenient location to purge results below X atoms/bn-cm (e.g. ala Origen-MSX default 1e-20). Though currently I do this myself after, in the depletion_results.h5 file and do it in a sweep over all timesteps of a nuclide.

I might attack CRAM sub-steps next to further improve oscillations etc.

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