Commit graph

16 commits

Author SHA1 Message Date
Perry
2d5c50080c
Allow the use of substeps for CRAM (#3908)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
2026-04-22 18:24:34 -05:00
Paul Romano
9c91bddf04
Migrate to SciPy sparse arrays (#3613) 2026-01-02 13:43:25 +02:00
Ethan Peterson
8b2698f5c0
Change matrix format to CSC in depletion (#2764) 2023-11-28 07:34:02 -06:00
Ethan Peterson
9830efaf2a
change identity matrix format to csr in cram (#2771) 2023-11-21 14:22:42 -08:00
Paul Romano
36e316bb2c Make sure IPFCramSolver.__call__ doesn't modify n0 2020-06-05 21:18:46 -05:00
Andrew Johnson
46e98e4a01
Move deplete function to dedicated pool module; removed timed_deplete 2020-05-09 15:01:49 -04:00
Andrew Johnson
24212ae731
Require function as first argument to cram.deplete
Done in order to remove hardcoded used of CRAM48
2020-05-09 15:01:09 -04:00
Paul Romano
1c1fca3d70 Respond to @drewejohnson comments on #1371 2019-10-07 07:40:56 -05:00
Paul Romano
e869d8eef1 Fix documentation build (deplete module was causing issues) 2019-10-04 12:48:23 -05:00
Andrew Johnson
d112eddbc3
openmc.deplete.cram.IPFCramSolver accepts coefficients at init
Moved from deplete.abc into openmc.deplete.cram. CRAM16 and CRAM48
are aliases to __call__ methods for two instances of
IPFCramSolver: Cram16Solver and Cram48Solver, created using
16th and 48th order coefficients
2019-09-26 20:31:04 -04:00
Andrew Johnson
07d3207d88
Provide class-based CRAM solvers
CRAM16 and CRAM48 are now aliases for __call__ methods
on two new classes: openmc.deplete.cram.Cram16Solver
and Cram48Solver. These are two concrete subclasses of
openmc.deplete.abc.IPFCramSolver and
openmc.deplete.abc.DepSystemSolver abstract classes.

The primary benefit of the class based approach is that the
16th and 48th order have nearly identical implementations. The only
differences are the alpha, theta, and alpha_0 coefficients used.
This allows both the Cram16Solver and Cram48Solver to have unique
sets of coefficient vectors, while relying on the IPFSolver base
class implementation.

The implementation of IPF CRAM has been cleaned up. The NxN identity
matrix is not re-created each iteration. Given the alpha and
theta attributes on the IPFCramSolver instances, one can
iterate through the orders using a zip command. By forcing concrete
classes to declared alpha and theta vectors, the need to re-declare
the vectors at each entrance into CRAM48 is also removed.

Using these classes, a 10% speedup is observed depleting up to 500
materials on a single MPI process. The function-based approach
took 62s, while the new classes required 52s.
2019-09-19 16:44:13 -05:00
Andrew Johnson
b3c5d98454
Cleaner openmc.deplete namespace with __all__
Provide explicit __all__ lists for files in openmc/deplete
containing classes that should be brought into the "primary"
API. This prevents cluttering the openmc.deplete namespace
caused by the wildcard imports
```
from .nuclide import *
...
```

The abc, cram, and helpers modules are imported simply as
```
from . import abc
from . import cram
from . import helpers
```
2019-09-17 16:24:54 -05:00
Andrew Johnson
c0566e0a2d
Remove cram wrapper with maps of depletion matrices
openmc.deplete.cram.deplete now pre-generates a map object
that produces depletion matrices given the chain, rates,
and matrix_func. The internal cram wrapper function has
been removed, as the full inputs to CRAM48 are now known,
in zipped and mapped objects.

Some basic timing comparisons indicate that this approach
is at least as fast, if not marginally faster, for a
quarter PWR assembly and an SFR assembly.
2019-09-05 10:02:27 -05:00
Andrew Johnson
c1d66bc022
Ensure # fission yields == # burnable materials in cram.deplete
If the fission yields are a single entry, then
itertools.repeat is used to apply the fission yields to all
burnable materials. Otherwise, check that the number of
fission yield libraries is equal to the number of materials
to be burned.
2019-08-14 10:50:45 -05:00
Andrew Johnson
72bf884d9b
Pass fission yields to depletion matrix_func
Takes a single set of fission yields and passes them as
an additional argument to matrix_func:

   >>> A = matrix_func(chain, rates, fission_yields)

Applied to cf4, epc_rk4, celi, and leqi functions.
Assumes that fission yields will not change during a
depletion event. This change is probably overshadowed
by how much the reaction rates may change, but still worth
pointing out.
2019-08-07 19:54:49 -05:00
Andrew Johnson
0bc7800a92
Move openmc.deplete.integrator into openmc.deplete
Much of the previous API is intact, with the major change
being CRAM functions are imported from openmc.deplete.cram
in the test_deplete_cram.

The integrator abstract classes are placed in
openmc/deplete/abc.py with all concrete classes going in to
openmc/deplete/integrators.py

Documentation updated accordingly
2019-08-07 11:04:37 -05:00
Renamed from openmc/deplete/integrator/cram.py (Browse further)