mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
revert DepletionOperator to TransportOperator; doc updates
This commit is contained in:
parent
78e4e0aedf
commit
89d79310bb
10 changed files with 48 additions and 48 deletions
|
|
@ -12,7 +12,7 @@ Primary API
|
|||
The two primary requirements to perform depletion with :mod:`openmc.deplete`
|
||||
are:
|
||||
|
||||
1) A depletion operator
|
||||
1) A transpor operator
|
||||
2) A time-integration scheme
|
||||
|
||||
The former is responsible for calcuating and retaining important information required for depletion. The most common examples are reaction rates and power
|
||||
|
|
@ -41,8 +41,8 @@ algorithms <http://hdl.handle.net/1721.1/113721>`_.
|
|||
SICELIIntegrator
|
||||
SILEQIIntegrator
|
||||
|
||||
Each of these classes expects a "depletion operator" to be passed. OpenMC
|
||||
provides The following classes implementing depletion operators:
|
||||
Each of these classes expects a "transport operator" to be passed. OpenMC
|
||||
provides The following classes implementing transpor operators:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
|
|
@ -214,7 +214,7 @@ are stored in :class:`helpers.TalliedFissionYieldHelper`
|
|||
|
||||
helpers.TalliedFissionYieldHelper
|
||||
|
||||
Methods common to OpenMC-specific implementations of :class:`DepletionOperator`
|
||||
Methods common to OpenMC-specific implementations of :class:`TransportOperator`
|
||||
are stored in :class:`openmc_operator.OpenMCOperator`
|
||||
|
||||
.. autosummary::
|
||||
|
|
@ -230,7 +230,7 @@ Abstract Base Classes
|
|||
|
||||
A good starting point for extending capabilities in :mod:`openmc.deplete` is
|
||||
to examine the following abstract base classes. Custom classes can
|
||||
inherit from :class:`abc.DepletionOperator` to implement alternative
|
||||
inherit from :class:`abc.TransportOperator` to implement alternative
|
||||
schemes for collecting reaction rates and other data prior to depleting
|
||||
materials
|
||||
|
||||
|
|
@ -239,12 +239,12 @@ materials
|
|||
:nosignatures:
|
||||
:template: mycallable.rst
|
||||
|
||||
abc.DepletionOperator
|
||||
abc.TransportOperator
|
||||
|
||||
The following classes are abstract classes used to pass information from
|
||||
transport simulations (in the case of transport-coupled depletion) or to
|
||||
simply calculate these quantities directly (in the case of
|
||||
transport-independent depletion) back on to the :class:`abc.DepletionOperator`
|
||||
transport-independent depletion) back on to the :class:`abc.TransportOperator`
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ updated reaction rates, and the process is repeated for as many timesteps as
|
|||
are requested.
|
||||
|
||||
The depletion module is designed such that the reaction rate solution (the
|
||||
depletion "operator") is completely isolated from the solution of the transmutation
|
||||
equations and the method used for advancing time.
|
||||
transport "operator") is completely isolated from the solution of the
|
||||
transmutation equations and the method used for advancing time.
|
||||
|
||||
:mod:`openmc.deplete` supports multiple time-integration methods for determining
|
||||
material compositions over time. Each method appears as a different class.
|
||||
For example, :class:`openmc.deplete.CECMIntegrator` runs a depletion calculation
|
||||
using the CE/CM algorithm (deplete over a timestep using the middle-of-step
|
||||
reaction rates). An instance of :class:`~openmc.deplete.abc.DepletionOperator`
|
||||
reaction rates). An instance of :class:`~openmc.deplete.abc.TransportOperator`
|
||||
is passed to one of these functions along with the timesteps and power level::
|
||||
|
||||
power = 1200.0e6 # watts
|
||||
|
|
@ -37,7 +37,7 @@ time::
|
|||
time, keff = results.get_keff()
|
||||
|
||||
Note that the coupling between the reaction rate solver and the transmutation
|
||||
solver happens in-memory rather than by reading/writing files on disk. OpenMC has two categories of depletion operators for obtaining transmutation reaction
|
||||
solver happens in-memory rather than by reading/writing files on disk. OpenMC has two categories of transport operators for obtaining transmutation reaction
|
||||
rates.
|
||||
|
||||
.. _coupled-depletion:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ from .pool import deplete
|
|||
|
||||
|
||||
__all__ = [
|
||||
"OperatorResult", "DepletionOperator",
|
||||
"OperatorResult", "TransportOperator",
|
||||
"ReactionRateHelper", "NormalizationHelper", "FissionYieldHelper",
|
||||
"Integrator", "SIIntegrator", "DepSystemSolver", "add_params"]
|
||||
|
||||
|
|
@ -75,13 +75,13 @@ def change_directory(output_dir):
|
|||
os.chdir(orig_dir)
|
||||
|
||||
|
||||
class DepletionOperator(ABC):
|
||||
"""Abstract class defining a depletion operator
|
||||
class TransportOperator(ABC):
|
||||
"""Abstract class defining a transport operator
|
||||
|
||||
Each depletion integrator is written to work with a generic depletion
|
||||
operator that takes a vector of material compositions and returns an
|
||||
eigenvalue and reaction rates. This abstract class sets the requirements
|
||||
for such a depletion operator. Users should instantiate
|
||||
for such a transport operator. Users should instantiate
|
||||
:class:`openmc.deplete.CoupledOperator` or
|
||||
:class:`openmc.deplete.IndependentOperator` rather than this class.
|
||||
|
||||
|
|
@ -222,10 +222,10 @@ class ReactionRateHelper(ABC):
|
|||
----------
|
||||
n_nucs : int
|
||||
Number of burnable nuclides tracked by
|
||||
:class:`openmc.deplete.abc.DepletionOperator`
|
||||
:class:`openmc.deplete.abc.TransportOperator`
|
||||
n_react : int
|
||||
Number of reactions tracked by
|
||||
:class:`openmc.deplete.abc.DepletionOperator`
|
||||
:class:`openmc.deplete.abc.TransportOperator`
|
||||
|
||||
Attributes
|
||||
----------
|
||||
|
|
@ -294,7 +294,7 @@ class NormalizationHelper(ABC):
|
|||
"""Abstract class for obtaining normalization factor on tallies
|
||||
|
||||
This helper class determines how reaction rates calculated by an instance of
|
||||
:class:`openmc.deplete.abc.DepletionOperator` should be normalized for the
|
||||
:class:`openmc.deplete.abc.TransportOperator` should be normalized for the
|
||||
purpose of constructing a burnup matrix. Based on the method chosen, the
|
||||
power or source rate provided by the user, and reaction rates from a
|
||||
:class:`ReactionRateHelper`, this class will scale reaction rates to the
|
||||
|
|
@ -304,7 +304,7 @@ class NormalizationHelper(ABC):
|
|||
----------
|
||||
nuclides : list of str
|
||||
All nuclides with desired reaction rates. Ordered to be
|
||||
consistent with :class:`openmc.deplete.abc.DepletionOperator`
|
||||
consistent with :class:`openmc.deplete.abc.TransportOperator`
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ class NormalizationHelper(ABC):
|
|||
"""Perform work needed to obtain energy produced
|
||||
|
||||
This method is called prior to calculating the reaction rates
|
||||
in :meth:`openmc.deplete.abc.DepletionOperator.initial_condition`. Only
|
||||
in :meth:`openmc.deplete.abc.TransportOperator.initial_condition`. Only
|
||||
used for energy-based normalization.
|
||||
|
||||
Parameters
|
||||
|
|
@ -433,7 +433,7 @@ class FissionYieldHelper(ABC):
|
|||
def unpack():
|
||||
"""Unpack tally data prior to compute fission yields.
|
||||
|
||||
Called after a :meth:`openmc.deplete.abc.DepletionOperator.__call__`
|
||||
Called after a :meth:`openmc.deplete.abc.TransportOperator.__call__`
|
||||
routine during the normalization of reaction rates.
|
||||
|
||||
Not necessary for all subclasses to implement, unless tallies
|
||||
|
|
@ -466,13 +466,13 @@ class FissionYieldHelper(ABC):
|
|||
----------
|
||||
nuclides : iterable of str
|
||||
Nuclides with non-zero densities from the
|
||||
:class:`openmc.deplete.abc.DepletionOperator`
|
||||
:class:`openmc.deplete.abc.TransportOperator`
|
||||
|
||||
Returns
|
||||
-------
|
||||
nuclides : list of str
|
||||
Union of nuclides that the
|
||||
:class:`openmc.deplete.abc.DepletionOperator` says have non-zero
|
||||
:class:`openmc.deplete.abc.TransportOperator` says have non-zero
|
||||
densities at this stage and those that have yield data. Sorted by
|
||||
nuclide name
|
||||
|
||||
|
|
@ -488,7 +488,7 @@ class FissionYieldHelper(ABC):
|
|||
|
||||
Parameters
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
Operator with a depletion chain
|
||||
kwargs: optional
|
||||
Additional keyword arguments to be used in constuction
|
||||
|
|
@ -509,8 +509,8 @@ class Integrator(ABC):
|
|||
_params = r"""
|
||||
Parameters
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
Operator that calculates reaction rates
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
Operator to perform transport simulations
|
||||
timesteps : iterable of float or iterable of tuple
|
||||
Array of timesteps. Note that values are not cumulative. The units are
|
||||
specified by the `timestep_units` argument when `timesteps` is an
|
||||
|
|
@ -552,8 +552,8 @@ class Integrator(ABC):
|
|||
|
||||
Attributes
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
Operator that calculates reaction rates
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
Operator to perform transport simulations
|
||||
chain : openmc.deplete.Chain
|
||||
Depletion chain
|
||||
timesteps : iterable of float
|
||||
|
|
@ -847,8 +847,8 @@ class SIIntegrator(Integrator):
|
|||
_params = r"""
|
||||
Parameters
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
Operator that calculates reaction rates
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
Operator to perform transport simulations
|
||||
timesteps : iterable of float or iterable of tuple
|
||||
Array of timesteps. Note that values are not cumulative. The units are
|
||||
specified by the `timestep_units` argument when `timesteps` is an
|
||||
|
|
@ -893,8 +893,8 @@ class SIIntegrator(Integrator):
|
|||
|
||||
Attributes
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
Operator that calculates reaction rates
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
Operator to perform transport simulations
|
||||
chain : openmc.deplete.Chain
|
||||
Depletion chain
|
||||
timesteps : iterable of float
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""Transport-coupled operator for depletion.
|
||||
"""Transport-coupled transport operator for depletion.
|
||||
|
||||
This module implements a depletion operator coupled to OpenMC's transport solver
|
||||
This module implements a transport operator coupled to OpenMC's transport solver
|
||||
so that it can be used by depletion integrators. The implementation makes use of
|
||||
the Python bindings to OpenMC's C API so that reading tally results and updating
|
||||
material number densities is all done in-memory instead of through the
|
||||
|
|
@ -58,7 +58,7 @@ def _find_cross_sections(model):
|
|||
|
||||
|
||||
class CoupledOperator(OpenMCOperator):
|
||||
"""Transport-coupled depletion operator.
|
||||
"""Transport-coupled transport operator.
|
||||
|
||||
Instances of this class can be used to perform transport-coupled depletion
|
||||
using OpenMC's transport solver. Normally, a user needn't call methods of
|
||||
|
|
@ -199,7 +199,7 @@ class CoupledOperator(OpenMCOperator):
|
|||
"requires an openmc.Model object rather than the " \
|
||||
"openmc.Geometry and openmc.Settings parameters. Please use " \
|
||||
"the geometry and settings objects passed here to create a " \
|
||||
" model with which to generate the depletion Operator."
|
||||
" model with which to generate the transport Operator."
|
||||
raise TypeError(msg)
|
||||
|
||||
# Determine cross sections / depletion chain
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ class ConstantFissionYieldHelper(FissionYieldHelper):
|
|||
|
||||
Parameters
|
||||
----------
|
||||
operator : openmc.deplete.abc.DepletionOperator
|
||||
operator : openmc.deplete.abc.TransportOperator
|
||||
operator with a depletion chain
|
||||
kwargs:
|
||||
Additional keyword arguments to be used in construction
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"""Transport-independent depletion operator.
|
||||
"""Transport-independent transport operator for depletion.
|
||||
|
||||
This module implements a depletion operator that runs independently of any
|
||||
This module implements a transport operator that runs independently of any
|
||||
transport solver by using user-provided one-group cross sections.
|
||||
|
||||
"""
|
||||
|
|
@ -23,7 +23,7 @@ from .results import Results
|
|||
from .helpers import ChainFissionHelper, ConstantFissionYieldHelper, SourceRateHelper
|
||||
|
||||
class IndependentOperator(OpenMCOperator):
|
||||
"""Transport-independent depletion operator that uses one-group cross
|
||||
"""Transport-independent transport operator that uses one-group cross
|
||||
sections to calculate reaction rates.
|
||||
|
||||
Instances of this class can be used to perform depletion using one-group
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
"""OpenMC transport operator
|
||||
|
||||
This module implements functions shared by both OpenMC transport-coupled and
|
||||
transport-independent depletion operators.
|
||||
transport-independent transport operators.
|
||||
|
||||
"""
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ import numpy as np
|
|||
|
||||
import openmc
|
||||
from openmc.mpi import comm
|
||||
from .abc import DepletionOperator, OperatorResult
|
||||
from .abc import TransportOperator, OperatorResult
|
||||
from .atom_number import AtomNumber
|
||||
from .reaction_rates import ReactionRates
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ def _distribute(items):
|
|||
j += chunk_size
|
||||
|
||||
|
||||
class OpenMCOperator(DepletionOperator):
|
||||
class OpenMCOperator(TransportOperator):
|
||||
"""Abstract class holding OpenMC-specific functions for running
|
||||
depletion calculations.
|
||||
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ class StepResult:
|
|||
|
||||
Parameters
|
||||
----------
|
||||
op : openmc.deplete.abc.DepletionOperator
|
||||
op : openmc.deplete.abc.TransportOperator
|
||||
The operator used to generate these results.
|
||||
x : list of list of numpy.array
|
||||
The prior x vectors. Indexed [i][cell] using the above equation.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import scipy.sparse as sp
|
|||
from uncertainties import ufloat
|
||||
|
||||
from openmc.deplete.reaction_rates import ReactionRates
|
||||
from openmc.deplete.abc import DepletionOperator, OperatorResult
|
||||
from openmc.deplete.abc import TransportOperator, OperatorResult
|
||||
from openmc.deplete import (
|
||||
CECMIntegrator, PredictorIntegrator, CELIIntegrator, LEQIIntegrator,
|
||||
EPCRK4Integrator, CF4Integrator, SICELIIntegrator, SILEQIIntegrator
|
||||
|
|
@ -117,7 +117,7 @@ class TestChain:
|
|||
return sp.csr_matrix(np.array([[a11, a12], [a21, a22]]))
|
||||
|
||||
|
||||
class DummyOperator(DepletionOperator):
|
||||
class DummyOperator(TransportOperator):
|
||||
"""This is a dummy operator class with no statistical uncertainty.
|
||||
|
||||
y_1' = sin(y_2) y_1 + cos(y_1) y_2
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ to a custom file with new depletion_chain node
|
|||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from openmc.deplete.abc import DepletionOperator
|
||||
from openmc.deplete.abc import TransportOperator
|
||||
from openmc.deplete.chain import Chain, _find_chain_file
|
||||
|
||||
BARE_XS_FILE = "bare_cross_sections.xml"
|
||||
|
|
@ -32,7 +32,7 @@ def bare_xs(run_in_tmpdir):
|
|||
yield BARE_XS_FILE
|
||||
|
||||
|
||||
class BareDepleteOperator(DepletionOperator):
|
||||
class BareDepleteOperator(TransportOperator):
|
||||
"""Very basic class for testing the initialization."""
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue