openmc.deplete
– Depletion¶
Primary API¶
The two primary requirements to perform depletion with openmc.deplete
are:
A transport operator
A timeintegration scheme
The former is responsible for calculating and retaining important information
required for depletion. The most common examples are reaction rates and power
normalization data. The latter is responsible for projecting reaction rates and
compositions forward in calendar time across some step size \(\Delta t\),
and obtaining new compositions given a power or power density. The
CoupledOperator
class is provided to obtain reaction rates via tallies
through OpenMC’s transport solver, and the IndependentOperator
class is
provided to obtain reaction rates from crosssection data. Several classes are
provided that implement different timeintegration algorithms for depletion
calculations, which are described in detail in Colin Josey’s thesis,
Development and analysis of high order neutron transportdepletion coupling
algorithms.
Deplete using a firstorder predictor algorithm. 

Deplete using the CE/CM algorithm. 

Deplete using the CE/LI CFQ4 algorithm. 

Deplete using the CF4 algorithm. 

Deplete using the EPCRK4 algorithm. 

Deplete using the LE/QI CFQ4 algorithm. 

Deplete using the SICE/LI CFQ4 algorithm. 

Deplete using the SILE/QI CFQ4 algorithm. 
Each of these classes expects a “transport operator” to be passed. OpenMC provides the following transport operator classes:
Transportcoupled transport operator. 

Transportindependent transport operator that uses onegroup cross sections to calculate reaction rates. 
The CoupledOperator
and IndependentOperator
classes must also
have some knowledge of how nuclides transmute and decay. This is handled by the
Chain
class.
The IndependentOperator
class requires a set of fluxes and microscopic
cross sections. The following function can be used to generate this information:
Generate a microscopic cross sections and flux from a Model 
Minimal Example¶
A minimal example for performing depletion would be:
>>> import openmc
>>> import openmc.deplete
>>> geometry = openmc.Geometry.from_xml()
>>> settings = openmc.Settings.from_xml()
>>> model = openmc.model.Model(geometry, settings)
# Representation of a depletion chain
>>> chain_file = "chain_casl.xml"
>>> operator = openmc.deplete.CoupledOperator(
... model, chain_file)
# Set up 5 time steps of one day each
>>> dt = [24 * 60 * 60] * 5
>>> power = 1e6 # constant power of 1 MW
# Deplete using midpoint predictorcorrector
>>> cecm = openmc.deplete.CECMIntegrator(
... operator, dt, power)
>>> cecm.integrate()
Internal Classes and Functions¶
When running in parallel using mpi4py, the MPI intercommunicator used can
be changed by modifying the following module variable. If it is not explicitly
modified, it defaults to mpi4py.MPI.COMM_WORLD
.
 openmc.deplete.comm¶
MPI intercommunicator used to call OpenMC library
 Type
mpi4py.MPI.Comm
During a depletion calculation, the depletion chain, reaction rates, and number densities are managed through a series of internal classes that are not normally visible to a user. However, should you find yourself wondering about these classes (e.g., if you want to know what decay modes or reactions are present in a depletion chain), they are documented here. The following classes store data for a depletion chain:
Full representation of a depletion chain. 

Decay mode information 

Decay modes, reactions, and fission yields for a single nuclide. 

Transmutation reaction information 

Energydependent fission product yields for a single nuclide 

Mapping for fission yields of a parent at a specific energy 
The Chain
class uses information from the following module variable:
 chain.REACTIONS¶
Dictionary that maps transmutation reaction names to information needed when a chain is being generated: MT values, the change in atomic/mass numbers resulting from the reaction, and what secondaries are produced.
 Type
The following classes are used during a depletion simulation and store auxiliary data, such as number densities and reaction rates for each material.
Stores local material compositions (atoms of each nuclide). 

Microscopic cross section data for use in transportindependent depletion. 

Result of applying transport operator 

Reaction rates resulting from a transport operator call 

Results from a depletion simulation 

Result of a single depletion timestep 
The following class and functions are used to solve the depletion equations,
with cram.CRAM48()
being the default.
CRAM depletion solver that uses incomplete partial factorization 
Solve depletion equations using IPF CRAM 

Solve depletion equations using IPF CRAM 

Deplete materials using given reaction rates for a specified time 
 pool.USE_MULTIPROCESSING¶
Boolean switch to enable or disable the use of
multiprocessing
when solving the Bateman equations. The default is to usemultiprocessing
, but can cause the simulation to hang in some computing environments, namely due to MPI and networking restrictions. Disabling this option will result in only a single CPU core being used for depletion. Type
 pool.NUM_PROCESSES¶
Number of worker processes used for depletion calculations, which rely on the
multiprocessing.pool.Pool
class. If set toNone
(default), the number returned byos.cpu_count()
is used.
The following classes are used to help the openmc.deplete.CoupledOperator
compute quantities like effective fission yields, reaction rates, and
total system energy.
Class that computes fission yields based on average fission energy 

Computes normalization using fission Q values from depletion chain 

Class that uses a single set of fission yields on each isotope 

Class for generating onegroup reaction rates with direct tallies 

Class responsible for obtaining system energy via a tally score 

Helper that computes fission yields based on a cutoff energy 

Class that generates onegroup reaction rates using multigroup flux 
The openmc.deplete.IndependentOperator
uses inner classes subclassed
from those listed above to perform similar calculations.
The following classes are used to define transfer rates to model continuous removal or feed of nuclides during depletion.
Class for defining continuous removals and feeds. 
Intermediate Classes¶
Specific implementations of abstract base classes may utilize some of the same methods and data structures. These methods and data are stored in intermediate classes.
Methods common to tallybased implementation of FissionYieldHelper
are stored in helpers.TalliedFissionYieldHelper
Abstract class for computing fission yields with tallies 
Methods common to OpenMCspecific implementations of TransportOperator
are stored in openmc_operator.OpenMCOperator
Abstract class holding OpenMCspecific functions for running depletion calculations. 
Abstract Base Classes¶
A good starting point for extending capabilities in openmc.deplete
is
to examine the following abstract base classes. Custom classes can
inherit from abc.TransportOperator
to implement alternative
schemes for collecting reaction rates and other data prior to depleting
materials
Abstract class defining a transport operator 
The following classes are abstract classes used to pass information from
transport simulations (in the case of transportcoupled depletion) or to
simply calculate these quantities directly (in the case of
transportindependent depletion) back on to the abc.TransportOperator
Abstract class for obtaining normalization factor on tallies 

Abstract class for processing energy dependent fission yields 

Abstract class for generating reaction rates for operators 
Custom integrators or depletion solvers can be developed by subclassing from the following abstract base classes:
Abstract class for solving the timeintegration for depletion 

Abstract class for the Stochastic Implicit Euler integrators 

Abstract class for solving depletion equations 